/* ============================================
   SATORBITAL - Consolidated Stylesheet
   ============================================ */

/* --- CSS CUSTOM PROPERTIES --- */
:root {
    --color-primary: #00ff41;
    --color-primary-rgb: 0, 255, 65;
    --color-primary-dim: rgba(var(--color-primary-rgb), 0.3);
    --color-primary-faint: rgba(var(--color-primary-rgb), 0.1);
    --color-primary-hover: rgba(var(--color-primary-rgb), 0.2);
    --color-primary-active: rgba(var(--color-primary-rgb), 0.35);
    --color-primary-dark: #002b00;
    --color-secondary: #00ffc8;
    --color-secondary-rgb: 0, 255, 200;
    --color-text: #c3ffc3;
    --color-bg: #000;
    --color-bg-panel: rgba(0, 20, 0, 0.75);
    --color-bg-panel-dark: rgba(0, 20, 0, 0.85);
    --color-bg-input: rgba(0, 15, 0, 0.8);
    --color-border-panel: rgba(var(--color-primary-rgb), 0.4);
    --color-error: #ff4141;
    --color-error-dim: rgba(255, 65, 65, 0.2);
    --color-danger: #ff4141;
    --color-warning: #ffa500;
    --color-accent: var(--color-secondary);
    --color-text-dim: rgba(var(--color-primary-rgb), 0.6);
    --font-main: var(--font-mono, 'VT323', monospace);
    --font-display: var(--font-mono, 'VT323', monospace);
    --color-accent-cyan: var(--color-secondary);
    --color-accent-cyan-dim: rgba(var(--color-secondary-rgb), 0.5);
    --color-accent-gold: #ffc800;
    --color-accent-gold-dim: rgba(255, 200, 0, 0.3);
    --color-settings: var(--color-primary);
    --color-settings-dim: rgba(var(--color-primary-rgb), 0.5);
    --color-sunlit: #ffdd44;
    --panel-blur: 12px;
    --panel-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --touch-target-min: 44px;
    --font-mono: 'VT323', monospace;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; }

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--color-bg);
    color: var(--color-primary);
    font-family: var(--font-mono);
    cursor: crosshair;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: normal;
    text-shadow: 0 0 5px var(--color-primary);
}

/* Panel title: the same orbit mark as the landing header, and a way home */
.app-brand { margin-bottom: 8px; }
.app-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.app-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    color: var(--color-primary);
    filter: drop-shadow(0 0 6px rgba(var(--color-primary-rgb), 0.45));
}
.app-logo-sat { animation: app-logo-blink 3.2s ease-in-out infinite; transform-origin: 32px 32px; }
@keyframes app-logo-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}
.app-brand-link:hover .app-logo { filter: drop-shadow(0 0 12px rgba(var(--color-primary-rgb), 0.8)); }
.app-brand-link:hover span { text-shadow: 0 0 12px var(--color-primary); }

p {
    font-size: 18px;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 20px;
}

button {
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* --- SCROLLBARS --- */
::-webkit-scrollbar { width: 8px; background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 0; box-shadow: 0 0 6px var(--color-primary-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); box-shadow: 0 0 10px var(--color-accent-cyan-dim); }
* { scrollbar-width: thin; scrollbar-color: var(--color-primary) var(--color-bg); }

/* --- MAIN CANVAS --- */
#globe-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

/* --- CRT EFFECTS --- */
.crt-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 997;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.35) 100%);
}

.scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(to bottom, transparent, transparent 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 998;
    opacity: 0.6;
}

/* --- Z-INDEX LAYERS --- */
#ui-panel, #satellite-info-panel, #stats-panel, #hover-container { z-index: 50; }

/* ================================================================
   HELP CENTER — first-visit prompt, guided tour, "?" panel
   Same glass language as the Launch Director / Orbit Sandbox.
   ================================================================ */
.tour-root,
.help-prompt,
.help-dialog {
    position: fixed;
    inset: 0;
    z-index: 1400;
    font-family: 'Chakra Petch', var(--font-main), sans-serif;
    color: var(--color-text);
    animation: help-fade-in 0.22s ease-out both;
}
.tour-root.is-leaving,
.help-prompt.is-leaving,
.help-dialog.is-leaving { animation: help-fade-out 0.2s ease-in both; }

@keyframes help-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes help-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Transparent click-catcher: the spotlight's shadow does the dimming */
.tour-blocker { position: absolute; inset: 0; }
.tour-root--centered .tour-blocker { background: rgba(0, 0, 0, 0.55); }

.tour-spotlight {
    position: fixed;
    border-radius: 10px;
    box-shadow:
        0 0 0 1px var(--color-primary),
        0 0 22px rgba(var(--color-primary-rgb), 0.45),
        0 0 0 200vmax rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: left 0.42s cubic-bezier(0.22, 1, 0.36, 1), top 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.42s cubic-bezier(0.22, 1, 0.36, 1), height 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-spotlight::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 14px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    animation: tour-ping 1.8s ease-out infinite;
}
@keyframes tour-ping {
    from { opacity: 0.9; transform: scale(1); }
    to   { opacity: 0; transform: scale(1.08); }
}
.tour-root--centered .tour-spotlight { display: none; }

.tour-card,
.help-prompt-card,
.help-card {
    position: fixed;
    width: min(360px, calc(100vw - 24px));
    padding: 18px 20px 16px;
    border-radius: 14px;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(var(--color-primary-rgb), 0.09), transparent 55%),
        rgba(2, 8, 5, 0.9);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    box-shadow:
        inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 24px 60px -20px rgba(0, 0, 0, 0.9);
}
.tour-card {
    transition: left 0.42s cubic-bezier(0.22, 1, 0.36, 1), top 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-card.is-entering .tour-title,
.tour-card.is-entering .tour-text {
    animation: tour-copy-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tour-card.is-entering .tour-text { animation-delay: 0.05s; }
@keyframes tour-copy-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tour-card-head,
.tour-card-foot,
.help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tour-counter {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-text-dim);
}

.tour-title {
    margin: 10px 0 6px;
    font-weight: 600;
    font-size: 19px;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: var(--color-primary);
    text-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.35);
}

.tour-text {
    margin: 0 0 16px;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
}

.tour-skip {
    padding: 4px 0;
    background: none;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-dim);
    cursor: pointer;
}
.tour-skip:hover { color: var(--color-primary); }

.tour-progress {
    flex: 1;
    max-width: 120px;
    height: 3px;
    border-radius: 2px;
    background: rgba(var(--color-primary-rgb), 0.18);
    overflow: hidden;
}
.tour-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--color-primary);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.6);
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-keys {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-items: baseline;
    margin: -6px 0 16px;
}
.tour-keys[hidden] { display: none; }
.tour-keys dt { margin: 0; }
.tour-keys dd { margin: 0; font-size: 13px; line-height: 1.45; color: var(--color-text); }
.tour-keys kbd {
    display: inline-block;
    min-width: 26px;
    padding: 3px 7px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.4), 0 2px 0 rgba(var(--color-primary-rgb), 0.25);
}

.tour-actions { display: flex; gap: 8px; }
.tour-actions--prompt { justify-content: flex-end; margin-bottom: 14px; }

.tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    border: none;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.tour-btn:active:not(:disabled) { transform: scale(0.97); }
.tour-btn:disabled { opacity: 0.3; cursor: default; }
.tour-btn--primary {
    background: var(--color-primary);
    color: #000;
    box-shadow: 0 0 18px rgba(var(--color-primary-rgb), 0.35);
}
.tour-btn--primary:hover { box-shadow: 0 0 26px rgba(var(--color-primary-rgb), 0.6); }
.tour-btn--ghost {
    background: transparent;
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.35);
}
.tour-btn--ghost:hover:not(:disabled) { background: rgba(var(--color-primary-rgb), 0.1); }

/* --- First-visit prompt --- */
.help-prompt-scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(80% 70% at 50% 50%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.7));
}
.help-prompt-card,
.help-card {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: help-card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes help-card-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(0.98); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Tiny orbit glyph: a satellite circling a planet */
.help-prompt-orbit {
    position: relative;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
}
.help-prompt-orbit span {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(var(--color-primary-rgb), 0.9), rgba(var(--color-primary-rgb), 0.15) 70%);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.5);
}
.help-prompt-orbit i {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    animation: help-orbit 3.2s linear infinite;
}
.help-prompt-orbit i::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}
@keyframes help-orbit { to { transform: rotate(360deg); } }

.help-prompt-never {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--color-text-dim);
    cursor: pointer;
}
.help-prompt-never input {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    border-radius: 3px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.help-prompt-never input:checked { background: var(--color-primary); }
.help-prompt-never input:checked::after {
    content: '';
    width: 3px;
    height: 7px;
    margin-top: -2px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* --- "?" panel --- */
/* Icon-only button: the flex row would otherwise squash the glyph sideways */
.quick-audio-btn svg { flex: 0 0 auto; }
.quick-help-btn { width: 28px; padding: 0; }
.quick-help-btn svg { width: 14px; height: 14px; display: block; }

.help-card { width: min(430px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 32px)); overflow-y: auto; }

.help-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-text-dim);
    cursor: pointer;
}
.help-close:hover { color: var(--color-primary); background: rgba(var(--color-primary-rgb), 0.16); }

.help-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin: 12px 0 16px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.15);
}
.help-tab {
    padding: 8px 0 7px;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-dim);
    cursor: pointer;
}
.help-tab.is-active {
    background: rgba(var(--color-primary-rgb), 0.14);
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.4);
}

.help-pane { display: flex; flex-direction: column; gap: 14px; }
.help-pane[hidden] { display: none; }
.help-lead, .help-note { margin: 0; font-size: 13.5px; line-height: 1.6; }
.help-note {
    padding: 10px 12px;
    border-left: 2px solid var(--color-warning, #ffa500);
    background: rgba(255, 165, 0, 0.06);
    color: var(--color-text);
}

.help-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: help-step;
    display: grid;
    gap: 6px;
}
.help-steps li {
    counter-increment: help-step;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text);
}
.help-steps li::before {
    content: counter(help-step, decimal-leading-zero);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--color-text-dim);
}
.help-start { align-self: flex-start; }
.help-mail { align-self: stretch; text-transform: none; letter-spacing: 0.5px; }

.help-faq-list { display: grid; gap: 6px; }
.help-faq {
    border-radius: 8px;
    background: rgba(var(--color-primary-rgb), 0.04);
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.12);
}
.help-faq summary {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    cursor: pointer;
    list-style: none;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after { content: '+'; float: right; color: var(--color-text-dim); }
.help-faq[open] summary::after { content: '−'; }
.help-faq p { margin: 0; padding: 0 12px 12px; font-size: 12.5px; line-height: 1.6; color: var(--color-text); }

.help-diag-head {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-dim);
}
.help-copy-status { color: var(--color-primary); letter-spacing: 1px; }
.help-diag {
    margin: 0;
    max-height: 120px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    line-height: 1.6;
    color: var(--color-text-dim);
    white-space: pre-wrap;
    word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
    .tour-spotlight, .tour-card { transition: none; }
    .tour-spotlight::after, .help-prompt-orbit i { animation: none; }
}

/* --- LEFT PANEL (Controls) --- */
#ui-panel {
    position: absolute;
    top: 25px;
    left: 25px;
    background: linear-gradient(160deg, rgba(0, 24, 0, 0.84), rgba(0, 12, 0, 0.82));
    padding: 18px;
    width: 450px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 0 22px var(--color-primary-dim), inset 0 0 1px rgba(var(--color-primary-rgb), 0.22);
    background-image: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    transition: transform var(--panel-transition), opacity 0.4s ease;
}

#ui-panel.hidden {
    transform: translateX(calc(-100% - 30px));
    opacity: 0;
    pointer-events: none;
}

/* --- TOGGLE PANEL BUTTON --- */
#toggle-ui-panel-btn {
    position: fixed;
    top: 90px;
    left: 475px;
    z-index: 100;
    background: linear-gradient(90deg, rgba(0, 24, 8, 0.95), rgba(0, 12, 4, 0.95));
    border: 1px solid rgba(var(--color-primary-rgb), 0.55);
    border-left: none;
    color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    line-height: 1;
    width: 22px;
    height: 56px;
    padding: 0;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        2px 0 8px rgba(0, 0, 0, 0.4),
        inset 1px 0 0 rgba(var(--color-primary-rgb), 0.25);
    text-shadow: 0 0 5px rgba(var(--color-primary-rgb), 0.5);
    transition: left var(--panel-transition), background 0.2s ease, color 0.2s ease, opacity 0.4s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    line-height: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0 8px 8px 0; /* Add slight rounding on the right */
}

#toggle-ui-panel-btn:hover {
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.22), rgba(var(--color-primary-rgb), 0.05));
    color: var(--color-primary);
    box-shadow: 2px 0 12px rgba(var(--color-primary-rgb), 0.35), inset 1px 0 0 rgba(var(--color-primary-rgb), 0.4);
    text-shadow: 0 0 8px var(--color-primary);
    width: 26px;
}

#toggle-ui-panel-btn.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-12px);
}
#toggle-ui-panel-btn.panel-hidden { left: 0; border-radius: 0 6px 6px 0; }
#toggle-ui-panel-btn svg { transition: transform 0.3s ease; }
#toggle-ui-panel-btn.panel-hidden svg { transform: rotate(180deg); }

.gui-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(10px) !important;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out !important;
}

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

    .scanlines,
    .crt-overlay {
        opacity: 0.2;
    }
}

/* --- SEARCH --- */
#search-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    position: relative;
    z-index: 60;
}

#search-container { flex-grow: 1; }

#search-box {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    background-color: var(--color-bg-input);
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 18px;
    text-transform: uppercase;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 5px rgba(var(--color-primary-rgb), 0.1);
    transition: all 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
    backdrop-filter: blur(4px);
}

#search-box:focus {
    border-color: var(--color-primary);
    background-color: rgba(var(--color-primary-rgb), 0.05);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(var(--color-primary-rgb), 0.4);
    text-shadow: 0 0 5px rgba(var(--color-primary-rgb), 0.3);
}

#search-box::placeholder { color: var(--color-text-dim); }
#search-box:focus { box-shadow: 0 0 15px var(--color-accent-cyan-dim); }

#search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: var(--color-bg-panel-dark);
    border: 1px solid var(--color-primary);
    border-top: none;
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.15);
    z-index: 60;
}

.search-result-item {
    padding: 8px;
    color: #c3ffc3;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background-color: rgba(var(--color-primary-rgb), 0.15); color: var(--color-primary); }
.search-result-item.selected {
    background-color: rgba(var(--color-primary-rgb), 0.25);
    color: var(--color-primary);
    border-left: 2px solid var(--color-primary);
}

#search-results::-webkit-scrollbar { width: 8px; }
#search-results::-webkit-scrollbar-track { background: var(--color-bg-input); }
#search-results::-webkit-scrollbar-thumb { background: var(--color-primary); }

/* --- Hide UI during loading --- */
.loading-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease-out !important;
}

/* --- Hide GUI until first interaction --- */
.gui-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out !important;
}

/* --- Hide GUI during idle screensaver --- */
.gui-idle-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 1.2s ease-out !important;
}


/* --- INITIALIZE BUTTON --- */
#initialize-btn {
    position: relative;
    margin-top: 40px;
    padding: 16px 50px;
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: var(--color-primary);
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.15), rgba(var(--color-primary-rgb), 0.08));
    border: 2px solid var(--color-primary);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    display: inline-block;
    clip-path: polygon(
        12px 0%, calc(100% - 12px) 0%,
        100% 12px, 100% calc(100% - 12px),
        calc(100% - 12px) 100%, 12px 100%,
        0% calc(100% - 12px), 0% 12px
    );
    box-shadow:
        0 0 20px rgba(var(--color-primary-rgb), 0.4),
        inset 0 0 20px rgba(var(--color-primary-rgb), 0.1);
    animation: btn-pulse 2s ease-in-out infinite;
}

#initialize-btn.hidden {
    display: none;
}

#initialize-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#initialize-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(var(--color-primary-rgb), 0.3),
        transparent
    );
    animation: btn-shine 3s ease-in-out infinite;
}

#initialize-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        var(--color-primary),
        var(--color-secondary),
        var(--color-primary),
        var(--color-secondary)
    );
    background-size: 400% 400%;
    z-index: -1;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s;
    animation: gradient-shift 3s ease infinite;
}

#initialize-btn:hover::after {
    opacity: 0.8;
}

.btn-text {
    position: relative;
    z-index: 2;
    display: block;
    text-shadow:
        0 0 10px rgba(var(--color-primary-rgb), 0.8),
        0 0 20px rgba(var(--color-primary-rgb), 0.5),
        0 0 30px rgba(var(--color-primary-rgb), 0.3);
}

.btn-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(var(--color-primary-rgb), 0.8),
        transparent
    );
    animation: scanline-move 2s linear infinite;
}

.btn-glow {
    position: absolute;
    inset: -4px;
    background: radial-gradient(circle at 50% 50%,
        rgba(var(--color-primary-rgb), 0.2),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

#initialize-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 40px rgba(var(--color-primary-rgb), 0.8),
        inset 0 0 30px rgba(var(--color-primary-rgb), 0.2);
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

#initialize-btn:hover .btn-glow {
    opacity: 1;
}

#initialize-btn:active {
    transform: scale(0.98);
    box-shadow:
        0 0 20px rgba(var(--color-primary-rgb), 0.6),
        inset 0 0 40px rgba(var(--color-primary-rgb), 0.3);
}

@keyframes btn-pulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(var(--color-primary-rgb), 0.4),
            inset 0 0 20px rgba(var(--color-primary-rgb), 0.1);
    }
    50% {
        box-shadow:
            0 0 40px rgba(var(--color-primary-rgb), 0.6),
            inset 0 0 30px rgba(var(--color-primary-rgb), 0.2);
    }
}

@keyframes btn-shine {
    0% { left: -100%; }
    20%, 100% { left: 100%; }
}

@keyframes scanline-move {
    0% { top: 0%; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- LOADING (legacy bar in panel) --- */
#loading-container {
    display: none;
}

#loading-status {
    display: none;
}

/* --- CONTROLS CONTAINER --- */
#controls-container {
    margin-top: 16px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.4);
    padding-top: 12px;
}

/* --- CONTROL GROUPS --- */
.control-group {
    margin-top: 12px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    background: rgba(var(--color-primary-rgb), 0.04);
    padding: 10px 10px 8px;
}

.control-group p {
    margin: 0 0 8px 0;
    font-size: 17px;
    letter-spacing: 1px;
}

/* --- COORDINATE SYSTEM BUTTONS --- */
#system-controls { display: flex; justify-content: space-between; }

.system-btn {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.08), transparent);
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 16px;
    min-height: 34px;
    padding: 6px;
    cursor: pointer;
    flex-grow: 1;
    margin: 0 5px;
    transition: all 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    text-shadow: 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.system-btn:first-child { margin-left: 0; }
.system-btn:last-child { margin-right: 0; }

.system-btn:hover {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.2), rgba(var(--color-primary-rgb), 0.05));
    border-color: var(--color-primary);
    box-shadow: 0 4px 8px rgba(var(--color-primary-rgb), 0.1), inset 0 0 8px rgba(var(--color-primary-rgb), 0.15);
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.5);
    transform: translateY(-1px);
}

.system-btn.active {
    background: var(--color-primary);
    color: var(--color-bg-panel-dark);
    text-shadow: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 12px var(--color-primary-dim);
    border-color: var(--color-primary);
    transform: translateY(0);
}

/* --- ALTITUDE SLIDERS --- */
.slider-wrapper { margin-bottom: 5px; font-size: 16px; }
.slider-wrapper label { color: #c3ffc3; }
.slider-wrapper span { color: var(--color-primary); font-weight: bold; }

#ui-description {
    margin: 0;
    font-size: 17px;
    color: var(--color-text-dim);
    letter-spacing: 0.5px;
}

input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; cursor: pointer; background: rgba(var(--color-primary-rgb), 0.2); border: 1px solid var(--color-primary); }
input[type=range]::-webkit-slider-thumb { border: 1px solid #000; height: 16px; width: 8px; background: var(--color-primary); cursor: pointer; -webkit-appearance: none; margin-top: -6px; transition: box-shadow 0.2s; }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.6); }
input[type=range]::-moz-range-track { height: 6px; background: rgba(var(--color-primary-rgb), 0.2); border: 1px solid var(--color-primary); }
input[type=range]::-moz-range-thumb { border: 1px solid #000; height: 16px; width: 8px; background: var(--color-primary); cursor: pointer; border-radius: 0; }

/* --- TIME CONTROLS --- */
#time-controls { display: flex; justify-content: space-between; }

.time-btn {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.08), transparent);
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    min-height: 34px;
    padding: 6px;
    cursor: pointer;
    flex-grow: 1;
    margin: 0 2px;
    transition: all 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.time-btn.active {
    background: var(--color-primary);
    color: var(--color-bg-panel-dark);
    text-shadow: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 12px var(--color-primary-dim);
    border-color: var(--color-primary);
    transform: translateY(0);
}

.time-speed-control {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.time-btn:hover {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.2), rgba(var(--color-primary-rgb), 0.05));
    border-color: var(--color-primary);
    box-shadow: 0 4px 8px rgba(var(--color-primary-rgb), 0.1), inset 0 0 8px rgba(var(--color-primary-rgb), 0.15);
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.5);
    transform: translateY(-1px);
}
.time-btn.active { background: var(--color-primary); color: #002b00; text-shadow: none; }
#time-live-btn { border-color: rgba(255, 65, 65, 0.5); color: #ff4141; background: linear-gradient(180deg, rgba(255, 65, 65, 0.08), transparent); }
#time-live-btn:hover { background: linear-gradient(180deg, rgba(255, 65, 65, 0.25), rgba(255, 65, 65, 0.08)); border-color: #ff4141; box-shadow: 0 4px 8px rgba(255, 65, 65, 0.15), inset 0 0 8px rgba(255, 65, 65, 0.2); text-shadow: 0 0 6px rgba(255, 65, 65, 0.6); }

/* --- CHECKBOXES --- */
.checkbox-wrapper { margin-bottom: 10px; display: flex; align-items: center; }
.checkbox-wrapper label { font-size: 17px; cursor: pointer; }
.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px; height: 15px;
    border: 2px solid var(--color-primary);
    margin-right: 10px;
    cursor: pointer;
    position: relative;
}

.checkbox-wrapper {
    padding: 6px 8px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.15);
    background: rgba(var(--color-primary-rgb), 0.03);
}
.checkbox-wrapper input[type="checkbox"]:checked {
    background-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.5), inset 0 0 4px rgba(var(--color-primary-rgb), 0.3);
}

/* --- CONSTELLATION FILTER --- */
#constellation-toggle-btn {
    width: 100%;
    padding: 8px;
    background-color: var(--color-primary-dark);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

#constellation-toggle-btn:hover {
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.3);
}

#constellation-toggle-btn.active {
    background-color: rgba(var(--color-primary-rgb), 0.15);
    box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.5), inset 0 0 4px rgba(var(--color-primary-rgb), 0.3);
}

.constellation-menu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin 0.3s ease-out, padding 0.3s ease-out;
    margin-top: 0;
    max-height: 0;
    padding: 0 10px;
}

.constellation-menu.active {
    max-height: 300px;
    margin-top: 8px;
    padding: 10px;
}

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

.constellation-btn {
    padding: 6px 8px;
    background-color: var(--color-primary-dark);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 12px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s ease;
    border-radius: 2px;
}

.constellation-btn:hover {
    background-color: rgba(var(--color-primary-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.3);
}

.constellation-btn.active {
    background-color: rgba(var(--color-primary-rgb), 0.15);
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.5), inset 0 0 2px rgba(var(--color-primary-rgb), 0.4);
    border-color: var(--color-primary);
}

/* --- SHARED BUTTON STYLE (action buttons) --- */
.panel-btn,
#export-csv-btn,
#load-full-catalog-btn,
#reset-view-btn,
#toggle-orbit-btn,
#expand-info-btn,
#first-person-btn,
#isolate-btn,
#show-orbit-btn {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.08), rgba(var(--color-primary-rgb), 0.02));
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 17px;
    padding: 9px 10px;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-shadow: 0 0 4px rgba(var(--color-primary-rgb), 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), border-box;
}

.panel-btn:hover,
#export-csv-btn:hover,
#load-full-catalog-btn:hover,
#reset-view-btn:hover,
#toggle-orbit-btn:hover,
#expand-info-btn:hover,
#first-person-btn:hover,
#isolate-btn:hover,
#show-orbit-btn:hover {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.2), rgba(var(--color-primary-rgb), 0.08));
    border-color: var(--color-primary);
    text-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.7);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.15), inset 0 0 10px rgba(var(--color-primary-rgb), 0.2);
    transform: translateY(-1px);
}

.panel-btn:active,
#export-csv-btn:active,
#load-full-catalog-btn:active,
#reset-view-btn:active,
#toggle-orbit-btn:active,
#expand-info-btn:active,
#first-person-btn:active,
#isolate-btn:active,
#show-orbit-btn:active {
    background: rgba(var(--color-primary-rgb), 0.15);
    box-shadow: inset 0 2px 8px rgba(var(--color-primary-rgb), 0.4);
    transform: translateY(1px);
    border-color: rgba(var(--color-primary-rgb), 0.4);
}

