/* ESTACIÓN ECO-7 · Estética analógica de observatorio (1978) */
:root {
  --chassis: #191d1a;
  --panel: #232824;
  --panel-hi: #2d332e;
  --bezel: #111512;
  --border: #3c453e;
  --ink: #e4dcc8;
  --ink-dim: #9aa396;
  --amber: #ffb84d;
  --amber-dim: #9e6c24;
  --phosphor: #52ff9a;
  --phosphor-dim: #1d5938;
  --danger: #e2533e;
  --paper: #f2ead7;
  --paper-ink: #24211b;
  --mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #242b25 0%, #121513 75%);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  padding: 14px;
}

.chassis {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--chassis);
  border: 2px solid #384039;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

/* Topbar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #2a302b 0%, #1e231f 100%);
  border-bottom: 2px solid #101311;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.subtitle {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}

.led {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a403b;
  border: 1px solid #0e100e;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.7);
}

.led-on {
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor), inset 0 1px 2px rgba(255,255,255,0.6);
}

.led-amber {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.status-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: #121613;
  border: 1px solid #343d36;
  border-radius: 4px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
}

.pill-label {
  font-size: 9px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
}

.pill-value {
  font-size: 12px;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#vol-slider {
  width: 74px;
  accent-color: var(--amber);
  cursor: pointer;
}

/* Hardware Buttons */
.hw-btn {
  background: linear-gradient(180deg, #353d37 0%, #242a25 100%);
  color: var(--ink);
  border: 1px solid #4a544c;
  border-bottom-color: #141815;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 2px 0 #101311;
  transition: transform 0.06s, background 0.12s, border-color 0.12s;
}

.hw-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #404a42 0%, #2c332d 100%);
  border-color: #6b786d;
}

.hw-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #101311;
}

.hw-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.hw-btn.active {
  background: linear-gradient(180deg, #4f3d1d 0%, #362811 100%);
  border-color: var(--amber);
  color: #ffe3b0;
}

.hw-btn-subtle {
  background: #1e231f;
  color: var(--ink-dim);
}

/* Main 3-Rack Grid */
.console-grid {
  display: grid;
  grid-template-columns: 315px minmax(460px, 1fr) 340px;
  gap: 12px;
  padding: 12px;
}

.rack {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.11em;
  color: var(--ink-dim);
  padding-bottom: 6px;
  border-bottom: 1px solid #323933;
}

/* CRT Bezels */
.crt-bezel {
  position: relative;
  background: var(--bezel);
  border: 3px solid #141815;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.07);
}

.crt-bezel canvas {
  display: block;
  width: 100%;
  height: auto;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0px,
    rgba(0, 0, 0, 0.14) 1px,
    transparent 1px,
    transparent 3px
  );
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.55);
}

.crt-tag {
  position: absolute;
  top: 6px;
  left: 9px;
  z-index: 2;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(146, 216, 168, 0.72);
  pointer-events: none;
}

/* Left Rack: Radar & Briefing */
.radar-bezel {
  cursor: crosshair;
}

.radar-hint {
  text-align: center;
  font-size: 10px;
  color: #7ea88c;
  background: #0b140e;
  padding: 4px 6px;
  border-top: 1px solid #19291e;
}

.motor-badge {
  color: var(--phosphor);
  font-weight: 700;
}

.motor-badge.slewing {
  color: var(--amber);
}

.readout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nixie-box {
  background: #101411;
  border: 1px solid #323b34;
  border-radius: 4px;
  padding: 6px 8px;
  text-align: center;
}

.nixie-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.nixie-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.35);
}

.slew-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.slew-mid {
  display: flex;
  gap: 10px;
}

.pad-btn {
  min-width: 72px;
  padding: 4px 8px;
  font-size: 10px;
}

.briefing-card {
  background: #1b201c;
  border: 1px solid #323b34;
  border-radius: 5px;
  padding: 10px;
  flex: 1;
}

.card-title {
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.briefing-card p {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: #cbd2c5;
  font-family: var(--sans);
}

.checklist-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  margin-bottom: 5px;
}

.signal-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.signal-checklist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #141815;
  border: 1px solid #2c342e;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
}

.signal-checklist li.done {
  border-color: #2e6645;
  color: var(--phosphor);
}

.signal-checklist .sig-status {
  font-size: 9px;
  letter-spacing: 0.08em;
}

/* Center Rack: CRT + Tuner */
.crt-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lock-indicator {
  font-weight: 700;
  color: var(--ink-dim);
}

.lock-indicator.locked {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.55);
}

.tuner-deck {
  background: #1a1f1b;
  border: 1px solid #343d36;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tuner-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
}

