/* ==========================================================================
   DEAD AIR // 404.0 — Hardware Receiver Stylesheet
   Zero-bloat, pure CSS. Strict dark-room tactile receiver aesthetic.
   ========================================================================== */

/* --- Custom Properties & Design Tokens --- */
:root {
  --color-void: #050505;
  --color-void-deep: #070708;
  --color-chassis: #11100e;
  --color-chassis-dark: #090807;
  --color-bezel: #262420;
  --color-bezel-light: #3d3933;
  --color-hairline: rgba(140, 136, 129, 0.22);
  --color-bone: #ece8df;
  --color-bone-muted: #cac6be;
  --color-ash: #8c8881;
  --color-ash-dark: #4a4742;
  --color-rec-red: #d92b2b;
  --color-rec-glow: rgba(217, 43, 43, 0.5);
  --color-ghost-cyan: #7fd0ff;
  --color-ghost-cyan-glow: rgba(127, 208, 255, 0.35);

  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, Monaco, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --proximity: 0;
  --voltage-jitter-x: 0px;
  --voltage-jitter-y: 0px;
}

/* --- Base Reset & Typography --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--color-void);
  color: var(--color-bone);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-void);
  background-image: 
    radial-gradient(circle at 50% 25%, rgba(28, 23, 16, 0.4) 0%, rgba(10, 9, 8, 0.85) 60%, var(--color-void) 100%);
  color: var(--color-bone);
  overflow-x: hidden;
  position: relative;
  text-rendering: optimizeLegibility;
}

::selection {
  background-color: var(--color-rec-red);
  color: #ffffff;
}

/* Tabular numerals for steady readouts */
.tabular-nums,
[data-tuner-readout],
.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- Focus Rings (A11y) --- */
:focus-visible {
  outline: 2px solid var(--color-bone);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-rec-red);
  outline-offset: 2px;
}

/* --- Analog Grain & CRT Scanline Overlays --- */
#noise-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
  opacity: 0.055;
  mix-blend-mode: screen;
}

.crt-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background: 
    linear-gradient(rgba(18, 16, 14, 0) 50%, rgba(0, 0, 0, 0.35) 50%),
    radial-gradient(circle at 50% 50%, transparent 65%, rgba(0, 0, 0, 0.85) 100%);
  background-size: 100% 4px, 100% 100%;
}

/* --- Header & Callsign Bar --- */
.station-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background-color: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-bezel);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.callsign-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.station-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-bone);
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-rec-red);
  margin-right: 4px;
}

.path-separator {
  color: var(--color-ash-dark);
  font-family: var(--font-mono);
  font-size: 11px;
}

.live-path-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Sound Toggle Button */
.sound-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  min-height: 38px;
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  color: var(--color-ash);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.sound-toggle:hover {
  border-color: var(--color-bezel-light);
  color: var(--color-bone);
}

.sound-toggle[aria-pressed="true"] {
  border-color: rgba(217, 43, 43, 0.6);
  color: var(--color-bone);
  background-color: #171212;
}

.sound-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-ash-dark);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.sound-toggle[aria-pressed="true"] .sound-led {
  background-color: var(--color-rec-red);
  box-shadow: 0 0 8px var(--color-rec-red);
}

/* --- Layout & Chassis Console --- */
.console-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.rack-chassis {
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  transition: border-color 0.2s ease;
}

/* Machine screw accents */
.screw {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #0c0b0a;
  border: 1px solid var(--color-bezel);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screw::after {
  content: '';
  width: 6px;
  height: 1px;
  background-color: var(--color-bezel-light);
}
.screw-tl { top: -6px; left: 16px; }
.screw-tr { top: -6px; right: 16px; transform: rotate(35deg); }
.screw-bl { bottom: -6px; left: 16px; transform: rotate(90deg); }
.screw-br { bottom: -6px; right: 16px; transform: rotate(-40deg); }

/* Top Chassis Bar */
.chassis-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-bezel);
  background-color: var(--color-chassis-dark);
}

.rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background-color: #070707;
  border: 1px solid var(--color-bezel);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-bone);
  text-transform: uppercase;
}

.rec-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-rec-red);
  box-shadow: 0 0 6px var(--color-rec-red);
  animation: recBlink 2.2s infinite ease-in-out;
}

@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.chassis-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Two-Column Grid */
.chassis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
}

@media (min-width: 900px) {
  .chassis-grid {
    grid-template-columns: 1.8fr 1fr;
    gap: 1.5rem;
    padding: 1.75rem;
  }
}

/* Left Column / Tuner Receiver Section */
.receiver-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.station-intro {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 600px) {
  .station-intro {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
  }
}

.huge-404-tag {
  font-family: var(--font-mono);
  font-size: clamp(48px, 9vw, 76px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--color-rec-red);
  text-shadow: 0 0 20px rgba(217, 43, 43, 0.45);
  user-select: none;
  flex-shrink: 0;
}