.system-btn:active, .time-btn:active {
    background: rgba(var(--color-primary-rgb), 0.15);
    box-shadow: inset 0 2px 8px rgba(var(--color-primary-rgb), 0.4);
    transform: translateY(1px);
}

#expand-info-btn { margin: 15px 0; }
#toggle-orbit-btn { margin-top: 0; }

#toggle-trails-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-primary-rgb), 0.02));
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    color: var(--color-text-dim);
    font-family: 'VT323', monospace;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
    letter-spacing: 1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#toggle-trails-btn .trail-icon {
    font-size: 18px;
    transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1), text-shadow 0.3s ease;
}

#toggle-trails-btn:hover {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.25), rgba(var(--color-primary-rgb), 0.08));
    border-color: rgba(var(--color-primary-rgb), 0.8);
    color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.15), inset 0 0 10px rgba(var(--color-primary-rgb), 0.15);
    transform: translateY(-1px);
}

#toggle-trails-btn:hover .trail-icon {
    text-shadow: 0 0 8px var(--color-primary);
}

#toggle-trails-btn.active {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.15), rgba(var(--color-primary-rgb), 0.12));
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.3), inset 0 0 12px rgba(var(--color-primary-rgb), 0.2);
    transform: translateY(0);
}

#toggle-trails-btn.active .trail-icon {
    text-shadow: 0 0 12px var(--color-primary);
    animation: trailPulse 2s ease-in-out infinite;
}

@keyframes trailPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

/* --- BUTTON GROUP --- */
.button-group {
    margin-top: 20px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.4);
    padding-top: 15px;
}

/* --- ORBIT FRAME CONTROLS --- */
#orbit-frame-controls { display: flex; }

.orbit-frame-btn {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 2px 10px;
    cursor: pointer;
    margin-left: 5px;
    transition: background-color 0.2s, color 0.2s;
}

.orbit-frame-btn:hover { background-color: rgba(var(--color-primary-rgb), 0.2); }
.orbit-frame-btn.active { background-color: var(--color-primary); color: #002b00; text-shadow: none; }

/* --- GRAPH TIME SCALE CONTROLS --- */
.graph-time-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.4);
    padding-top: 10px;
}

.time-scale-btn {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    padding: 5px 10px;
    flex-grow: 1;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.time-scale-btn:first-child { margin-left: 0; }
.time-scale-btn:last-child { margin-right: 0; }
.time-scale-btn:hover { background-color: rgba(var(--color-primary-rgb), 0.2); }
.time-scale-btn.active { background-color: var(--color-primary); color: #002b00; text-shadow: none; }

/* --- RIGHT PANEL (Satellite Info) --- */
#satellite-info-panel {
    position: absolute;
    top: 84px;
    right: 25px;
    width: 350px;
    max-height: calc(100vh - 225px);
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(0, 22, 0, 0.9), rgba(0, 12, 0, 0.85));
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 0 20px var(--color-primary-dim), inset 0 0 1px rgba(var(--color-primary-rgb), 0.22);
    color: var(--color-text);
    padding: 15px;
    z-index: 50;
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#satellite-info-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 30px));
}

#info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.4);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

#info-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--color-primary);
    text-transform: uppercase;
    text-shadow: 0 0 5px var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#close-info-panel {
    background: none;
    border: 1px solid #ff4141;
    color: #ff4141;
    font-family: 'VT323', monospace;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 8px;
    flex-shrink: 0;
}

#close-info-panel:hover { background-color: rgba(255, 65, 65, 0.2); }

.info-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 18px; }
.info-label { color: var(--color-primary); }
.info-value { color: #c3ffc3; }

/* --- EXPANDED INFO --- */
#expanded-info {
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.4);
    padding-top: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#expanded-info.hidden { max-height: 0; border-top: none; padding-top: 0; margin-bottom: 0; }
#expanded-info:not(.hidden) { max-height: 200px; }

/* --- ADVANCED FILTERS --- */
#advanced-filters {
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin 0.3s ease-out;
    margin-top: 5px;
}
#advanced-filters.hidden { max-height: 0; margin-top: 0; }
#advanced-filters:not(.hidden) { max-height: 500px; }

.expand-btn {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--color-primary);
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.1), transparent);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    border-left: 3px solid var(--color-primary);
    padding: 8px 10px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.expand-btn:hover {
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.25), rgba(var(--color-primary-rgb), 0.05));
    border-color: rgba(var(--color-primary-rgb), 0.6);
    border-left: 4px solid var(--color-primary);
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.5);
    padding-left: 14px;
}

.reset-btn {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #ff4141;
    background: rgba(255, 65, 65, 0.05);
    border: 1px solid rgba(255, 65, 65, 0.3);
    padding: 4px 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s;
}
.reset-btn:hover { background: rgba(255, 65, 65, 0.15); }

input[type=range]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- ORBIT CLASS BADGE --- */
.orbit-class-badge {
    padding: 1px 6px;
    border: 1px solid currentColor;
    font-size: 16px;
    letter-spacing: 1px;
}

/* --- FIRST PERSON ACTIVE STATE --- */
#first-person-btn.active-fp {
    background-color: var(--color-primary);
    color: #002b00;
    text-shadow: none;
}

#isolate-btn.active-isolate {
    background-color: #ff4141;
    border-color: #ff4141;
    color: #1a0000;
    text-shadow: none;
}

/* --- OBSERVER INFO --- */
#observer-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(var(--color-secondary-rgb), 0.3);
}

.observer-row .info-label { color: var(--color-secondary); }
.observer-row .info-value { color: var(--color-secondary); }

#sat-visibility.visible { color: var(--color-primary); }
#sat-visibility.below-horizon { color: #ff4141; }

/* ================================================================
   LOCATION INDICATOR — ESTACIÓN LOCAL (bottom-left)
   ================================================================
   A small ground station: your coordinates, the local time at your
   longitude and whether the Sun is up over your head, plus the two
   camera actions. Same phosphor language as the rest of the console.
   ================================================================ */
#location-indicator {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    right: auto !important;
    top: auto !important;
    z-index: 40 !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--color-primary);
    background: linear-gradient(180deg, rgba(0, 18, 14, 0.82), rgba(0, 8, 6, 0.82));
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: 2px;
    box-shadow:
        inset 0 0 22px rgba(var(--color-primary-rgb), 0.05),
        0 6px 18px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
/* header tab floating over the top edge */
#location-indicator::before {
    content: "ESTACIÓN LOCAL";
    position: absolute;
    top: -7px;
    left: 10px;
    padding: 0 6px;
    background: #050a08;
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--color-text-dim);
    pointer-events: none;
}
/* corner bracket, bottom right */
#location-indicator::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-right: 1px solid rgba(var(--color-primary-rgb), 0.7);
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.7);
    pointer-events: none;
}
#location-indicator.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(120%);
}

.geo-body {
    display: flex;
    align-items: stretch;
}

.geo-readout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 9px;
    border-right: 1px solid rgba(var(--color-primary-rgb), 0.16);
}
.geo-readout > i {
    width: 1px;
    height: 16px;
    background: rgba(var(--color-primary-rgb), 0.2);
}
.geo-coords {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 1px;
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.55);
}
.geo-coords b { font-weight: 400; }
/* GPS lock LED */
.geo-coords::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary), inset 0 0 2px rgba(255, 255, 255, 0.6);
    animation: geo-lock 1.6s ease-in-out infinite;
}
@keyframes geo-lock {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.82); }
}
.geo-clock {
    font-family: 'VT323', monospace;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 1px;
    color: rgba(var(--color-primary-rgb), 0.85);
    font-variant-numeric: tabular-nums;
}
.geo-sun {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    letter-spacing: 1.6px;
    color: #ffd166;
}
.geo-sun::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd166;
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.8);
}
.geo-sun.is-night { color: rgba(var(--color-primary-rgb), 0.55); }
.geo-sun.is-night::before {
    background: transparent;
    box-shadow: inset 3px -2px 0 0 rgba(var(--color-primary-rgb), 0.75);
}

.geo-actions { display: flex; align-items: stretch; }
.geo-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: rgba(var(--color-primary-rgb), 0.8);
    background: transparent;
    border: none;
    border-right: 1px solid rgba(var(--color-primary-rgb), 0.16);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.geo-btn:last-child { border-right: none; }
.geo-btn:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.14);
    text-shadow: 0 0 7px var(--color-primary);
}
.geo-btn.active {
    color: #04120e;
    background: var(--color-primary);
    text-shadow: none;
}
.geo-crosshair {
    position: relative;
    width: 12px;
    height: 12px;
    flex: none;
    border: 1px solid currentColor;
    border-radius: 50%;
}
.geo-crosshair::before,
.geo-crosshair::after {
    content: "";
    position: absolute;
    background: currentColor;
}
.geo-crosshair::before { left: 50%; top: -3px; bottom: -3px; width: 1px; margin-left: -0.5px; }
.geo-crosshair::after { top: 50%; left: -3px; right: -3px; height: 1px; margin-top: -0.5px; }
.geo-grid {
    width: 13px;
    height: 9px;
    flex: none;
    background:
        linear-gradient(currentColor, currentColor) 0 0/3px 3px no-repeat,
        linear-gradient(currentColor, currentColor) 5px 0/3px 3px no-repeat,
        linear-gradient(currentColor, currentColor) 10px 0/3px 3px no-repeat,
        linear-gradient(currentColor, currentColor) 0 6px/3px 3px no-repeat,
        linear-gradient(currentColor, currentColor) 5px 6px/3px 3px no-repeat,
        linear-gradient(currentColor, currentColor) 10px 6px/3px 3px no-repeat;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .geo-body { flex-direction: column; }
    .geo-readout { border-right: none; border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.16); }
    .geo-btn { flex: 1; justify-content: center; padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .geo-coords::before { animation: none; }
}

#sky-observer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 40;
    display: flex;
    justify-content: center;
    padding-top: 20px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#sky-observer-overlay.visible {
    opacity: 1;
}

#sky-observer-overlay .observer-label {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: var(--color-secondary);
    background: rgba(0, 20, 20, 0.7);
    border: 1px solid rgba(var(--color-secondary-rgb), 0.3);
    padding: 6px 16px;
    backdrop-filter: blur(8px);
    letter-spacing: 2px;
}

#sky-observer-overlay .observer-hint {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: rgba(var(--color-secondary-rgb), 0.5);
    margin-top: 4px;
    text-align: center;
}

/* --- SKY OBSERVER CURSOR --- */
#sky-observer-cursor {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 45;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#sky-observer-cursor.visible {
    opacity: 1;
}

#sky-observer-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--color-secondary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--color-secondary), 0 0 16px rgba(var(--color-secondary-rgb), 0.5);
}

#sky-observer-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(var(--color-secondary-rgb), 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: cursorPulse 2s ease-in-out infinite;
}

@keyframes cursorPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

#sky-observer-cursor.target-lock::after {
    border-color: var(--color-secondary);
    border-width: 2px;
    animation: targetLockPulse 0.5s ease-in-out infinite;
}

@keyframes targetLockPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.9); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* --- MULTI-SELECT PANEL --- */
#multi-select-panel {
    position: absolute;
    bottom: 170px;
    right: 25px;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(20, 20, 0, 0.9), rgba(15, 15, 0, 0.85));
    border: 2px solid rgba(255, 200, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 200, 0, 0.3), inset 0 0 10px rgba(255, 200, 0, 0.05);
    color: #ffc800;
    padding: 15px;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#multi-select-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#multi-select-panel h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #ffc800;
    text-shadow: 0 0 5px rgba(255, 200, 0, 0.5);
    letter-spacing: 2px;
}

.multi-select-item {
    padding: 8px;
    margin-bottom: 5px;
    background: rgba(255, 200, 0, 0.1);
    border: 1px solid rgba(255, 200, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: all 0.2s;
}

.multi-select-item:hover {
    background: rgba(255, 200, 0, 0.2);
    border-color: rgba(255, 200, 0, 0.5);
}

.multi-select-item-name {
    color: #ffc800;
    flex: 1;
}

.multi-select-item-remove {
    background: rgba(255, 65, 65, 0.3);
    border: 1px solid #ff4141;
    color: #ff4141;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.multi-select-item-remove:hover {
    background: rgba(255, 65, 65, 0.5);
}

.multi-select-connections {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 200, 0, 0.3);
}

.connection-info {
    font-size: 13px;
    margin-bottom: 8px;
    color: rgba(255, 200, 0, 0.8);
    line-height: 1.4;
}

#clear-selection-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background: linear-gradient(180deg, rgba(255, 65, 65, 0.1), rgba(255, 65, 65, 0.05));
    border: 1px solid rgba(255, 65, 65, 0.5);
    color: #ff4141;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#clear-selection-btn:hover {
    background: linear-gradient(180deg, rgba(255, 65, 65, 0.25), rgba(255, 65, 65, 0.1));
    border-color: #ff4141;
    box-shadow: 0 4px 12px rgba(255, 65, 65, 0.2), inset 0 0 8px rgba(255, 65, 65, 0.2);
    text-shadow: 0 0 8px rgba(255, 65, 65, 0.6);
    transform: translateY(-1px);
}

/* --- VU METER GRAPHS --- */
.graph-wrapper { margin-top: 15px; }
.graph-title { font-size: 16px; margin: 0 0 5px 0; color: var(--color-primary); }
.graph-range-label { color: #c3ffc3; font-size: 14px; opacity: 0.7; }

.graph-bar-container {
    height: 22px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    background-color: rgba(var(--color-primary-rgb), 0.05);
    position: relative;
    overflow: hidden;
}

.graph-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff41 60%, #ffff70 85%, #ff4141 100%);
    box-shadow: 0 0 5px var(--color-primary);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.graph-value-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 0 4px #000, 0 0 8px #000;
    z-index: 3;
    pointer-events: none;
    letter-spacing: 1px;
}

.graph-ticks {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.graph-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: rgba(var(--color-primary-rgb), 0.15);
}

.graph-tick.major { background-color: rgba(var(--color-primary-rgb), 0.3); }

.graph-scale {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-dim);
    margin-top: 2px;
    padding: 0 1px;
}

.graph-reference-lines {
    margin-top: 10px;
    font-size: 13px;
    color: #c3ffc3;
    opacity: 0.8;
}

.ref-line { margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.ref-color { display: inline-block; width: 8px; height: 8px; border-radius: 1px; }

.graph-peak-marker {
    position: absolute;
    top: 0; left: 0;
    width: 2px; height: 100%;
    background-color: #fff;
    box-shadow: 0 0 8px #fff;
    transition: left 0.1s linear;
}

/* --- GROUND TRACK MAP --- */
.ground-track-wrapper { margin-top: 15px; margin-bottom: 15px; }

#ground-track-map {
    width: 100%;
    height: auto;
    background-color: #000;
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    image-rendering: pixelated;
}

/* --- HOVER INTERACTION --- */
#hover-container {
    position: absolute;
    display: none;
    align-items: center;
    transform: translate(40px, -50%);
    z-index: 100;
    pointer-events: none;
}

#hover-label {
    background-color: var(--color-bg-panel-dark);
    border: 1px solid var(--color-primary);
    color: #c3ffc3;
    padding: 5px 10px;
    font-size: 16px;
    white-space: pre;
    text-shadow: 0 0 5px var(--color-primary);
    display: none;
    text-align: left;
    pointer-events: none;
}

#hover-ring {
    position: absolute;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#hover-ring circle {
    fill: transparent;
    stroke: rgba(var(--color-primary-rgb), 0.9);
    stroke-width: 2;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 125.66;
    transition: none;
}

#hover-ring.loading circle {
    transition: stroke-dashoffset 1.5s linear;
    stroke-dashoffset: 0;
}

#touch-selection-feedback {
    position: fixed;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(var(--color-primary-rgb), 0.92);
    box-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.35), inset 0 0 8px rgba(var(--color-primary-rgb), 0.24);
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 120;
}

#touch-selection-feedback.visible {
    animation: touchSelectPulse 0.44s ease-out;
}

#touch-selection-feedback.miss {
    border-color: rgba(255, 65, 65, 0.9);
    box-shadow: 0 0 16px rgba(255, 65, 65, 0.35), inset 0 0 8px rgba(255, 65, 65, 0.2);
}

#touch-selection-assist {
    position: fixed;
    min-width: 210px;
    max-width: min(88vw, 320px);
    max-height: 42vh;
    overflow-y: auto;
    padding: 10px;
    background: linear-gradient(160deg, rgba(0, 24, 0, 0.95), rgba(0, 12, 0, 0.92));
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(var(--color-primary-rgb), 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 130;
}

#touch-selection-assist.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#touch-selection-assist-title {
    font-size: 14px;
    color: rgba(var(--color-primary-rgb), 0.92);
    letter-spacing: 1.3px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.24);
    padding-bottom: 6px;
}

#touch-selection-assist-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.touch-selection-assist-item {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.6px;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.touch-selection-assist-item:hover,
.touch-selection-assist-item:active {
    background: rgba(var(--color-primary-rgb), 0.2);
    border-color: rgba(var(--color-primary-rgb), 0.65);
}

@keyframes touchSelectPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.35);
        opacity: 0;
    }
    18% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.9);
        opacity: 0;
    }
}

/* --- STATS PANEL (Bottom Center) --- */
/* ================================================================
   STATS PANEL — Flight Deck Instrument Cluster
   ================================================================ */
#stats-panel {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    height: 46px;
    padding: 0;
    background: linear-gradient(180deg, rgba(0, 18, 6, 0.92), rgba(0, 8, 3, 0.92));
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(var(--color-primary-rgb), 0.18),
        inset 0 0 0 1px rgba(0, 0, 0, 0.45),
        0 6px 18px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(var(--color-primary-rgb), 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: stretch;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    transition: opacity 0.4s ease, transform 0.3s ease;
    overflow: hidden;
}
/* Top accent rule */
#stats-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 8px;
    right: 8px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--color-primary-rgb), 0.5), transparent);
    pointer-events: none;
}
/* Subtle bottom scanline base */
#stats-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(0, 0, 0, 0.15) 3px,
        rgba(0, 0, 0, 0.15) 4px
    );
    opacity: 0.5;
}

#stats-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(120%);
}

.stats-item {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 4px 18px;
    position: relative;
    min-width: 80px;
}
/* Status LED dot beside each item */
.stats-item::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 4px var(--color-primary);
    opacity: 0.85;
    animation: stats-led 2.4s ease-in-out infinite;
}
.stats-item:nth-child(3)::before { animation-delay: 0.4s; }
.stats-item:nth-child(5)::before { animation-delay: 0.8s; }
@keyframes stats-led {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 0.35; }
}

.stats-label {
    color: var(--color-text-dim);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2.5px;
    line-height: 1;
    padding-left: 8px;
}

.stats-item > :not(.stats-label):not(.stats-item::before) {
    /* The value lines (utc-clock, obj-counter, fps-counter) */
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.45);
    padding-left: 8px;
}

.stats-sep {
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent,
        rgba(var(--color-primary-rgb), 0.35) 30%,
        rgba(var(--color-primary-rgb), 0.35) 70%,
        transparent);
    flex-shrink: 0;
}

#perf-mode-indicator {
    letter-spacing: 1px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.9;
}

#perf-mode-indicator.perf-mode-normal { opacity: 0.9; }
#perf-mode-indicator.perf-mode-degraded { opacity: 0.78; }
#perf-mode-indicator.perf-mode-critical { opacity: 1; font-weight: 700; }

#utc-clock,
#obj-counter,
#fps-counter {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.45);
    padding-left: 8px;
}
#fps-counter {
    color: #ffc800;
    text-shadow: 0 0 6px rgba(255, 200, 0, 0.45);
}

/* ================================================================
   ACTION DOCK — RETRO-SCIENCE HEX FAB (bottom-right, hover-expand)
   ================================================================
   Collapsed: a single hex/circular FAB at bottom-right.
   Hover:     a horizontal tactical tray slides out to the left,
              revealing all action buttons (settings included).
   ================================================================ */
/* Stable hover hit-area: fixed-size box anchored at bottom-right.
   FAB and tray are absolutely positioned inside so the bounding box
   never grows/shrinks → hover state never flickers. */
.action-dock {
    position: fixed !important;
    bottom: 74px !important;
    right: 22px !important;
    left: auto !important;
    top: auto !important;
    z-index: 60 !important;
    display: block !important;
    width: 540px !important;
    height: 56px !important;
    pointer-events: none !important;
}
/* Children handle their own pointer-events */
.action-dock > * {
    pointer-events: auto;
    position: absolute;
}

/* Hex FAB trigger — the only element visible when collapsed.
   Pinned to the bottom-right of the dock; never moves.
   IMPORTANT: clip-path lives only on the pseudo elements (visual),
   NOT on the button itself, so the full 48x48 rect stays a clean
   hover target — no flicker at the clipped corners. */
.action-dock-expand {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 3;
    right: 0 !important;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(var(--color-primary-rgb), 0.35));
}
.action-dock-expand::before {
    /* Hex body (visual only) */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 45%, rgba(var(--color-primary-rgb), 0.18) 0%, transparent 65%),
        linear-gradient(140deg, rgba(0, 32, 0, 0.95), rgba(0, 12, 0, 0.95));
    clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
    z-index: -2;
    pointer-events: none;
}
.action-dock-expand::after {
    /* Inner hex bezel ring */
    content: "";
    position: absolute;
    inset: 3px;
    background:
        repeating-linear-gradient(90deg,
            rgba(var(--color-primary-rgb), 0.10) 0,
            rgba(var(--color-primary-rgb), 0.10) 1px,
            transparent 1px,
            transparent 5px),
        linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.08), rgba(var(--color-primary-rgb), 0.02));
    clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    z-index: -1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
}
.action-dock-expand svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 0 4px rgba(var(--color-primary-rgb), 0.6));
}
.action-dock.is-open .action-dock-expand,
.action-dock:hover .action-dock-expand {
    transform: translateY(-50%) rotate(180deg);
    filter: drop-shadow(0 0 14px rgba(var(--color-primary-rgb), 0.7));
}
.action-dock:hover .action-dock-expand::after {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 12px rgba(var(--color-primary-rgb), 0.25);
}

/* Tray — anchored just left of the settings cog. Its right edge
   never moves, only its width grows on hover. The dock's bounding
   box stays stable. */
.action-dock-tray {
    right: 58px !important; /* just past the FAB (48) + gap */
    top: 50%;
    transform: translateY(-50%);
    box-sizing: border-box;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 0 !important;
    height: 40px !important;
    background:
        linear-gradient(180deg, rgba(0, 22, 8, 0.92), rgba(0, 10, 4, 0.92));
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    border-right: none;
    border-radius: 22px 0 0 22px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        inset 0 0 18px rgba(var(--color-primary-rgb), 0.06),
        0 0 18px rgba(var(--color-primary-rgb), 0.15);
    max-width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none;
    transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease,
                padding 0.3s ease;
    margin-right: 0 !important;
}
.action-dock-tray::before {
    /* subtle scanline texture across the tray */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(var(--color-primary-rgb), 0.04) 3px,
        rgba(var(--color-primary-rgb), 0.04) 4px
    );
    border-radius: inherit;
    opacity: 0.6;
    z-index: 0;
}
.action-dock.is-open .action-dock-tray,
.action-dock:hover .action-dock-tray {
    max-width: 480px !important;
    opacity: 1 !important;
    padding: 0 22px 0 14px !important;
    overflow: visible !important;
    pointer-events: auto;
}

.dock-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(180deg, rgba(0, 28, 4, 0.55), rgba(0, 14, 2, 0.55));
    transition: all 0.22s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45);
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}
.dock-btn:active { transform: translateY(1px); }
/* Tooltip ABOVE buttons (dock sits on bottom) */
.dock-btn[title]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: linear-gradient(180deg, rgba(0, 14, 4, 0.97), rgba(0, 6, 2, 0.97));
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.2px;
    padding: 4px 9px;
    white-space: nowrap;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.2);
    text-shadow: 0 0 5px rgba(var(--color-primary-rgb), 0.5);
}
.dock-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Color variants — tactical color-coded */
.dock-btn--green { border: 1px solid rgba(var(--color-primary-rgb), 0.45); color: rgba(var(--color-primary-rgb), 0.85); }
.dock-btn--green:hover { border-color: var(--color-primary); color: var(--color-primary); background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.22), rgba(var(--color-primary-rgb), 0.08)); box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.4), inset 0 0 6px rgba(var(--color-primary-rgb), 0.15); transform: translateY(-1px); }

.dock-btn--amber { border: 1px solid rgba(255, 200, 0, 0.45); color: rgba(255, 200, 0, 0.85); }
.dock-btn--amber:hover { border-color: #ffc800; color: #ffc800; background: linear-gradient(180deg, rgba(255, 200, 0, 0.2), rgba(255, 200, 0, 0.06)); box-shadow: 0 0 10px rgba(255, 200, 0, 0.4), inset 0 0 6px rgba(255, 200, 0, 0.15); transform: translateY(-1px); }
.dock-btn--amber.active { background: rgba(255, 200, 0, 0.22); border-color: #ffc800; color: #ffc800; box-shadow: inset 0 0 8px rgba(255, 200, 0, 0.3); }

.dock-btn--lavender { border: 1px solid rgba(var(--color-primary-rgb), 0.45); color: rgba(var(--color-primary-rgb), 0.85); }
.dock-btn--lavender:hover { border-color: var(--color-primary); color: var(--color-primary); background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.22), rgba(var(--color-primary-rgb), 0.06)); box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.4), inset 0 0 6px rgba(var(--color-primary-rgb), 0.15); transform: translateY(-1px); }
.dock-btn--lavender.active { background: rgba(var(--color-primary-rgb), 0.22); border-color: var(--color-primary); color: var(--color-primary); }