.freq-display {
  background: #0e120f;
  border: 1px solid #353e37;
  border-radius: 5px;
  padding: 8px 12px;
}

.freq-digits {
  font-size: 28px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(255, 184, 77, 0.45);
  line-height: 1.15;
}

.freq-digits small {
  font-size: 13px;
  color: var(--amber-dim);
}

.vu-meter {
  background: #0e120f;
  border: 1px solid #353e37;
  border-radius: 5px;
  padding: 8px 10px;
}

.vu-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

#snr-percent {
  color: var(--phosphor);
  font-weight: 700;
}

.vu-track {
  position: relative;
  height: 14px;
  background: #18211b;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #2b352e;
}

.vu-zone-lock {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 28%;
  background: rgba(255, 184, 77, 0.16);
  border-left: 1px dashed var(--amber);
}

.vu-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #27a860 0%, #52ff9a 65%, #ffb84d 100%);
  transition: width 0.06s linear;
}

.vu-scale {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--ink-dim);
  margin-top: 4px;
}

.vu-scale .amber {
  color: var(--amber);
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#freq-slider {
  width: 100%;
  accent-color: var(--amber);
  cursor: ew-resize;
}

.freq-marks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-dim);
}

.hi-mark {
  color: var(--amber);
  font-weight: 700;
}

.tuner-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.group-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.btn-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.record-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid #2e3630;
}

.hw-btn-record {
  background: linear-gradient(180deg, #753024 0%, #4d1d15 100%);
  border-color: #a64636;
  color: #ffe8e3;
  padding: 8px 14px;
}

.hw-btn-record:hover:not(:disabled) {
  background: linear-gradient(180deg, #913b2c 0%, #61241a 100%);
  border-color: #d95f4a;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6952;
  box-shadow: 0 0 6px #ff6952;
}

.rec-progress-wrap {
  flex: 1;
  height: 10px;
  background: #101411;
  border: 1px solid #303932;
  border-radius: 3px;
  overflow: hidden;
}

.rec-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 184, 77, 0.7);
}

.hw-btn-next {
  background: linear-gradient(180deg, #2b6944 0%, #1b452c 100%);
  border-color: var(--phosphor);
  color: #e4fff0;
  padding: 8px 12px;
}

.hidden {
  display: none !important;
}

/* Right Rack: Thermal Printer & Manual */
.tab-bar {
  display: flex;
  gap: 4px;
}

.tab-btn {
  background: #181c19;
  color: var(--ink-dim);
  border: 1px solid #343d36;
  border-radius: 3px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}

.tab-btn.active {
  background: #353d37;
  color: var(--amber);
  border-color: var(--amber-dim);
}

.tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
}

.printer-slot {
  background: #111412;
  border: 1px solid #2e3630;
  border-radius: 4px;
  padding: 6px;
  margin-bottom: 10px;
  text-align: center;
}

.slot-lip {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #7c857d;
  border-bottom: 3px solid #060807;
  padding-bottom: 4px;
}

.slips-feed {
  flex: 1;
  max-height: 580px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.empty-feed {
  background: #1a1f1b;
  border: 1px dashed #3b443d;
  border-radius: 6px;
  padding: 16px;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
}

/* Thermal Paper Slip */
.slip {
  background: var(--paper);
  color: var(--paper-ink);
  padding: 12px 13px;
  border-radius: 2px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.38);
  border-top: 3px dashed #bfb59f;
  border-bottom: 3px dashed #bfb59f;
  animation: slipPrint 0.35s ease-out;
}

@keyframes slipPrint {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slip-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  border-bottom: 1px solid #b8ae96;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.slip-anomaly .slip-head {
  color: #8f2213;
  border-bottom-color: #c9867b;
}

.slip-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.slip-meta {
  font-size: 10px;
  color: #5c5547;
  margin-bottom: 7px;
}

.slip-body {
  font-size: 11px;
  white-space: pre-line;
  background: rgba(0, 0, 0, 0.045);
  padding: 6px 7px;
  border-left: 2px solid #7d7461;
  margin-bottom: 7px;
}

.slip-note {
  font-family: var(--sans);
  font-style: italic;
  font-size: 11.5px;
  color: #453f34;
}

/* Manual Paper */
.manual-paper {
  background: #ece3ce;
  color: #26221b;
  border-radius: 4px;
  padding: 14px;
  overflow-y: auto;
  max-height: 610px;
  box-shadow: inset 0 0 18px rgba(90, 74, 42, 0.14);
}

