/* === NOVA HUD Style Block 1 === */
/* Hide the default system cursor across the app and interactive elements */
  *, *::before, *::after, html, body, canvas, div, span, a, button, [role="button"], input, select {
    cursor: none !important;
  }
  #tooltip, .tooltip, [id*="tooltip"], [class*="tooltip"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #nova-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    pointer-events: none !important;
    z-index: 99999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.8),
                0 0 16px 4px rgba(56, 189, 248, 0.35);
    transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  }

  #nova-cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    pointer-events: none !important;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.25s ease-out, height 0.25s ease-out, border-color 0.25s ease, background-color 0.25s ease;
  }

  body.nova-cursor-hover #nova-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #38bdf8;
    box-shadow: 0 0 12px 3px rgba(56, 189, 248, 0.9);
  }

  body.nova-cursor-hover #nova-cursor-halo {
    width: 40px;
    height: 40px;
    border-color: rgba(56, 189, 248, 0.65);
    background-color: rgba(56, 189, 248, 0.06);
  }

  #nova-trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none !important;
    z-index: 99997;
  }

    /* === UPDATE 5: Subtle Idle HUD Dimming === */
    html:not(.is-booting) #bottom-hud,
    html:not(.is-booting) #header-nova-pill,
    html:not(.is-booting) #map-key-summon-btn {
      transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms ease, background-color 300ms ease, box-shadow 300ms ease;
    }
    html:not(.is-booting).nova-hud-idle #bottom-hud,
    html:not(.is-booting).nova-hud-idle #header-nova-pill,
    html:not(.is-booting).nova-hud-idle #map-key-summon-btn {
      opacity: 0.38 !important;
      transition: opacity 1200ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    html:not(.is-booting).nova-hud-idle #bottom-hud:hover,
    html:not(.is-booting).nova-hud-idle #header-nova-pill:hover,
    html:not(.is-booting).nova-hud-idle #map-key-summon-btn:hover {
      opacity: 1 !important;
    }

  
    /* === SPATIAL 2D SCREEN-ALIGNED HUD CALLOUT === */
    html.is-booting #spatial-telemetry-layer {
      opacity: 0 !important;
      pointer-events: none !important;
      visibility: hidden !important;
    }
    #spatial-telemetry-layer {
      position: fixed;
      inset: 0;
      z-index: 18;
      pointer-events: none;
      overflow: hidden;
      transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    #spatial-callout-card {
      position: absolute;
      top: 0;
      left: 0;
      width: 312px;
      pointer-events: auto;
      background: transparent;
      border: none;
      border-radius: 0;
      box-shadow: none;
      padding: 4px 8px;
      color: #f8fafc;
    }
    .spatial-hairline-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      border-top: 1px solid rgba(255, 255, 255, 0.09);
      border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    }
    .spatial-hairline-cell {
      padding: 5px 6px;
    }
    .spatial-hairline-cell:nth-child(odd) {
      border-right: 1px solid rgba(255, 255, 255, 0.08);
      padding-left: 0;
    }
    .spatial-hairline-cell:nth-child(even) {
      padding-left: 8px;
      padding-right: 0;
    }
    .spatial-hairline-cell:nth-child(1),
    .spatial-hairline-cell:nth-child(2) {
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

/* === NOVA HUD Style Block 2 === */
/* Force a heavy 1.5s glide on the Bottom HUD and Map Key */
  #bottom-hud, #hud-bar, nav, aside, .map-key-panel, [data-nova-map-key] {
    transition: all 1.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
  
  /* Docking class applied only during the tour */
  .nova-hud-docked {
    transform: translate(-50%, 150px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Thin Cyan Horizon Line Docking Area */
  #nova-tour-dock {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 60vw; height: 40px; z-index: 99998;
    display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
    opacity: 0; pointer-events: none; transition: opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  }
  #nova-tour-dock.active { opacity: 1; pointer-events: auto; }
  
  .cyan-line {
    width: 200px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(34,211,238,0.9), transparent);
    box-shadow: 0 0 15px rgba(34,211,238,0.7);
    transition: width 0.8s ease, box-shadow 0.8s ease;
  }
  #nova-tour-dock:hover .cyan-line { width: 300px; box-shadow: 0 0 25px rgba(34,211,238,1); }

/* === NOVA HUD Style Block 3 === */
#nova-ephemeris-hud {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: none;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.55);
    user-select: none;
    pointer-events: auto;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  }
  #nova-ephemeris-hud .eph-date {
    color: rgba(251, 191, 36, 0.92);
    font-weight: 500;
    min-width: 148px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  #nova-ephemeris-hud .eph-div {
    color: rgba(226, 232, 240, 0.22);
    pointer-events: none;
  }
  #nova-ephemeris-hud .eph-group {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  #nova-ephemeris-hud button {
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    padding: 2px 0;
    color: rgba(226, 232, 240, 0.45);
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  #nova-ephemeris-hud button:hover {
    color: rgba(248, 250, 252, 0.92);
  }
  #nova-ephemeris-hud button.active {
    color: #fbbf24;
    border-bottom-color: rgba(251, 191, 36, 0.8);
  }
  #nova-ephemeris-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 110px;
    height: 1px;
    background: rgba(226, 232, 240, 0.25);
    outline: none;
    cursor: pointer;
  }
  #nova-ephemeris-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
  }
  #nova-ephemeris-slider::-moz-range-thumb {
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border: none;
    border-radius: 50%;
    cursor: pointer;
  }
  @media (max-width: 768px) {
    #nova-ephemeris-hud { gap: 8px; font-size: 9px; }
    #nova-ephemeris-slider { width: 64px; }
    .eph-hide-sm { display: none; }
  }

  /* === NOVA UNIFIED TRANSPARENT BOTTOM HUD === */
  #bottom-hud button svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
  }
  #bottom-hud #attitude-sphere-wrapper {
    background: transparent !important;
    box-shadow: none !important;
  }
  #bottom-hud {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* === PATH B: EDUCATIONAL OBSERVATORY HUD (ASYMMETRICAL + MONOSPACE) === */

  /* 1. Dock Top Ephemeris Bar to Top-Right to break centered box framing */
  #nova-ephemeris-hud {
    left: auto !important;
    right: 1.5rem !important;
    transform: none !important;
  }

  /* 2. Dock Attitude Gimbal to Bottom-Left as a standalone orientation compass */
  #hud-center-gimbal {
    position: fixed !important;
    bottom: 1.25rem !important;
    left: 1.25rem !important;
    z-index: 20 !important;
    padding: 0 !important;
  }

  /* 3. Convert Bottom HUD circular buttons into crisp monospace observatory toggles */
  #bottom-hud {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 4px 8px !important;
  }
  #bottom-hud #hud-toggle-group {
    gap: 14px !important;
    margin-left: 6px !important;
    margin-right: 14px !important;
  }
  #bottom-hud #hud-right-controls {
    gap: 14px !important;
    padding-left: 14px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.14) !important;
  }

  #btn-cosmic-tour,
  #hud-toggle-group button,
  #hud-right-controls button {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    padding: 2px 2px 3px 2px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 10px !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: #9aa3b2 !important;
    border-bottom: 1px solid transparent !important;
    transition: color 180ms ease, border-color 180ms ease !important;
  }

  #btn-cosmic-tour:hover,
  #hud-toggle-group button:hover,
  #hud-right-controls button:hover {
    color: rgba(248, 250, 252, 0.96) !important;
    transform: none !important;
  }

  /* Hide circular SVGs non-destructively so JS references stay intact */
  #btn-cosmic-tour svg,
  #hud-toggle-group button svg,
  #hud-right-controls button svg {
    display: none !important;
  }

  /* Active state matches Top Bar's warm amber underline */
  #hud-toggle-group button[data-nova-active="true"] {
    color: #fbbf24 !important;
    border-bottom-color: #fbbf24 !important;
  }

  /* Crisp monospace labels */
  #btn-cosmic-tour::before    { content: "TOUR"; }
  #btn-cosmic-web::before     { content: "WEB"; }
  #btn-orbits::before         { content: "ORBITS"; }
  #btn-toggle-labels::before  { content: "LABELS"; }
  #btn-t0::before             { content: "TIERS"; }
  #btn-toggle-sidebar::before { content: "INFO"; }
  #btn-fullscreen-zen::before { content: "FULL"; }

  /* === UNIFIED AMBER + STARLIGHT OBSERVATORY POLISH === */

  /* Active amber underline for INFO and FULL buttons */
  #hud-right-controls button[data-nova-active="true"] {
    color: #fbbf24 !important;
    border-bottom-color: #fbbf24 !important;
  }

  /* Unify Bottom-Bar Zoom Slider thumb & glow to Warm Amber */
  #bottom-hud input[type="range"]::-webkit-slider-thumb {
    background: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.9) !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.55) !important;
  }
  #bottom-hud input[type="range"]::-moz-range-thumb {
    background: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.9) !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.55) !important;
  }
  #bottom-hud #zoom-anchor-left,
  #bottom-hud #zoom-anchor-right {
    border-color: rgba(251, 191, 36, 0.45) !important;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.25) !important;
  }

  /* True Viewport Bottom-Left Gimbal (reparented to body) */
  body > #hud-center-gimbal {
    position: fixed !important;
    bottom: 1.5rem !important;
    left: 1.5rem !important;
    z-index: 20 !important;
    padding: 0 !important;
    opacity: 0.82;
    transition: opacity 260ms ease;
  }
  body > #hud-center-gimbal:hover {
    opacity: 1;
  }
  html.is-booting body > #hud-center-gimbal,
  html.screensaver-active body > #hud-center-gimbal {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Restyle Map Key Drawer to Match Transparent Observatory Aesthetic */
  #map-key-drawer {
    background: rgba(2, 6, 23, 0.52) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  }
  #map-key-drawer * {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  }
  #map-key-attached-tab,
  #map-key-summon-btn {
    background-color: rgba(251, 191, 36, 0.65) !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.35) !important;
  }
  #map-key-drawer svg {
    filter: grayscale(1) brightness(1.15) opacity(0.75);
  }

  /* === OBSERVATORY COLOR HARMONY & LAYOUT TWEAKS === */

  /* 1. Warm Amber for the 4 NOVA layer toggles; Starlight White/Gray for INFO & FULL */
  #hud-toggle-group button[data-nova-active="true"] {
    color: #fbbf24 !important;
    border-bottom-color: #fbbf24 !important;
  }
  #hud-right-controls button[data-nova-active="true"] {
    color: #f8fafc !important;
    border-bottom-color: rgba(248, 250, 252, 0.88) !important;
  }
  #hud-right-controls button[data-nova-active="false"] {
    color: #9aa3b2 !important;
    border-bottom-color: transparent !important;
  }

  /* 2. Exact left/right anchor circle alignment (5px inset on both ends) */
  #zoom-anchor-left,
  #zoom-ripple-left {
    left: 5px !important;
    right: auto !important;
  }
  #zoom-anchor-right,
  #zoom-ripple-right {
    right: 5px !important;
    left: auto !important;
    transform: translate(50%, -50%) !important;
  }

  /* 3. Endpoint pulse animation for scale slider min/max */
  @keyframes novaZoomEndpointPulse {
    0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.8); }
  }
  @keyframes novaZoomEndpointPulseRight {
    0%   { opacity: 0.9; transform: translate(50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(50%, -50%) scale(2.8); }
  }
  #zoom-ripple-left.nova-pulse {
    animation: novaZoomEndpointPulse 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  #zoom-ripple-right.nova-pulse {
    animation: novaZoomEndpointPulseRight 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  /* 4. Prevent Standby Badge / Top-Right Ephemeris Bar overlap on exit */
  #screensaver-hud-badge {
    color: rgba(226, 232, 240, 0.82) !important;
    transition: opacity 150ms ease !important;
  }
  html.screensaver-active #screensaver-hud-badge {
    transition: opacity 600ms ease 250ms !important;
  }
  #nova-ephemeris-hud {
    transition: opacity 350ms ease 220ms !important;
  }
  html.screensaver-active #nova-ephemeris-hud {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 180ms ease 0ms !important;
  }

  /* === IDEA 1: CIRCULAR INDICATOR NODES (REPLACING STATIC UNDERLINES) === */
  #hud-toggle-group button,
  #hud-right-controls button,
  #btn-cosmic-tour,
  #nova-ephemeris-hud button {
    position: relative !important;
    border-bottom-color: transparent !important;
  }

  .nova-node {
    position: absolute;
    left: 50%;
    width: 4.5px;
    height: 4.5px;
    border-radius: 9999px;
    transform: translateX(-50%) scale(0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  #bottom-hud .nova-node { bottom: calc(100% + 5px); }
  #hud-toggle-group button[data-nova-active="true"] .nova-node {
    background: #fbbf24;
    box-shadow: 0 0 7px rgba(251, 191, 36, 0.85);
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  #hud-right-controls button[data-nova-active="true"] .nova-node {
    background: #f8fafc;
    box-shadow: 0 0 7px rgba(248, 250, 252, 0.85);
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  #btn-cosmic-tour[data-nova-active="true"] .nova-node,
  #btn-cosmic-tour:hover .nova-node {
    background: #fbbf24;
    box-shadow: 0 0 7px rgba(251, 191, 36, 0.8);
    opacity: 0.9;
    transform: translateX(-50%) scale(1);
  }

  #nova-ephemeris-hud .nova-node { top: calc(100% + 5px); }
  #nova-ephemeris-hud button.active { border-bottom: none !important; }
  #nova-ephemeris-hud button.active .nova-node {
    background: #fbbf24;
    box-shadow: 0 0 7px rgba(251, 191, 36, 0.85);
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  /* === FIX 2: SOFTEN CUSTOM CURSOR OVER HUD TEXT BUTTONS === */
  body.nova-cursor-hud-text #nova-cursor-dot {
    opacity: 0.15 !important;
    transform: translate(-50%, -50%) scale(0.5) !important;
  }
  body.nova-cursor-hud-text #nova-cursor-halo {
    opacity: 0.28 !important;
    border-color: rgba(248, 250, 252, 0.35) !important;
  }

  /* === FIX 3: MINIMALIST KBD BADGES FOR MAP KEY === */
  .nova-kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    color: rgba(248, 250, 252, 0.9);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
  }

  /* === TWEAKS: NO UNDERLINES, CLICKABLE NODES, NO BOTTOM TIPS, GIMBAL CLUSTER === */

  /* 1. Kill all residual underlines on bottom & top bars */
  #bottom-hud button,
  #hud-toggle-group button[data-nova-active="true"],
  #hud-right-controls button[data-nova-active="true"],
  #hud-right-controls button[data-nova-active="false"],
  #nova-ephemeris-hud button,
  #nova-ephemeris-hud button.active {
    border-bottom: none !important;
    border-bottom-color: transparent !important;
    text-decoration: none !important;
  }

  /* 2. Make the circular nodes the clickable targets (not the text underneath) */
  #hud-toggle-group button,
  #hud-right-controls button,
  #btn-cosmic-tour {
    pointer-events: none !important;
  }
  #bottom-hud .nova-node {
    pointer-events: auto !important;
    cursor: pointer !important;
    width: 6px !important;
    height: 6px !important;
    bottom: calc(100% + 7px) !important;
    opacity: 0.42 !important;
    background: rgba(148, 163, 184, 0.35) !important;
    border: 1px solid rgba(148, 163, 184, 0.55);
    transform: translateX(-50%) scale(1) !important;
    transition: opacity 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1), background 200ms ease, box-shadow 200ms ease !important;
  }
  /* Generous invisible hitbox around each node for effortless clicking */
  #bottom-hud .nova-node::after {
    content: "";
    position: absolute;
    inset: -14px -18px -22px -18px;
    border-radius: 12px;
  }

  /* Dock Observatory Standby badge next to NOVA wordmark on top-left */
  #screensaver-hud-badge {
    left: 8.5rem !important;
    right: auto !important;
    top: 1.65rem !important;
  }
  #bottom-hud .nova-node:hover {
    opacity: 1 !important;
    transform: translateX(-50%) scale(1.35) !important;
    border-color: rgba(248, 250, 252, 0.9) !important;
  }
  #hud-toggle-group button[data-nova-active="true"] .nova-node {
    background: #fbbf24 !important;
    border-color: #fde68a !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.85) !important;
    opacity: 1 !important;
  }
  #hud-right-controls button[data-nova-active="true"] .nova-node {
    background: #f8fafc !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 8px rgba(248, 250, 252, 0.85) !important;
    opacity: 1 !important;
  }
  #btn-cosmic-tour .nova-node:hover,
  #btn-cosmic-tour[data-nova-active="true"] .nova-node {
    background: #fbbf24 !important;
    border-color: #fde68a !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.85) !important;
    opacity: 1 !important;
  }

  /* 3. Disable hover tooltip popups on the bottom bar (keep them on top bar) */
  #bottom-hud [data-tip]::after {
    display: none !important;
  }

  /* 4. Option B: Anchor Bottom-Left Gimbal with a minimalist telemetry/reset readout */
  body > #hud-center-gimbal {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }
  #nova-gimbal-telemetry {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9aa3b2;
    cursor: pointer;
    user-select: none;
    line-height: 1.45;
    transition: color 200ms ease;
  }
  #nova-gimbal-telemetry:hover {
    color: rgba(248, 250, 252, 0.95);
  }
  #nova-gimbal-telemetry .gimbal-sub {
    display: block;
    font-size: 8px;
    color: rgba(251, 191, 36, 0.72);
    letter-spacing: 0.12em;
  }

  /* === FINAL OBSERVATORY POLISH: BORDERLESS, COLOR CURSOR, TOUR MODE === */

  /* 1. Remove pill/box from top-left NOVA button & Map Key drawer */
  #header-nova-pill {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  #map-key-drawer {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }
  #map-key-drawer * {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  }

  /* 2. Color-matched, clearly visible cursor halo on button hover */
  body.nova-cursor-hud-text #nova-cursor-dot {
    opacity: 0.75 !important;
    transform: translate(-50%, -50%) scale(0.85) !important;
  }
  body.nova-cursor-hud-text #nova-cursor-halo {
    opacity: 0.92 !important;
    transform: translate(-50%, -50%) scale(1.12) !important;
  }
  body.nova-cursor-amber #nova-cursor-halo {
    border-color: rgba(251, 191, 36, 0.92) !important;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.45) !important;
  }
  body.nova-cursor-amber #nova-cursor-dot {
    background: #fbbf24 !important;
  }
  body.nova-cursor-white #nova-cursor-halo {
    border-color: rgba(248, 250, 252, 0.92) !important;
    box-shadow: 0 0 12px rgba(248, 250, 252, 0.4) !important;
  }
  body.nova-cursor-white #nova-cursor-dot {
    background: #f8fafc !important;
  }

  /* 3. Textless Tour button with true 18x18 circular rotating border & blinking cyan node */
  #btn-cosmic-tour::before {
    content: "" !important;
  }
  #btn-cosmic-tour {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    padding: 0 !important;
    border-radius: 9999px !important;
    border: 1px dashed rgba(34, 211, 238, 0.55) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  @keyframes novaTourNodeBlink {
    0%, 100% { opacity: 1;   box-shadow: 0 0 10px rgba(34, 211, 238, 0.95); }
    50%      { opacity: 0.3; box-shadow: 0 0 4px rgba(34, 211, 238, 0.4); }
  }
  body.nova-tour-minimal #btn-cosmic-tour .nova-node,
  #btn-cosmic-tour[data-nova-active="true"] .nova-node {
    background: #22d3ee !important;
    border-color: #67e8f9 !important;
    animation: novaTourNodeBlink 1.6s ease-in-out infinite !important;
  }

  /* 4. During Guided Tour: keep bottom bar visible, hide text, align nodes inline */
  body.nova-tour-minimal #bottom-hud {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.nova-tour-minimal #hud-toggle-group button::before,
  body.nova-tour-minimal #hud-right-controls button::before {
    opacity: 0 !important;
    transition: opacity 280ms ease !important;
  }
  body.nova-tour-minimal #bottom-hud .nova-node {
    bottom: 50% !important;
    transform: translate(-50%, 50%) scale(1) !important;
  }
  body.nova-tour-minimal #bottom-hud .nova-node:hover {
    transform: translate(-50%, 50%) scale(1.35) !important;
  }

  /* === TOUR MINIMIZE, FIXED MAP KEY & RIGHT-EDGE NODES === */

  /* 1. Permanently disable bottom cyan collapse line & prevent bottom HUD from sliding offscreen */
  #hud-summon-btn,
  #bottom-hud-summon-btn,
  #hud-collapse-line,
  [id*="hud-summon"],
  [id*="bottom-summon"] {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
  #bottom-hud {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  html.is-booting #bottom-hud,
  html.screensaver-active #bottom-hud {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* 2. Static cyan node above Tour button when active */
  body.nova-tour-minimal #btn-cosmic-tour .nova-node,
  #btn-cosmic-tour[data-nova-active="true"] .nova-node {
    background: #22d3ee !important;
    border-color: #67e8f9 !important;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.9) !important;
    opacity: 1 !important;
    animation: none !important;
  }

  /* 3. During active tour (when bottom bar is NOT hovered): minimize text, keep nodes + slider */
  body.nova-tour-minimal #bottom-hud:not(:hover) #hud-toggle-group button::before,
  body.nova-tour-minimal #bottom-hud:not(:hover) #hud-right-controls button::before {
    opacity: 0 !important;
    transition: opacity 280ms ease !important;
  }
  body.nova-tour-minimal #bottom-hud:hover #hud-toggle-group button::before,
  body.nova-tour-minimal #bottom-hud:hover #hud-right-controls button::before {
    opacity: 1 !important;
    transition: opacity 220ms ease !important;
  }
  body.nova-tour-minimal #bottom-hud:not(:hover) .nova-node {
    bottom: 50% !important;
    transform: translate(-50%, 50%) scale(1) !important;
  }
  body.nova-tour-minimal #bottom-hud:hover .nova-node {
    bottom: calc(100% + 7px) !important;
    transform: translateX(-50%) scale(1) !important;
  }

  /* 4. Remove amber vertical line & summon bar from Map Key completely */
  #map-key-attached-tab,
  #map-key-summon-btn {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }

  /* 5. Keep Map Key in the exact same position in all states; toggle via opacity only */
  #map-key-drawer {
    position: fixed !important;
    bottom: 1.5rem !important;
    right: 2.25rem !important;
    transform: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 260ms ease !important;
  }
  #map-key-drawer.nova-mapkey-open {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* 6. Minimalist stacked right-edge nodes to toggle Map Key */
  #nova-mapkey-nodes {
    position: fixed;
    right: 1rem;
    bottom: 2.1rem;
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    cursor: pointer;
    pointer-events: auto;
  }
  html.is-booting #nova-mapkey-nodes,
  html.screensaver-active #nova-mapkey-nodes {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  #nova-mapkey-nodes .mk-node {
    width: 5.5px;
    height: 5.5px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.55);
    transition: all 220ms ease;
  }
  #nova-mapkey-nodes:hover .mk-node {
    background: rgba(248, 250, 252, 0.85);
    border-color: #ffffff;
    transform: scale(1.25);
  }
  #nova-mapkey-nodes[data-open="true"] .mk-node {
    background: #fbbf24;
    border-color: #fde68a;
    box-shadow: 0 0 7px rgba(251, 191, 36, 0.85);
  }

  /* === FINAL POLISH: SMOOTH 900ms GLIDE, WORKING MAP KEY & NO CYAN LINE === */

  /* 1. Ultra-gradual 1.8s glide for bottom-bar text & floating nodes during tour */
  #hud-toggle-group button::before,
  #hud-right-controls button::before {
    transition: opacity 1800ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
  body.nova-tour-minimal #bottom-hud:not(:hover) #hud-toggle-group button::before,
  body.nova-tour-minimal #bottom-hud:not(:hover) #hud-right-controls button::before {
    opacity: 0 !important;
    transition: opacity 1900ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
  body.nova-tour-minimal #bottom-hud:hover #hud-toggle-group button::before,
  body.nova-tour-minimal #bottom-hud:hover #hud-right-controls button::before {
    opacity: 1 !important;
    transition: opacity 1500ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
  #bottom-hud .nova-node {
    transition: bottom 1800ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 1800ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 1200ms ease,
                background 350ms ease,
                box-shadow 350ms ease !important;
  }

  /* 2. Guarantee Map Key & right-edge nodes sit above canvas and toggle cleanly */
  #nova-mapkey-nodes {
    z-index: 9990 !important;
    pointer-events: auto !important;
  }
  #map-key-drawer {
    z-index: 9985 !important;
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: none !important;
    transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1), visibility 420ms ease !important;
  }
  #map-key-drawer.nova-mapkey-open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  /* === NOVA SLEW CONSOLE (NASA OPEN MCT / JPL AESTHETIC) === */
  #nova-cmd-overlay {
    position: fixed;
    top: 5.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    width: min(520px, calc(100vw - 2rem));
    z-index: 9995;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }
  #nova-cmd-overlay.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
  #nova-cmd-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(4, 7, 12, 0.90);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 2px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  }
  #nova-cmd-prompt {
    color: #7dd3fc;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    user-select: none;
  }
  #nova-cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    caret-color: #7dd3fc;
  }
  #nova-cmd-input::placeholder {
    color: rgba(100, 116, 139, 0.65);
  }
  #nova-cmd-hint {
    color: #64748b;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    user-select: none;
  }
  #nova-cmd-results {
    margin-top: 4px;
    background: rgba(4, 7, 12, 0.90);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 2px;
    overflow: hidden;
    display: none;
  }
  #nova-cmd-results.has-items {
    display: block;
  }
  .nova-cmd-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    font-size: 11.5px;
    color: rgba(226, 232, 240, 0.82);
    cursor: pointer;
    border-left: 2px solid transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
  }
  .nova-cmd-item:last-child { border-bottom: none; }
  .nova-cmd-item:hover,
  .nova-cmd-item.selected {
    background: transparent;
    border-left-color: #7dd3fc;
    color: #f8fafc;
  }
  .nova-cmd-meta {
    font-size: 9.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .nova-cmd-item.selected .nova-cmd-meta {
    color: #7dd3fc;
  }
  #nova-cmd-status {
    margin-top: 5px;
    padding: 0 2px;
    font-size: 10px;
    color: #64748b;
    letter-spacing: 0.06em;
    min-height: 14px;
  }
  #nova-cmd-status.is-error {
    color: #f59e0b;
  }

  /* === GIMBAL LIVE TELEMETRY READOUT === */
  #nova-nav-telemetry {
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9.5px;
    line-height: 1.25;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
  }
  #nova-nav-telemetry .t-row {
    display: flex;
    gap: 10px;
  }
  #nova-nav-telemetry .t-val {
    color: rgba(226, 232, 240, 0.88);
  }
  #nova-nav-telemetry .t-val.in-transit {
    color: #f59e0b;
  }

  /* === HIDE INFO CALLOUTS DURING TRAVEL, FADE IN ON ARRIVAL === */
  #spatial-telemetry-layer,
  #spatial-satellite-layer {
    transition: opacity 0.35s ease !important;
  }
  body.nova-tier-sweep #spatial-telemetry-layer,
  body.nova-tier-sweep #spatial-satellite-layer,
  body.nova-tier-sweep #spatial-callout-card,
  html[data-travel="traveling"] #spatial-telemetry-layer,
  html[data-travel="traveling"] #spatial-satellite-layer,
  html[data-travel="traveling"] #spatial-callout-card,
  html[data-travel="settling"] #spatial-telemetry-layer,
  html[data-travel="settling"] #spatial-satellite-layer,
  html[data-travel="settling"] #spatial-callout-card {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.1s ease !important;
  }

  /* === ZERO-BOX TETHERED SPACE TYPOGRAPHY (INFOpanelDemo) === */
  #spatial-leader-svg {
    display: block !important;
  }
  #spatial-leader-line {
    stroke: rgba(241, 245, 249, 0.72) !important;
    stroke-width: 1 !important;
  }
  #spatial-anchor-dot {
    fill: #ffffff !important;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.9)) !important;
  }
  #spatial-anchor-ring {
    stroke: rgba(255, 255, 255, 0.35) !important;
  }

  #spatial-callout-card {
    background: transparent;
    border: none;
    padding: 4px 8px;
    width: 280px !important;
    max-width: 300px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.96), 0 0 14px rgba(0, 0, 0, 0.88) !important;
    overflow: visible !important;
  }
  /* Edgeless adaptive blur ONLY when positioned over bright/busy backgrounds */
  #spatial-callout-card.nova-busy-bg::before {
    content: "";
    position: absolute;
    inset: -26px -30px;
    z-index: -1;
    pointer-events: none;
    background: rgba(2, 5, 10, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 42%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 1) 42%, rgba(0, 0, 0, 0) 100%);
  }

  /* === ZERO-BOX GUIDED TOUR SATELLITE & SURFACE PIN CALLOUTS === */
  #spatial-satellite-nodes > *,
  #spatial-surface-pin-container > * {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.96), 0 0 14px rgba(0, 0, 0, 0.88);
  }
  #spatial-satellite-nodes > *::before,
  #spatial-surface-pin-container > *::before {
    display: none;
  }
  #spatial-satellite-nodes *,
  #spatial-surface-pin-container * {
    border-color: rgba(255, 255, 255, 0.16);
  }

  /* Strip out jargon grids, scale badges, and legacy footers */
  #spatial-target-scale,
  #spatial-metrics-grid,
  #spatial-deck-label,
  #spatial-callout-card > div:last-child {
    display: none !important;
  }

  /* Clean Header */
  #spatial-target-name {
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.14em !important;
    color: #f8fafc !important;
  }

  /* === PHASE 0: SUBTITLE WRAP, WCAG AA HUD CONTRAST (>=4.5:1) & SCALE DISCLOSURE CHIP === */
  #spatial-target-meta {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.35 !important;
    font-size: 11.5px !important;
    color: rgba(216, 224, 236, 0.92) !important;
  }

  /* Raise inactive time controls & bottom HUD toggles above 4.5:1 AA contrast and >=12px */
  #nova-ephemeris-hud button,
  #hud-toggle-group button,
  #hud-right-controls button {
    color: #9aa3b2 !important;
    font-size: 12px !important;
  }
  #nova-ephemeris-hud button:hover,
  #hud-toggle-group button:hover,
  #hud-right-controls button:hover {
    color: #f1f5f9 !important;
  }
  #nova-ephemeris-hud button.active {
    color: #ffffff !important;
    font-weight: 600 !important;
  }
  #nova-attitude-label,
  .attitude-label,
  [data-attitude-label] {
    color: #9aa3b2 !important;
    font-size: 12px !important;
  }

  /* Persistent Scale Disclosure (Zero-Box Minimalist) */
  #nova-scale-chip-wrap {
    position: fixed;
    top: 44px;
    left: 24px;
    transform: none;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    pointer-events: auto;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  #nova-scale-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 2px;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: #9aa3b2;
    font-size: 9.5px;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.75);
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  #nova-scale-chip:hover,
  #nova-scale-chip:focus-visible,
  #nova-scale-chip[aria-expanded="true"] {
    color: #fbbf24;
    border-bottom-color: rgba(251, 191, 36, 0.55);
    outline: none;
  }
  #nova-scale-chip .scale-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 8.5px;
    font-weight: 600;
    line-height: 1;
    opacity: 0.85;
  }
  #nova-scale-popover {
    margin-top: 8px;
    width: min(360px, 88vw);
    padding: 2px 0 2px 12px;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(251, 191, 36, 0.55);
    color: #e2e8f0;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 12.5px;
    line-height: 1.5;
    margin-left: 4px;
    text-align: left;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95), 0 0 16px rgba(0, 0, 0, 0.85);
  }
  #nova-scale-popover strong {
    color: #fbbf24;
    font-weight: 600;
  }
  #nova-scale-popover[hidden] {
    display: none;
  }

  /* Hide scale disclosure during Observatory Standby, Fullscreen, or Guided Tour */
  body.nova-standby-active #nova-scale-chip-wrap,
  body.nova-tour-active #nova-scale-chip-wrap,
  :fullscreen #nova-scale-chip-wrap,
  :-webkit-full-screen #nova-scale-chip-wrap {
    display: none !important;
  }

  body.nova-tier-sweep #nova-scale-chip-wrap {
    opacity: 0.45;
  }

  /* (Duplicate #spatial-target-meta removed so Phase 0 wrap & AA contrast rules apply) */

  /* Pure Narration Script Text */
  #spatial-target-summary {
    font-size: 12.5px !important;
    line-height: 1.55 !important;
    color: rgba(248, 250, 252, 0.95) !important;
    margin-top: 6px !important;
    font-weight: 400 !important;
  }

  /* Subtle Fact-Cycle Indicator (only brightens on hover) */
  #spatial-deck-next-btn {
    color: #9aa3b2 !important;
    font-size: 9px !important;
  }
  #spatial-deck-next-btn:hover,
  #spatial-deck-next-btn span:last-child {
    color: #f59e0b !important;
  }

  /* Borderless Physical (Zoom-In) Feature Links */
  #spatial-surface-sites-bar:not(:empty) {
    margin-top: 8px !important;
    margin-bottom: 2px !important;
    gap: 8px !important;
  }
  #spatial-surface-sites-bar button {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 0 !important;
    color: rgba(226, 232, 240, 0.9) !important;
    font-size: 10px !important;
    letter-spacing: 0.06em !important;
    padding: 1px 0 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95) !important;
  }
  #spatial-surface-sites-bar button:hover {
    color: #f59e0b !important;
    border-bottom-color: #f59e0b !important;
  }

  /* Frameless Minimal Tour Micro-Bar */
  #spatial-tour-controls {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    padding: 0 0 6px 0 !important;
    margin-bottom: 8px !important;
  }
  #tour-step-badge {
    background: transparent !important;
    border: none !important;
    color: #f59e0b !important;
    padding: 0 !important;
  }
  #tour-progress-bar {
    background: #f59e0b !important;
  }
  #spatial-tour-controls button {
    background: transparent !important;
    border: none !important;
    color: rgba(226, 232, 240, 0.8) !important;
  }
  #spatial-tour-controls button:hover {
    color: #f59e0b !important;
  }

  /* === ULTRA-MINIMALIST OBSERVATORY TOOLTIPS === */
  [data-tip] {
    position: relative;
  }
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-2px);
    padding: 3px 7px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(226, 232, 240, 0.88);
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 60;
  }
  #bottom-hud [data-tip]::after {
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(2px);
  }
  [data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

/* === NOVA HUD Style Block 4 === */
body.nova-standby-hidden #nova-scale-chip-wrap {
    display: none !important;
  }

