* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --panel-blue: #2B4B7E;
  --panel-blue-dark: #1e3660;
  --panel-blue-light: #3a5f9a;
  --bezel-color: #8a8a8a;
  --bezel-dark: #555;
  --bezel-light: #b0b0b0;
  --led-on: #ff2200;
  --led-off: #3a1515;
  --led-glow: 0 0 8px 2px rgba(255, 34, 0, 0.8), 0 0 16px 4px rgba(255, 34, 0, 0.3);
  --switch-metal: linear-gradient(180deg, #d4d4d4 0%, #a0a0a0 30%, #888 50%, #a0a0a0 70%, #c0c0c0 100%);
  --bg-dark: #0a0a0a;
  --terminal-green: #33ff33;
}

body {
  background: var(--bg-dark);
  font-family: 'IBM Plex Mono', monospace;
  color: #ccc;
  overflow-x: hidden;
}

/* Panel frame */
.panel-bezel {
  background: linear-gradient(145deg, #999 0%, #777 20%, #888 50%, #666 80%, #777 100%);
  border: 3px solid #555;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.3);
  padding: 12px;
}

.panel-face {
  background: linear-gradient(180deg, #2f5187 0%, var(--panel-blue) 10%, var(--panel-blue-dark) 90%, #1a2d50 100%);
  border: 2px solid #1a2d50;
  border-radius: 4px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  position: relative;
}

/* LED styling */
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--led-off);
  border: 1px solid #222;
  transition: all 0.05s ease;
  flex-shrink: 0;
}

.led.on {
  background: var(--led-on);
  box-shadow: var(--led-glow);
  border-color: #aa2200;
}

/* Toggle switch */
.switch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.switch-body {
  width: 14px;
  height: 36px;
  background: #333;
  border-radius: 3px;
  position: relative;
  border: 1px solid #222;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.switch-lever {
  width: 10px;
  height: 20px;
  background: linear-gradient(90deg, #c0c0c0, #e8e8e8, #c0c0c0);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: top 0.08s ease, box-shadow 0.08s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  border: 1px solid #999;
}

.switch-lever.up { top: -2px; }
.switch-lever.center { top: 8px; }
.switch-lever.down { top: 18px; }

/* Control switch (momentary) */
.ctrl-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.ctrl-switch-body {
  width: 16px;
  height: 32px;
  background: #333;
  border-radius: 3px;
  position: relative;
  border: 1px solid #222;
}

.ctrl-switch-lever {
  width: 12px;
  height: 18px;
  background: linear-gradient(90deg, #c0c0c0, #e8e8e8, #c0c0c0);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: top 0.06s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  border: 1px solid #999;
  top: 7px;
}

.ctrl-switch-lever.pressed-up { top: -1px; }
.ctrl-switch-lever.pressed-down { top: 15px; }

/* Terminal CRT effect */
.terminal {
  background: #0a0a0a;
  color: var(--terminal-green);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.terminal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.terminal-text {
  text-shadow: 0 0 6px rgba(51, 255, 51, 0.5);
}

/* Memory inspector */
.mem-row:hover {
  background: rgba(255,255,255,0.05);
}

.mem-row .pc-highlight {
  background: rgba(255, 200, 0, 0.2);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Panel label text */
.panel-label {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #d0d8e8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.panel-sublabel {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7px;
  color: #8a9ab8;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* File drop zone */
.drop-zone {
  border: 2px dashed #555;
  transition: all 0.2s ease;
}
.drop-zone.active {
  border-color: var(--terminal-green);
  background: rgba(51, 255, 51, 0.05);
}

/* Tooltip */
.tooltip-wrap { position: relative; }
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #ddd;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 100;
  transition: opacity 0.15s;
  pointer-events: none;
}
.tooltip-wrap:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Animations */
@keyframes flash {
  0% { background: rgba(255,200,0,0.3); }
  100% { background: transparent; }
}
.reg-flash {
  animation: flash 0.4s ease;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .panel-bezel { padding: 6px; }
  .led { width: 7px; height: 7px; }
  .switch-body { width: 11px; height: 28px; }
  .switch-lever { width: 8px; height: 16px; }
}

@media (max-width: 600px) {
  .mobile-warning {
    display: flex !important;
  }
}