.manual-paper h3 {
  margin: 0 0 2px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.manual-meta {
  margin: 0 0 12px;
  font-size: 10px;
  color: #6b614e;
  border-bottom: 1px solid #bfb399;
  padding-bottom: 6px;
}

.manual-paper h4 {
  margin: 12px 0 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4f3b1e;
}

.manual-paper ul {
  margin: 0;
  padding-left: 16px;
  font-family: var(--sans);
  font-size: 12px;
}

.manual-paper li {
  margin-bottom: 5px;
}

.morse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
}

/* Finale Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 9, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal-paper {
  max-width: 560px;
  background: var(--paper);
  color: var(--paper-ink);
  border: 2px solid #8a7e66;
  border-radius: 4px;
  padding: 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.modal-stamp {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #8f2213;
  border: 1.5px solid #8f2213;
  padding: 3px 8px;
  margin-bottom: 10px;
}

.modal-paper h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.modal-paper p {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px;
}

.modal-note {
  font-size: 12.5px !important;
  color: #595142;
  background: rgba(0, 0, 0, 0.05);
  padding: 10px;
  border-left: 3px solid #8a7e66;
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1120px) {
  .console-grid {
    grid-template-columns: 1fr;
  }
  .slips-feed, .manual-paper {
    max-height: 380px;
  }
}


/* Acto II: Visor SSTV, Magnetófono REVOX-78 y Emisor 50 kW */
.crt-mode-tabs {
  display: flex;
  gap: 5px;
  align-items: center;
}

.sstv-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sstv-bezel canvas {
  max-height: 360px;
  object-fit: contain;
  background: #06110b;
}

.sstv-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sstv-gallery {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.sstv-empty {
  font-size: 11px;
  color: var(--ink-dim);
}

.sstv-actions {
  display: flex;
  gap: 6px;
}

.sstv-caption {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  color: #c9d4c4;
  background: #171c18;
  border-left: 3px solid var(--amber);
  padding: 7px 10px;
  border-radius: 3px;
}

/* Magnetófono REVOX-78 */
.tape-deck {
  background: #141815;
  border: 1px solid #353f37;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reels-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0c0f0d;
  border: 1px solid #2a322c;
  border-radius: 5px;
  padding: 10px 16px;
}

.reel {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #8a948c;
  background: radial-gradient(circle, #1a1e1b 24%, #4f5750 26%, #4f5750 38%, #222723 40%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel span {
  display: block;
  width: 28px;
  height: 3px;
  background: #b8c2ba;
  border-radius: 2px;
}

.reel.spin-fwd {
  animation: spinFwd 1.1s linear infinite;
}

.reel.spin-rev {
  animation: spinRev 0.9s linear infinite;
}

@keyframes spinFwd {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.tape-bridge {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-align: center;
}

.tape-readout {
  background: #0d120f;
  border: 1px solid #2a332c;
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 11px;
  color: var(--phosphor);
  min-height: 44px;
}

.tape-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tape-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 420px;
}

.tape-item {
  background: #191e1a;
  border: 1px solid #323b34;
  border-radius: 4px;
  padding: 7px 9px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  transition: border-color 0.12s, background 0.12s;
}

.tape-item:hover {
  background: #222924;
  border-color: #546357;
}

.tape-item.selected {
  border-color: var(--amber);
  background: #27231a;
  color: #ffe3b0;
}

.tape-badge {
  font-size: 9px;
  color: var(--amber);
}

/* Emisor de 50 kW (Noche 7) */
.transmitter-panel {
  background: linear-gradient(180deg, #2b1f18 0%, #1d1714 100%);
  border: 1.5px solid #a86b32;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tx-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
}

.tx-warn {
  color: #ff7c66;
}

.tx-desc {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  color: #e6d8c3;
}

.tx-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hw-btn-tx-bridge {
  background: linear-gradient(180deg, #2d6e48 0%, #1b472d 100%);
  border-color: var(--phosphor);
  color: #e6fff0;
  padding: 9px 12px;
}

.hw-btn-tx-neutral {
  background: linear-gradient(180deg, #634d23 0%, #403115 100%);
  border-color: var(--amber);
  color: #fff0cf;
  padding: 9px 12px;
}

.hw-btn-tx-silence {
  background: linear-gradient(180deg, #423535 0%, #2b2222 100%);
  border-color: #876363;
  color: #ebd5d5;
  padding: 9px 12px;
}


/* Decodificador CW / Telemetría en vivo */
.live-decoder {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0a120d;
  border: 1px solid #2b3c31;
  border-radius: 5px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  overflow: hidden;
}

.decoder-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  border-right: 1px solid #2c3830;
  padding-right: 8px;
  white-space: nowrap;
}

.decoder-stream {
  color: #5ea378;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.decoder-stream.active {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 184, 77, 0.45);
}