/* === PHASE 1 (R3): KEYBOARD FOCUS RINGS & SR-ONLY LIVE REGION === */
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #67e8f9 !important;
  outline-offset: 2px !important;
  border-radius: 3px;
}
.nova-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#nova-cmd-input:focus,
#nova-cmd-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* === SEAMLESS PRE-BOOT LOADER (NO BOXES, PILLS, OR COLORS) === */
#nova-preloader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}

html.is-preloading #nova-preloader {
  opacity: 1;
}

#nova-boot-center-container {
  transition: opacity 0.75s ease 0.15s;
}

html.is-preloading #nova-boot-center-container {
  opacity: 0 !important;
  pointer-events: none !important;
}

.nova-preloader-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.72);
  will-change: transform;
  animation: novaPreloaderSpin 0.9s linear infinite;
}

.nova-preloader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  color: rgba(255, 255, 255, 0.48);
  user-select: none;
}

@keyframes novaPreloaderSpin {
  to { transform: rotate(360deg); }
}

/* === MOBILE-ONLY HUD & ZEN MODE (ZERO DESKTOP IMPACT) === */
@media (pointer: coarse) and (max-width: 960px), (hover: none) and (max-width: 960px) {
  html:not(.is-booting).nova-hud-idle #bottom-hud {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body > #hud-center-gimbal {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    left: 10px !important;
    transform: scale(0.68) !important;
    transform-origin: bottom left !important;
  }
  #odometer-group {
    display: none !important;
  }

  #bottom-hud {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    padding: 4px 10px !important;
    gap: 8px !important;
    justify-content: safe center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: rgba(2, 6, 23, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 9999px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
  #bottom-hud::-webkit-scrollbar {
    display: none;
  }

  #bottom-hud div:has(> input[type="range"]):not(:has(#btn-cosmic-tour)),
  #bottom-hud input[type="range"],
  #bottom-hud #zoom-anchor-left,
  #bottom-hud #zoom-anchor-right {
    display: none !important;
  }

  #bottom-hud #hud-left-controls,
  #bottom-hud #hud-right-section,
  #bottom-hud #hud-toggle-group,
  #bottom-hud #hud-right-controls {
    margin: 0 !important;
    padding-left: 0 !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
  }
  #bottom-hud #hud-left-controls > * {
    margin-left: 0 !important;
  }
  #bottom-hud #hud-right-controls {
    padding-left: 10px !important;
    margin-left: 2px !important;
  }

  #btn-cosmic-tour,
  #hud-toggle-group button,
  #hud-right-controls button {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 6px !important;
    font-size: 10.5px !important;
    letter-spacing: 0.08em !important;
  }
  #btn-cosmic-tour {
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.14) !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
    border-radius: 9999px !important;
    padding: 4px 11px !important;
  }

  /* Compact, scrollable Map Key drawer sized for portrait & landscape phones */
  #map-key-drawer {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    right: 8px !important;
    width: 176px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 116px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px !important;
  }
  #map-key-drawer > div:last-child {
    font-size: 8.5px !important;
    line-height: 1.25 !important;
    letter-spacing: 0.05em !important;
  }
  #map-key-drawer > div:last-child > * + * {
    margin-top: 3px !important;
  }
  #map-key-drawer .nova-kbd {
    font-size: 8px !important;
    padding: 0 4px !important;
    min-width: 16px !important;
    line-height: 1.3 !important;
  }
  #map-key-summon-btn {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Mobile Zen Mode (activated by FULL or TOUR start on mobile) */