.intro-text h1 {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-bone);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-chip {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border: 1px solid rgba(217, 43, 43, 0.4);
  background-color: rgba(217, 43, 43, 0.08);
  color: var(--color-rec-red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-text p {
  color: var(--color-ash);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 0.35rem;
  max-width: 640px;
}

/* Receiver Cabinet Module */
.receiver-cabinet {
  background-color: var(--color-void-deep);
  border: 1px solid var(--color-bezel);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.receiver-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-bezel);
}

.frequency-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.freq-digits {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-bone);
  letter-spacing: -0.02em;
}

.freq-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.carrier-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--color-rec-red);
  color: var(--color-rec-red);
  background-color: rgba(217, 43, 43, 0.1);
  letter-spacing: 0.05em;
  margin-left: 0.35rem;
  transition: all 0.15s ease;
}

.carrier-chip.ghost {
  border-color: var(--color-ghost-cyan);
  color: var(--color-ghost-cyan);
  background-color: rgba(127, 208, 255, 0.15);
  box-shadow: 0 0 10px rgba(127, 208, 255, 0.35);
}

.fine-tune-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fine-tune-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash);
  letter-spacing: 0.08em;
  margin-right: 0.25rem;
}

.step-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  min-width: 42px;
  height: 36px;
  background-color: #181714;
  border: 1px solid var(--color-bezel);
  color: var(--color-bone);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.step-btn:hover {
  background-color: #24221e;
  border-color: var(--color-bezel-light);
  color: #ffffff;
}

.step-btn:active {
  background-color: #070707;
}

/* Glass Tuning Dial Section */
.tuning-dial-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 640px) {
  .tuning-dial-row {
    grid-template-columns: 1fr 140px;
    gap: 1.25rem;
  }
}

.glass-scale-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.glass-scale-container {
  position: relative;
  width: 100%;
  height: 82px;
  background-color: #0c0b0a;
  border: 1px solid var(--color-bezel);
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0.5rem 0.4rem;
}

/* Glass Glare & Scratch Lines */
.glass-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 0%, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

/* Sickly CRT Chromatic Tint & Proximity Aura */
.crt-tint-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.proximity-active .crt-tint-layer {
  opacity: 1;
}

.scale-svg {
  width: 100%;
  height: 44px;
  display: block;
}

/* Glowing Red Needle */
.tuner-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-rec-red);
  box-shadow: 0 0 10px var(--color-rec-red);
  pointer-events: none;
  transition: left 0.06s linear;
  z-index: 5;
}

.tuner-needle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-rec-red);
  box-shadow: 0 0 8px var(--color-rec-red);
}

/* Range Slider */
.freq-slider {
  width: 100%;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: #181714;
  border: 1px solid var(--color-bezel);
  outline: none;
  cursor: pointer;
  margin: 0;
}

.freq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 20px;
  background: var(--color-rec-red);
  border: 1px solid #000;
  box-shadow: 0 0 6px rgba(217, 43, 43, 0.75);
  cursor: ew-resize;
}

.freq-slider::-moz-range-thumb {
  width: 14px;
  height: 20px;
  background: var(--color-rec-red);
  border: 1px solid #000;
  box-shadow: 0 0 6px rgba(217, 43, 43, 0.75);
  cursor: ew-resize;
  border-radius: 0;
}

/* Scale Markers */
.scale-markers {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  padding: 0 2px;
}

.marker-target {
  color: var(--color-ghost-cyan);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.marker-target-dot {
  width: 4px;
  height: 4px;
  background-color: var(--color-ghost-cyan);
  border-radius: 50%;
  display: inline-block;
}

/* Tactile Rotary Dial Button */
.rotary-unit {
  background-color: #0d0c0a;
  border: 1px solid var(--color-bezel);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rotary-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--color-ash);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.rotary-knob-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.rotary-knob-wrapper:active {
  cursor: grabbing;
}

.rotary-knurled-rim {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    #2a2723 0deg 4deg,
    #151412 4deg 8deg
  );
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.7);
}

.rotary-dial-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #22201c 0%, #12110f 70%, #090807 100%);
  border: 1px solid var(--color-bezel-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.05s linear;
}

.dial-center-cap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #070707;
  border: 1px solid var(--color-bezel);
}

.dial-pip {
  position: absolute;
  top: 4px;
  width: 3px;
  height: 12px;
  background-color: var(--color-rec-red);
  border-radius: 1px;
  box-shadow: 0 0 4px var(--color-rec-red);
}

.rotary-sub-label {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-ash-dark);
  margin-top: 0.35rem;
}

/* Recovered Live Fragment Box */
.fragment-box {
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fragment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fragment-text {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-bone);
  min-height: 2.8rem;
  transition: color 0.15s ease;
}

/* --- Right Column / Rack Telemetry & Logging --- */
.rack-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  background-color: var(--color-void-deep);
  border: 1px solid var(--color-bezel);
  padding: 1.25rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-bezel);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-ash);
  text-transform: uppercase;
}

.section-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-ash);
  border-radius: 50%;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Primary Recovery Button */