.dock-btn--pink { border: 1px solid rgba(255, 95, 135, 0.5); color: rgba(255, 125, 165, 0.85); }
.dock-btn--pink:hover { border-color: #ff7da1; color: #ff8db0; background: linear-gradient(180deg, rgba(255, 95, 135, 0.2), rgba(255, 95, 135, 0.06)); box-shadow: 0 0 12px rgba(255, 95, 135, 0.4), inset 0 0 6px rgba(255, 95, 135, 0.15); transform: translateY(-1px); }

.dock-btn--orange { border: 1px solid rgba(255, 165, 0, 0.45); color: rgba(255, 165, 0, 0.85); }
.dock-btn--orange:hover { border-color: #ffa500; color: #ffb733; background: linear-gradient(180deg, rgba(255, 165, 0, 0.2), rgba(255, 165, 0, 0.06)); box-shadow: 0 0 12px rgba(255, 165, 0, 0.4), inset 0 0 6px rgba(255, 165, 0, 0.15); transform: translateY(-1px); }
.dock-btn--orange.premium-locked { opacity: 0.35; cursor: not-allowed; }

.dock-separator-v {
    width: 1px;
    height: 22px;
    background: linear-gradient(180deg, transparent, rgba(var(--color-primary-rgb), 0.45), transparent);
    margin: 0 4px;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(var(--color-primary-rgb), 0.25);
}


/* --- SETTINGS PANEL --- */
#settings-panel {
    position: absolute;
    bottom: 170px;
    right: 25px;
    width: 390px;
    max-height: 500px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.95), rgba(5, 5, 20, 0.9));
    border: 2px solid rgba(var(--color-primary-rgb), 0.6);
    box-shadow: 0 0 25px rgba(var(--color-primary-rgb), 0.4), inset 0 0 15px rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
    padding: 16px;
    z-index: 50;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#settings-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#settings-panel h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.6);
    letter-spacing: 3px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.3);
    padding-bottom: 10px;
}

.settings-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: rgba(var(--color-primary-rgb), 0.9);
    letter-spacing: 2px;
}

.quality-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quality-btn {
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-primary-rgb), 0.05));
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.1, 0.7, 0.1, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.quality-btn:hover {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.2), rgba(var(--color-primary-rgb), 0.1));
    border-color: rgba(var(--color-primary-rgb), 0.6);
    box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.2), inset 0 0 8px rgba(var(--color-primary-rgb), 0.1);
    transform: translateY(-1px);
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.5);
}

.quality-btn.active {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.4), rgba(var(--color-primary-rgb), 0.25));
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.5), inset 0 0 8px rgba(var(--color-primary-rgb), 0.2);
    transform: translateY(0);
}

.settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(var(--color-primary-rgb), 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.settings-toggle:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.3);
}

.settings-toggle label {
    font-size: 15px;
    color: rgba(var(--color-primary-rgb), 0.9);
    cursor: pointer;
}

.settings-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 20px;
    background: rgba(var(--color-primary-rgb), 0.2);
    border: 2px solid rgba(var(--color-primary-rgb), 0.4);
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.settings-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: rgba(var(--color-primary-rgb), 0.6);
    top: 1px;
    left: 1px;
    transition: all 0.3s;
}

.settings-toggle input[type="checkbox"]:checked {
    background: rgba(var(--color-primary-rgb), 0.4);
    border-color: var(--color-primary);
}

.settings-toggle input[type="checkbox"]:checked::before {
    left: 21px;
    background: var(--color-primary);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.8);
}

.quality-info {
    font-size: 13px;
    color: rgba(var(--color-primary-rgb), 0.6);
    margin-top: 8px;
    line-height: 1.4;
}

.settings-slider {
    margin-bottom: 12px;
}

.settings-slider label {
    display: block;
    font-size: 15px;
    color: rgba(var(--color-primary-rgb), 0.9);
    margin-bottom: 6px;
}

.settings-slider span {
    color: var(--color-primary);
    font-weight: bold;
}

/* the small print under a setting that costs performance */
.settings-hint {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.2;
    color: rgba(var(--color-primary-rgb), 0.5);
}

.settings-slider input[type="range"] {
    width: 100%;
}

/* (donate-btn and launch-director-btn styles moved into .dock-btn variants above) */

@keyframes donateBtnPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 70, 120, 0.3), inset 0 0 8px rgba(255, 120, 160, 0.1); }
    50% { box-shadow: 0 0 18px rgba(255, 70, 120, 0.55), inset 0 0 12px rgba(255, 130, 170, 0.18); }
}

/* ================================================================
   ACCOUNT QUICK BAR — TOP-RIGHT TACTICAL STRIP
   ================================================================
   A single-row pill housing BGM / SFX / LOGIN. Forced single row.
   ================================================================ */
#account-quick-bar {
    position: fixed !important;
    top: 18px !important;
    right: 18px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 50 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    padding: 5px 10px 5px 12px !important;
    width: auto !important;
    max-width: none !important;
    height: 40px !important;
    background: linear-gradient(180deg, rgba(0, 16, 6, 0.78), rgba(0, 8, 3, 0.78));
    border: 1px solid rgba(var(--color-primary-rgb), 0.22);
    border-radius: 3px;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        0 6px 18px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.4s ease;
}
/* Decorative top-rule for the bar (subtle tactical accent) */
#account-quick-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 6px;
    right: 6px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--color-primary-rgb), 0.35), transparent);
    pointer-events: none;
}
/* (el LED de estado que habia aqui se quito: parecia una notificacion) */
#account-quick-bar::after {
    content: none;
    display: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary), 0 0 2px var(--color-primary);
    order: -1;
    margin: 0 2px 0 2px;
    flex-shrink: 0;
    animation: quick-bar-led 2.4s ease-in-out infinite;
}
@keyframes quick-bar-led {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

#account-btn {
    position: relative;
    z-index: 1;
    background: rgba(var(--color-primary-rgb), 0.06);
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    border-radius: 2px;
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    height: 28px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    transition: all 0.2s ease;
    padding: 0 14px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(var(--color-primary-rgb), 0.4);
    /* CRITICAL: contain the shimmer animation */
    overflow: hidden;
    isolation: isolate;
}
#account-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.18);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.35);
}

#account-btn.account-login {
    animation: account-login-pulse 3s ease-in-out infinite;
}

#account-btn.account-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(var(--color-primary-rgb), 0.15) 50%, transparent 70%);
    transform: translateX(-140%);
    animation: account-login-sweep 4s ease-in-out infinite;
    pointer-events: none;
}
#account-btn.logged-in {
    font-weight: bold;
    font-size: 13px;
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-color: rgba(0, 255, 200, 0.5);
    color: #00ffc8;
    text-shadow: 0 0 5px #00ffc8;
    top: auto;
}
#account-btn.logged-in:hover {
    background: rgba(0, 255, 200, 0.12);
    border-color: #00ffc8;
}

@keyframes account-login-pulse {
    0%, 100% { box-shadow: inset 0 0 6px rgba(var(--color-primary-rgb), 0.08); }
    50% { box-shadow: inset 0 0 10px rgba(var(--color-primary-rgb), 0.18); }
}

@keyframes account-login-sweep {
    0%, 20% { transform: translateX(-140%); }
    50%, 100% { transform: translateX(140%); }
}

.quick-audio-btn {
    position: relative;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.28);
    border-radius: 2px;
    background: rgba(var(--color-primary-rgb), 0.04);
    color: rgba(var(--color-primary-rgb), 0.8);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    transition: all 0.2s ease;
    overflow: hidden;
}

.quick-audio-btn .audio-icon { opacity: 0.75; transition: opacity 0.2s; }
.quick-audio-btn:hover .audio-icon { opacity: 1; }
.quick-audio-btn.muted .audio-wave { display: none; }

.quick-audio-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.16);
    border-color: var(--color-primary);
    color: var(--color-primary, #00ff41);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.3);
}

.quick-audio-btn.muted {
    border-color: rgba(255, 65, 65, 0.3);
    color: rgba(255, 95, 95, 0.8);
    background: rgba(255, 0, 0, 0.05);
}

.quick-audio-btn.muted:hover {
    border-color: #ff4141;
    color: #ff6666;
    background: rgba(255, 0, 0, 0.14);
    box-shadow: 0 0 8px rgba(255, 65, 65, 0.3);
}

/* --- THEME GRID --- */
.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    background: rgba(var(--color-primary-rgb), 0.05);
    border: 2px solid rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.theme-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.12);
    border-color: rgba(var(--color-primary-rgb), 0.4);
}

.theme-btn.active {
    border-color: var(--color-primary, #00ff41);
    background: rgba(var(--color-primary-rgb), 0.25);
    box-shadow: 0 0 15px currentColor;
}
.theme-btn.active::before {
    content: '\2713';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 14px;
    font-weight: bold;
    color: var(--color-primary, #00ff41);
}

.theme-btn .theme-preview {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.theme-btn .theme-tag {
    font-size: 10px;
    padding: 1px 5px;
    border: 1px solid;
    letter-spacing: 1px;
}

.theme-tag.free {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.theme-tag.premium {
    color: #ffc800;
    border-color: #ffc800;
}

.theme-btn.locked {
    opacity: 0.5;
}

.theme-btn.locked::after {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
}

/* ================================================================
   DONATION MODAL — MINIMAL REDESIGN (APP)
   ================================================================ */
.donate-modal-card {
    background: linear-gradient(180deg, rgba(3, 14, 8, 0.97), rgba(1, 8, 4, 0.98));
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    padding: 40px 36px 32px;
    max-width: 440px;
    width: 92%;
    position: relative;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.12), inset 0 0 30px rgba(0, 255, 65, 0.04);
    animation: donateCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes donateCardIn {
    0%   { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.donate-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 255, 65, 0.06);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.donate-modal-close:hover {
    background: rgba(0, 255, 65, 0.15);
    border-color: var(--color-primary);
}

.donate-modal-icon {
    font-size: 40px;
    color: #ff6b8a;
    text-shadow: 0 0 20px rgba(255, 107, 138, 0.4);
    margin-bottom: 16px;
    animation: donateHeartPulse 2s ease-in-out infinite;
}

@keyframes donateHeartPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

.donate-modal-title {
    font-family: var(--font-mono);
    font-size: clamp(22px, 4vw, 28px);
    color: var(--color-primary);
    text-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.3);
    letter-spacing: 3px;
    margin: 0 0 12px;
}

.donate-modal-desc {
    font-family: var(--font-mono);
    font-size: 13px;
    color: rgba(200, 255, 210, 0.75);
    line-height: 1.5;
    margin: 0 0 28px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.donate-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.donate-modal-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-family: var(--font-mono);
    text-decoration: none;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
}

.donate-btn-label {
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 700;
}

.donate-btn-sub {
    font-size: 11px;
    opacity: 0.8;
}

.donate-stripe {
    color: #aab4ff;
    border-color: rgba(120, 132, 255, 0.5);
    background: rgba(103, 114, 229, 0.08);
}

.donate-stripe:hover {
    background: rgba(103, 114, 229, 0.2);
    border-color: rgba(120, 132, 255, 0.8);
    box-shadow: 0 0 20px rgba(103, 114, 229, 0.25);
    transform: translateY(-2px);
}

.donate-bizum {
    color: #7de7ff;
    border-color: rgba(50, 190, 255, 0.5);
    background: rgba(0, 140, 210, 0.08);
}

.donate-bizum:hover {
    background: rgba(0, 140, 210, 0.2);
    border-color: rgba(50, 190, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.25);
    transform: translateY(-2px);
}

.donate-modal-note {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(180, 255, 190, 0.55);
    line-height: 1.4;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.12);
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =====================================================
   AUTH MODAL + ACCOUNT POPUP
   ===================================================== */

/* --- AUTH TERMINAL MODAL (APP) --- */
.auth-terminal {
    width: min(480px, calc(100vw - 32px));
    background: rgba(2, 10, 5, 0.98);
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    box-shadow: 0 0 0 1px rgba(var(--color-primary-rgb), 0.12), 0 0 40px rgba(var(--color-primary-rgb), 0.15), inset 0 0 60px rgba(var(--color-primary-rgb), 0.04);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    animation: authCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authCardIn {
    0%   { opacity: 0; transform: translateY(16px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(var(--color-primary-rgb), 0.08);
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.3);
}
.auth-titlebar-text {
    font-size: 11px;
    letter-spacing: 0.8px;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
}
.auth-close {
    background: none;
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.auth-close:hover {
    background: rgba(255, 0, 60, 0.2);
    border-color: rgba(255, 0, 60, 0.6);
    color: #ff4466;
}
.auth-body {
    padding: 24px 26px 22px;
}

.auth-modal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    color: var(--color-primary, #00ff41);
    margin: 0 0 18px 0;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.3);
}

.auth-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 10px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
    margin-bottom: -1px;
}
.auth-tab:hover { color: var(--color-primary); }
.auth-tab.active {
    color: var(--color-primary, #00ff41);
    border-bottom-color: var(--color-primary, #00ff41);
    text-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    background-color: rgba(0, 15, 0, 0.6);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    letter-spacing: 0.5px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    caret-color: var(--color-primary, #00ff41);
}
.auth-input::placeholder { color: var(--color-text-dim); }
.auth-input:focus {
    border-color: rgba(var(--color-primary-rgb), 0.6);
    box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.15);
}

.auth-submit-btn {
    padding: 12px;
    background: rgba(var(--color-primary-rgb), 0.08);
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}
.auth-submit-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.18);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 2px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(var(--color-primary-rgb), 0.15);
}

.auth-social-row {
    display: flex;
    gap: 10px;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 10px 12px;
    background: rgba(var(--color-primary-rgb), 0.03);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}
.auth-social-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary, #00ff41);
    border-color: rgba(var(--color-primary-rgb), 0.5);
}

.auth-social-text {
    font-weight: normal;
}

.auth-social-logo {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-social-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-social-logo.github-logo {
    color: rgba(200, 255, 200, 0.8);
}

.auth-error {
    color: #ff6b6b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin: 10px 0 0;
    min-height: 1.2em;
}

.auth-success {
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin: 10px 0 0;
    min-height: 1.2em;
}

/* --- ACCOUNT POPUP --- */
.account-popup {
    position: absolute;
    top: 72px;
    right: 25px;
    background: linear-gradient(135deg, rgba(0, 20, 0, 0.97), rgba(0, 10, 0, 0.95));
    border: 1px solid var(--color-primary, #00ff41);
    padding: 14px 16px;
    z-index: 200;
    min-width: 180px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
    font-family: var(--font-mono, monospace);
}

.account-popup-email {
    color: rgba(0, 255, 65, 0.75);
    font-size: 13px;
    margin-bottom: 8px;
    word-break: break-all;
    letter-spacing: 0.3px;
}

.account-popup-premium {
    display: inline-block;
    color: #ffc800;
    border: 1px solid #ffc800;
    font-size: 11px;
    padding: 2px 7px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-shadow: 0 0 6px rgba(255, 200, 0, 0.4);
}

.account-popup-profile {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    padding: 8px;
    text-align: center;
    text-decoration: none;
    background: rgba(var(--color-primary-rgb), 0.08);
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    color: var(--color-primary);
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
}
.account-popup-profile:hover { background: rgba(var(--color-primary-rgb), 0.18); border-color: var(--color-primary); }

.account-popup-logout {
    display: block;
    width: 100%;
    padding: 8px;
    background: rgba(255, 65, 65, 0.07);
    border: 1px solid rgba(255, 65, 65, 0.35);
    color: var(--color-danger, #ff4141);
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.account-popup-logout:hover {
    background: rgba(255, 65, 65, 0.18);
    border-color: var(--color-danger, #ff4141);
}

/* Multi-select enhanced connections */
.ms-connections-header {
    font-size: 13px;
    margin-bottom: 8px;
    color: #ffc800;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 200, 0, 0.2);
    padding-bottom: 4px;
}
.connection-info {
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(255, 200, 0, 0.04);
    border-left: 2px solid rgba(255, 200, 0, 0.3);
    font-size: 12px;
    line-height: 1.6;
}
.conn-pair {
    color: #ffc800;
    font-size: 13px;
    margin-bottom: 4px;
    letter-spacing: 1px;
}
.conn-data {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    padding-left: 8px;
}

/* ==========================================================
   NEURAL LINK THEME — Cyberpunk HUD Overrides
   Scoped via [data-theme="neuralLink"] on <body>
   ========================================================== */
[data-theme="neuralLink"] #info-panel,
[data-theme="neuralLink"] #settings-panel,
[data-theme="neuralLink"] #multi-select-panel,
[data-theme="neuralLink"] #theme-selector {
    clip-path: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
    border: 1px solid var(--color-primary) !important;
    box-shadow: 0 0 20px rgba(var(--color-secondary-rgb),0.25), inset 0 0 20px rgba(var(--color-primary-rgb),0.04) !important;
    background: linear-gradient(135deg, rgba(10,0,18,0.95), rgba(5,0,12,0.92)) !important;
}
[data-theme="neuralLink"] h3,
[data-theme="neuralLink"] h4,
[data-theme="neuralLink"] .panel-title {
    text-shadow: 0 0 5px var(--color-primary), 0 0 12px var(--color-primary), 2px 0 1px rgba(var(--color-secondary-rgb),0.3), -2px 0 1px rgba(var(--color-primary-rgb),0.3);
    letter-spacing: 3px;
}
[data-theme="neuralLink"] label,
[data-theme="neuralLink"] .info-label {
    text-shadow: 0 0 4px rgba(var(--color-primary-rgb),0.4);
}
[data-theme="neuralLink"] #info-panel button,
[data-theme="neuralLink"] #settings-panel button,
[data-theme="neuralLink"] .theme-btn,
[data-theme="neuralLink"] #clear-selection-btn {
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
    border: 1px solid var(--color-border);
}
[data-theme="neuralLink"] #info-panel button:hover,
[data-theme="neuralLink"] .theme-btn:hover {
    box-shadow: 0 0 12px rgba(var(--color-secondary-rgb),0.5), inset 0 0 8px rgba(var(--color-primary-rgb),0.1);
}
[data-theme="neuralLink"] #info-panel.visible {
    animation: neuralPanelDeploy 0.5s cubic-bezier(0.22,1,0.36,1);
}
@keyframes neuralPanelDeploy {
    0% { clip-path: polygon(50% 50%,50% 50%,50% 50%,50% 50%,50% 50%,50% 50%,50% 50%,50% 50%); opacity: 0; }
    40% { clip-path: polygon(0 50%,50% 0,100% 50%,100% 50%,100% 50%,50% 100%,0 50%,0 50%); opacity: 0.6; }
    100% { clip-path: polygon(0 14px,14px 0,calc(100% - 14px) 0,100% 14px,100% calc(100% - 14px),calc(100% - 14px) 100%,14px 100%,0 calc(100% - 14px)); opacity: 1; }
}
[data-theme="neuralLink"] #info-panel::before,
[data-theme="neuralLink"] #settings-panel::before {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-top: 2px solid var(--color-secondary); border-left: 2px solid var(--color-secondary);
    opacity: 0.6; pointer-events: none;
}
[data-theme="neuralLink"] #info-panel::after,
[data-theme="neuralLink"] #settings-panel::after {
    content: ''; position: absolute; bottom: 3px; right: 3px;
    width: 20px; height: 20px;
    border-bottom: 2px solid var(--color-secondary); border-right: 2px solid var(--color-secondary);
    opacity: 0.6; pointer-events: none;
}
[data-theme="neuralLink"] #fullscreen-btn,
[data-theme="neuralLink"] #hide-gui-btn,
[data-theme="neuralLink"] #multi-select-btn,
[data-theme="neuralLink"] #settings-btn,
[data-theme="neuralLink"] #donate-btn,
[data-theme="neuralLink"] #launch-director-btn,
[data-theme="neuralLink"] #account-btn {
    border-color: var(--color-primary) !important;
    text-shadow: 0 0 6px var(--color-primary);
}
[data-theme="neuralLink"] #fullscreen-btn:hover,
[data-theme="neuralLink"] #hide-gui-btn:hover,
[data-theme="neuralLink"] #multi-select-btn:hover,
[data-theme="neuralLink"] #settings-btn:hover,
[data-theme="neuralLink"] #donate-btn:hover,
[data-theme="neuralLink"] #launch-director-btn:hover,
[data-theme="neuralLink"] #account-btn:hover {
    box-shadow: 0 0 15px rgba(var(--color-secondary-rgb),0.5);
}
[data-theme="neuralLink"] ::-webkit-scrollbar-thumb { background: var(--color-primary); }
[data-theme="neuralLink"] ::-webkit-scrollbar-track { background: rgba(10,0,18,0.8); }

/* ==========================================================
   APOLLO ARCHIVE THEME — Aerospace Glass UI
   Scoped via [data-theme="apolloArchive"] on <body>
   ========================================================== */

/* Glassmorphism panels — frosted glass with subtle orange border */
[data-theme="apolloArchive"] #info-panel,
[data-theme="apolloArchive"] #settings-panel,
[data-theme="apolloArchive"] #multi-select-panel,
[data-theme="apolloArchive"] #theme-selector {
    background: rgba(12, 20, 32, 0.65) !important;
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(255, 107, 43, 0.3) !important;
    border-radius: 4px;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 1px rgba(255, 107, 43, 0.2);
}

/* Panel top accent line — mission-critical orange stripe */
[data-theme="apolloArchive"] #info-panel::before,
[data-theme="apolloArchive"] #settings-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 8px; right: 8px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 107, 43, 0.6) 20%,
        rgba(255, 107, 43, 0.8) 50%,
        rgba(255, 107, 43, 0.6) 80%,
        transparent
    );
    pointer-events: none;
}

/* Titles — official document letter-spacing */
[data-theme="apolloArchive"] h3,
[data-theme="apolloArchive"] h4,
[data-theme="apolloArchive"] .panel-title {
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 600;
    color: #e0ddd5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Labels — clean technical readout */
[data-theme="apolloArchive"] label,
[data-theme="apolloArchive"] .info-label {
    letter-spacing: 1px;
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.85em;
    text-transform: uppercase;
}

/* Values — slightly brighter for contrast against glass */
[data-theme="apolloArchive"] .info-value,
[data-theme="apolloArchive"] span[id$="-value"] {
    font-weight: 600;
    color: #f0ede5;
}

/* Buttons — clean aerospace with subtle glass */
[data-theme="apolloArchive"] #info-panel button,
[data-theme="apolloArchive"] #settings-panel button,
[data-theme="apolloArchive"] .theme-btn,
[data-theme="apolloArchive"] #clear-selection-btn {
    background: rgba(12, 20, 32, 0.5) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 107, 43, 0.25) !important;
    border-radius: 3px;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}
[data-theme="apolloArchive"] #info-panel button:hover,
[data-theme="apolloArchive"] .theme-btn:hover,
[data-theme="apolloArchive"] #clear-selection-btn:hover {
    background: rgba(255, 107, 43, 0.12) !important;
    border-color: rgba(255, 107, 43, 0.5) !important;
    box-shadow: 0 0 12px rgba(255, 107, 43, 0.15);
}

/* Toolbar buttons — frosted glass circles */
[data-theme="apolloArchive"] #fullscreen-btn,
[data-theme="apolloArchive"] #hide-gui-btn,
[data-theme="apolloArchive"] #multi-select-btn,
[data-theme="apolloArchive"] #settings-btn,
[data-theme="apolloArchive"] #donate-btn,
[data-theme="apolloArchive"] #launch-director-btn,
[data-theme="apolloArchive"] #account-btn {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(12, 20, 32, 0.5) !important;
    border-color: rgba(255, 107, 43, 0.3) !important;
    transition: all 0.2s ease;
}
[data-theme="apolloArchive"] #fullscreen-btn:hover,
[data-theme="apolloArchive"] #hide-gui-btn:hover,
[data-theme="apolloArchive"] #multi-select-btn:hover,
[data-theme="apolloArchive"] #settings-btn:hover,
[data-theme="apolloArchive"] #donate-btn:hover,
[data-theme="apolloArchive"] #launch-director-btn:hover,
[data-theme="apolloArchive"] #account-btn:hover {
    background: rgba(255, 107, 43, 0.1) !important;
    box-shadow: 0 0 15px rgba(255, 107, 43, 0.2);
}

/* Panel deploy — smooth slide-in from right */
[data-theme="apolloArchive"] #info-panel.visible {
    animation: apolloPanelSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes apolloPanelSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Scrollbar — subtle, professional */
[data-theme="apolloArchive"] ::-webkit-scrollbar { width: 4px; }
[data-theme="apolloArchive"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 43, 0.35);
    border-radius: 2px;
}
[data-theme="apolloArchive"] ::-webkit-scrollbar-track {
    background: rgba(12, 20, 32, 0.3);
}

