  :root {
    --bg:        #000;
    --amber:     #5b9fd9;
    --amber-mid: rgba(91, 159, 217, 0.55);
    --amber-dim: rgba(91, 159, 217, 0.20);
    --green:     #5fb872;
    --green-mid: rgba(95, 184, 114, 0.55);
    --cyan:      #66e0ff;
    --cyan-mid:  rgba(102, 224, 255, 0.6);
    --red:       #ff5a5a;
    --panel-bg:  rgba(0, 0, 0, 0.82);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
  body {
    font-family: 'VT323', monospace;
    color: var(--amber);
    user-select: none;
    -webkit-user-select: none;
  }
  canvas#scene {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 0; touch-action: none;
  }

  /* ── Panels ── */
  .panel {
    position: fixed; z-index: 10;
    background: var(--panel-bg);
    border: 1px solid var(--amber-mid);
    color: var(--amber);
    backdrop-filter: blur(2px);
  }
  /* Inner panels in flex wrappers must override .panel position */
  #leftpanel > .panel,
  #rightpanel > .panel {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    width: 100%;
  }
  .corners::before, .corners::after,
  .corners > .ctl, .corners > .ctr {
    content: ""; position: absolute; width: 12px; height: 12px;
    border: 2px solid var(--amber);
  }
  .corners::before { top: -3px; left: -3px; border-right: none; border-bottom: none; }
  .corners::after  { top: -3px; right: -3px; border-left: none; border-bottom: none; }
  .corners > .ctl  { bottom: -3px; left: -3px; border-right: none; border-top: none; }
  .corners > .ctr  { bottom: -3px; right: -3px; border-left: none; border-top: none; }

  h1, h2, h3 { font-weight: normal; letter-spacing: 1px; }
  h2 { font-size: 16px; padding: 6px 10px; border-bottom: 1px solid var(--amber-dim); color: var(--amber); }
  h2.cyan { color: var(--cyan); border-color: rgba(90,215,255,0.20); }
  h2 .dot { display: inline-block; width: 7px; height: 7px; background: currentColor; margin-left: 6px; vertical-align: middle; animation: blink 1.4s infinite; }
  @keyframes blink { 0%,50% { opacity: 1 } 51%,100% { opacity: 0 } }
  .blink { animation: blink 1s infinite; }

  /* ── Brand bar (top-left, no panel chrome) ── */
  #brand-bar {
    position: fixed; top: 10px; left: 16px; z-index: 13;
    display: flex; align-items: center; gap: 12px;
    pointer-events: none;
  }
  .brand {
    font-size: 22px; letter-spacing: 4px; color: var(--cyan);
    text-shadow: 0 0 10px rgba(102, 224, 255, 0.45);
    pointer-events: auto;
  }
  .brand .div { color: var(--amber-mid); margin: 0 4px; }
  .menu-btn {
    background: transparent; color: var(--amber);
    border: 1px solid var(--amber-mid);
    width: 32px; height: 32px;
    font-size: 16px; cursor: pointer;
    display: none;
    pointer-events: auto;
  }

  /* ── Unified time panel (bottom, full-width, prominent) ── */
  #timepanel {
    position: fixed; bottom: 8px; left: 8px; right: 8px;
    z-index: 13;
    padding: 10px 18px 12px;
    max-width: 1100px;
    margin: 0 auto;
  }
  .tp-display {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(91, 159, 217, 0.18);
  }
  .tp-time {
    font-size: 28px; color: var(--cyan);
    letter-spacing: 1.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
  }
  .tp-time.scrubbing { color: #ffd070; }
  .tp-time .delta { color: var(--amber-mid); margin-left: 12px; font-size: 18px; }
  .tp-stats {
    display: flex; gap: 18px; align-items: baseline;
    font-size: 12px; letter-spacing: 1px;
    color: var(--amber-mid);
    flex-shrink: 0;
  }
  .tp-stats .v { color: var(--amber); margin-left: 4px; }
  #slider {
    height: 36px; position: relative; cursor: pointer;
    background: linear-gradient(to right, transparent 49.7%, var(--amber-mid) 49.7%, var(--amber-mid) 50.3%, transparent 50.3%);
    margin-bottom: 8px;
    touch-action: none;
  }
  #slider-handle {
    position: absolute; top: 0; left: 50%;
    width: 14px; height: 22px; transform: translateX(-50%);
    background: var(--cyan); pointer-events: none;
    box-shadow: 0 0 8px rgba(102, 224, 255, 0.7);
  }
  .slider-ticks {
    position: absolute; left: 0; right: 0; top: 23px; bottom: 0;
    pointer-events: none;
  }
  .slider-ticks .tk {
    position: absolute; top: 0; width: 1px; height: 6px;
    background: var(--amber-mid); transform: translateX(-50%);
  }
  .slider-ticks .tk.now { background: var(--cyan); height: 9px; }
  .slider-ticks .tk::after {
    content: attr(data-lbl);
    position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    font-size: 10px; color: var(--amber-mid);
    letter-spacing: .5px; white-space: nowrap;
  }
  .slider-ticks .tk:first-child::after { transform: translateX(-10%); }
  .slider-ticks .tk:last-child::after  { transform: translateX(-90%); }
  .tp-controls {
    display: flex; align-items: center; gap: 10px;
    padding-top: 4px;
  }
  .tc-btn {
    background: transparent; color: var(--amber);
    border: 1px solid var(--amber-mid);
    padding: 6px 14px; font-family: inherit; font-size: 16px;
    letter-spacing: .8px; cursor: pointer;
    min-height: 40px; min-width: 48px;
    transition: background .15s, color .15s;
  }
  .tc-btn:hover { background: var(--amber-dim); }
  .tc-btn.playing { background: var(--amber); color: #000; }
  .rate-label {
    font-size: 11px; color: var(--amber-mid);
    letter-spacing: 1.5px;
    margin-left: 12px;
  }
  #rate-slider {
    flex: 1; height: 22px; position: relative; cursor: pointer;
    border: 1px solid var(--amber-mid);
    background: rgba(0, 0, 0, 0.35);
    max-width: 220px;
    touch-action: none;
  }
  #rate-slider-handle {
    position: absolute; top: -1px; bottom: -1px; left: 30%;
    width: 8px; transform: translateX(-50%);
    background: var(--amber); pointer-events: none;
    box-shadow: 0 0 5px rgba(91, 159, 217, 0.6);
  }
  .rate-value {
    min-width: 56px; text-align: right;
    font-size: 14px; color: var(--cyan);
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
  }
  .status-ok   { color: var(--green); }
  .status-warn { color: #e8b056; }
  .status-err  { color: var(--red); }
  .mobile-only { display: none; }
  .blink { animation: blink 1s infinite; }
  @keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

  /* ── Left panel ── */
  #leftpanel {
    position: fixed;
    top: 52px; left: 8px; width: 260px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    padding: 0; background: transparent; border: none;
    z-index: 11;
  }
  .filter-group { display: flex; flex-direction: column; }
  .filter-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    cursor: pointer; transition: background .15s;
    font-size: 14px; letter-spacing: .5px;
  }
  .filter-row:hover { background: rgba(91, 159, 217, 0.06); }
  .filter-row input[type=checkbox] {
    accent-color: var(--amber); cursor: pointer;
    width: 14px; height: 14px;
  }
  .filter-row .label { flex: 1; color: var(--amber); letter-spacing: 1px; }
  .filter-row .count {
    font-size: 12px; color: var(--amber-mid);
    min-width: 50px; text-align: right;
  }
  .filter-row[data-overlay] .label { color: var(--cyan); }
  .cat-desc {
    font-size: 12px; color: #908a78;
    padding: 0 12px 6px 36px;
    margin-top: -3px;
    letter-spacing: .4px;
    line-height: 1.4;
    pointer-events: none;
  }
  /* Legend marks */
  .legend-mark {
    width: 14px; height: 14px; flex-shrink: 0;
    background: var(--amber);
  }
  .legend-mark.payload  { background: #5ad7ff; transform: rotate(45deg); }
  .legend-mark.station  { background: transparent; border: 1px solid #f5f5f0; }
  .legend-mark.rocket   { background: #ffb030; width: 6px; height: 16px; }
  .legend-mark.debris   {
    background: transparent;
    background:
      linear-gradient(45deg, transparent 44%, #ff5a5a 44%, #ff5a5a 56%, transparent 56%),
      linear-gradient(-45deg, transparent 44%, #ff5a5a 44%, #ff5a5a 56%, transparent 56%);
  }
  .legend-mark.storm    {
    background: transparent;
    border: 2px solid #5ad7ff; border-radius: 50%;
  }
  .legend-mark.starlink {
    width: 0; height: 0;
    background: transparent;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 13px solid #4fdc7a;
  }

  /* ── Right panel (object info) ── */
  #rightpanel {
    position: fixed;
    top: 52px; right: 8px; width: 320px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 11;
  }
  .panel-body { padding: 0; }
  .info-empty {
    padding: 16px 14px;
    color: var(--amber-mid);
    font-size: 13px; line-height: 1.55;
    letter-spacing: .4px; font-style: italic;
  }
  .info-section {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(91, 159, 217, 0.12);
  }
  .info-section:last-child { border-bottom: none; }
  .info-label {
    font-size: 10px; color: var(--amber-mid);
    letter-spacing: 1.5px; margin-bottom: 4px;
  }
  .info-name {
    font-size: 16px; color: var(--cyan);
    letter-spacing: 1px; margin: 2px 0 6px;
    font-weight: normal; word-break: break-word;
  }
  .info-cat {
    display: inline-block;
    font-size: 10px; color: var(--amber);
    letter-spacing: 1.2px;
    padding: 1px 6px;
    border: 1px solid var(--amber-mid);
    margin-bottom: 8px;
  }
  .info-desc {
    font-size: 13px; line-height: 1.55;
    color: #c8c8bc; margin-top: 4px;
  }
  .info-row {
    display: flex; justify-content: space-between;
    align-items: baseline;
    font-size: 12px; padding: 2px 0;
    letter-spacing: .3px;
  }
  .info-row .k { color: var(--amber-mid); }
  .info-row .v { color: var(--amber); text-align: right; }
  .info-row .v.dyn { color: var(--cyan); }
  .info-links {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 4px;
  }
  .info-link {
    font-size: 11px; letter-spacing: .5px;
    color: var(--cyan); text-decoration: none;
    padding: 3px 8px;
    border: 1px solid var(--cyan-mid);
    transition: background .15s;
  }
  .info-link:hover { background: rgba(102, 224, 255, 0.12); }

  /* ── Filter row highlight (click to lock) ── */
  .filter-row.locked {
    background: rgba(102, 224, 255, 0.12);
    box-shadow: inset 3px 0 0 var(--cyan);
  }
  .filter-row.locked .label { color: var(--cyan); }
  .status-pill {
    font-size: 12px; letter-spacing: 1px;
    padding: 0 6px; min-width: 80px; text-align: center;
  }

  /* ── Chip (hover/lock info) ── */
  #chip {
    position: fixed; z-index: 30;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid var(--amber-mid);
    color: var(--amber);
    padding: 8px 10px 8px 10px;
    min-width: 220px; max-width: 280px;
    pointer-events: auto;
    display: none;
    font-size: 13px;
    transform: translate(0, 0);
  }
  #chip.locked {
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(90, 215, 255, 0.3);
  }
  .ch-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 10px; margin-bottom: 4px;
  }
  .ch-name {
    color: var(--cyan); font-size: 14px; letter-spacing: .8px;
    word-break: break-word; line-height: 1.15;
  }
  .ch-cat {
    font-size: 11px; color: var(--amber-mid);
    letter-spacing: 1.2px; flex-shrink: 0;
  }
  .ch-body { display: flex; flex-direction: column; gap: 2px; }
  .ch-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 12px; letter-spacing: .3px;
    line-height: 1.4;
  }
  .ch-row .k { color: var(--amber-mid); }
  .ch-row .v { color: var(--amber); text-align: right; }
  .ch-row .v.dyn { color: var(--cyan); }
  .ch-hint {
    font-size: 11px; color: var(--amber-mid);
    margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--amber-dim);
    letter-spacing: .5px;
  }
  #chip.locked .ch-hint { color: var(--cyan-mid); border-color: rgba(90,215,255,0.20); }
  #chip-close {
    color: var(--amber); cursor: pointer; pointer-events: auto;
    font-size: 16px; padding: 0 4px; display: none;
  }
  .ch-actions {
    display: flex; gap: 6px; margin-top: 8px;
    padding-top: 6px; border-top: 1px solid var(--amber-dim);
  }
  .ch-btn {
    flex: 1; background: rgba(91, 159, 217, 0.08);
    color: var(--amber);
    border: 1px solid var(--amber-mid);
    padding: 4px 6px;
    font-family: inherit; font-size: 11px;
    letter-spacing: 1px; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
  }
  .ch-btn:hover { background: rgba(91, 159, 217, 0.18); }
  .ch-btn.active {
    background: rgba(90, 215, 255, 0.15);
    color: var(--cyan);
    border-color: var(--cyan-mid);
  }
  #chip.locked .ch-actions { display: flex; }
  #chip:not(.locked) .ch-actions { display: none; }

  /* ── Target reticle for locked sat ── */
  #target-reticle {
    position: fixed; z-index: 12; pointer-events: none;
    width: 72px; height: 72px;
    margin-left: -36px; margin-top: -36px;
    display: none;
  }
  #target-reticle.visible {
    display: block;
    animation: reticle-pulse 1.6s ease-in-out infinite;
  }
  @keyframes reticle-pulse {
    0%, 100% { opacity: .9; }
    50%      { opacity: 1.0; }
  }
  .tr-corner {
    position: absolute; width: 14px; height: 14px;
    border: 1.5px solid var(--cyan);
    box-shadow: 0 0 4px rgba(90, 215, 255, 0.5);
  }
  .tr-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
  .tr-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
  .tr-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
  .tr-br { bottom: 0; right: 0; border-left: none; border-top: none; }
  .tr-ring {
    position: absolute; inset: 14px;
    border: 1px dashed var(--cyan);
    border-radius: 50%;
    opacity: 0.45;
    animation: tr-rotate 7s linear infinite;
  }
  @keyframes tr-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  .tr-cross-h, .tr-cross-v {
    position: absolute; background: var(--cyan);
    opacity: 0.35;
    box-shadow: 0 0 4px rgba(90,215,255,0.5);
  }
  .tr-cross-h {
    top: 50%; left: -24px; right: -24px;
    height: 1px; transform: translateY(-50%);
  }
  .tr-cross-v {
    left: 50%; top: -24px; bottom: -24px;
    width: 1px; transform: translateX(-50%);
  }
  .tr-label {
    position: absolute; top: -26px; left: 50%;
    transform: translateX(-50%);
    font-size: 11px; color: var(--cyan);
    letter-spacing: 1.5px; white-space: nowrap;
    text-shadow: 0 0 4px rgba(0,0,0,0.9);
  }

  /* ── KSP-style banner ── */
  #banner {
    position: fixed; top: 52px;
    left: 280px; right: 320px;
    z-index: 14; display: none;
  }
  #banner.visible { display: block; }
  .banner-inner { padding: 8px 14px 10px; }
  .banner-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 10px;
  }
  .b-title { font-size: 16px; color: var(--cyan); letter-spacing: 1.5px; }
  .b-meta { font-size: 11px; color: var(--amber); letter-spacing: 1px; }
  .b-body { font-size: 13px; color: #c8c8bc; margin-top: 6px; line-height: 1.5; }
  .b-stats {
    display: flex; gap: 16px; margin-top: 6px;
    font-size: 11px; letter-spacing: .5px; color: var(--amber-mid);
  }
  .b-stats .k { color: var(--amber-mid); margin-right: 4px; }
  .b-stats .v { color: var(--cyan); }
  #banner-close {
    position: absolute; top: 4px; right: 8px;
    color: var(--amber); cursor: pointer; font-size: 16px;
    background: none; border: none; pointer-events: auto;
  }

  /* ── City labels ── */
  .city-label {
    position: fixed; z-index: 8;
    pointer-events: none;
    color: #dcdcd0; font-size: 17px; letter-spacing: .5px;
    text-shadow: 0 0 8px rgba(0,0,0,.95),0 0 4px rgba(0,0,0,.9),1px 1px 0 #000;
    transform: translate(10px,-50%);
    display: none; transition: opacity .15s; opacity: 0;
  }
  .city-label.visible { display: block; opacity: .9; }
  .city-label::before {
    content: "+"; color: var(--green);
    margin-right: 6px; text-shadow: 0 0 4px var(--green-mid);
  }
  .city-label.tier-5 { font-size: 18px; color: #eaeae0; }
  .city-label.tier-2 { font-size: 15px; color: #a8a89c; }

  /* ── Station labels ── */
  .station-label {
    position: fixed; z-index: 9;
    pointer-events: auto;
    cursor: pointer;
    color: #f5f5f0; font-size: 14px; letter-spacing: .8px;
    text-shadow: 0 0 6px rgba(0,0,0,1),0 0 3px rgba(0,0,0,1),1px 1px 0 #000;
    transform: translate(14px, -50%);
    display: none; white-space: nowrap;
    transition: color .15s;
  }
  .station-label:hover { color: var(--cyan); }
  .station-label.visible { display: block; }
  .station-label::before {
    content: "■ "; color: #f5f5f0;
    font-size: 10px; margin-right: 4px;
    text-shadow: 0 0 4px rgba(255,255,255,0.5);
  }
  /* ISS special marker */
  .station-label.iss {
    font-size: 16px;
    color: #ffd070;
    letter-spacing: 1.2px;
    text-shadow: 0 0 10px rgba(255,208,112,0.7), 0 0 4px rgba(0,0,0,1), 1px 1px 0 #000;
  }
  .station-label.iss::before {
    content: "◆ ";
    color: #ffd070;
    font-size: 13px;
    text-shadow: 0 0 6px rgba(255,208,112,0.9);
  }
  .station-label.iss:hover { color: #ffffff; }

  /* ── Satellite zoom-LOD labels (debris analysis) ── */
  .sat-label {
    position: fixed; z-index: 7;
    pointer-events: auto;
    cursor: pointer;
    color: #c9c2b0; font-size: 11px; letter-spacing: .4px;
    text-shadow: 0 0 5px rgba(0,0,0,1),0 0 2px rgba(0,0,0,1);
    transform: translate(8px, -50%);
    white-space: nowrap; opacity: 0;
    transition: opacity .12s, color .12s;
    padding: 1px 4px;
  }
  .sat-label.visible { opacity: .85; }
  .sat-label:hover { color: var(--cyan); opacity: 1; }

  /* ── Search panel ── */
  #search-input {
    background: rgba(91, 159, 217, 0.05);
    color: var(--amber);
    border: 1px solid var(--amber-mid);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: .5px;
    outline: none;
    display: block;
    margin: 8px 10px 6px;
    width: calc(100% - 20px);
  }
  #search-input::placeholder { color: rgba(91, 159, 217, 0.35); }
  #search-input:focus { border-color: var(--cyan); }
  .quick-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 0 10px 8px;
  }
  .qtag {
    background: rgba(91, 159, 217, 0.06);
    color: var(--amber-mid);
    border: 1px solid var(--amber-dim);
    padding: 2px 7px;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .12s;
  }
  .qtag:hover {
    background: rgba(91, 159, 217, 0.16);
    color: var(--amber);
    border-color: var(--amber-mid);
  }
  #search-results {
    max-height: 220px;
    overflow-y: auto;
  }
  #search-results:empty { display: none; }
  #search-results { border-top: 1px solid var(--amber-dim); }
  .search-result {
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(91, 159, 217, 0.07);
    font-size: 12px;
  }
  .search-result:hover { background: rgba(90, 215, 255, 0.07); }
  .sr-name {
    color: var(--cyan); letter-spacing: .3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1;
  }
  .sr-cat {
    color: var(--amber-mid);
    font-size: 10px; letter-spacing: .8px;
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .search-empty {
    padding: 8px 10px;
    color: var(--amber-mid);
    font-size: 12px;
    letter-spacing: .5px;
    font-style: italic;
  }

  /* ── Load status rows ── */
  #load-rows {
    max-height: 220px;
    overflow-y: auto;
  }
  .load-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 3px 10px;
    font-size: 12px; letter-spacing: .4px;
    border-bottom: 1px solid rgba(91, 159, 217, 0.06);
  }
  .lr-name { color: var(--amber); flex: 1; }
  .lr-count {
    color: var(--cyan); font-size: 11px;
    min-width: 60px; text-align: right;
  }
  .lr-status {
    font-size: 10px; letter-spacing: 1px;
    padding: 1px 6px;
    margin: 0 6px;
    text-transform: uppercase;
    min-width: 50px; text-align: center;
  }
  .lr-status.loading { color: var(--cyan); border: 1px solid var(--cyan-mid); }
  .lr-status.ok      { color: var(--green); border: 1px solid var(--green-mid); }
  .lr-status.fail    { color: var(--red);   border: 1px solid rgba(255,90,90,0.5); }
  .lr-status.retry   { color: #e8b056;       border: 1px solid rgba(232,176,86,0.5); }

  /* ── Splash: title card ──
     Black card with scanlines and a vignette. The logo resolves in JS; the
     sub-line and bar animate in CSS. .lift zooms the card out, opens an iris
     ring, and fades the black so the globe shows through. */
  #splash {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; pointer-events: auto;
  }
  #splash::before {
    content: ''; position: absolute; inset: 0;
    background:
      repeating-linear-gradient(to bottom, rgba(102,224,255,0.035) 0 1px, transparent 1px 3px),
      radial-gradient(ellipse at center, #02070d 0%, #000 70%);
    transition: opacity .9s ease .15s;
  }
  #splash::after {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: linear-gradient(to right, transparent, var(--cyan), transparent);
    box-shadow: 0 0 18px var(--cyan);
    opacity: 0;
    animation: sweep 1.3s cubic-bezier(.3,.1,.2,1) .1s 1 both;
  }
  @keyframes sweep {
    0%   { transform: translateY(0);     opacity: 0; }
    10%  { opacity: .9; }
    100% { transform: translateY(100vh); opacity: 0; }
  }
  .splash-card {
    position: relative; text-align: center;
    width: min(560px, calc(100vw - 32px));
    transition: transform .7s cubic-bezier(.5,0,.2,1), opacity .5s ease, filter .6s ease;
  }
  #splash .logo {
    font-size: clamp(30px, 7vw, 46px); letter-spacing: .4em;
    padding-left: .4em; white-space: pre;
    color: var(--cyan);
    text-shadow: 0 0 14px rgba(102, 224, 255, 0.55), 0 0 42px rgba(102, 224, 255, 0.25);
    animation: logo-in .5s ease both;
  }
  @keyframes logo-in {
    from { opacity: 0; filter: blur(6px); }
    to   { opacity: 1; filter: blur(0); }
  }
  #splash .sub {
    font-size: 13px; color: var(--amber-mid);
    margin-top: 6px;
    animation: sub-in 1.1s cubic-bezier(.2,.7,.2,1) .35s both;
  }
  @keyframes sub-in {
    from { opacity: 0; letter-spacing: 16px; }
    to   { opacity: 1; letter-spacing: 5px; }
  }
  .splash-bar {
    height: 1px; margin: 18px auto 12px; width: 70%;
    background: rgba(91, 159, 217, 0.18);
    position: relative; overflow: hidden;
  }
  .splash-bar span {
    position: absolute; inset: 0;
    background: linear-gradient(to right, transparent, var(--cyan) 50%, transparent);
    transform-origin: center;
    animation: bar-grow 1.2s cubic-bezier(.2,.7,.2,1) .4s both;
  }
  @keyframes bar-grow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
  #splash-lines {
    min-height: 54px;
    font-size: 13px; letter-spacing: .5px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  #splash-lines .ln { color: var(--green-mid); animation: linein .25s ease both; }
  #splash-lines .ln::before { content: '> '; color: var(--amber-mid); }
  #splash-lines .ln.err { color: var(--red); }
  #splash-lines .ln.ok  { color: var(--green); }
  @keyframes linein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  /* The iris grows by width and height, not scale, so its border stays 2px. */
  .splash-iris {
    position: absolute; left: 50%; top: 50%;
    width: 10px; height: 10px; transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid var(--cyan);
    box-shadow: 0 0 24px var(--cyan), inset 0 0 24px rgba(102,224,255,.4);
    opacity: 0; pointer-events: none;
  }
  #splash.lift { pointer-events: none; }
  #splash.lift::before { opacity: 0; }
  #splash.lift .splash-card { transform: scale(1.25); opacity: 0; filter: blur(4px); }
  #splash.lift .splash-iris { animation: iris 1s cubic-bezier(.2,.6,.2,1) both; }
  @keyframes iris {
    0%   { width: 10px;   height: 10px;   opacity: 0; }
    15%  { opacity: 1; }
    100% { width: 260vmax; height: 260vmax; opacity: 0; }
  }

  /* ── Acquisition strip (top centre, during catalog load) ── */
  #acq {
    top: 12px; left: 50%;
    width: min(440px, calc(100vw - 600px));
    min-width: 300px;
    padding: 7px 12px 6px;
    z-index: 12; pointer-events: none;
    border-color: rgba(102, 224, 255, 0.45);
    opacity: 0; transform: translate(-50%, -140%);
    transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s ease, border-color .4s;
  }
  #acq.on  { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
  #acq.off { opacity: 0; transform: translate(-50%, -140%); transition-delay: 0s; }
  #acq.corners::before, #acq.corners::after,
  #acq.corners > .ctl, #acq.corners > .ctr { width: 8px; height: 8px; border-color: var(--cyan); }
  .acq-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; letter-spacing: 2px; color: var(--cyan);
  }
  .acq-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .acq-count { color: var(--amber-mid); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
  .acq-count span { color: var(--cyan); font-size: 16px; }
  .acq-spin {
    width: 11px; height: 11px; flex: none;
    border: 1.5px solid var(--cyan); border-right-color: transparent; border-radius: 50%;
    animation: rot .8s linear infinite;
  }
  @keyframes rot { to { transform: rotate(360deg); } }
  .acq-segs { display: flex; gap: 3px; margin: 6px 0 5px; height: 7px; }
  .acq-segs .seg {
    flex: 1; position: relative; overflow: hidden;
    background: rgba(91, 159, 217, 0.12);
    border: 1px solid rgba(91, 159, 217, 0.3);
    animation: seg-in .35s ease calc(var(--i) * 40ms) both;
  }
  @keyframes seg-in { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: none; } }
  .acq-segs .seg::after {
    content: ''; position: absolute; inset: 0;
    transform-origin: left; transform: scaleX(0);
    transition: transform .45s cubic-bezier(.2,.8,.2,1), background .3s;
  }
  .acq-segs .seg.loading::before {
    content: ''; position: absolute; top: 0; bottom: 0; width: 60%;
    background: linear-gradient(to right, transparent, rgba(102,224,255,.6), transparent);
    animation: shimmer 1.1s linear infinite;
    animation-delay: calc(var(--i) * -90ms);
  }
  @keyframes shimmer { from { left: -60%; } to { left: 100%; } }
  .acq-segs .seg.ok::after    { transform: scaleX(1); background: var(--green); box-shadow: 0 0 6px var(--green); }
  .acq-segs .seg.fail::after  { transform: scaleX(1); background: var(--red); }
  .acq-segs .seg.retry        { border-color: rgba(232,176,86,.7); animation: blink .6s infinite; }
  .acq-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .5px; }
  .acq-line {
    flex: 1; min-width: 0; color: var(--green-mid);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .acq-line::before { content: '> '; color: var(--amber-mid); }
  .acq-line.ok  { color: var(--green); }
  .acq-line.err { color: var(--red); }
  .acq-line.in  { animation: linein .25s ease both; }
  .acq-sys { display: flex; gap: 6px; flex: none; }
  .acq-sys i {
    font-style: normal; font-size: 10px; letter-spacing: 1px;
    color: rgba(91, 159, 217, 0.4);
    transition: color .3s, text-shadow .3s;
  }
  .acq-sys i[data-state="busy"] { color: var(--cyan); animation: blink .8s infinite; }
  .acq-sys i[data-state="ok"]   { color: var(--green); text-shadow: 0 0 6px var(--green-mid); }
  .acq-sys i[data-state="fail"] { color: var(--red); }
  #acq.done { border-color: var(--green-mid); }
  #acq.done .acq-title { color: var(--green); }
  #acq.done .acq-spin  { animation: none; border-color: var(--green); border-radius: 0; transform: rotate(45deg) scale(.7); background: var(--green); }
  #acq.done .acq-segs .seg { animation: seg-done .6s ease calc(var(--i) * 30ms) 2 alternate; }
  @keyframes seg-done { to { filter: brightness(2.2); } }

  /* ── Boot power-on ──
     body.boot-wait keeps the chrome hidden behind the title card. revealScene
     swaps it for boot-in, which wipes each panel on left to right with a short
     CRT flicker, staggered by --d. */
  body.boot-wait #brand-bar,
  body.boot-wait #leftpanel > .panel,
  body.boot-wait #rightpanel > .panel,
  body.boot-wait #timepanel { opacity: 0; }
  body.boot-in #brand-bar                     { animation: panel-on .7s ease .25s both; }
  body.boot-in #leftpanel > .panel            { animation: panel-on .8s ease both; }
  body.boot-in #leftpanel > .panel:nth-child(1) { animation-delay: .45s; }
  body.boot-in #leftpanel > .panel:nth-child(2) { animation-delay: .6s; }
  body.boot-in #leftpanel > .panel:nth-child(3) { animation-delay: .75s; }
  body.boot-in #leftpanel > .panel:nth-child(4) { animation-delay: .9s; }
  body.boot-in #rightpanel > .panel           { animation: panel-on .8s ease .7s both; }
  body.boot-in #timepanel                     { animation: panel-up .9s cubic-bezier(.2,.8,.2,1) .55s both; }
  @keyframes panel-on {
    0%   { opacity: 0; clip-path: inset(-6px 100% -6px -6px); }
    55%  { opacity: 1; clip-path: inset(-6px -6px -6px -6px); }
    62%  { opacity: .35; }
    70%  { opacity: 1; }
    78%  { opacity: .6; }
    100% { opacity: 1; clip-path: inset(-6px -6px -6px -6px); }
  }
  @keyframes panel-up {
    0%   { opacity: 0; transform: translateY(40px); }
    60%  { opacity: 1; }
    70%  { opacity: .5; }
    100% { opacity: 1; transform: none; }
  }

  /* ── Live-load feedback ── */
  .load-row.lr-in { animation: row-in .35s ease calc(var(--i) * 35ms) both; }
  @keyframes row-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
  .load-row.lr-flash { animation: row-flash .8s ease; }
  @keyframes row-flash {
    0%   { background: rgba(102, 224, 255, 0.28); }
    100% { background: transparent; }
  }
  .filter-row.bump .count { animation: bump .6s ease; }
  .filter-row.bump .legend-mark { animation: mark-pop .6s ease; }
  @keyframes bump {
    0%   { color: #fff; text-shadow: 0 0 8px var(--cyan); }
    100% { color: var(--amber-mid); text-shadow: none; }
  }
  @keyframes mark-pop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.5); filter: brightness(1.8); }
    100% { transform: scale(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    #splash::after, .splash-iris, .acq-segs .seg.loading::before { display: none; }
    body.boot-in #brand-bar, body.boot-in #leftpanel > .panel,
    body.boot-in #rightpanel > .panel, body.boot-in #timepanel { animation-duration: .01s; animation-delay: 0s; }
  }

  /* ── Mobile ── */
  @media (max-width: 880px) {
    .brand { font-size: 18px; letter-spacing: 2px; }
    #timepanel {
      left: 6px; right: 6px; bottom: 6px;
      padding: 8px 12px 10px;
    }
    .tp-display {
      flex-direction: column; align-items: flex-start;
      gap: 2px; margin-bottom: 6px; padding-bottom: 4px;
    }
    .tp-time { font-size: 18px; letter-spacing: 1px; }
    .tp-time .delta { font-size: 12px; margin-left: 8px; }
    .tp-stats { font-size: 10px; gap: 12px; }
    #slider { height: 32px; margin-bottom: 6px; }
    #slider-handle { width: 14px; height: 20px; }
    .slider-ticks { top: 21px; }
    .slider-ticks .tk::after { font-size: 9px; }
    .tp-controls { gap: 6px; flex-wrap: wrap; }
    .tc-btn { padding: 6px 12px; min-width: 44px; min-height: 36px; font-size: 14px; }
    .rate-label { margin-left: 6px; font-size: 10px; }
    #rate-slider { flex: 1; min-width: 80px; max-width: none; }
    .rate-value { font-size: 12px; min-width: 48px; }
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .mobile-only { display: block; }
    #leftpanel {
      top: 52px; left: 6px; right: 6px; width: auto;
      transform: translateX(-110%); transition: transform .25s;
      max-height: calc(100vh - 260px);
    }
    #leftpanel.open { transform: translateX(0); }
    #rightpanel {
      top: 52px; left: 6px; right: 6px; width: auto;
      transform: translateX(110%); transition: transform .25s;
      max-height: calc(100vh - 260px);
    }
    #rightpanel.open { transform: translateX(0); }
    #banner { top: 52px; left: 8px; right: 8px; }
    #brand-bar { top: 8px; left: 12px; gap: 8px; }
    .menu-btn { width: 36px; height: 36px; }
    .city-label { font-size: 14px; }
    .city-label.tier-5 { font-size: 15px; }
    .city-label.tier-2 { font-size: 13px; }
    .station-label { font-size: 12px; }
    .sat-label { font-size: 10px; }
    #acq { top: 52px; left: 6px; right: 6px; width: auto; min-width: 0; transform: translateY(-40px); }
    #acq.on  { transform: none; }
    #acq.off { transform: translateY(-40px); }
    .acq-head { font-size: 12px; letter-spacing: 1px; }
  }