html.nova-mobile-zen header,
html.nova-mobile-zen #header-nova-pill,
html.nova-mobile-zen #nova-ephemeris-hud,
html.nova-mobile-zen body > #hud-center-gimbal,
html.nova-mobile-zen #odometer-group,
html.nova-mobile-zen #map-key-summon-btn,
html.nova-mobile-zen #map-key-drawer,
html.nova-mobile-zen #screensaver-hud-badge {
  opacity: 0 !important;
  pointer-events: none !important;
}
html.nova-mobile-zen #bottom-hud {
  opacity: 0.78 !important;
}
html.nova-mobile-zen #btn-fullscreen-zen::before {
  content: "EXIT";
}

/* === NOVA HAND-TRACKING CONTROL (DESKTOP ONLY) === */
#nova-hand-pip {
  position: fixed;
  top: 64px;
  right: 24px;
  z-index: 35;
  width: 176px;
  padding: 6px 8px 4px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms ease, border-color 180ms ease;
}
#nova-hand-pip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
#nova-hand-pip[data-state="active"] {
  border-color: rgba(251, 191, 36, 0.55);
}
#nova-hand-pip .hand-pip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #cbd5e1;
  margin-bottom: 4px;
}
#nova-hand-pip .hand-pip-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #94a3b8;
}
#nova-hand-pip[data-state="active"] .hand-pip-dot {
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.85);
}
#nova-hand-pip[data-state="brake"] .hand-pip-dot {
  background: #f8fafc;
}
#nova-hand-canvas {
  display: block;
  width: 160px;
  height: 100px;
}