/* Separator lines inside panels — frosted dividers */
[data-theme="apolloArchive"] hr,
[data-theme="apolloArchive"] .panel-divider {
    border-color: rgba(255, 107, 43, 0.15);
}

/* --- SHORTCUT HINTS --- */
#shortcut-hint {
    position: fixed;
    bottom: 22px;
    right: 22px;
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--color-text-dim);
    letter-spacing: 1.5px;
    pointer-events: none;
    z-index: 30;
    padding: 4px 10px;
    background: linear-gradient(180deg, rgba(0, 14, 4, 0.4), rgba(0, 6, 2, 0.4));
    border: 1px solid rgba(var(--color-primary-rgb), 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* --- ANIMATIONS --- */
@keyframes text-flicker {
    0%  { opacity: 1; }
    95% { opacity: 1; }
    96% { opacity: 0.8; }
    97% { opacity: 1; }
    98% { opacity: 0.5; }
    100% { opacity: 1; }
}

#loading-status-text, #fps-counter {
    animation: text-flicker 3s infinite;
}

@keyframes loading-ring {
    from { mask: conic-gradient(#000 0, #0000 0); }
    to   { mask: conic-gradient(#000 360deg, #0000 0); }
}

/* --- RESPONSIVE DESIGN --- */

/* Tablets and small laptops */
@media (max-width: 1200px) {
    #ui-panel {
        width: 380px;
    }
    #toggle-ui-panel-btn {
        left: 405px;
    }
    #satellite-info-panel {
        width: 320px;
    }
    #settings-panel,
    #multi-select-panel {
        width: 340px;
    }
}

/* Small tablets */
@media (max-width: 900px) {
    #ui-panel {
        width: 320px;
        padding: 15px;
        top: 15px;
        left: 15px;
    }
    #toggle-ui-panel-btn {
        left: 335px;
        top: 75px;
    }
    #toggle-ui-panel-btn.panel-hidden {
        left: 0;
    }
    #satellite-info-panel {
        width: 280px;
        top: 15px;
        right: 15px;
        padding: 12px;
    }
    #stats-panel {
        bottom: 15px;
        font-size: 13px;
        gap: 12px;
        padding: 6px 14px;
    }
    #shortcut-hint {
        bottom: 15px;
        right: 15px;
        font-size: 12px;
    }
    #fullscreen-btn {
        bottom: 50px;
        right: 15px;
    }
    #satellite-info-panel {
        top: 78px;
        max-height: calc(100vh - 205px);
    }
    #account-quick-bar {
        top: 12px;
        right: 12px;
    }
    #account-btn.logged-in {
        right: auto;
        top: auto;
    }
    .account-popup {
        top: 64px;
        right: 15px;
    }
    h1 { font-size: 28px; }
}

/* Mobile drawer breakpoint */
@media (max-width: 768px) {
    /* --- LEFT PANEL: Bottom drawer --- */
    #ui-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: min(78vh, 78dvh);
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        transform: translateY(calc(100% - 64px));
        transition: transform var(--panel-transition);
        z-index: 55;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    #ui-panel.drawer-open,
    #ui-panel:focus-within {
        transform: translateY(0);
    }

    #ui-panel.hidden {
        transform: translateY(100%);
        opacity: 1;
    }

    /* Drawer handle */
    #ui-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--color-primary-dim);
        border-radius: 2px;
        margin: 0 auto 10px;
        flex-shrink: 0;
    }

    /* Hide desktop toggle button on mobile */
    #toggle-ui-panel-btn {
        display: none;
    }

    /* --- RIGHT PANEL: Fullscreen sheet --- */
    #satellite-info-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 8px;
        right: 8px;
        width: auto;
        height: min(68vh, 68dvh);
        max-height: min(68vh, 68dvh);
        border-radius: 16px 16px 0 0;
        border-bottom: 0;
        padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
        z-index: 56;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(var(--color-primary-rgb), 0.18);
    }

    #satellite-info-panel.hidden {
        transform: translateY(100%);
    }

    #satellite-info-panel:not(.hidden) {
        transform: translateY(0);
    }

    /* Drawer handle for info panel */
    #satellite-info-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--color-primary-dim);
        border-radius: 2px;
        margin: 0 auto 10px;
    }

    #satellite-info-panel #info-header {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--color-bg-panel-dark);
        padding-top: 4px;
    }

    #close-info-panel {
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
        font-size: 22px;
        padding: 0 12px;
    }

    /* --- STATS: Compact single line --- */
    #stats-panel {
        bottom: 10px;
        font-size: 12px;
        gap: 8px;
        padding: 5px 10px;
    }

    /* --- Multi-select & Settings panels --- */
    #multi-select-panel,
    #settings-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }

    /* --- Floating buttons: horizontal row --- */
    #fullscreen-btn,
    #hide-gui-btn,
    #multi-select-btn,
    #settings-btn,
    #donate-btn,
    #launch-director-btn {
        bottom: auto;
        top: 10px;
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
    }

    #fullscreen-btn { right: 10px; }
    #hide-gui-btn { right: 60px; }
    #multi-select-btn { right: 110px; }
    #settings-btn { right: 160px; }
    #donate-btn { right: 210px; }
    #launch-director-btn { right: 260px; }

    #account-quick-bar {
        top: 10px;
        right: 10px;
        left: auto;
        bottom: auto;
        height: 42px !important;
        gap: 5px !important;
        padding: 4px 6px !important;
    }

    .quick-audio-btn {
        min-height: 32px;
        height: 32px;
        padding: 0 9px;
    }

    #account-btn {
        position: relative;
        right: auto;
        top: auto;
        min-height: 32px;
        height: 32px;
        padding: 0 12px;
    }

    #account-btn.logged-in {
        width: var(--touch-target-min);
        min-width: var(--touch-target-min);
        height: var(--touch-target-min);
        padding: 0;
    }

    /* --- Touch targets --- */
    button,
    .system-btn,
    .time-btn,
    .quality-btn,
    .constellation-btn,
    .expand-btn,
    .reset-btn,
    #close-info-panel,
    #first-person-btn,
    #show-orbit-btn,
    #isolate-btn,
    #expand-info-btn {
        min-height: var(--touch-target-min);
    }

    .checkbox-wrapper {
        min-height: var(--touch-target-min);
        padding: 4px 0;
    }

    #search-box,
    .search-result-item {
        min-height: var(--touch-target-min);
    }

    .checkbox-wrapper input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    input[type=range]::-webkit-slider-thumb {
        height: 22px;
        width: 14px;
        margin-top: -9px;
    }

    input[type=range]::-moz-range-thumb {
        height: 22px;
        width: 14px;
    }

    /* --- Ground track map responsive --- */
    #ground-track-map {
        width: 100%;
        max-width: 100%;
    }

    /* --- Constellation grid 2 columns still works on mobile --- */
    .constellation-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .constellation-btn {
        min-height: var(--touch-target-min);
        font-size: 13px;
    }

    /* --- Hide shortcut hints on mobile --- */
    #shortcut-hint { display: none; }

    /* --- Location indicator --- */
    #location-indicator {
        bottom: 12px;
        left: 10px;
        right: auto;
        width: auto;
        max-width: calc(100vw - 90px);
    }

    h1 { font-size: 24px; letter-spacing: 2px; }
    .info-row { font-size: 16px; }
}

@media (max-width: 560px) {
    #fullscreen-btn,
    #hide-gui-btn,
    #multi-select-btn,
    #settings-btn,
    #donate-btn,
    #launch-director-btn {
        right: auto;
    }

    #fullscreen-btn { left: 8px; top: 8px; }
    #hide-gui-btn { left: 56px; top: 8px; }
    #multi-select-btn { left: 104px; top: 8px; }
    #settings-btn { left: 152px; top: 8px; }

    #donate-btn { left: 8px; top: 58px; }
    #launch-director-btn { left: 56px; top: 58px; }

    #account-quick-bar {
        right: 8px;
        bottom: 8px;
        left: auto;
    }

    #location-indicator {
        bottom: 18px;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    #ui-panel {
        padding: 10px 12px;
    }

    #stats-panel {
        font-size: 11px;
        gap: 6px;
        padding: 4px 8px;
    }

    .info-row { font-size: 15px; }
    h1 { font-size: 20px; }
}

/* --- FINAL OVERRIDES: AUTH + DONATION --- */

#auth-modal.is-open .auth-terminal {
    animation: authCardIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-input.typing {
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.2);
}

/* --- DONATE TERMINAL MODAL (APP) — CRT bezel --- */
.donate-terminal {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    max-height: min(90vh, 780px);
    overflow-y: auto;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(8, 14, 8, 0.97), rgba(2, 8, 4, 0.99));
    border: 2px solid rgba(var(--color-primary-rgb), 0.55);
    border-radius: 8px;
    padding: 10px 10px 18px;
    box-shadow:
        0 0 0 1px rgba(var(--color-primary-rgb), 0.12),
        0 0 40px rgba(var(--color-primary-rgb), 0.18),
        inset 0 0 60px rgba(var(--color-primary-rgb), 0.04),
        inset 0 0 0 1px rgba(0, 0, 0, 0.65),
        inset 0 0 0 5px rgba(20, 30, 22, 0.55),
        inset 0 0 0 6px rgba(var(--color-primary-rgb), 0.06),
        0 12px 36px rgba(0, 0, 0, 0.6);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.donate-terminal::before,
.donate-terminal::after {
    content: "";
    position: absolute;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2a4a32 0%, #0c1a0e 60%, #050a06 100%);
    box-shadow:
        inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.18),
        inset 0 -1px 2px rgba(0, 0, 0, 0.7),
        0 1px 1px rgba(0, 0, 0, 0.6);
    z-index: 3;
    pointer-events: none;
}
.donate-terminal::before { left: 6px; }
.donate-terminal::after  { right: 6px; }
.donate-terminal > .screw-bl,
.donate-terminal > .screw-br {
    position: absolute;
    bottom: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2a4a32 0%, #0c1a0e 60%, #050a06 100%);
    box-shadow:
        inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.18),
        inset 0 -1px 2px rgba(0, 0, 0, 0.7),
        0 1px 1px rgba(0, 0, 0, 0.6);
    z-index: 3;
    pointer-events: none;
}
.donate-terminal > .screw-bl { left: 6px; }
.donate-terminal > .screw-br { right: 6px; }
.donate-terminal > .term-plate {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 2.5px;
    color: rgba(var(--color-primary-rgb), 0.55);
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
}
.donate-terminal > .term-plate .led {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 4px var(--color-primary);
    animation: term-plate-led 2.4s ease-in-out infinite;
}
.donate-terminal > .term-plate .led.led-amber {
    background: #ffc800;
    box-shadow: 0 0 4px #ffc800;
    animation-delay: 0.4s;
}
@keyframes term-plate-led {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
.donate-titlebar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 8px 28px;
    background:
        linear-gradient(180deg, rgba(0, 30, 8, 0.65), rgba(0, 14, 4, 0.65));
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.35);
    border-radius: 4px 4px 0 0;
}
.donate-titlebar::before {
    content: "■";
    color: var(--color-primary);
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.6);
    font-size: 8px;
    opacity: 0.7;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}
.donate-titlebar-text {
    font-size: 11px;
    letter-spacing: 0.8px;
    color: rgba(var(--color-primary-rgb), 0.6);
    font-family: 'JetBrains Mono', monospace;
}
.donate-close {
    background: none;
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.donate-close:hover {
    background: rgba(255, 0, 60, 0.2);
    border-color: rgba(255, 0, 60, 0.6);
    color: #ff4466;
}
.donate-body {
    position: relative;
    padding: 24px 26px 22px;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(0, 24, 6, 0.55) 0%, rgba(0, 8, 2, 0.85) 80%);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}
.donate-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(0, 0, 0, 0.18) 3px,
        rgba(0, 0, 0, 0.18) 4px
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}
.donate-body::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}
.donate-body > * { position: relative; z-index: 2; }
.donate-header {
    margin-bottom: 18px;
}
.donate-prompt {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(var(--color-primary-rgb), 0.6);
    font-family: 'JetBrains Mono', monospace;
}
.donate-title {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: var(--color-primary, #00ff41);
    text-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.3);
    letter-spacing: 2px;
    line-height: 1.1;
    font-family: 'JetBrains Mono', monospace;
}
.donate-desc {
    margin: 0;
    font-size: 13px;
    color: rgba(180, 255, 190, 0.75);
    line-height: 1.45;
    font-family: 'JetBrains Mono', monospace;
}
.donate-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.donate-col {
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    background: rgba(var(--color-primary-rgb), 0.03);
    padding: 12px 14px;
}
.donate-col-accent {
    border-color: rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.03);
}
.donate-col-label {
    margin: 0 0 10px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: rgba(var(--color-primary-rgb), 0.55);
    font-family: 'JetBrains Mono', monospace;
}
.donate-col-accent .donate-col-label {
    color: rgba(0, 229, 255, 0.6);
}
.donate-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: rgba(200, 255, 210, 0.85);
    font-family: 'JetBrains Mono', monospace;
}
.donate-list-accent {
    color: rgba(180, 230, 255, 0.85);
}
.donate-bullet {
    color: rgba(var(--color-primary-rgb), 0.4);
    margin-right: 4px;
}
.donate-col-accent .donate-bullet {
    color: rgba(0, 229, 255, 0.4);
}
.donate-actions {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}
.donate-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}
.donate-btn-icon {
    font-size: 18px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    border-color: inherit;
    opacity: 0.6;
    flex-shrink: 0;
}
.donate-btn-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.donate-btn-name {
    font-size: 15px;
    letter-spacing: 2px;
}
.donate-btn-sub {
    font-size: 11px;
    opacity: 0.7;
}
.donate-stripe {
    color: #b0b8ff;
    border-color: rgba(120, 132, 255, 0.45);
    background: rgba(100, 112, 230, 0.08);
}
.donate-stripe:hover {
    background: rgba(100, 112, 230, 0.18);
    box-shadow: 0 0 18px rgba(100, 112, 230, 0.2);
}
.donate-paypal {
    color: #80ccff;
    border-color: rgba(0, 160, 255, 0.4);
    background: rgba(0, 112, 186, 0.08);
}
.donate-paypal:hover {
    background: rgba(0, 112, 186, 0.18);
    box-shadow: 0 0 18px rgba(0, 160, 255, 0.2);
}
.donate-kofi {
    color: #ffb0a8;
    border-color: rgba(255, 100, 95, 0.45);
    background: rgba(255, 80, 75, 0.08);
}
.donate-kofi:hover {
    background: rgba(255, 80, 75, 0.18);
    box-shadow: 0 0 18px rgba(255, 100, 95, 0.2);
}
.donate-founder {
    margin-top: 14px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.15);
    padding-top: 14px;
}
.donate-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(180, 255, 190, 0.8);
    cursor: pointer;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}
.donate-checkbox input[type="checkbox"] {
    accent-color: var(--color-primary, #00ff41);
    width: 14px;
    height: 14px;
}
.donate-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 15, 0, 0.6);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    color: var(--color-primary, #00ff41);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    outline: none;
    margin-bottom: 6px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.donate-input::placeholder {
    color: rgba(var(--color-primary-rgb), 0.3);
}
.donate-input:focus {
    border-color: rgba(var(--color-primary-rgb), 0.5);
}
.donate-status {
    font-size: 11px;
    color: rgba(var(--color-primary-rgb), 0.7);
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}
.donate-footer {
    margin: 0;
    font-size: 11px;
    color: rgba(var(--color-primary-rgb), 0.45);
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.1);
    padding-top: 12px;
    line-height: 1.4;
    font-family: 'JetBrains Mono', monospace;
}
@media (max-width: 600px) {
    .donate-columns {
        grid-template-columns: 1fr;
    }
    .donate-body {
        padding: 16px 18px 16px;
    }
}

/* ================================================================
   DONATION MODAL — "Transmission Packet" (theme-adaptive, rebuilt)
   Matches the .donate-card markup in app.html / landing.html
   ================================================================ */
.donate-card {
    position: relative;
    width: min(540px, calc(100vw - 28px));
    max-height: min(92vh, 860px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 18px 16px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-text);
    background:
        repeating-linear-gradient(180deg, rgba(var(--color-primary-rgb),0.025) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.98));
    border: 1px solid rgba(var(--color-primary-rgb), 0.55);
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.6),
        0 0 44px rgba(var(--color-primary-rgb), 0.16),
        inset 0 0 70px rgba(var(--color-primary-rgb), 0.045),
        0 24px 60px rgba(0, 0, 0, 0.65);
    animation: donateCardPop 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes donateCardPop {
    0% { opacity: 0; transform: translateY(18px) scale(0.965); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.donate-card-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    border-radius: 4px;
    color: var(--color-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 6;
    transition: all 0.18s;
}
.donate-card-close:hover {
    color: #ff5050;
    border-color: rgba(255, 80, 80, 0.45);
    box-shadow: 0 0 12px rgba(255, 80, 80, 0.35);
}
.donate-class-stripe {
    display: flex;
    justify-content: center;
    padding: 4px 8px;
    border: 1px dashed rgba(var(--color-secondary-rgb), 0.45);
    background: rgba(var(--color-secondary-rgb), 0.05);
    border-radius: 3px;
}
.donate-class-stripe-top { margin: 2px 30px 12px 0; }
.donate-class-stripe-bot { margin: 14px 0 2px; }
.donate-class-text {
    font-size: 9px;
    letter-spacing: 2.5px;
    color: var(--color-secondary);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.donate-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.donate-head-meta { display: flex; flex-direction: column; gap: 5px; }
.donate-packet-id { font-size: 10px; letter-spacing: 2px; color: var(--color-text-dim); }
.donate-timestamp {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--color-text-dim);
}
.donate-ts-led {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary);
    animation: donateLedBlink 1.8s ease-in-out infinite;
}
@keyframes donateLedBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.donate-insignia {
    color: rgba(var(--color-primary-rgb), 0.6);
    flex-shrink: 0;
    animation: donateInsigniaSpin 32s linear infinite;
}
.donate-insignia svg { display: block; width: 52px; height: 52px; }
@keyframes donateInsigniaSpin { to { transform: rotate(360deg); } }
.donate-title-row {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "mark title" "mark sub";
    column-gap: 10px;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.18);
}
.donate-prompt-mark {
    grid-area: mark;
    align-self: center;
    font-size: 26px;
    color: var(--color-secondary);
    text-shadow: 0 0 8px rgba(var(--color-secondary-rgb), 0.4);
}
.donate-card-title {
    grid-area: title;
    font-family: var(--font-display, var(--font-mono));
    font-size: 30px;
    line-height: 1;
    letter-spacing: 3px;
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.6);
}
.donate-card-subtitle { grid-area: sub; font-size: 12px; color: var(--color-text-dim); margin-top: 4px; }
.donate-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.donate-data-section {
    padding: 11px 12px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.22);
    border-radius: 4px;
    background: rgba(var(--color-primary-rgb), 0.03);
}
.donate-data-section--accent {
    border-color: rgba(var(--color-secondary-rgb), 0.35);
    background: rgba(var(--color-secondary-rgb), 0.05);
}
.donate-data-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.15);
}
.donate-data-tag {
    font-size: 9px;
    letter-spacing: 1px;
    padding: 2px 5px;
    color: #000;
    background: var(--color-primary);
    border-radius: 2px;
    font-weight: 700;
}
.donate-data-section--accent .donate-data-tag { background: var(--color-secondary); }
.donate-data-title { font-size: 10px; letter-spacing: 1.5px; color: var(--color-text-dim); }
.donate-data-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.donate-data-list li { display: flex; gap: 8px; font-size: 11.5px; line-height: 1.35; color: var(--color-text); }
.donate-data-bullet { color: var(--color-primary); flex-shrink: 0; }
.donate-data-section--accent .donate-data-bullet { color: var(--color-secondary); }
.donate-amount-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(var(--color-secondary-rgb), 0.35);
    border-radius: 4px;
    background: rgba(var(--color-secondary-rgb), 0.06);
}
.donate-amount-figure {
    font-family: var(--font-display, var(--font-mono));
    font-size: 22px;
    line-height: 1;
    letter-spacing: 2px;
    color: var(--color-secondary);
    text-shadow: 0 0 8px rgba(var(--color-secondary-rgb), 0.4);
    flex-shrink: 0;
}
.donate-amount-text { font-size: 11px; line-height: 1.45; color: var(--color-text); }
.donate-channels { margin-bottom: 4px; }
.donate-channels-label { font-size: 9px; letter-spacing: 2px; color: var(--color-text-dim); margin-bottom: 9px; }
.donate-channels-grid { display: grid; gap: 9px; }
.donate-card .donate-ch {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    text-decoration: none;
    border: 1px solid rgba(var(--color-primary-rgb), 0.4);
    border-radius: 4px;
    background: rgba(var(--color-primary-rgb), 0.04);
    color: var(--color-primary);
    transition: background 0.18s, box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}
.donate-card .donate-ch:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.7);
    box-shadow: 0 0 22px rgba(var(--color-primary-rgb), 0.2), inset 0 0 18px rgba(var(--color-primary-rgb), 0.06);
    transform: translateY(-1px);
}
.donate-ch-num {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--color-text-dim);
    padding-right: 12px;
    border-right: 1px solid rgba(var(--color-primary-rgb), 0.2);
    flex-shrink: 0;
}
.donate-ch-body { display: flex; flex-direction: column; gap: 2px; }
.donate-ch-name {
    font-family: var(--font-display, var(--font-mono));
    font-size: 18px;
    letter-spacing: 2px;
    color: var(--color-primary);
    text-shadow: 0 0 6px rgba(var(--color-primary-rgb), 0.4);
}
.donate-ch-sub { font-size: 9px; letter-spacing: 1.5px; color: var(--color-text-dim); }
.donate-ch-arrow { margin-left: auto; font-size: 18px; color: var(--color-primary); transition: transform 0.2s; }
.donate-card .donate-ch:hover .donate-ch-arrow { transform: translateX(4px); }
.donate-card .donate-ch-bizum { border-color: rgba(var(--color-secondary-rgb), 0.4); }
.donate-card .donate-ch-bizum .donate-ch-name,
.donate-card .donate-ch-bizum .donate-ch-arrow {
    color: var(--color-secondary);
    text-shadow: 0 0 6px rgba(var(--color-secondary-rgb), 0.4);
}
.donate-card .donate-ch-bizum:hover {
    background: rgba(var(--color-secondary-rgb), 0.08);
    border-color: rgba(var(--color-secondary-rgb), 0.7);
    box-shadow: 0 0 22px rgba(var(--color-secondary-rgb), 0.18);
}
.donate-card-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.15);
}
.donate-foot-tag { font-size: 10px; letter-spacing: 2px; color: var(--color-secondary); opacity: 0.85; }
.donate-foot-text { font-size: 11px; color: var(--color-text-dim); }

/* SEC 03 — Crew manifest enlistment */
.donate-enlist {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.22);
    border-radius: 4px;
    background: rgba(var(--color-primary-rgb), 0.03);
}
.donate-enlist-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.15);
}
.donate-enlist-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    color: var(--color-text);
    cursor: pointer;
    margin-bottom: 10px;
}
.donate-enlist-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.donate-check-box {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    border-radius: 2px;
    background: rgba(0,0,0,0.4);
    position: relative;
    transition: all 0.15s;
}
.donate-enlist-check input:checked + .donate-check-box {
    background: var(--color-primary);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.5);
}
.donate-enlist-check input:checked + .donate-check-box::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.donate-enlist-check input:focus-visible + .donate-check-box {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}
.donate-enlist-input {
    width: 100%;
    padding: 9px 11px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    border-radius: 3px;
    color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.donate-enlist-input::placeholder { color: rgba(var(--color-primary-rgb), 0.35); letter-spacing: 1.5px; }
.donate-enlist-input:focus {
    border-color: rgba(var(--color-primary-rgb), 0.6);
    box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.18);
}
.donate-enlist-status { font-size: 10.5px; color: var(--color-text-dim); margin-top: 6px; min-height: 13px; }

@media (max-width: 560px) {
    .donate-card { padding: 12px 13px 14px; }
    .donate-card-title { font-size: 25px; }
    .donate-data-grid { grid-template-columns: 1fr; }
    .donate-class-text { font-size: 8px; letter-spacing: 1.5px; }
}

/* ================================================================
   DONATION MODAL v3 — "Mission Support" (minimal, theme-adaptive)
   ================================================================ */
.dn-card {
    position: relative;
    width: min(412px, calc(100vw - 28px));
    padding: 30px 28px 22px;
    text-align: center;
    border-radius: 18px;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(var(--color-primary-rgb),0.13), transparent 55%),
        linear-gradient(180deg, rgba(0,0,0,0.93), rgba(0,0,0,0.98));
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.5),
        0 0 60px rgba(var(--color-primary-rgb),0.14),
        inset 0 1px 0 rgba(var(--color-primary-rgb),0.12),
        0 30px 70px rgba(0,0,0,0.7);
    overflow: hidden;
    animation: dnPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