.btn-primary-recovery {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: var(--color-bone);
  color: var(--color-void);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-primary-recovery:hover {
  background-color: #ffffff;
}

.btn-secondary-action {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  color: var(--color-bone);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-secondary-action:hover {
  border-color: var(--color-bezel-light);
  background-color: #1a1916;
}

/* Diagnostics Display Panel */
.diagnostics-panel {
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-ash);
}

.diag-val {
  color: var(--color-bone);
  font-weight: 500;
}

.diag-val.alert {
  color: var(--color-rec-red);
}

.diag-val.ghost {
  color: var(--color-ghost-cyan);
}

/* Static Note Logging Form */
.note-logging-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--color-bezel);
  padding-top: 1rem;
}

.note-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-input-row {
  display: flex;
  gap: 0.35rem;
}

.note-input {
  flex: 1;
  min-width: 0;
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-bone);
  outline: none;
}

.note-input::placeholder {
  color: var(--color-ash-dark);
}

.note-input:focus {
  border-color: var(--color-bone-muted);
}

.note-submit-btn {
  padding: 0.5rem 0.85rem;
  background-color: #181714;
  border: 1px solid var(--color-bezel);
  color: var(--color-bone);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-submit-btn:hover {
  background-color: var(--color-bone);
  color: var(--color-void);
}

.note-status-log {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  min-height: 1.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chassis-tagline {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash-dark);
  border-top: 1px solid rgba(140, 136, 129, 0.15);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

/* --- Signal Archive / Main Index Specific Styles --- */
.archive-hero {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: var(--color-chassis-dark);
  border-bottom: 1px solid var(--color-bezel);
}

.archive-header-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 800px) {
  .archive-header-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.archive-title-group h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-bone);
  text-transform: uppercase;
}

.archive-title-group p {
  color: var(--color-ash);
  font-size: 0.95rem;
  max-width: 620px;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* Oscillogram Display */
.oscillogram-card {
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  padding: 0.85rem;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.oscillogram-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash);
}

.oscillogram-svg {
  width: 100%;
  height: 54px;
  color: var(--color-rec-red);
}

/* Telemetry Matrix Grid */
.telemetry-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .telemetry-matrix {
    grid-template-columns: repeat(4, 1fr);
  }
}

.telemetry-cell {
  background-color: var(--color-void-deep);
  border: 1px solid var(--color-bezel);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.telemetry-cell-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.telemetry-cell-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-bone);
}

.telemetry-cell-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-ash-dark);
}

/* Drift Routes List (Clickable 404 Triggers) */
.drift-routes-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem;
  border-top: 1px solid var(--color-bezel);
}

.drift-routes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ash);
  padding-bottom: 0.25rem;
}

.drift-route-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background-color: var(--color-void-deep);
  border: 1px solid var(--color-bezel);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

@media (min-width: 640px) {
  .drift-route-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.drift-route-card:hover {
  background-color: var(--color-chassis);
  border-color: var(--color-bezel-light);
}

.drift-route-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.drift-route-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-bone);
}

.drift-route-card:hover .drift-route-title {
  color: var(--color-rec-red);
}

.drift-route-tag {
  font-size: 10px;
  padding: 1px 5px;
  background-color: #1a1815;
  border: 1px solid var(--color-bezel);
  color: var(--color-rec-red);
}

.drift-route-desc {
  font-size: 12px;
  color: var(--color-ash);
  line-height: 1.4;
}

.drift-route-action {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.drift-route-card:hover .drift-route-action {
  color: var(--color-bone);
}

/* Custom Route Launcher Form */
.custom-launcher-form {
  margin: 1.25rem;
  background-color: var(--color-void-deep);
  border: 1px solid var(--color-bezel);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .custom-launcher-form {
    flex-direction: row;
    align-items: stretch;
  }
}

.launcher-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--color-chassis);
  border: 1px solid var(--color-bezel);
  padding: 0.5rem 0.75rem;
}

.launcher-prefix {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-ash);
  user-select: none;
}

.launcher-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-bone);
  outline: none;
  padding: 0 0.35rem;
}

.launcher-btn {
  padding: 0.65rem 1.25rem;
  background-color: #1a1815;
  border: 1px solid var(--color-bezel);
  color: var(--color-bone);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.launcher-btn:hover {
  background-color: var(--color-bone);
  color: var(--color-void);
}

/* --- Proximity Flicker & CRT Anomaly Animations --- */
@keyframes voltageSag {
  0%   { opacity: 1; }
  18%  { opacity: 0.94; }
  22%  { opacity: 0.98; }
  45%  { opacity: 0.92; }
  48%  { opacity: 0.97; }
  72%  { opacity: 0.93; }
  100% { opacity: 1; }
}

@keyframes needleJitter {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-0.6px, 0.4px); }
  40%  { transform: translate(0.5px, -0.3px); }
  60%  { transform: translate(-0.4px, -0.3px); }
  80%  { transform: translate(0.3px, 0.5px); }
  100% { transform: translate(0, 0); }
}

.proximity-flicker {
  animation: voltageSag 0.35s infinite alternate ease-in-out;
}

.proximity-jitter {
  animation: needleJitter 0.14s infinite alternate;
}

/* --- Strict Prefers-Reduced-Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .rec-pulse-dot,
  .proximity-flicker,
  .proximity-jitter {
    animation: none !important;
    transform: none !important;
  }

  #noise-canvas {
    display: none !important;
  }
}