@media (pointer: coarse) and (max-width: 960px), (hover: none) and (max-width: 960px) {
  #btn-hand-control,
  #nova-hand-pip {
    display: none !important;
  }
}

/* === NOVA HAND TARGETING RETICLE (PHASE 2) === */
#nova-hand-reticle {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  margin-left: -22px;
  margin-top: -22px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}
#nova-hand-reticle.is-visible {
  opacity: 1;
}
#nova-hand-reticle svg {
  display: block;
  transform: rotate(-90deg);
}
#nova-hand-reticle .reticle-track {
  fill: none;
  stroke: rgba(248, 250, 252, 0.28);
  stroke-width: 1.25;
}
#nova-hand-reticle .reticle-progress {
  fill: none;
  stroke: #fbbf24;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
}
#nova-hand-reticle .reticle-dot {
  fill: #f8fafc;
}
#nova-hand-reticle.is-snapped .reticle-track {
  stroke: rgba(251, 191, 36, 0.45);
}
#nova-hand-reticle.is-snapped .reticle-dot {
  fill: #fbbf24;
}
#nova-hand-reticle.is-locked .reticle-progress {
  stroke: #f8fafc;
}
#nova-hand-reticle .reticle-label {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #fbbf24;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

@media (pointer: coarse) and (max-width: 960px), (hover: none) and (max-width: 960px) {
  #nova-hand-reticle {
    display: none !important;
  }
}