@keyframes dnPop {
    0% { opacity: 0; transform: translateY(22px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.dn-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-radius: 50%;
    color: var(--color-text-dim);
    font-size: 19px; line-height: 1;
    cursor: pointer;
    transition: all 0.18s;
    z-index: 4;
}
.dn-close:hover { color: var(--color-primary); border-color: rgba(var(--color-primary-rgb),0.55); transform: rotate(90deg); }
.dn-orbit { position: relative; width: 100%; height: 138px; margin: 2px auto 12px; }
.dn-ascii-canvas {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-primary);
    filter: drop-shadow(0 0 6px rgba(var(--color-primary-rgb),0.4));
    pointer-events: none;
}
.dn-tier-name.dn-scrambling { color: var(--color-primary); text-shadow: 0 0 10px rgba(var(--color-primary-rgb),0.7); }
.dn-title {
    font-family: var(--font-display, var(--font-mono));
    font-size: 30px;
    letter-spacing: 2px;
    color: var(--color-primary);
    text-shadow: 0 0 12px rgba(var(--color-primary-rgb),0.6);
    margin-bottom: 18px;
}
.dn-amounts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.dn-chip {
    min-width: 56px; padding: 10px 0; flex: 1 1 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px; font-weight: 700;
    color: var(--color-text);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: 10px;
    cursor: pointer; transition: all 0.16s;
}
.dn-chip:hover { border-color: rgba(var(--color-primary-rgb), 0.6); color: var(--color-primary); }
.dn-chip--on {
    color: #001008;
    background: var(--color-primary);
    border-color: transparent;
    box-shadow: 0 0 18px rgba(var(--color-primary-rgb),0.45);
}
.dn-chip-custom { font-size: 13px; }
.dn-custom-wrap { position: relative; width: 160px; margin: 0 auto 14px; }
.dn-custom-cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-dim); font-family: 'JetBrains Mono', monospace; font-size: 15px; }
.dn-custom-input {
    width: 100%; padding: 10px 12px 10px 26px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    border-radius: 10px;
    color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 15px; text-align: center; outline: none;
}
.dn-custom-input:focus { border-color: rgba(var(--color-primary-rgb), 0.65); box-shadow: 0 0 14px rgba(var(--color-primary-rgb),0.18); }
.dn-custom-input::-webkit-outer-spin-button,
.dn-custom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dn-tier {
    display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--color-text-dim);
}
.dn-tier-dot { width: 8px; height: 8px; border-radius: 50%; transition: all 0.2s; }
.dn-tier-dot[data-tier="supporter"] { background: #00ff41; box-shadow: 0 0 8px #00ff41; }
.dn-tier-dot[data-tier="patron"]    { background: #00e5ff; box-shadow: 0 0 8px #00e5ff; }
.dn-tier-dot[data-tier="pioneer"]   { background: #ffcc00; box-shadow: 0 0 8px #ffcc00; }
.dn-tier-name { color: var(--color-text); }
.dn-cta {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 15px 18px;
    font-family: var(--font-display, var(--font-mono));
    font-size: 21px; letter-spacing: 2px;
    color: #001008;
    background: var(--color-primary);
    border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 0 26px rgba(var(--color-primary-rgb),0.4), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
}
.dn-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 34px rgba(var(--color-primary-rgb),0.55), inset 0 1px 0 rgba(255,255,255,0.5); }
.dn-cta:active { transform: translateY(0); }
.dn-cta[disabled] { filter: grayscale(0.6) brightness(0.7); cursor: wait; transform: none; }
.dn-cta-arrow { transition: transform 0.18s; }
.dn-cta:hover .dn-cta-arrow { transform: translateX(4px); }
.dn-status { min-height: 14px; margin-top: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--color-secondary); }
.dn-trust {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 1px; color: var(--color-text-dim);
}
.dn-lock { opacity: 0.8; }
.dn-mural {
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
    margin-top: 14px;
    font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--color-text-dim); cursor: pointer;
}
.dn-mural input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.dn-mural-box {
    width: 15px; height: 15px; flex-shrink: 0;
    border: 1px solid rgba(var(--color-primary-rgb), 0.5);
    border-radius: 3px; background: rgba(0,0,0,0.4); position: relative; transition: all 0.15s;
}
.dn-mural input:checked + .dn-mural-box { background: var(--color-primary); box-shadow: 0 0 8px rgba(var(--color-primary-rgb),0.5); }
.dn-mural input:checked + .dn-mural-box::after {
    content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
    border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.dn-mural input:focus-visible + .dn-mural-box { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.dn-mural-name {
    width: 124px; padding: 6px 9px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    border-radius: 6px; color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 11px; outline: none;
}
.dn-mural-name:focus { border-color: rgba(var(--color-primary-rgb), 0.6); }
@media (prefers-reduced-motion: reduce) {
    .dn-card { animation: none; }
}
@media (max-width: 440px) {
    .dn-card { padding: 26px 18px 18px; }
    .dn-title { font-size: 26px; }
    .dn-chip { font-size: 14px; min-width: 48px; }
}


/* ================================================================
   ORBIT SANDBOX — "Orbital Design Console" (elevated sci-fi panel)
   ================================================================ */
.dock-btn--cyan { border: 1px solid rgba(var(--color-secondary-rgb), 0.5); color: rgba(var(--color-secondary-rgb), 0.85); }
.dock-btn--cyan:hover { border-color: var(--color-secondary); color: var(--color-secondary); background: linear-gradient(180deg, rgba(var(--color-secondary-rgb), 0.2), rgba(var(--color-secondary-rgb), 0.06)); box-shadow: 0 0 12px rgba(var(--color-secondary-rgb), 0.4), inset 0 0 6px rgba(var(--color-secondary-rgb), 0.15); transform: translateY(-1px); }


/* ================================================================
   ================================================================
   AWWWARDS OVERHAUL LAYER — APP v2
   ================================================================
   Additive polish layer for the main app. Theme-safe: every color
   goes through the --color-* custom properties the four skins
   already override. Nothing above is removed — only refined.
   ================================================================ */

/* ----------------------------------------------------------------
   CUSTOM RANGE SLIDERS — replace browser defaults everywhere
   ---------------------------------------------------------------- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(90deg,
        rgba(var(--color-primary-rgb), 0.45),
        rgba(var(--color-primary-rgb), 0.12));
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -6px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 55%),
        var(--color-primary);
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.55);
    transition: box-shadow 0.2s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.8);
}

input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.05); }

input[type="range"]::-moz-range-track {
    height: 4px;
    background: linear-gradient(90deg,
        rgba(var(--color-primary-rgb), 0.45),
        rgba(var(--color-primary-rgb), 0.12));
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.55);
    transition: box-shadow 0.2s ease, transform 0.15s;
}

input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.8);
}

/* Settings panel sliders pick up the lavender settings accent */
#settings-panel input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.5), rgba(var(--color-primary-rgb), 0.1));
    border-color: rgba(var(--color-primary-rgb), 0.3);
}
#settings-panel input[type="range"]::-webkit-slider-thumb {
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), transparent 55%),
        var(--color-settings);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.55);
}
#settings-panel input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.5), rgba(var(--color-primary-rgb), 0.1));
    border-color: rgba(var(--color-primary-rgb), 0.3);
}
#settings-panel input[type="range"]::-moz-range-thumb {
    background: var(--color-settings);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.55);
}

/* ----------------------------------------------------------------
   SETTINGS PANEL — sections become cards with header accents
   ---------------------------------------------------------------- */
#settings-panel .settings-section {
    position: relative;
    padding: 12px 12px 10px;
    margin-bottom: 14px;
    background: linear-gradient(170deg, rgba(var(--color-primary-rgb), 0.035), rgba(0, 0, 0, 0.25));
    border: 1px solid rgba(var(--color-primary-rgb), 0.14);
    border-radius: 3px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#settings-panel .settings-section:hover {
    border-color: rgba(var(--color-primary-rgb), 0.3);
    box-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.06), inset 0 0 20px rgba(var(--color-primary-rgb), 0.03);
}

#settings-panel .settings-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10px;
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, var(--color-settings), transparent);
    opacity: 0.7;
}

#settings-panel .settings-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 2px;
}

#settings-panel .settings-section h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.25), transparent);
}

/* Toggle switch: satisfying snap + glow on state change */
.settings-toggle input[type="checkbox"]::before {
    transition: left 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.22s, box-shadow 0.22s;
}

.settings-toggle:active input[type="checkbox"]::before { transform: scaleX(1.2); }

/* ----------------------------------------------------------------
   ACTION DOCK — donate heartbeat + gradient separator
   ---------------------------------------------------------------- */
#donate-btn { animation: donateBtnPulse 4s ease-in-out infinite; }
#donate-btn:hover { animation: none; }

.dock-separator-v {
    background: linear-gradient(180deg,
        transparent,
        rgba(var(--color-primary-rgb), 0.5),
        transparent) !important;
    width: 1px;
}

/* Launch Director dock button: exhaust flicker on hover */
#launch-director-btn:hover svg {
    animation: dockExhaust 0.5s ease-in-out infinite;
}

@keyframes dockExhaust {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 2px 3px rgba(255, 165, 0, 0.5)); }
    50%      { transform: translateY(-1px); filter: drop-shadow(0 4px 5px rgba(255, 165, 0, 0.8)); }
}

/* ----------------------------------------------------------------
   STATS PANEL — floating glass pill
   ---------------------------------------------------------------- */
#stats-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#stats-panel:hover {
    border-color: rgba(var(--color-primary-rgb), 0.5);
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.15), inset 0 0 20px rgba(var(--color-primary-rgb), 0.04);
}

/* ----------------------------------------------------------------
   SATELLITE INFO PANEL — action buttons polish
   ---------------------------------------------------------------- */
#toggle-orbit-btn,
#first-person-btn,
#isolate-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.22s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

#toggle-orbit-btn:hover,
#first-person-btn:hover,
#isolate-btn:hover { transform: translateY(-1px); }

#toggle-orbit-btn:active,
#first-person-btn:active,
#isolate-btn:active { transform: translateY(0) scale(0.985); }


/* ================================================================
   ORBITAL LOADER — un lanzamiento en pixel art
   ================================================================
   orbital-loader.js pinta la escena a baja resolucion; aqui el lienzo
   se escala sin suavizado (pixeles nitidos) y el HUD se compone
   alrededor: marca y fase arriba, estado y altitud abajo. El centro
   queda libre para el cohete.
   ================================================================ */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    background: #0b2a1a;
}

#ol-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Salida: la escena avanza un poco hacia el satelite y se funde con la
   camara de la app, que arranca con el mismo encuadre (el limbo abajo).
   Solo opacidad y transformacion: el compositor las anima aunque la app
   este ocupada montando la escena 3D, asi que el fundido nunca se congela. */
#loading-overlay.ol-out { background: transparent; pointer-events: none; }
#loading-overlay.ol-out .ol-hud { opacity: 0; transition: opacity 0.45s ease-out; }
#loading-overlay.ol-out #ol-canvas {
    transform-origin: 50% 42%;
    animation: ol-exit 1.4s cubic-bezier(0.45, 0, 0.3, 1) forwards;
}
#loading-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse at 50% 42%, transparent 35%, rgba(0, 0, 0, 0.7) 100%);
}
#loading-overlay.ol-out::after { animation: ol-bloom 1.4s ease-out forwards; }
/* La salida se oscurece en vez de encenderse: debajo espera el espacio
   negro de la app, y un fogonazo blanco antes de el deslumbra */
@keyframes ol-exit {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.18); }
}
@keyframes ol-bloom {
    0%   { opacity: 0; }
    35%  { opacity: 1; }
    100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    #loading-overlay.ol-out #ol-canvas,
    #loading-overlay.ol-out::after { animation: none; }
    #loading-overlay.ol-out #ol-canvas { opacity: 0; transition: opacity 0.6s ease-out; }
}

.ol-hud {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(18px, 4vh, 44px) clamp(18px, 4vw, 52px);
    font-family: 'VT323', monospace;
    color: #8ff5ad;
    text-shadow: 0 2px 0 #010604;
}

.ol-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 1.6vh, 16px);
}

.ol-brand {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'VT323', monospace;
    font-weight: 400;
    font-size: clamp(26px, 3.4vw, 42px);
    letter-spacing: 0.22em;
    line-height: 1;
    color: #39d96a;
}

.ol-logo {
    width: 0.9em;
    height: 0.9em;
    color: #39d96a;
    filter: drop-shadow(0 2px 0 #010604);
}

/* Mission phase: pixel-font callout that pops on every change */

.ol-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(520px, 100%);
    align-self: center;
}

.ol-readout {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.ol-status {
    font-size: clamp(14px, 1.4vw, 18px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8ff5ad;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ol-numbers { display: inline-flex; gap: 16px; align-items: baseline; flex-shrink: 0; }
.ol-alt { font-size: clamp(14px, 1.4vw, 18px); letter-spacing: 0.1em; color: #39d96a; }
.ol-percent {
    font-size: clamp(24px, 2.8vw, 34px);
    line-height: 1;
    color: #e6fff0;
    min-width: 3ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Chunky pixel progress bar */
.ol-bar {
    height: 8px;
    padding: 2px;
    background: #010604;
    box-shadow: 0 0 0 2px #1c7a3c;
}
.ol-bar i {
    display: block;
    height: 100%;
    background: repeating-linear-gradient(90deg, #39d96a 0 6px, #1c7a3c 6px 8px);
    transform: scaleX(0);
    transform-origin: left;
}

@media (max-width: 560px) {
    .ol-readout { flex-direction: column; align-items: center; gap: 4px; }
    .ol-status { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
}


/* ----------------------------------------------------------------
   REDUCED MOTION — this layer degrades cleanly
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    #donate-btn,
    #launch-director-btn:hover svg,
    .ld-stage.active .ld-stage-dot,
    .ld-stage.done .ld-stage-dot,
    .ld-telem-box::after,
    .ld-launch-btn:not(:disabled):hover .ld-launch-btn-icon {
        animation: none;
    }

}

/* ================================================================
   LAUNCH DIRECTOR + ORBIT SANDBOX — pixel arcade
   ================================================================
   Both tools share one hardware language: 3px ink outlines, bevels
   made of hard inset shadows, stepped corners and a PICO-8 palette.
   Launch Director wears orange and a red arcade button; the Orbit
   Sandbox wears blue. Movement snaps with steps() like sprites do.
   ================================================================ */
#launch-director-panel,
#orbit-sandbox-panel {
    --px-ink: #0b0f14;
    --px-navy: #1d2b53;
    --px-slate: #29384f;
    --px-plum: #7e2553;
    --px-grey: #5f574f;
    --px-silver: #c2c3c7;
    --px-white: #fff1e8;
    --px-red: #ff004d;
    --px-orange: #ffa300;
    --px-yellow: #ffec27;
    --px-lime: #00e436;
    --px-blue: #29adff;
    --px-lavender: #83769c;
    --px-pink: #ff77a8;
    --px-display: 'Silkscreen', 'VT323', monospace;
    --px-body: 'VT323', monospace;
    --px-notch: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
    position: absolute;
    top: 16px;
    right: 16px;
    width: 404px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    padding: 0 8px 8px 0;
    background: transparent;
    border: none;
    filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.55));
    scrollbar-width: thin;
    scrollbar-color: var(--px-lavender) transparent;
}
#launch-director-panel { --px-acc: var(--px-orange); --px-acc-dark: #ab5236; --px-acc-light: #ffd27a; }
#launch-director-panel::-webkit-scrollbar,
#orbit-sandbox-panel::-webkit-scrollbar { width: 6px; }
#launch-director-panel::-webkit-scrollbar-thumb { background: var(--px-lavender); }
#launch-director-panel.is-launching { visibility: hidden; }

.ldp {
    position: relative;
    padding: 12px 14px 14px;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.09) 0 3px, transparent 3px 6px),
        var(--px-navy);
    color: var(--px-white);
    font-family: var(--px-body);
    font-size: 18px;
    line-height: 1.1;
    clip-path: var(--px-notch);
    box-shadow:
        inset 0 0 0 3px var(--px-ink),
        inset 6px 6px 0 0 rgba(255, 255, 255, 0.1),
        inset -6px -6px 0 0 rgba(0, 0, 0, 0.3);
}

.ldp button { font-family: var(--px-display); border-radius: 0; }
.ldp :focus-visible { outline: 3px solid var(--px-yellow) !important; outline-offset: 2px; }

/* ── header ── */
.ldp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 3px solid var(--px-ink);
    box-shadow: 0 3px 0 rgba(255, 255, 255, 0.08);
}
.ldp-brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ldp-title {
    font-family: var(--px-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--px-acc);
    text-shadow: 2px 2px 0 var(--px-ink);
}
.ldp-sub { font-size: 16px; color: var(--px-lavender); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldp-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--px-display);
    font-size: 10px;
    color: var(--px-silver);
}
#launch-director-panel .ld-status-led {
    width: 8px;
    height: 8px;
    background: var(--px-lime);
    box-shadow: 0 0 0 2px var(--px-ink);
}
#launch-director-panel .ld-status-led.ld-led-active {
    background: var(--px-red);
    animation: pxBlink 0.5s steps(1) infinite;
}
.ldp-close {
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 14px;
    color: var(--px-white);
    background: var(--px-red);
    border: 3px solid var(--px-ink);
    box-shadow: inset -3px -3px 0 var(--px-plum), inset 3px 3px 0 var(--px-pink);
    cursor: pointer;
}
.ldp-close:hover { filter: brightness(1.12); }
.ldp-close:active { box-shadow: inset 3px 3px 0 var(--px-plum); }

/* ── the little screen ── */
.ldp-screen {
    position: relative;
    margin-bottom: 10px;
    background: #0b1030;
    border: 3px solid var(--px-ink);
    box-shadow: 0 0 0 3px var(--px-slate);
    margin-inline: 3px;
}
.ldp-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 4px);
    pointer-events: none;
}
.ldp-desk {
    display: block;
    width: 100%;
    height: 180px;
    image-rendering: pixelated;
}

.ldp-verdict {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 7px 4px;
    font-family: var(--px-display);
    font-size: 10px;
    color: var(--px-ink);
    background: var(--px-lime);
    box-shadow: 0 0 0 2px var(--px-ink);
}
.ldp-verdict::before { content: ''; width: 5px; height: 5px; background: currentColor; animation: pxBlink 1s steps(1) infinite; }
.ldp-verdict.is-elliptical { background: var(--px-yellow); }
.ldp-verdict.is-decay { background: var(--px-red); color: var(--px-white); }
.ldp-verdict.is-escape { background: var(--px-orange); }

/* ── speed gauge ── */
.ldp-gauge { padding: 8px 3px 4px; margin-bottom: 8px; }
.ldp-gauge-bar {
    position: relative;
    display: flex;
    height: 24px;
    border: 3px solid var(--px-ink);
}
.ldp-zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.14) 0 3px, transparent 3px 9px);
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.ldp-zone + .ldp-zone { border-left: 2px solid var(--px-ink); }
.ldp-zone i {
    font-style: normal;
    font-family: var(--px-display);
    font-size: 8px;
    color: var(--px-ink);
    white-space: nowrap;
    overflow: hidden;
}
.ldp-zone--decay { background-color: var(--px-red); }
.ldp-zone--elliptical { background-color: var(--px-yellow); }
.ldp-zone--stable { background-color: var(--px-lime); }
.ldp-zone--escape { background-color: var(--px-orange); }
.ldp-zone--decay i { color: var(--px-white); }
.ldp-gauge-needle {
    position: absolute;
    top: -9px;
    bottom: -9px;
    left: 50%;
    width: 4px;
    margin-left: -2px;
    background: var(--px-white);
    box-shadow: 0 0 0 2px var(--px-ink);
    transition: left 0.18s steps(3);
}
.ldp-gauge-needle::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -6px;
    width: 12px;
    height: 4px;
    background: var(--px-white);
    box-shadow: 0 0 0 2px var(--px-ink);
}

/* ── parameters ── */
.ldp-param-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}
.ldp-k {
    font-family: var(--px-display);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--px-lavender);
}
.ldp-v b { font-size: 28px; font-weight: 400; color: var(--px-yellow); text-shadow: 2px 2px 0 var(--px-ink); }
.ldp-v i { font-style: normal; font-size: 16px; color: var(--px-silver); margin-left: 4px; }

.ldp .ld-slider {
    --fill: 50%;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 24px;
    margin: 0 0 8px;
    background: transparent;
    cursor: pointer;
}
.ldp .ld-slider::-webkit-slider-runnable-track {
    box-sizing: border-box;
    height: 16px;
    border: 3px solid var(--px-ink);
    background: linear-gradient(90deg, var(--px-acc) var(--fill), var(--px-slate) var(--fill));
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}
.ldp .ld-slider::-moz-range-track {
    box-sizing: border-box;
    height: 16px;
    border: 3px solid var(--px-ink);
    background: var(--px-slate);
}
.ldp .ld-slider::-moz-range-progress { height: 10px; background: var(--px-acc); }
.ldp .ld-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 16px;
    height: 24px;
    margin-top: -7px;
    background: var(--px-white);
    border: 3px solid var(--px-ink);
    border-radius: 0;
    box-shadow: inset -3px -3px 0 var(--px-silver);
}
.ldp .ld-slider::-moz-range-thumb {
    box-sizing: border-box;
    width: 16px;
    height: 24px;
    background: var(--px-white);
    border: 3px solid var(--px-ink);
    border-radius: 0;
    box-shadow: inset -3px -3px 0 var(--px-silver);
}
.ldp .ld-slider:active::-webkit-slider-thumb { background: var(--px-yellow); box-shadow: inset -3px -3px 0 var(--px-orange); }

/* chunky keycaps: presets, tabs, modes */
.ldp .ld-preset,
.ldp-result-follow {
    color: var(--px-white);
    background: var(--px-slate);
    border: 3px solid var(--px-ink);
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.35), inset 3px 3px 0 rgba(255, 255, 255, 0.14);
    cursor: pointer;
}
.ldp .ld-preset:hover,
.ldp-result-follow:hover { background: var(--px-plum); }
.ldp .ld-preset:active,
.ldp-result-follow:active { box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.4); transform: translateY(2px); }

.ldp-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: -2px 0 10px;
}
.ldp .ld-preset { padding: 7px 0 8px; font-size: 11px; }

/* ── telemetry ── */
.ldp-telem {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 4px 0 10px;
}
.ldp-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px 8px 4px;
    background: var(--px-ink);
    box-shadow: inset 3px 0 0 var(--px-lavender);
    min-width: 0;
}
.ldp-cell .ldp-k { font-size: 8px; }
.ldp-cell-v { font-size: 21px; white-space: nowrap; }
.ldp-cell.is-stable .ldp-cell-v { color: var(--px-lime); }
.ldp-cell.is-elliptical .ldp-cell-v { color: var(--px-yellow); }
.ldp-cell.is-decay .ldp-cell-v { color: var(--px-red); }
.ldp-cell.is-escape .ldp-cell-v { color: var(--px-orange); }

/* ── mission result ── */
#launch-director-panel .launch-result:empty { display: none; }
#launch-director-panel .launch-result {
    --res: var(--px-lime);
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 3px 12px;
    padding: 10px 12px 12px;
    background: var(--px-ink);
    box-shadow: 0 0 0 3px var(--res);
    animation: pxPop 0.3s steps(3) both;
}
#launch-director-panel .launch-result:focus { outline: none !important; }
#launch-director-panel .launch-result.is-elliptical { --res: var(--px-yellow); }
#launch-director-panel .launch-result.is-decay { --res: var(--px-red); }
#launch-director-panel .launch-result.is-escape { --res: var(--px-orange); }
.ldp-result-title { font-family: var(--px-display); font-size: 16px; font-weight: 700; color: var(--res); }
.ldp-result-line { font-size: 18px; color: var(--px-silver); }
.ldp-result-follow { align-self: flex-start; margin-top: 6px; padding: 6px 10px; font-size: 10px; }

/* ── payload + the big red button ── */
.ldp-name { display: flex; flex-direction: column; gap: 4px; }
.ldp-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    font-family: var(--px-body);
    font-size: 22px;
    color: var(--px-white);
    background: var(--px-ink);
    border: 3px solid var(--px-slate);
    border-radius: 0;
    text-transform: uppercase;
}
.ldp-input::placeholder { color: var(--px-grey); }
.ldp-input:focus { border-color: var(--px-yellow); outline: none; }
.ldp-launch {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 14px 0 18px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--px-white);
    background: var(--px-red);
    border: 3px solid var(--px-ink);
    box-shadow: inset -5px -7px 0 var(--px-plum), inset 5px 5px 0 var(--px-pink);
    text-shadow: 3px 3px 0 var(--px-plum);
    cursor: pointer;
}
.ldp-launch-cap { display: inline-block; }
.ldp-launch:hover:not(:disabled) { filter: brightness(1.08); }
.ldp-launch:hover:not(:disabled) .ldp-launch-cap { animation: pxJitter 0.24s steps(2) infinite; }
.ldp-launch:active:not(:disabled) { padding: 17px 0 15px; box-shadow: inset 5px 7px 0 var(--px-plum); }
.ldp-launch:disabled {
    color: var(--px-silver);
    background: var(--px-grey);
    box-shadow: inset -5px -7px 0 #3a3530;
    text-shadow: none;
    cursor: default;
}

/* ── manifest ── */
.ldp-manifest:empty { display: none; }
.ldp-manifest { margin-top: 14px; }
.ldp-manifest h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-family: var(--px-display);
    font-size: 11px;
    font-weight: 400;
    color: var(--px-lavender);
}
.ldp-manifest h4 b { padding: 1px 6px; color: var(--px-ink); background: var(--px-lime); font-weight: 700; }
#launch-director-panel .ld-launched-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto repeat(3, 32px);
    align-items: center;
    gap: 6px;
    padding: 5px 5px 5px 10px;
    margin-bottom: 5px;
    background: var(--px-ink);
    box-shadow: inset 3px 0 0 var(--px-lime);
}
#launch-director-panel .ld-launched-name { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#launch-director-panel .ld-launched-alt { font-size: 16px; color: var(--px-silver); }
#launch-director-panel .ld-launched-publish { order: 1; }
#launch-director-panel .ld-launched-follow { order: 2; }
#launch-director-panel .ld-launched-delete { order: 3; }
#launch-director-panel .ld-launched-publish-status { order: 4; grid-column: 1 / -1; font-family: var(--px-display); font-size: 9px; color: var(--px-yellow); }
#launch-director-panel .ld-launched-publish-status:empty { display: none; }
#launch-director-panel .ld-launched-publish,
#launch-director-panel .ld-launched-follow,
#launch-director-panel .ld-launched-delete {
    width: 32px;
    height: 32px;
    padding: 0;
    font-family: var(--px-body);
    font-size: 18px;
    color: var(--px-white);
    background: var(--px-slate);
    border: 2px solid var(--px-navy);
    box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.35);
    cursor: pointer;
}
#launch-director-panel .ld-launched-follow:hover,
#launch-director-panel .ld-launched-publish:hover:not(:disabled) { background: var(--px-blue); color: var(--px-ink); }
#launch-director-panel .ld-launched-delete:hover { background: var(--px-red); }
#launch-director-panel .ld-launched-publish:disabled { opacity: 0.6; cursor: default; }

/* ── Orbit Sandbox specifics ── */

/* terminal mode */

@keyframes pxBlink { 50% { opacity: 0; } }
@keyframes pxJitter { 0% { transform: translate(0, 0); } 100% { transform: translate(1px, -1px); } }
@keyframes pxNudge { 100% { transform: translateX(3px); } }
@keyframes pxPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── the launch short film overlay (PixelLaunchShow) ── */
.pls-root {
    position: fixed;
    inset: 0;
    z-index: 9000;
    overflow: hidden;
    background: transparent;
}
.pls-canvas {
    position: absolute;
    top: 0;
    left: 0;
    image-rendering: pixelated;
}
.pls-root.is-leaving { pointer-events: none; }
.pls-root.is-leaving .pls-skip { opacity: 0; }
.pls-skip {
    position: absolute;
    right: 20px;
    bottom: 20px;
    padding: 10px 14px 12px;
    font-family: 'Silkscreen', 'VT323', monospace;
    font-size: 13px;
    color: #fff1e8;
    background: #0b0f14;
    border: 3px solid #fff1e8;
    border-radius: 0;
    box-shadow: 4px 4px 0 #000;
    cursor: pointer;
    transition: opacity 0.2s steps(2);
}
.pls-skip:hover { color: #0b0f14; background: #ffec27; }
.pls-skip:focus-visible { outline: 3px solid #ffec27; outline-offset: 3px; }
.pls-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 520px) {
    #launch-director-panel,
#orbit-sandbox-panel { left: 12px; right: 12px; top: 12px; width: auto; }
    .ldp { padding: 10px 12px 12px; }
    .ldp-v b { font-size: 24px; }
    .ldp-launch { font-size: 18px; }
    .pls-skip { right: 12px; bottom: 12px; padding: 7px 10px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    #launch-director-panel .ld-status-led.ld-led-active,
.ldp-verdict::before,
.ldp-launch:hover .ldp-launch-cap,
#launch-director-panel .launch-result { animation: none; }
    .ldp-gauge-needle { transition: none; }
}

/* ================================================================
   ORBIT SANDBOX — laboratory instrument (retro phosphor)
   ================================================================
   A wide bench instrument: CRT scope on the left, the catalogue and
   controls on the right. One ink, the active skin's phosphor, dimmed
   by opacity — no toy palette.
   ================================================================ */
#orbit-sandbox-panel {
    --osr-ink: var(--color-primary, #00ff41);
    --osr-rgb: var(--color-primary-rgb, 0, 255, 65);
    --osr-line: rgba(var(--osr-rgb), 0.28);
    --osr-dim: rgba(var(--osr-rgb), 0.55);
    --osr-mono: 'JetBrains Mono', 'Courier New', monospace;
    --osr-term: 'VT323', monospace;
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 120px);
    padding: 0;
    filter: none;
    scrollbar-color: var(--osr-line) transparent;
}
#orbit-sandbox-panel::-webkit-scrollbar-thumb { background: var(--osr-line); }

.osr {
    position: relative;
    padding: 14px 18px 18px;
    color: var(--osr-ink);
    font-family: var(--osr-mono);
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
        radial-gradient(120% 90% at 30% 0%, rgba(var(--osr-rgb), 0.05), transparent 60%),
        rgba(1, 6, 3, 0.95);
    border: 1px solid var(--osr-line);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 18px 50px -20px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(var(--osr-rgb), 0.04);
}
.osr::before,
.osr::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--osr-ink);
    pointer-events: none;
}
.osr::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.osr::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.osr button { font-family: var(--osr-mono); border-radius: 0; }
.osr :focus-visible { outline: 2px solid var(--osr-ink) !important; outline-offset: 2px; }

/* ── header ── */
.osr-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--osr-line);
}
.osr-brand { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; flex-wrap: wrap; }
.osr-led {
    width: 8px;
    height: 8px;
    align-self: center;
    background: var(--osr-ink);
    box-shadow: 0 0 8px var(--osr-ink);
    animation: osrBlink 2.4s steps(1) infinite;
}
.osr-title {
    font-family: var(--osr-term);
    font-size: 28px;
    line-height: 1;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(var(--osr-rgb), 0.55);
}
.osr-sub { font-size: 10px; letter-spacing: 2px; color: var(--osr-dim); white-space: nowrap; }

.osr-mode { display: flex; gap: 0; border: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-mode-btn {
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--osr-dim);
    background: transparent;
    border: 0;
    cursor: pointer;
}
#orbit-sandbox-panel .osb-mode-btn + .osb-mode-btn { border-left: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-mode-btn:hover { color: var(--osr-ink); }
#orbit-sandbox-panel .osb-mode-btn.active { color: #000; background: var(--osr-ink); }

.osr-close {
    width: 32px;
    height: 32px;
    font-size: 14px;
    color: var(--osr-dim);
    background: transparent;
    border: 1px solid var(--osr-line);
    cursor: pointer;
}
.osr-close:hover { color: #000; background: var(--osr-ink); }

/* ── body: scope | controls ── */
.osr-body {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr);
    gap: 18px;
    align-items: start;
}
.osr-scope,
.osr-controls { display: grid; gap: 12px; min-width: 0; }

.osr-screen {
    position: relative;
    overflow: hidden;
    background: #000;
    border: 2px solid #111;
    border-radius: 16px / 12px;
    box-shadow: 0 0 0 1px var(--osr-line), inset 0 0 50px rgba(0, 0, 0, 0.95);
}
.osr-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.75) 100%),
        radial-gradient(90% 60% at 25% 15%, rgba(255, 255, 255, 0.05), transparent 50%);
    animation: osrFlicker 5s steps(1) infinite;
}
.osr-canvas {
    display: block;
    width: 100%;
    height: 330px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 2px rgba(var(--osr-rgb), 0.55));
}
.osr-screen-meta {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 1;
    display: grid;
    justify-items: end;
    gap: 2px;
    pointer-events: none;
}
.osr-cat { font-size: 9px; letter-spacing: 2px; color: var(--osr-dim); }
.osr-cat::before { content: '// '; }
.osr-name { font-family: var(--osr-term); font-size: 24px; line-height: 1; text-shadow: 0 0 8px rgba(var(--osr-rgb), 0.6); }
.osr-readout {
    position: absolute;
    right: 14px;
    bottom: 10px;
    z-index: 1;
    display: grid;
    justify-items: end;
    pointer-events: none;
}
.osr-readout b {
    font-family: var(--osr-term);
    font-size: 46px;
    font-weight: 400;
    line-height: 0.85;
    text-shadow: 0 0 12px rgba(var(--osr-rgb), 0.7);
}
.osr-readout i { font-style: normal; font-size: 9px; letter-spacing: 2px; color: var(--osr-dim); }

.osr-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--osr-line);
    border-left: 1px solid var(--osr-line);
}
#orbit-sandbox-panel .osb-cell {
    display: grid;
    gap: 2px;
    padding: 6px 10px 5px;
    border-right: 1px solid var(--osr-line);
    border-bottom: 1px solid var(--osr-line);
    min-width: 0;
}
#orbit-sandbox-panel .osb-cell-k { font-size: 9px; letter-spacing: 1.5px; color: var(--osr-dim); }
#orbit-sandbox-panel .osb-cell-v { font-family: var(--osr-term); font-size: 22px; line-height: 1; white-space: nowrap; }
#orbit-sandbox-panel .osb-cell-v i { font-style: normal; font-size: 15px; color: var(--osr-dim); }
.osr-blurb { margin: 0; font-size: 12px; line-height: 1.6; color: var(--color-text, #c8ffc8); }
.osr-blurb::before { content: '> '; color: var(--osr-ink); }

/* ── controls ── */
.osr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-tab {
    padding: 6px 4px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--osr-dim);
    background: transparent;
    border: 0;
    cursor: pointer;
}
#orbit-sandbox-panel .osb-tab + .osb-tab { border-left: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-tab:hover { color: var(--osr-ink); }
#orbit-sandbox-panel .osb-tab.active { color: #000; background: var(--osr-ink); }

.osr-presets { display: grid; margin-top: 10px; border-top: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-preset {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px 6px 8px;
    text-align: left;
    color: var(--osr-ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(var(--osr-rgb), 0.12);
    border-left: 3px solid transparent;
    cursor: pointer;
}
#orbit-sandbox-panel .osb-preset:hover { background: rgba(var(--osr-rgb), 0.07); }
#orbit-sandbox-panel .osb-preset.active { background: rgba(var(--osr-rgb), 0.14); border-left-color: var(--osr-ink); }
#orbit-sandbox-panel .osb-dot { width: 6px; height: 6px; align-self: center; border: 1px solid var(--osr-ink); }
#orbit-sandbox-panel .osb-preset.active .osb-dot { background: var(--osr-ink); box-shadow: 0 0 6px var(--osr-ink); }
#orbit-sandbox-panel .osb-preset-name { font-family: var(--osr-term); font-size: 21px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#orbit-sandbox-panel .osb-preset-spec { font-size: 10px; letter-spacing: 0.5px; color: var(--osr-dim); white-space: nowrap; }

.osr-sliders { display: grid; gap: 10px; margin-top: 14px; }
.osr-slider { display: grid; gap: 4px; cursor: pointer; }
.osr-slider-row { display: flex; align-items: baseline; justify-content: space-between; }
.osr-k { font-size: 10px; letter-spacing: 2px; color: var(--osr-dim); }
.osr-v b { font-family: var(--osr-term); font-size: 26px; font-weight: 400; line-height: 1; text-shadow: 0 0 8px rgba(var(--osr-rgb), 0.5); }
.osr-v i { font-style: normal; margin-left: 4px; font-size: 11px; color: var(--osr-dim); }

#orbit-sandbox-panel input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
#orbit-sandbox-panel input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background:
        repeating-linear-gradient(90deg, rgba(var(--osr-rgb), 0.45) 0 1px, transparent 1px 10%) 0 0 / 100% 100%,
        linear-gradient(90deg, var(--osr-ink) var(--fill, 50%), rgba(var(--osr-rgb), 0.12) var(--fill, 50%)) 0 3px / 100% 2px no-repeat;
}
#orbit-sandbox-panel input[type="range"]::-moz-range-track { height: 2px; background: rgba(var(--osr-rgb), 0.18); }
#orbit-sandbox-panel input[type="range"]::-moz-range-progress { height: 2px; background: var(--osr-ink); }
#orbit-sandbox-panel input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 18px;
    margin-top: -5px;
    background: var(--osr-ink);
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 8px rgba(var(--osr-rgb), 0.8);
}
#orbit-sandbox-panel input[type="range"]::-moz-range-thumb {
    width: 8px;
    height: 18px;
    background: var(--osr-ink);
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 8px rgba(var(--osr-rgb), 0.8);
}

.osr-launch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--osr-ink);
    background: rgba(var(--osr-rgb), 0.06);
    border: 1px solid var(--osr-ink);
    cursor: pointer;
}
.osr-launch::before { content: '['; }
.osr-launch::after { content: ']'; }
.osr-launch:hover:not(:disabled) { color: #000; background: var(--osr-ink); box-shadow: 0 0 18px rgba(var(--osr-rgb), 0.35); }
.osr-launch:disabled { color: var(--osr-dim); border-color: var(--osr-line); background: transparent; cursor: not-allowed; }

/* terminal mode */
#orbit-sandbox-panel .osb-term-window { border: 1px solid var(--osr-line); background: #000; }
#orbit-sandbox-panel .osb-term-chrome { padding: 5px 10px; border-bottom: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-term-title { font-size: 10px; letter-spacing: 1px; color: var(--osr-dim); }
#orbit-sandbox-panel .osb-term-output {
    height: 300px;
    overflow-y: auto;
    padding: 8px 10px;
    font-family: var(--osr-term);
    font-size: 18px;
    line-height: 1.1;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--osr-ink);
    text-shadow: 0 0 6px rgba(var(--osr-rgb), 0.45);
}
#orbit-sandbox-panel .osb-term-dim,
#orbit-sandbox-panel .osb-term-echo { color: var(--osr-dim); }
#orbit-sandbox-panel .osb-term-accent,
#orbit-sandbox-panel .osb-term-cmd,
#orbit-sandbox-panel .osb-term-ok,
#orbit-sandbox-panel .osb-term-active { color: var(--osr-ink); font-weight: 700; }
#orbit-sandbox-panel .osb-term-warn,
#orbit-sandbox-panel .osb-term-error { color: var(--color-danger, #ff4141); }
#orbit-sandbox-panel .osb-term-ascii { display: block; line-height: 1; }
#orbit-sandbox-panel .osb-term-input-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--osr-line); }
#orbit-sandbox-panel .osb-term-prompt { font-family: var(--osr-term); font-size: 20px; }
#orbit-sandbox-panel .osb-term-input {
    flex: 1;
    min-width: 0;
    font-family: var(--osr-term);
    font-size: 20px;
    color: var(--osr-ink);
    background: transparent;
    border: 0;
    outline: none;
    caret-color: var(--osr-ink);
}

@keyframes osrBlink { 50% { opacity: 0.25; } }
@keyframes osrFlicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: 0.82; } 98% { opacity: 1; } 99% { opacity: 0.9; } }

@media (max-width: 900px) {
    #orbit-sandbox-panel { left: 12px; right: 12px; top: 12px; width: auto; max-height: calc(100vh - 100px); }
    .osr { padding: 12px; }
    .osr-body { grid-template-columns: 1fr; }
    .osr-canvas { height: 240px; }
    .osr-sub { display: none; }
    .osr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .osr-led,
    .osr-screen::after { animation: none; }
}

/* ================================================================
   LAUNCH DIRECTOR — mission console (retro phosphor, wide)
   ================================================================
   Same bench-instrument language as the Orbit Sandbox: the pixel
   control room on the left, the controls and the payload on the
   right. Colour only where it means something (the verdict).
   ================================================================ */
#launch-director-panel {
    --ld-ink: #00ff41;
    --ld-text: #b9ffcf;
    --ld-dim: #4fbf73;
    --ld-line: rgba(0, 255, 65, 0.28);
    --ld-panel: #03140a;
    --ld-warn: #ffb000;
    --ld-bad: #ff5a6e;
    --px-acc: var(--ld-ink);
    --px-yellow: var(--ld-warn);
    width: min(960px, calc(100vw - 32px));
    max-height: calc(100vh - 120px);
    padding: 0;
    filter: none;
    scrollbar-color: var(--ld-line) transparent;
}
#launch-director-panel::-webkit-scrollbar-thumb { background: var(--ld-line); }

.ldp {
    padding: 14px 18px 18px;
    color: var(--ld-text);
    font-family: 'VT323', monospace;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
        radial-gradient(120% 90% at 30% 0%, rgba(0, 255, 65, 0.05), transparent 60%),
        rgba(1, 6, 3, 0.95);
    border: 1px solid var(--ld-line);
    clip-path: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 18px 50px -20px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(0, 255, 65, 0.04);
}
.ldp::before,
.ldp::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--ld-ink);
    pointer-events: none;
}
.ldp::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.ldp::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.ldp button { font-family: 'VT323', monospace; }
.ldp :focus-visible { outline: 2px solid var(--ld-warn) !important; }

/* header */
.ldp-head { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--ld-line); box-shadow: none; }
.ldp-brand { flex-direction: row; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ldp-title {
    font-family: 'VT323', monospace;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 3px;
    color: var(--ld-ink);
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.55);
}
.ldp-sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; color: var(--ld-dim); }
.ldp-state { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; color: var(--ld-dim); }
#launch-director-panel .ld-status-led { background: var(--ld-ink); box-shadow: 0 0 8px var(--ld-ink); }
#launch-director-panel .ld-status-led.ld-led-active { background: var(--ld-warn); box-shadow: 0 0 8px var(--ld-warn); }
.ldp-close {
    font-size: 14px;
    color: var(--ld-dim);
    background: transparent;
    border: 1px solid var(--ld-line);
    box-shadow: none;
}
.ldp-close:hover { color: #000; background: var(--ld-ink); filter: none; }
.ldp-close:active { box-shadow: none; }

/* two columns */
.ldp-body {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
    gap: 18px;
    align-items: start;
}
.ldp-col { display: grid; gap: 12px; min-width: 0; align-content: start; }

/* the control room screen */
.ldp-screen {
    margin: 0;
    overflow: hidden;
    background: #000;
    border: 2px solid #111;
    border-radius: 16px / 12px;
    box-shadow: 0 0 0 1px var(--ld-line), inset 0 0 50px rgba(0, 0, 0, 0.95);
}
.ldp-screen::after {
    border-radius: inherit;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.7) 100%);
}
.ldp-desk { height: 240px; }
.ldp-verdict {
    left: 12px;
    bottom: 10px;
    padding: 2px 8px 3px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    letter-spacing: 1px;
    color: #000;
    background: var(--ld-ink);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
}
.ldp-verdict.is-elliptical { background: var(--ld-warn); box-shadow: 0 0 12px rgba(255, 176, 0, 0.5); }
.ldp-verdict.is-decay { color: #000; background: var(--ld-bad); box-shadow: 0 0 12px rgba(255, 90, 110, 0.5); }
.ldp-verdict.is-escape { background: #ff8a3d; box-shadow: 0 0 12px rgba(255, 138, 61, 0.5); }

/* velocity gauge */
.ldp-gauge { margin: 0; padding: 8px 0 2px; }
.ldp-gauge-bar { height: 22px; border: 1px solid var(--ld-line); }
.ldp-zone { background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 6px); box-shadow: none; }
.ldp-zone + .ldp-zone { border-left: 1px solid rgba(0, 0, 0, 0.8); }
.ldp-zone i { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 1px; }
.ldp-zone--decay { background-color: rgba(255, 90, 110, 0.22); }
.ldp-zone--elliptical { background-color: rgba(255, 176, 0, 0.18); }
.ldp-zone--stable { background-color: rgba(0, 255, 65, 0.24); }
.ldp-zone--escape { background-color: rgba(255, 138, 61, 0.2); }
.ldp-zone--decay i { color: var(--ld-bad); }
.ldp-zone--elliptical i { color: var(--ld-warn); }
.ldp-zone--stable i { color: var(--ld-ink); }
.ldp-zone--escape i { color: #ff8a3d; }
.ldp-gauge-needle,
.ldp-gauge-needle::before { background: var(--ld-text); box-shadow: 0 0 0 1px #000, 0 0 8px rgba(185, 255, 207, 0.8); }

/* parameters */
.ldp-params { display: grid; gap: 2px; }
.ldp-k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; color: var(--ld-dim); }
.ldp-v b { font-size: 30px; color: var(--ld-ink); text-shadow: 0 0 8px rgba(0, 255, 65, 0.55); }
.ldp-v i { font-size: 16px; color: var(--ld-dim); }
.ldp .ld-slider { height: 20px; margin-bottom: 6px; }
.ldp .ld-slider::-webkit-slider-runnable-track {
    height: 8px;
    border: 1px solid var(--ld-line);
    background: linear-gradient(90deg, var(--ld-ink) var(--fill), rgba(0, 255, 65, 0.06) var(--fill));
    box-shadow: none;
}
.ldp .ld-slider::-moz-range-track { height: 8px; border: 1px solid var(--ld-line); background: rgba(0, 255, 65, 0.06); }
.ldp .ld-slider::-moz-range-progress { height: 8px; background: var(--ld-ink); }
.ldp .ld-slider::-webkit-slider-thumb {
    width: 10px;
    height: 20px;
    margin-top: -7px;
    background: #000;
    border: 2px solid var(--ld-ink);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
}
.ldp .ld-slider::-moz-range-thumb { width: 10px; height: 20px; background: #000; border: 2px solid var(--ld-ink); box-shadow: 0 0 8px rgba(0, 255, 65, 0.6); }
.ldp .ld-slider:active::-webkit-slider-thumb { background: var(--ld-ink); box-shadow: 0 0 10px var(--ld-ink); }

.ldp .ld-preset,
.ldp-result-follow {
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--ld-dim);
    background: transparent;
    border: 1px solid var(--ld-line);
    box-shadow: none;
}
.ldp .ld-preset:hover,
.ldp-result-follow:hover { color: #000; background: var(--ld-ink); }
.ldp .ld-preset:active,
.ldp-result-follow:active { box-shadow: none; transform: translateY(1px); }
.ldp-presets { gap: 0; margin: 0 0 8px; }
.ldp .ld-preset { padding: 3px 0 4px; font-size: 17px; }
.ldp .ld-preset + .ld-preset { border-left: 0; }

/* telemetry */
.ldp-telem { margin: 0; gap: 0; border-top: 1px solid var(--ld-line); border-left: 1px solid var(--ld-line); }
.ldp-cell { background: transparent; box-shadow: none; border-right: 1px solid var(--ld-line); border-bottom: 1px solid var(--ld-line); }
.ldp-cell .ldp-k { font-size: 9px; }
.ldp-cell-v { font-size: 22px; color: var(--ld-text); }
.ldp-cell.is-stable .ldp-cell-v { color: var(--ld-ink); }
.ldp-cell.is-elliptical .ldp-cell-v { color: var(--ld-warn); }
.ldp-cell.is-decay .ldp-cell-v { color: var(--ld-bad); }
.ldp-cell.is-escape .ldp-cell-v { color: #ff8a3d; }

/* result */
#launch-director-panel .launch-result {
    --res: var(--ld-ink);
    margin: 0;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 0 0 1px var(--res), 0 0 18px -6px var(--res);
}
#launch-director-panel .launch-result.is-elliptical { --res: var(--ld-warn); }
#launch-director-panel .launch-result.is-decay { --res: var(--ld-bad); }
#launch-director-panel .launch-result.is-escape { --res: #ff8a3d; }
.ldp-result-title { font-family: 'VT323', monospace; font-size: 26px; font-weight: 400; letter-spacing: 2px; text-shadow: 0 0 8px var(--res); }
.ldp-result-line { color: var(--ld-dim); }

/* payload: design picker, name and the launch key */
.ldp-payload { display: grid; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--ld-line); }
.ldp-skins { display: grid; gap: 6px; }
.ldp-skin-list { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.ldp-skin {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-width: 68px;
    max-width: 96px;
    padding: 5px 6px 4px;
    color: var(--ld-dim);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--ld-line);
    cursor: pointer;
}
.ldp-skin:hover { color: var(--ld-text); border-color: var(--ld-dim); }
.ldp-skin.is-on { color: var(--ld-ink); border-color: var(--ld-ink); box-shadow: 0 0 0 1px var(--ld-ink), inset 0 0 14px rgba(0, 255, 65, 0.2); }
.ldp-skin-art { display: block; max-width: 100%; height: 34px; object-fit: contain; image-rendering: pixelated; }
.ldp-skin-std {
    width: 34px;
    height: 34px;
    background:
        linear-gradient(var(--ld-ink), var(--ld-ink)) center / 8px 8px no-repeat,
        linear-gradient(#29adff, #29adff) left center / 10px 3px no-repeat,
        linear-gradient(#29adff, #29adff) right center / 10px 3px no-repeat;
    opacity: 0.8;
}
.ldp-skin-name { max-width: 100%; overflow: hidden; font-size: 15px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.ldp-skin-note { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--ld-dim); }
.ldp-skin-note a,
a.ldp-skin-note { color: var(--ld-ink); }

.ldp-input {
    font-family: 'VT323', monospace;
    font-size: 22px;
    color: var(--ld-ink);
    background: #000;
    border: 1px solid var(--ld-line);
    caret-color: var(--ld-ink);
}
.ldp-input::placeholder { color: rgba(0, 255, 65, 0.3); }
.ldp-input:focus { border-color: var(--ld-ink); box-shadow: 0 0 0 1px var(--ld-ink); }
.ldp-launch {
    margin-top: 0;
    padding: 10px 0 12px;
    font-family: 'VT323', monospace;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 4px;
    color: #000;
    background: var(--ld-ink);
    border: 0;
    box-shadow: 0 0 0 1px #000, 0 0 22px -4px rgba(0, 255, 65, 0.8);
    text-shadow: none;
}
.ldp-launch-cap::before { content: '[ '; }
.ldp-launch-cap::after { content: ' ]'; }
.ldp-launch:hover:not(:disabled) { filter: none; background: var(--ld-text); }
.ldp-launch:active:not(:disabled) { padding: 11px 0 11px; box-shadow: 0 0 0 1px #000; }
.ldp-launch:disabled { color: var(--ld-dim); background: transparent; box-shadow: inset 0 0 0 1px var(--ld-line); }

/* manifest */
.ldp-manifest { margin-top: 0; }
.ldp-manifest h4 { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2px; color: var(--ld-dim); }
.ldp-manifest h4 b { color: #000; background: var(--ld-ink); }
#launch-director-panel .ld-launched-item { background: rgba(0, 0, 0, 0.5); box-shadow: inset 2px 0 0 var(--ld-ink); }
#launch-director-panel .ld-launched-item.has-thumb { grid-template-columns: 44px minmax(0, 1fr) auto repeat(3, 32px); }
#launch-director-panel .ld-launched-thumb { width: 40px; height: 26px; object-fit: contain; image-rendering: pixelated; }
#launch-director-panel .ld-launched-name { color: var(--ld-text); }
#launch-director-panel .ld-launched-alt { color: var(--ld-dim); }
#launch-director-panel .ld-launched-publish-status { font-family: 'JetBrains Mono', monospace; color: var(--ld-warn); }
#launch-director-panel .ld-launched-publish,
#launch-director-panel .ld-launched-follow,
#launch-director-panel .ld-launched-delete { color: var(--ld-dim); background: transparent; border: 1px solid var(--ld-line); box-shadow: none; }
#launch-director-panel .ld-launched-follow:hover,
#launch-director-panel .ld-launched-publish:hover:not(:disabled) { color: #000; background: var(--ld-ink); }
#launch-director-panel .ld-launched-delete:hover { color: #000; background: var(--ld-bad); }

@media (max-width: 900px) {
    #launch-director-panel { left: 12px; right: 12px; top: 12px; width: auto; max-height: calc(100vh - 100px); }
    .ldp { padding: 12px; }
    .ldp-body { grid-template-columns: 1fr; }
    .ldp-desk { height: 180px; }
    .ldp-sub { display: none; }
}

/* ================================================================
   PREMIUM SKIN SIGNATURES — per-theme ambient layers
   ================================================================
   Each skin gets a distinctive full-screen ambience + panel
   treatment, driven purely by body[data-theme]. Zero JS cost.
   ================================================================ */

/* ── TERMINAL: living phosphor tube ── */
body[data-theme="terminal"] #ui-panel,
body[data-theme="terminal"] #satellite-info-panel {
    animation: skinPhosphorBreath 34s steps(1) infinite;
}

@keyframes skinPhosphorBreath {
    0%, 96.5%, 97.5%, 100% { filter: none; }
    97%   { filter: brightness(1.22) saturate(1.15); }
    97.2% { filter: brightness(0.92); }
}

/* ── NEURAL LINK: data cascade + synaptic panel glow ── */
body[data-theme="neuralLink"]::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, transparent 0 46px, rgba(0, 243, 255, 0.05) 46px 47px),
        repeating-linear-gradient(0deg, transparent 0 9px, rgba(0, 243, 255, 0.035) 9px 11px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 30%, black 75%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, black 30%, black 75%, transparent 100%);
    opacity: 0.5;
    animation: skinDataCascade 7s linear infinite;
}

@keyframes skinDataCascade {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 0, 0 220px; }
}

body[data-theme="neuralLink"] #ui-panel,
body[data-theme="neuralLink"] #satellite-info-panel,
body[data-theme="neuralLink"] #settings-panel,
body[data-theme="neuralLink"] #stats-panel {
    box-shadow:
        0 0 24px rgba(0, 243, 255, 0.14),
        inset 0 0 30px rgba(0, 243, 255, 0.04);
}

/* ── APOLLO ARCHIVE: warm archive vignette + paper grain ── */
body[data-theme="apolloArchive"]::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.35'/%3E%3C/svg%3E"),
        radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(58, 32, 6, 0.28) 100%);
    opacity: 0.5;
    mix-blend-mode: multiply;
}