#nova-hand-pip .hand-pip-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  color: #94a3b8;
  opacity: 0.85;
  transition: opacity 220ms ease;
}
#nova-hand-pip[data-state="active"] .hand-pip-legend {
  opacity: 0.35;
}
#nova-hand-pip .hand-pip-legend > div {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
#nova-hand-pip .hand-pip-legend > div span:first-child {
  color: #e2e8f0;
}

/* === SPATIAL TOP-LEFT MODE BUTTON & CALLOUT SUPPRESSION (v9) === */
#btn-hand-control.nova-spatial-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 2px 6px;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9aa3b2;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}
#btn-hand-control.nova-spatial-mode-btn:hover {
  color: rgba(248, 250, 252, 0.96);
}
#btn-hand-control.nova-spatial-mode-btn[data-nova-active="true"] {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}
#btn-hand-control .spatial-new-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.85);
  animation: spatialDotPulse 2.2s ease-in-out infinite;
}
@keyframes spatialDotPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Deactivate INFO callout cards & inspector while SPATIAL mode is active */
html.nova-spatial-active #inspector,
html.nova-spatial-active #spatial-target-callout,
html.nova-spatial-active [id*="target-callout"],
html.nova-spatial-active #screensaver-hud-badge {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Keep NOVA | SCALE | SPATIAL visible in desktop Fullscreen (still hidden in Standby/Boot/Mobile Zen) */
html:not(.screensaver-active):not(.is-booting):not(.nova-mobile-zen):fullscreen header.hidden,
html:not(.screensaver-active):not(.is-booting):not(.nova-mobile-zen):-webkit-full-screen header.hidden {
  display: flex !important;
}

/* === MAP KEY / VOLUME ICON SEPARATION === */
#map-key-drawer,
#map-key-summon-btn {
  bottom: 68px !important;
}

/* === HIDE TOP BAR HUD & VOLUME BUTTON IN GUIDED TOUR & STANDBY === */
html.nova-tour-active header,
html.screensaver-active header,
html.nova-tour-active #btn-nova-audio,
html.screensaver-active #btn-nova-audio {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* === HIDE TOP-RIGHT TIME BAR IN GUIDED TOUR & STANDBY === */
html.nova-tour-active #nova-ephemeris-hud,
html.screensaver-active #nova-ephemeris-hud,
html.nova-tour-active #nova-ephemeris-slider,
html.screensaver-active #nova-ephemeris-slider {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* === HIDE EXACT INFO CALLOUT CARD IN SPATIAL MODE (v18) === */
html.nova-spatial-active #spatial-callout,
html.nova-spatial-active div:has(#spatial-target-meta).fixed,
html.nova-spatial-active aside:has(#spatial-target-meta) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* === HIDE SPATIAL TELEMETRY CALLOUT LAYER IN SPATIAL MODE === */
html.nova-spatial-active #spatial-telemetry-layer,
html.nova-spatial-active #spatial-callout-card {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