/* Horizontal-hold hiccup every ~40s, like a worn tape */
body[data-theme="apolloArchive"] #ui-panel,
body[data-theme="apolloArchive"] #satellite-info-panel {
    animation: skinHorizHold 41s steps(1) infinite;
}

@keyframes skinHorizHold {
    0%, 97.4%, 98.2%, 100% { transform: none; }
    97.6% { transform: translateX(3px) skewX(-0.6deg); }
    97.9% { transform: translateX(-2px); }
}

/* ── SYNTHWAVE: horizon glow + neon panel pulse ── */
body[data-theme="synthwave"]::after {
    content: '';
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 26vh;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(0deg, rgba(255, 59, 157, 0.14), transparent 75%);
    animation: skinSynthPulse 4.2s ease-in-out infinite;
}

@keyframes skinSynthPulse {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1; }
}

body[data-theme="synthwave"] #ui-panel,
body[data-theme="synthwave"] #satellite-info-panel,
body[data-theme="synthwave"] #settings-panel {
    box-shadow:
        0 0 26px rgba(255, 0, 128, 0.16),
        0 0 60px rgba(128, 0, 255, 0.08),
        inset 0 0 30px rgba(255, 0, 128, 0.04);
}

@media (prefers-reduced-motion: reduce) {
    body[data-theme="terminal"] #ui-panel,
    body[data-theme="terminal"] #satellite-info-panel,
    body[data-theme="apolloArchive"] #ui-panel,
    body[data-theme="apolloArchive"] #satellite-info-panel,
    body[data-theme="neuralLink"]::after,
    body[data-theme="synthwave"]::after {
        animation: none;
    }
}

/* ================================================================
   ACCESSIBILITY FLOOR — keyboard focus must always be visible.
   Several component rules (`input[type=range]:focus`, id-scoped
   inputs) zero the outline with more specificity than the base
   :focus-visible rule; !important keeps this floor from being lost.
   ================================================================ */
:is(a, button, input, select, textarea, summary,
    [tabindex]:not([tabindex="-1"]), [role="button"], [role="tab"]):focus-visible {
    outline: 2px solid var(--color-secondary) !important;
    outline-offset: 2px !important;
}

/* Touch targets: 44px minimum on coarse pointers, without resizing the
   desktop HUD. Labels stretch across their row (they toggle their input
   via `for`), sliders get a tall hit box around the unchanged thin track,
   and compact icon buttons grow an invisible hit area instead of layout. */
@media (pointer: coarse) {
    input[type="range"] {
        height: var(--touch-target-min) !important;
    }

    .checkbox-wrapper,
    .settings-toggle {
        /* + the 1px top and bottom borders, so the stretched label itself reaches 44px */
        min-height: calc(var(--touch-target-min) + 2px);
        padding-block: 0;
    }

    .checkbox-wrapper label,
    .settings-toggle label {
        flex: 1;
        align-self: stretch;
        display: flex;
        align-items: center;
    }

    .dock-btn,
    .quick-audio-btn,
    #account-quick-bar .account-login {
        position: relative;
    }

    .dock-btn::before,
    .quick-audio-btn::before,
    #account-quick-bar .account-login::before {
        content: '';
        position: absolute;
        inset: calc((100% - var(--touch-target-min)) / 2) calc((100% - var(--touch-target-min)) / 2);
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
    }
}

/* ================================================================
   MISIONES — mi cielo, maquina del tiempo y eventos en directo
   Usan las variables de la skin, asi que cambian de color con ella.
   ================================================================ */
.mission-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 10px 0 4px;
}
.mission-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 58px;
    padding: 8px 4px 7px;
    font-family: var(--font-main, 'VT323', monospace);
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 1.2px;
    text-align: center;
    color: var(--color-text, #00ff41);
    background: rgba(var(--color-primary-rgb, 0, 255, 65), 0.04);
    border: 1px solid var(--color-primary-dim, rgba(0, 255, 65, 0.3));
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.mission-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mission-btn:hover,
.mission-btn:focus-visible { background: var(--color-primary-hover, rgba(0, 255, 65, 0.2)); border-color: var(--color-primary-dim); outline: none; }
.mission-btn.is-on { color: var(--color-bg, #000); background: var(--color-primary, #00ff41); border-color: var(--color-primary); box-shadow: 0 0 16px var(--color-primary-dim); }
.mission-live { width: 10px; height: 10px; margin: 5px 0; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; animation: mission-live 1.6s ease-in-out infinite; }
@keyframes mission-live { 50% { opacity: 0.35; } }
/* en el movil el panel es un cajon que asoma 64 px: los modos van como
   iconos en esa franja, junto a la marca, para verse sin abrirlo */
@media (max-width: 768px) {
    .mission-bar { position: absolute; top: 19px; right: 14px; margin: 0; grid-template-columns: repeat(3, 40px); }
    .mission-btn { min-height: 34px; padding: 0; }
    .mission-btn span { display: none; }
    .mission-btn svg { width: 18px; height: 18px; }
    .mission-live { margin: 0; }
}

/* ---------------------------------------------------- mi cielo --- */
.sky-hud {
    position: fixed;
    inset: 0;
    z-index: 9000;
    font-family: var(--font-main, 'VT323', monospace);
    color: var(--color-text, #00ff41);
    opacity: 0;
    transition: opacity 0.5s ease 0.5s;
    pointer-events: none;
}
.sky-hud.is-on { opacity: 1; }
.sky-hud.is-leaving { opacity: 0; transition: opacity 0.4s ease; }
.sky-look { position: absolute; inset: 0; pointer-events: auto; cursor: grab; outline: none; touch-action: none; }
.sky-look:active { cursor: grabbing; }
.sky-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sky-label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1px 6px 2px 10px;
    margin: -22px 0 0 10px;
    font-size: 13px;
    letter-spacing: 1px;
    white-space: nowrap;
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-bg, #000) 70%, transparent);
    border-left: 1px solid var(--color-primary);
    text-shadow: 0 0 6px var(--color-bg, #000);
}
.sky-label::before { content: ''; position: absolute; left: -11px; top: 100%; width: 10px; height: 1px; background: var(--color-primary); transform: rotate(-45deg); transform-origin: right; }
.sky-label.is-star { color: #ffdd55; border-color: #ffdd55; }
.sky-label.is-on { color: var(--color-bg, #000); background: var(--color-primary); }
.sky-panel {
    position: absolute;
    pointer-events: auto;
    padding: 12px 14px;
    background: var(--color-bg-panel, rgba(0, 10, 2, 0.85));
    border: 1px solid var(--color-primary-dim, rgba(0, 255, 65, 0.3));
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}
.sky-panel p { margin: 0; }
.sky-kicker { font-size: 12px; letter-spacing: 3px; color: var(--color-text-dim); margin-bottom: 8px !important; }
.sky-where { top: 70px; left: 18px; width: 250px; display: grid; gap: 4px; }
.sky-place { font-size: 26px; letter-spacing: 2px; line-height: 1; color: var(--color-primary); text-shadow: 0 0 12px var(--color-primary-dim); }
.sky-coords, .sky-clock { font-size: 15px; color: var(--color-text-dim); }
.sky-sun { font-size: 14px; line-height: 1.25; padding: 6px 8px; border: 1px dashed var(--color-primary-dim); }
.sky-sun[data-phase="twilight"] { color: #ffcc66; border-color: rgba(255, 204, 102, 0.5); }
.sky-sun[data-phase="day"] { color: #8fd3ff; border-color: rgba(143, 211, 255, 0.45); }
.sky-count { font-size: 14px; color: var(--color-text); }
.sky-zoom { display: flex; gap: 6px; margin-top: 6px; }
.sky-zoom button, .sky-exit {
    font: inherit;
    font-size: 15px;
    padding: 4px 10px;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-primary-dim);
    cursor: pointer;
}
.sky-zoom button:hover, .sky-exit:hover { background: var(--color-primary-hover); }
.sky-exit { margin-top: 8px; color: var(--color-bg, #000); background: var(--color-primary); border-color: var(--color-primary); letter-spacing: 1.5px; }
.sky-exit:hover { background: var(--color-primary); box-shadow: 0 0 18px var(--color-primary-dim); }
.sky-top { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; pointer-events: none; }
.sky-tape {
    position: relative;
    width: min(520px, 60vw);
    height: 30px;
    overflow: hidden;
    border-bottom: 1px solid var(--color-primary-dim);
    -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.sky-tape-inner { position: absolute; top: 0; left: 50%; height: 100%; will-change: transform; }
.sky-tape-inner span { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 11px; color: var(--color-text-dim); }
.sky-tape-inner span::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 1px; height: 5px; background: currentColor; }
.sky-tape-inner span.is-major { font-size: 16px; color: var(--color-primary); }
.sky-tape-needle { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; border: 6px solid transparent; border-bottom-color: var(--color-primary); transform: translateX(-50%); }
.sky-elevation { font-size: 13px; letter-spacing: 2px; color: var(--color-text-dim); }
.sky-list { top: 70px; right: 18px; width: 330px; max-height: calc(100vh - 290px); overflow-y: auto; }
.sky-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sky-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 6px;
    font: inherit;
    font-size: 15px;
    color: var(--color-text);
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}
.sky-row i { width: 8px; height: 8px; border-radius: 50%; }
.sky-row:hover { background: var(--color-primary-faint); border-color: var(--color-primary-dim); }
.sky-row.is-on { background: var(--color-primary-hover); border-color: var(--color-primary); }
.sky-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sky-row-el, .sky-row-az { text-align: right; color: var(--color-primary); }
.sky-row-km { text-align: right; color: var(--color-text-dim); font-size: 13px; white-space: nowrap; }
.sky-row-el, .sky-row-az { white-space: nowrap; }
.sky-passes { left: 50%; bottom: 58px; transform: translateX(-50%); width: min(880px, calc(100vw - 36px)); display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.sky-passes .sky-kicker { flex-basis: 100%; margin-bottom: 0 !important; }
.sky-pass-wait { font-size: 14px; color: var(--color-text-dim); }
.sky-pass {
    flex: 1 1 180px;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    font: inherit;
    text-align: left;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-primary-dim);
    cursor: pointer;
}
.sky-pass:hover { background: var(--color-primary-faint); }
.sky-pass b { font-weight: 400; font-size: 18px; letter-spacing: 2px; color: var(--color-primary); }
.sky-pass-when { font-size: 20px; }
.sky-pass-path, .sky-pass-vis { font-size: 13px; color: var(--color-text-dim); }
.sky-pass.is-visible { border-color: #ffdd55; box-shadow: 0 0 14px rgba(255, 221, 85, 0.2); }
.sky-pass.is-visible .sky-pass-vis { color: #ffdd55; }
.sky-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; font-size: 13px; letter-spacing: 1px; color: var(--color-text-dim); white-space: nowrap; }
@media (max-width: 900px) {
    .sky-where { width: auto; right: 18px; top: 60px; grid-template-columns: 1fr 1fr; }
    .sky-where .sky-kicker, .sky-where .sky-place, .sky-where .sky-exit { grid-column: 1 / -1; }
    .sky-list { top: auto; bottom: 170px; left: 18px; right: 18px; width: auto; max-height: 30vh; }
    .sky-top { top: 16px; }
    .sky-hint { display: none; }
    .sky-passes { bottom: 18px; }
}

.sky-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9500;
    width: min(460px, calc(100vw - 32px));
    padding: 18px;
    transform: translate(-50%, -50%);
    font-family: var(--font-main, 'VT323', monospace);
    color: var(--color-text);
    background: var(--color-bg-panel-dark, rgba(0, 10, 2, 0.95));
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 40px var(--color-primary-dim), 0 20px 60px rgba(0, 0, 0, 0.6);
}
.sky-picker-title { margin: 0 0 12px; font-size: 22px; letter-spacing: 2px; color: var(--color-primary); }
.sky-picker button {
    font: inherit;
    font-size: 16px;
    padding: 6px 8px;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-primary-dim);
    cursor: pointer;
}
.sky-picker button:hover { background: var(--color-primary-hover); }
.sky-picker-geo { width: 100%; margin-bottom: 12px; color: var(--color-bg, #000) !important; background: var(--color-primary) !important; }
.sky-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.sky-picker-cancel { margin-top: 12px; }

/* ------------------------------------------- maquina del tiempo --- */
.tm-panel {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 70;
    width: min(900px, calc(100vw - 32px));
    padding: 12px 16px 14px;
    transform: translate(-50%, 16px);
    opacity: 0;
    font-family: var(--font-main, 'VT323', monospace);
    color: var(--color-text);
    background: var(--color-bg-panel, rgba(0, 10, 2, 0.9));
    border: 1px solid var(--color-primary-dim);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.tm-panel.is-on { opacity: 1; transform: translate(-50%, 0); }
body.sky-mode .tm-panel { bottom: auto; top: 110px; width: min(700px, calc(100vw - 32px)); }
.tm-head { display: flex; align-items: center; margin-bottom: 8px; }
.tm-kicker { font-size: 13px; letter-spacing: 3px; color: var(--color-text-dim); }
.tm-close { font: inherit; font-size: 22px; line-height: 1; padding: 0 8px; color: var(--color-text); background: transparent; border: 0; cursor: pointer; }
.tm-main { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 16px; }
.tm-play {
    width: 46px;
    height: 46px;
    font-size: 18px;
    color: var(--color-bg, #000);
    background: var(--color-primary);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 18px var(--color-primary-dim);
}
.tm-yearbox { display: grid; }
.tm-year { font-size: 58px; line-height: 0.9; letter-spacing: 3px; color: var(--color-primary); text-shadow: 0 0 18px var(--color-primary-dim); font-variant-numeric: tabular-nums; }
.tm-count { font-size: 13px; letter-spacing: 1px; color: var(--color-text-dim); max-width: 26ch; }
.tm-story { display: grid; gap: 4px; margin: 0; padding-left: 16px; border-left: 1px solid var(--color-primary-dim); font-size: 15px; line-height: 1.3; min-height: 60px; }
.tm-story b { font-weight: 400; font-size: 17px; letter-spacing: 1.5px; color: var(--color-primary); }
.tm-story.is-in { animation: tm-in 0.35s ease-out; }
@keyframes tm-in { from { opacity: 0; transform: translateX(8px); } }
.tm-focus { justify-self: start; margin-top: 4px; font: inherit; font-size: 14px; padding: 3px 10px; color: var(--color-text); background: transparent; border: 1px solid var(--color-primary); cursor: pointer; }
.tm-focus.is-on, .tm-focus:hover { color: var(--color-bg, #000); background: var(--color-primary); }
.tm-chart { display: block; width: 100%; height: 64px; margin-top: 12px; cursor: pointer; }
.tm-slider { width: 100%; margin: 4px 0 0; accent-color: var(--color-primary); }
.tm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font: inherit; font-size: 13px; color: var(--color-text-dim); background: transparent; border: 1px solid var(--color-primary-dim); cursor: pointer; }
.tm-chip i { width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid currentColor; }
.tm-chip b { font-weight: 400; color: var(--color-text); }
.tm-chip.is-past { color: var(--color-primary); border-color: var(--color-primary-dim); }
.tm-chip.is-past i { background: currentColor; }
.tm-chip:hover { color: var(--color-bg, #000); background: var(--color-primary); }
.tm-chip:hover b { color: inherit; }
.tm-min { margin-left: auto; font: inherit; font-size: 18px; line-height: 1; padding: 0 8px; color: var(--color-text); background: transparent; border: 0; cursor: pointer; }
.tm-panel.is-min { width: min(520px, calc(100vw - 32px)); padding-bottom: 10px; }
.tm-panel.is-min .tm-story, .tm-panel.is-min .tm-chart, .tm-panel.is-min .tm-chips, .tm-panel.is-min .tm-note, .tm-panel.is-min .tm-count { display: none; }
.tm-panel.is-min .tm-main { grid-template-columns: auto auto; gap: 12px; }
.tm-panel.is-min .tm-year { font-size: 34px; }
.tm-panel.is-min .tm-play { width: 36px; height: 36px; font-size: 14px; }
.tm-note { margin: 4px 0 0; font-size: 12px; color: var(--color-text-dim); }
@media (max-width: 760px) {
    .tm-panel { bottom: 128px; }
    .tm-main { grid-template-columns: auto 1fr; }
    .tm-story { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
    .tm-year { font-size: 44px; }
}

/* ---------------------------------------------------- en directo --- */
.ev-panel {
    position: fixed;
    top: 70px;
    right: 18px;
    bottom: 90px;
    z-index: 70;
    width: 360px;
    display: flex;
    flex-direction: column;
    font-family: var(--font-main, 'VT323', monospace);
    color: var(--color-text);
    background: var(--color-bg-panel, rgba(0, 10, 2, 0.9));
    border: 1px solid var(--color-primary-dim);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.ev-panel.is-on { opacity: 1; transform: none; }
.ev-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--color-primary-dim); }
.ev-live { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; font-size: 13px; letter-spacing: 2px; color: #fff; background: #d62828; }
.ev-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: mission-live 1.4s ease-in-out infinite; }
.ev-kicker { font-size: 14px; letter-spacing: 3px; color: var(--color-text-dim); }
.ev-close { margin-left: auto; font: inherit; font-size: 22px; line-height: 1; color: var(--color-text); background: transparent; border: 0; cursor: pointer; }
.ev-list { overflow-y: auto; padding: 6px 14px 14px; scrollbar-width: thin; }
.ev-block { padding: 10px 0; border-bottom: 1px dashed var(--color-primary-dim); }
.ev-title { margin: 0 0 8px; font-weight: 400; font-size: 13px; letter-spacing: 3px; color: var(--color-text-dim); }
.ev-body { display: grid; gap: 6px; }
.ev-iss { margin: 0; font-size: 18px; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.ev-btn { justify-self: start; font: inherit; font-size: 14px; padding: 2px 10px; color: var(--color-text); background: transparent; border: 1px solid var(--color-primary); cursor: pointer; }
.ev-btn:hover { color: var(--color-bg, #000); background: var(--color-primary); }
.ev-launch, .ev-row {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 7px 9px;
    font: inherit;
    text-align: left;
    color: var(--color-text);
    background: var(--color-primary-faint, rgba(0, 255, 65, 0.06));
    border: 1px solid transparent;
    cursor: pointer;
}
.ev-launch:hover, .ev-row:hover { border-color: var(--color-primary-dim); }
.ev-launch-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ev-launch-top b { font-weight: 400; font-size: 17px; color: var(--color-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-status { font-size: 11px; letter-spacing: 1px; padding: 0 5px; border: 1px solid currentColor; color: var(--color-text-dim); }
.ev-status--go { color: #6dff8a; }
.ev-status--tbd, .ev-status--tbc { color: #ffcc66; }
.ev-status--hold { color: #ff7070; }
.ev-count { font-size: 22px; letter-spacing: 1px; color: var(--color-text); font-variant-numeric: tabular-nums; }
.ev-meta { font-size: 13px; color: var(--color-text-dim); }
.ev-more { display: none; margin-top: 4px; font-size: 13px; line-height: 1.3; color: var(--color-text); }
.ev-launch.is-open .ev-more { display: block; }
.ev-row { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
.ev-row b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row-v { font-size: 13px; color: var(--color-text-dim); }
.ev-kp { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.ev-kp i { height: 10px; background: var(--color-primary-faint, rgba(0, 255, 65, 0.1)); border: 1px solid var(--color-primary-dim); }
.ev-kp i.is-on { background: var(--color-primary); }
.ev-kp i.is-warm { background: #ffcc33; border-color: #ffcc33; }
.ev-kp i.is-hot { background: #ff4545; border-color: #ff4545; }
.ev-kp-n { margin: 0; font-size: 20px; color: var(--color-primary); }
.ev-note, .ev-wait { margin: 0; font-size: 13px; line-height: 1.3; color: var(--color-text-dim); }
.ev-src { margin: 2px 0 0; font-size: 11px; color: var(--color-text-dim); opacity: 0.7; }
@media (max-width: 760px) {
    .ev-panel { top: 60px; left: 12px; right: 12px; width: auto; bottom: 130px; }
}

/* retoques: etiquetas de capitulo que no se pisan y filas que no se salen */
.ev-panel *, .ev-panel *::before { box-sizing: border-box; }
.ev-launch-top b { min-width: 0; flex: 1 1 auto; }
.ev-status { flex: none; white-space: nowrap; }

/* pasos: cabecera con su ayuda */
.sky-pass-head { flex-basis: 100%; display: flex; align-items: center; gap: 12px; }
.sky-pass-head .sky-kicker { margin: 0 !important; }
.sky-pass-tz { font-size: 12px; letter-spacing: 1px; color: var(--color-text-dim); }
.sky-pass-q { margin-left: auto; width: 24px; height: 24px; font: inherit; font-size: 15px; line-height: 1; color: var(--color-bg, #000); background: var(--color-primary); border: 0; border-radius: 50%; cursor: pointer; }
.sky-pass-rel { font-size: 13px; color: var(--color-primary); }
.sky-pass-help { flex-basis: 100%; display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--color-primary); background: var(--color-primary-faint); }
.sky-pass-help p { margin: 0; font-size: 14px; line-height: 1.35; }
.sky-pass-help-ok { justify-self: end; font: inherit; font-size: 14px; padding: 3px 12px; color: var(--color-bg, #000); background: var(--color-primary); border: 0; cursor: pointer; }

/* Mi cielo: la cortina de pixel art que tapa el salto de la orbita al suelo */
.sky-trans {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: grid;
    place-items: center;
    background: #000;
    opacity: 0;
    transition: opacity 0.2s linear;
    pointer-events: all;
}
.sky-trans.is-in { opacity: 1; }
.sky-trans.is-out { opacity: 0; transition-duration: 0.38s; }
.sky-trans canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}
.sky-trans-label {
    position: relative;
    margin: 0;
    padding: 0 16px 10px;
    font-family: 'VT323', monospace;
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: 3px;
    color: var(--color-primary, #00ff41);
    text-shadow: 0 0 12px var(--color-primary, #00ff41), 0 2px 0 #000;
    text-align: center;
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 0 30px 18px rgba(0, 0, 0, 0.72);
}
.sky-trans-bar {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 3px;
    background: var(--color-primary, #00ff41);
    transform-origin: left;
    transform: scaleX(0);
}
@media (prefers-reduced-motion: reduce) {
    .sky-trans, .sky-trans.is-out { transition: none; }
}


/* ---------------------------------------- mi cielo: cuando pasan por aqui --- */
.sky-passes { display: block; width: min(1060px, calc(100vw - 36px)); max-height: 46vh; overflow-y: auto; }
.sky-pass-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.sky-pass-titles { display: grid; gap: 1px; }
.sky-pass-title { margin: 0; font-size: 20px; letter-spacing: 1.5px; color: var(--color-primary); text-transform: uppercase; }
.sky-pass-tz { font-size: 13px; letter-spacing: 0.5px; color: var(--color-text-dim); }
.sky-pass-filter { font: inherit; font-size: 14px; letter-spacing: 1px; padding: 4px 10px; color: #ffdd55; background: transparent; border: 1px solid rgba(255, 221, 85, 0.5); cursor: pointer; }
.sky-pass-filter.is-on { color: #1a1200; background: #ffdd55; border-color: #ffdd55; }
.sky-pass-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.sky-pass {
    display: grid;
    grid-template-columns: 1fr 64px;
    grid-template-areas: "top arc" "route arc" "why why" "go go";
    gap: 4px 8px;
    padding: 10px 11px;
    text-align: left;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--color-primary-dim);
    cursor: default;
}
.sky-pass:hover { background: rgba(0, 0, 0, 0.35); }
.sky-pass-top { grid-area: top; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; }
.sky-pass-top b { font-weight: 400; font-size: 17px; letter-spacing: 2px; color: var(--color-primary); }
.sky-pass-badge { justify-self: end; padding: 1px 6px; font-size: 12px; letter-spacing: 1px; color: var(--color-text-dim); border: 1px solid var(--color-primary-dim); }
.sky-pass-when { grid-column: 1 / -1; font-size: 24px; line-height: 1; color: var(--color-text); }
.sky-pass-rel { grid-column: 1 / -1; font-size: 13px; color: var(--color-primary); }
.sky-pass-arc { grid-area: arc; width: 64px; height: 64px; align-self: start; }
.sky-pass-arc .h { fill: rgba(0, 0, 0, 0.35); stroke: var(--color-primary-dim); stroke-width: 1; }
.sky-pass-arc .g { fill: none; stroke: var(--color-primary-dim); stroke-width: 0.6; stroke-dasharray: 2 2; }
.sky-pass-arc text { font-size: 7px; fill: var(--color-text-dim); text-anchor: middle; font-family: inherit; }
.sky-pass-arc .p { fill: none; stroke: var(--color-primary); stroke-width: 2; stroke-linecap: round; }
.sky-pass-arc .a { fill: var(--color-primary); }
.sky-pass-arc .m { fill: #fff; }
.sky-pass-route { grid-area: route; margin: 0; font-size: 14px; line-height: 1.25; color: var(--color-text); }
.sky-pass-why { grid-area: why; margin: 0; font-size: 13px; line-height: 1.25; color: var(--color-text-dim); }
.sky-pass-go { grid-area: go; justify-self: start; margin-top: 2px; font: inherit; font-size: 14px; letter-spacing: 1.5px; padding: 3px 12px; color: var(--color-bg, #000); background: var(--color-primary); border: 0; cursor: pointer; }
.sky-pass-go:hover { filter: brightness(1.15); }
.sky-pass.is-visible { border-color: #ffdd55; box-shadow: 0 0 16px rgba(255, 221, 85, 0.18); }
.sky-pass.is-visible .sky-pass-badge { color: #1a1200; background: #ffdd55; border-color: #ffdd55; }
.sky-pass.is-visible .sky-pass-arc .p { stroke: #ffdd55; }
.sky-pass.is-viewing { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.sky-pass.is-viewing .sky-pass-go { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }

/* el aviso de que se esta viendo un paso (tiempo simulado) */
.sky-viewing {
    position: absolute;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 8px 7px 14px;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 20px var(--color-primary-dim);
    pointer-events: auto;
    white-space: nowrap;
}
.sky-viewing[hidden] { display: none; }
.sky-viewing-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; animation: mission-live 1.2s ease-in-out infinite; }
.sky-viewing button { font: inherit; font-size: 14px; letter-spacing: 1.5px; padding: 3px 10px; color: var(--color-bg, #000); background: var(--color-primary); border: 0; cursor: pointer; }
@media (max-width: 900px) {
    .sky-passes { max-height: 34vh; }
    .sky-pass-row { grid-template-columns: 1fr; }
    .sky-viewing { top: 70px; white-space: normal; width: calc(100vw - 36px); }
}
/* una sola fila que se desliza, y plegable */
.sky-passes { max-height: none; overflow: visible; }
.sky-pass-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.sky-pass { flex: 0 0 250px; }
.sky-pass-fold { font: inherit; font-size: 16px; width: 30px; height: 28px; color: var(--color-primary); background: transparent; border: 1px solid var(--color-primary-dim); cursor: pointer; }
.sky-passes.is-folded .sky-pass-row, .sky-passes.is-folded .sky-pass-wait { display: none; }
.sky-passes.is-folded .sky-pass-head { margin-bottom: 0; }
.sky-pass-head { flex-wrap: nowrap; }
.sky-pass-titles { margin-right: auto; }
.sky-viewing { top: 138px; }
@media (max-width: 900px) { .sky-pass { flex-basis: 78vw; } .sky-pass-head { flex-wrap: wrap; } }

/* ================================================================
   COMPARADOR (multiseleccion): letras de color, escala de alturas y parejas
   ================================================================ */
#multi-select-panel.msx {
    right: 22px;
    bottom: 96px;
    width: 400px;
    max-height: calc(100vh - 190px);
    padding: 0;
    color: var(--color-text, #b9ffcf);
    background: linear-gradient(180deg, rgba(0, 18, 6, 0.94), rgba(0, 8, 3, 0.94));
    border: 1px solid var(--color-primary-dim);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(var(--color-primary-rgb), 0.18);
    font-family: var(--font-main, 'VT323', monospace);
    overflow-y: auto;
    scrollbar-width: thin;
}
.msx-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: rgba(0, 12, 4, 0.96); border-bottom: 1px solid var(--color-primary-dim); }
.msx-title { display: flex; align-items: baseline; gap: 10px; }
.msx-title b { font-weight: 400; font-size: 19px; letter-spacing: 3px; color: var(--color-primary); }
.msx-count { font-size: 14px; color: var(--color-text-dim); }
.msx-close { font: inherit; font-size: 15px; width: 26px; height: 26px; color: var(--color-text-dim); background: transparent; border: 1px solid var(--color-primary-dim); cursor: pointer; }
.msx-close:hover { color: var(--color-primary); border-color: var(--color-primary); }
.msx-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 20px 22px; text-align: center; }
.msx-empty svg { width: 150px; height: 75px; }
.msx-empty path { fill: none; stroke: var(--color-primary-dim); stroke-width: 2; stroke-dasharray: 5 4; }
.msx-empty p { margin: 4px 0 0; font-size: 18px; color: var(--color-text); }
.msx-empty small { font-size: 14px; line-height: 1.3; color: var(--color-text-dim); }
.msx-cols, .msx-sat { display: grid; grid-template-columns: 26px minmax(0, 1fr) 76px 72px 24px; align-items: center; gap: 8px; }
.msx-cols { padding: 8px 12px 2px; font-size: 11px; letter-spacing: 1.5px; color: var(--color-text-dim); }
.msx-cols span:nth-child(3), .msx-cols span:nth-child(4) { text-align: right; }
.msx-list { margin: 0; padding: 0 8px 4px; list-style: none; }
.msx-sat { padding: 6px 4px; border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.08); }
.msx-letter { display: inline-grid; place-items: center; width: 24px; height: 24px; font-size: 17px; color: #000; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 50%, transparent); }
.msx-who { display: grid; min-width: 0; }
.msx-who b { font-weight: 400; font-size: 16px; color: #eaffef; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msx-who small { font-size: 11px; letter-spacing: 1.5px; color: var(--color-text-dim); }
.msx-num { font-size: 15px; text-align: right; color: var(--color-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.msx-remove { font: inherit; font-size: 12px; width: 22px; height: 22px; color: var(--color-text-dim); background: transparent; border: 0; cursor: pointer; }
.msx-remove:hover { color: #ff5a4f; }
.msx-k { margin: 0 0 8px; font-size: 12px; letter-spacing: 2px; color: var(--color-text-dim); }
.msx-scale { position: relative; padding: 12px 14px 8px; }
.msx-track { position: relative; height: 28px; margin-top: 12px; background: rgba(var(--color-primary-rgb), 0.05); border: 1px solid rgba(var(--color-primary-rgb), 0.15); }
.msx-band { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-size: 11px; letter-spacing: 1.5px; color: rgba(255, 255, 255, 0.3); border-right: 1px dashed rgba(var(--color-primary-rgb), 0.25); }
.msx-band--leo { background: rgba(0, 255, 65, 0.06); }
.msx-band--meo { background: rgba(41, 173, 255, 0.05); }
.msx-band--geo { background: rgba(255, 176, 0, 0.08); border-right: 0; }
.msx-marker { position: absolute; top: -12px; transform: translateX(-50%); display: grid; place-items: center; width: 18px; height: 18px; font-size: 13px; color: #000; background: var(--c); transition: left 0.4s ease; box-shadow: 0 0 8px var(--c); }
.msx-marker::after { content: ''; position: absolute; top: 18px; left: 8px; width: 2px; height: 22px; background: var(--c); }
.msx-ticks { position: relative; height: 16px; font-size: 11px; color: var(--color-text-dim); }
.msx-ticks span { position: absolute; transform: translateX(-50%); top: 3px; }
.msx-unit { position: absolute; right: 14px; bottom: 6px; font-size: 11px; color: var(--color-text-dim); }
.msx-pairs { padding: 8px 12px 4px; border-top: 1px solid rgba(var(--color-primary-rgb), 0.12); }
.msx-pair {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "who dist tag" "bar bar bar" "trend delay delay";
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(var(--color-primary-rgb), 0.15);
    --r: #ff5a4f;
}
.msx-pair[data-range="near"] { --r: #00ff41; }
.msx-pair[data-range="mid"] { --r: #ffc800; }
.msx-pair-who { grid-area: who; display: flex; align-items: center; gap: 4px; }
.msx-pair-who .msx-letter { width: 20px; height: 20px; font-size: 14px; }
.msx-pair-who i { width: 16px; height: 0; border-top: 2px dashed var(--r); }
.msx-dist { grid-area: dist; font-weight: 400; font-size: 22px; color: #eaffef; font-variant-numeric: tabular-nums; }
.msx-tag { grid-area: tag; display: none; padding: 1px 6px; font-size: 11px; letter-spacing: 1px; color: #000; background: var(--color-primary); }
.msx-pair.is-closest { border-color: var(--color-primary); box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.2); }
.msx-pair.is-closest .msx-tag { display: inline-block; }
.msx-bar { grid-area: bar; height: 6px; background: linear-gradient(90deg, var(--r) calc(var(--fill, 0) * 100%), rgba(255, 255, 255, 0.08) 0); transition: background 0.4s ease; }
.msx-trend { grid-area: trend; font-size: 14px; }
.msx-trend[data-dir="in"] { color: #00ff41; }
.msx-trend[data-dir="out"] { color: #ff9a3c; }
.msx-delay { grid-area: delay; justify-self: end; font-size: 14px; color: var(--color-text-dim); }
.msx-clear { display: block; width: calc(100% - 24px); margin: 4px 12px 12px; padding: 7px; font: inherit; font-size: 15px; letter-spacing: 2px; color: #ff5a4f; background: transparent; border: 1px solid rgba(255, 90, 79, 0.45); cursor: pointer; }
.msx-clear:hover { background: rgba(255, 90, 79, 0.12); }
@media (max-width: 768px) {
    #multi-select-panel.msx { left: 10px; right: 10px; width: auto; bottom: 80px; max-height: 55vh; }
}
.sky-path-btn { justify-self: start; font: inherit; font-size: 13px; letter-spacing: 1.5px; padding: 3px 10px; color: var(--color-text-dim); background: transparent; border: 1px solid var(--color-primary-dim); cursor: pointer; }
.sky-path-btn::before { content: '○ '; }
.sky-path-btn.is-on { color: var(--color-primary); border-color: var(--color-primary); }
.sky-path-btn.is-on::before { content: '● '; }

/* modos del panel, como ordenes de terminal: "> MI CIELO_" */
@media (min-width: 769px) {
    .mission-bar { grid-template-columns: 1fr; gap: 3px; margin: 12px 0 6px; padding: 6px 0; border-top: 1px dashed var(--color-primary-dim); border-bottom: 1px dashed var(--color-primary-dim); }
    .mission-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        min-height: 0;
        padding: 5px 10px;
        font-family: var(--font-main, 'VT323', monospace);
        font-size: 17px;
        letter-spacing: 2px;
        text-align: left;
        background: transparent;
        border: 1px solid transparent;
    }
    .mission-btn::before { content: '>'; color: var(--color-primary); opacity: 0.7; }
    .mission-btn svg { order: 2; width: 15px; height: 15px; margin-left: auto; opacity: 0.6; }
    .mission-btn .mission-live { order: 2; margin: 0 2px 0 auto; width: 8px; height: 8px; }
    .mission-btn span { order: 1; }
    .mission-btn span::after { content: '_'; opacity: 0; }
    .mission-btn:hover, .mission-btn:focus-visible { color: var(--color-bg, #000); background: var(--color-primary); border-color: var(--color-primary); box-shadow: 0 0 12px var(--color-primary-dim); }
    .mission-btn:hover::before, .mission-btn:focus-visible::before { color: inherit; opacity: 1; }
    .mission-btn:hover span::after, .mission-btn:focus-visible span::after { animation: mission-caret 0.8s steps(1) infinite; }
    .mission-btn.is-on { color: var(--color-primary); background: var(--color-primary-faint, rgba(0, 255, 65, 0.1)); border-color: var(--color-primary); box-shadow: inset 3px 0 0 var(--color-primary); }
    .mission-btn.is-on::before { content: '▶'; opacity: 1; }
}
@keyframes mission-caret { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (min-width: 769px) {
    .mission-btn { color: var(--color-primary); text-shadow: 0 0 8px var(--color-primary-dim); background: rgba(0, 0, 0, 0.35); }
    .mission-btn:hover, .mission-btn:focus-visible { text-shadow: none; }
}

/* ================================================================
   CONTROLES DESLIZANTES — interruptores y barras como en un terminal
   Usan el color de la skin, asi que cambian con ella.
   ================================================================ */
.settings-toggle { background: rgba(var(--color-primary-rgb), 0.03); border: 1px solid rgba(var(--color-primary-rgb), 0.18); }
.settings-toggle:hover { background: rgba(var(--color-primary-rgb), 0.07); border-color: rgba(var(--color-primary-rgb), 0.4); }
.settings-toggle label, .settings-slider label { font-family: var(--font-main, 'VT323', monospace); letter-spacing: 1px; text-transform: uppercase; color: var(--color-text, #b9ffcf); }
.settings-toggle label::before, .settings-slider label::before { content: '> '; color: var(--color-primary); }
.settings-slider span { color: var(--color-primary); }
.settings-hint { color: var(--color-text-dim); }
/* el interruptor: [■ OFF] ↔ [ON ■] */
.settings-toggle input[type="checkbox"] {
    flex: none;
    width: 66px;
    height: 24px;
    background: #000;
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    box-shadow: inset 0 0 0 2px #000;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-toggle input[type="checkbox"]::before {
    top: 4px;
    left: 4px;
    width: 14px;
    height: 14px;
    background: rgba(var(--color-primary-rgb), 0.35);
    box-shadow: none;
    transition: left 0.18s steps(3), background 0.18s ease;
}
.settings-toggle input[type="checkbox"]::after {
    content: 'OFF';
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-52%);
    font-family: var(--font-main, 'VT323', monospace);
    font-size: 15px;
    letter-spacing: 1px;
    color: rgba(var(--color-primary-rgb), 0.45);
}
.settings-toggle input[type="checkbox"]:checked { background: rgba(var(--color-primary-rgb), 0.08); border-color: var(--color-primary); box-shadow: inset 0 0 0 2px #000, 0 0 10px rgba(var(--color-primary-rgb), 0.35); }
.settings-toggle input[type="checkbox"]:checked::before { left: 46px; background: var(--color-primary); box-shadow: 0 0 8px var(--color-primary); }
.settings-toggle input[type="checkbox"]:checked::after { content: 'ON'; right: auto; left: 8px; color: var(--color-primary); }
.settings-toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* las barras: tramos que se encienden hasta el valor y un cursor de bloque */
input[type=range] { --fill: 0.5; height: 22px; }
input[type=range]::-webkit-slider-runnable-track {
    height: 10px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    background:
        linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.85) calc(var(--fill) * 100%), rgba(var(--color-primary-rgb), 0.12) 0);
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, rgba(0, 0, 0, 0.35) 5px 7px);
    mask: repeating-linear-gradient(90deg, #000 0 5px, rgba(0, 0, 0, 0.35) 5px 7px);
}
input[type=range]::-moz-range-track { height: 10px; border: 1px solid rgba(var(--color-primary-rgb), 0.45); background: rgba(var(--color-primary-rgb), 0.12); }
input[type=range]::-moz-range-progress { height: 10px; background: rgba(var(--color-primary-rgb), 0.85); }
input[type=range]::-webkit-slider-thumb { width: 10px; height: 20px; margin-top: -6px; border: 1px solid #000; background: var(--color-primary); box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.6); }
input[type=range]::-moz-range-thumb { width: 10px; height: 20px; border: 1px solid #000; background: var(--color-primary); box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.6); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { animation: range-caret 0.9s steps(1) infinite; }
@keyframes range-caret { 50% { background: #000; box-shadow: inset 0 0 0 2px var(--color-primary); } }

/* ================================================================
   DOCK DE HERRAMIENTAS (abajo a la derecha) — como teclas de terminal
   Todo en el color de la skin: cuadrado, negro, esquinas de mira y el
   boton que lo abre es un ">_" con el cursor parpadeando.
   ================================================================ */
/* el disparador: una tecla ">_" en vez del hexagono con flecha */
.action-dock-expand { width: 46px; height: 46px; filter: none; transition: none; }
.action-dock-expand svg { display: none; }
.action-dock-expand::before {
    content: '>';
    inset: 0;
    display: grid;
    place-items: center;
    padding-right: 10px;
    clip-path: none;
    font-family: var(--font-main, 'VT323', monospace);
    font-size: 26px;
    line-height: 1;
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.7);
    background:
        linear-gradient(var(--color-primary), var(--color-primary)) top left / 8px 2px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) top left / 2px 8px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) bottom right / 8px 2px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) bottom right / 2px 8px no-repeat,
        #000;
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.18);
}
.action-dock-expand::after {
    content: '_';
    inset: auto;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    margin: -15px 0 0 3px;
    clip-path: none;
    border: 0;
    background: none;
    font-family: var(--font-main, 'VT323', monospace);
    font-size: 26px;
    line-height: 1;
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.7);
    animation: dock-caret 1s steps(1) infinite;
}
@keyframes dock-caret { 50% { opacity: 0; } }
.action-dock.is-open .action-dock-expand,
.action-dock:hover .action-dock-expand { transform: translateY(-50%); filter: none; }
.action-dock.is-open .action-dock-expand::before,
.action-dock:hover .action-dock-expand::before { color: #000; background-color: var(--color-primary); text-shadow: none; box-shadow: 0 0 18px rgba(var(--color-primary-rgb), 0.55); }
.action-dock.is-open .action-dock-expand::after,
.action-dock:hover .action-dock-expand::after { color: #000; text-shadow: none; box-shadow: none; border: 0; }

/* la bandeja: rectangulo negro con esquinas de mira */
.action-dock-tray {
    right: 54px !important;
    height: 46px !important;
    gap: 4px !important;
    border-radius: 0;
    border: 1px solid rgba(var(--color-primary-rgb), 0.45);
    border-right: 1px solid rgba(var(--color-primary-rgb), 0.45);
    background:
        linear-gradient(var(--color-primary), var(--color-primary)) top left / 8px 2px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) top left / 2px 8px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) bottom left / 8px 2px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) bottom left / 2px 8px no-repeat,
        rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.14);
}
.action-dock.is-open .action-dock-tray,
.action-dock:hover .action-dock-tray { padding: 0 8px !important; }

/* las teclas: cuadradas y monocromas; al pasar, se invierten */
.dock-btn,
.dock-btn--green, .dock-btn--amber, .dock-btn--lavender, .dock-btn--pink, .dock-btn--orange, .dock-btn--cyan {
    width: 36px;
    height: 36px;
    border-radius: 0;
    color: var(--color-primary);
    background: #000;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    box-shadow: none;
}
.dock-btn svg { width: 17px; height: 17px; filter: drop-shadow(0 0 3px rgba(var(--color-primary-rgb), 0.55)); }
.dock-btn:hover,
.dock-btn--green:hover, .dock-btn--amber:hover, .dock-btn--lavender:hover, .dock-btn--pink:hover, .dock-btn--orange:hover, .dock-btn--cyan:hover,
.dock-btn:focus-visible {
    color: #000;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.55);
    transform: none;
    outline: none;
}
.dock-btn:hover svg, .dock-btn:focus-visible svg { filter: none; }
/* la herramienta abierta: marco completo y un punto encendido */
.dock-btn.active,
.dock-btn--amber.active, .dock-btn--lavender.active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.14);
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.35);
}
.dock-btn.active::before {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary);
}
/* apoyar conserva su tono, con discrecion */
.dock-btn--pink svg { color: #ff7da1; filter: drop-shadow(0 0 3px rgba(255, 95, 135, 0.6)); }
.dock-btn--pink:hover svg { color: #000; }
.dock-btn--orange.premium-locked { opacity: 0.35; }
.dock-separator-v { width: 0; height: 24px; margin: 0 4px; background: none; border-left: 1px dashed rgba(var(--color-primary-rgb), 0.45); box-shadow: none; }

/* la etiqueta: "> AJUSTES_" en letra de terminal */
.dock-btn[title]::after {
    bottom: calc(100% + 12px);
    padding: 3px 9px 4px;
    border-radius: 0;
    font-family: var(--font-main, 'VT323', monospace);
    font-size: 16px;
    letter-spacing: 1.5px;
    color: var(--color-primary);
    background: #000;
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.3);
    content: '> ' attr(title) '_';
}
@media (prefers-reduced-motion: reduce) { .action-dock-expand::after { animation: none; } }
/* la tecla de la consola de ordenes (Terminal.js inyecta su propio violeta) */
.action-dock .dock-btn.dock-btn--violet { color: var(--color-primary); background: #000; border: 1px solid rgba(var(--color-primary-rgb), 0.3); box-shadow: none; }
.action-dock .dock-btn.dock-btn--violet:hover,
.action-dock .dock-btn.dock-btn--violet:focus-visible { color: #000; background: var(--color-primary); border-color: var(--color-primary); box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.55); transform: none; }


/* ================================================================
   VUELTA DE STRIPE — aviso de pago recibido (DonationReturn.js)
   ================================================================ */
.donation-return {
    position: fixed;
    z-index: 10000;
    left: 50%;
    top: max(14px, env(safe-area-inset-top));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    max-width: min(560px, calc(100vw - 24px));
    padding: 12px 12px 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #d6ffe0;
    background: #03110a;
    border: 1px solid rgba(0, 255, 65, 0.55);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}
.donation-return[data-state="done"] { border-color: #00ff41; color: #eafff0; }
.donation-return[data-state="anon"],
.donation-return[data-state="slow"] { border-color: #ff9d00; color: #ffe2b3; }
.donation-return-close {
    flex: none;
    width: 32px;
    height: 32px;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    color: inherit;
    background: none;
    border: 1px solid currentColor;
    opacity: 0.7;
    cursor: pointer;
}
.donation-return-close:hover,
.donation-return-close:focus-visible { opacity: 1; }
