/* A.T.L.A.S styles (Tailwind utilities come from the Tailwind CDN in index.html) */
:root {
    --space-black: #02050B;
    --deep-navy: #0B1220;
    --glass-panel: #142238;
    --hud-cyan: #38BDF8;
    --sys-green: #34D399;
    --warn-amber: #FBBF24;
    --crit-red: #FB7185;
    --sci-purple: #A78BFA;
    --text-white: #E2E8F0;
}
body {
    background-color: var(--space-black);
    background-image:
        radial-gradient(circle at 18% 12%, rgba(20, 34, 56, 0.55) 0%, transparent 48%),
        radial-gradient(circle at 82% 85%, rgba(11, 18, 32, 0.75) 0%, transparent 52%),
        linear-gradient(rgba(56, 189, 248, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
/* Custom Aerospace Scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(2, 5, 11, 0.75); }
::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.22);
    border-radius: 9999px;
    transition: background 0.25s ease;
}
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.55); }

/* Primary Engineering Glass Panels (High Opacity for Legibility) */
.glass-panel {
    background: linear-gradient(165deg, rgba(20, 34, 56, 0.88) 0%, rgba(11, 18, 32, 0.94) 100%);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgba(56, 189, 248, 0.14);
    box-shadow: 0 22px 48px -14px rgba(2, 5, 11, 0.85), inset 0 1px 0 0 rgba(226, 232, 240, 0.06);
    transition: border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-panel:hover { border-color: rgba(56, 189, 248, 0.24); }

/* Secondary Floating HUD Glass (Higher Transparency for Viewport Overlays) */
.hud-floating-glass {
    background: linear-gradient(165deg, rgba(11, 18, 32, 0.72) 0%, rgba(2, 5, 11, 0.82) 100%);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(56, 189, 248, 0.18);
    box-shadow: 0 12px 32px -8px rgba(2, 5, 11, 0.8), inset 0 1px 0 0 rgba(226, 232, 240, 0.05);
}

/* Selectable Subsystem & Mission Cards */
.glass-card {
    position: relative;
    background: linear-gradient(160deg, rgba(20, 34, 56, 0.68) 0%, rgba(11, 18, 32, 0.88) 100%);
    border: 1px solid rgba(226, 232, 240, 0.09);
    box-shadow: 0 6px 20px -6px rgba(2, 5, 11, 0.65);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 65%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.glass-card:hover {
    border-color: rgba(56, 189, 248, 0.42);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -10px rgba(2, 5, 11, 0.85), 0 0 14px rgba(56, 189, 248, 0.1);
}
.glass-card:hover::before { opacity: 1; }
.glass-card.selected {
    background: linear-gradient(160deg, rgba(20, 34, 56, 0.92) 0%, rgba(11, 18, 32, 0.96) 100%);
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 8px 24px -6px rgba(2, 5, 11, 0.9), inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

/* ================= FIXED VIEWPORT NO-SCROLL APPLICATION SHELL ================= */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
}
.app-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.left-workstation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}
.right-workspace {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.viewport-hero-size {
    min-height: 440px;
    height: 58vh;
}
@media (min-width: 1024px) {
    body {
        overflow: hidden;
    }
    .app-shell {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    .main-workspace {
        overflow: hidden;
        grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
        gap: 10px;
        padding: 6px 10px 8px 10px;
    }
    .left-workstation {
        height: 100%;
        overflow: hidden;
        gap: 6px;
    }
    .right-workspace {
        height: 100%;
        overflow: hidden;
        display: grid;
        grid-template-rows: minmax(340px, 1fr) auto;
        gap: 8px;
    }
    .viewport-hero-size {
        min-height: 0 !important;
        height: 100% !important;
    }
}
.line-clamp-2-custom {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body.viewport-expanded-backdrop::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(2, 5, 11, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 45;
    pointer-events: auto;
}
.viewport-expanded-fallback {
    position: fixed !important;
    top: 3vh !important;
    left: 2.5vw !important;
    width: 95vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    z-index: 50 !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.96), 0 0 0 1px rgba(56, 189, 248, 0.16) !important;
}
#threeViewportPanel:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    background: #02050B;
}
/* ATLAS Dock Corner Repositioning */
.nexi-dock-br { bottom: 1rem; right: 1rem; left: auto; top: auto; align-items: flex-end; }
.nexi-dock-bl { bottom: 1rem; left: 1rem; right: auto; top: auto; align-items: flex-start; }
.nexi-dock-tr { top: 4.75rem; right: 1rem; left: auto; bottom: auto; align-items: flex-end; }

/* Smooth Collapsible CAD & Science Drawers */
.cad-drawer {
    transform-origin: top left;
    transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.26s;
}
.cad-drawer-right {
    transform-origin: top right;
}
.cad-drawer-closed {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none !important;
    visibility: hidden;
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    border-width: 0 !important;
    overflow: hidden;
}
.cad-drawer-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto !important;
    visibility: visible;
}

/* Smooth Tab & Modal Animations */
@keyframes tabSlideFade {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
.tab-pane:not(.hidden) { animation: tabSlideFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes pulse-border {
    0%, 100% { border-color: rgba(251, 113, 133, 0.35); box-shadow: 0 0 6px rgba(251, 113, 133, 0.15); }
    50% { border-color: rgba(251, 113, 133, 0.85); box-shadow: 0 0 16px rgba(251, 113, 133, 0.4); }
}
.warning-pulse { animation: pulse-border 2.2s infinite; }
@keyframes stage-glow {
    0%, 100% { border-color: rgba(251, 191, 36, 0.45); box-shadow: 0 0 10px rgba(251, 191, 36, 0.25); }
    50% { border-color: rgba(251, 191, 36, 0.95); box-shadow: 0 0 20px rgba(251, 191, 36, 0.55); }
}
.stage-btn-ready { animation: stage-glow 1.4s infinite; }
/* Tutorial Target Highlight Glow */
@keyframes tutorialHighlightPulse {
    0%, 100% { box-shadow: 0 0 0 1.5px #38BDF8, 0 0 18px rgba(56, 189, 248, 0.45); }
    50% { box-shadow: 0 0 0 3px #38BDF8, 0 0 28px rgba(56, 189, 248, 0.75); }
}
.nexi-tutorial-highlight {
    animation: tutorialHighlightPulse 1.6s infinite !important;
    border-color: #38BDF8 !important;
    position: relative;
    z-index: 25;
}
/* Character & ATLAS Animations */
@keyframes charBreathe {
    0%, 100% { transform: translateY(0px) scaleY(1); }
    50% { transform: translateY(-2.2px) scaleY(1.018); }
}
@keyframes charHeadSway {
    0%, 100% { transform: rotate(0deg) translateY(0px); }
    35% { transform: rotate(-2.2deg) translateY(-1px); }
    70% { transform: rotate(2.2deg) translateY(-0.5px); }
}
@keyframes charBlink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.08); }
}
@keyframes charTalkMouth {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1.35); }
}
@keyframes charConsoleType {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-4deg); }
}
@keyframes charCelebrateJump {
    0%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-6px) scale(1.04); }
    75% { transform: translateY(-3px) scale(1.02); }
}
@keyframes charAlertPulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(244, 63, 94, 0.2)); }
    50% { filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.85)); }
}
@keyframes nexiFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(1.5deg); }
}
@keyframes nexiRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.char-breathe { animation: charBreathe 3.6s ease-in-out infinite; transform-origin: center bottom; }
.char-head { animation: charHeadSway 4.8s ease-in-out infinite; transform-origin: 50% 45%; }
.char-eyes { animation: charBlink 4.2s infinite; transform-origin: 50% 41%; }
.char-state-talking .char-mouth { animation: charTalkMouth 0.26s ease-in-out infinite; transform-origin: 50% 51%; }
.char-state-typing .char-hand { animation: charConsoleType 0.35s ease-in-out infinite; transform-origin: 50% 80%; }
.char-state-celebrate { animation: charCelebrateJump 0.75s ease-in-out infinite; }
.char-state-alert { animation: charAlertPulse 1.2s ease-in-out infinite; }
.nexi-float { animation: nexiFloat 3.2s ease-in-out infinite; }
.nexi-ring { animation: nexiRingSpin 9s linear infinite; transform-origin: 50% 50%; }

/* HUD Corner Brackets for 3D Viewport */
.hud-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: rgba(56, 189, 248, 0.38);
    pointer-events: none;
    z-index: 12;
}
.hud-tl { top: 8px; left: 8px; border-top: 1.5px solid; border-left: 1.5px solid; border-top-left-radius: 5px; }
.hud-tr { top: 8px; right: 8px; border-top: 1.5px solid; border-right: 1.5px solid; border-top-right-radius: 5px; }
.hud-bl { bottom: 8px; left: 8px; border-bottom: 1.5px solid; border-left: 1.5px solid; border-bottom-left-radius: 5px; }
.hud-br { bottom: 8px; right: 8px; border-bottom: 1.5px solid; border-right: 1.5px solid; border-bottom-right-radius: 5px; }

button { transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
button:active { transform: scale(0.97); }
.telemetry-pill {
    background: linear-gradient(180deg, rgba(20, 34, 56, 0.78) 0%, rgba(11, 18, 32, 0.92) 100%);
    border: 1px solid rgba(56, 189, 248, 0.14);
    transition: all 0.25s ease;
}
.telemetry-pill:hover {
    border-color: rgba(56, 189, 248, 0.38);
    transform: translateY(-1px);
}
canvas { display: block; width: 100%; height: 100%; outline: none; }
input[type="range"] { accent-color: #38BDF8; cursor: pointer; }

/* ================= PHASE 1: PROFESSIONAL DARK AEROSPACE GLASSMORPHISM THEME (override layer) ================= */
:root {
    /* Palette tokens */
    --bg-deep-space: #020817;
    --bg-midnight: #061329;
    --bg-panel: #091A33;
    --bg-elevated: #0D213D;
    --glass-primary: rgba(7, 22, 43, 0.94);
    --glass-secondary: rgba(10, 30, 55, 0.88);
    --glass-floating: rgba(5, 18, 36, 0.82);
    --accent-cyan: #22D3EE;
    --accent-blue: #38BDF8;
    --accent-teal: #2DD4BF;
    --accent-green: #10D6A0;
    --accent-amber: #FBBF24;
    --accent-red: #FB7185;
    --accent-purple: #A78BFA;
    --text-primary: #EAF4FF;
    --text-secondary: #9DB2CA;
    --text-muted: #657D99;
    --glass-border: rgba(56, 189, 248, 0.18);
    /* Remap legacy tokens so existing rules inherit the new palette */
    --space-black: var(--bg-deep-space);
    --deep-navy: var(--bg-midnight);
    --glass-panel: var(--bg-panel);
    --hud-cyan: var(--accent-blue);
    --sys-green: var(--accent-green);
    --warn-amber: var(--accent-amber);
    --crit-red: var(--accent-red);
    --sci-purple: var(--accent-purple);
    --text-white: var(--text-primary);
}
body {
    background-color: var(--bg-deep-space);
    background-image:
        radial-gradient(circle at 18% 10%, rgba(13, 33, 61, 0.55) 0%, transparent 46%),
        radial-gradient(circle at 85% 90%, rgba(6, 19, 41, 0.80) 0%, transparent 52%),
        linear-gradient(rgba(56, 189, 248, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.012) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    letter-spacing: 0;
}
h1, h2, h3, .font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.01em; }
.font-mono, .telemetry-pill, [id*="Telemetry"], [id*="telemetry"] {
    font-variant-numeric: tabular-nums;
}
::-webkit-scrollbar-track { background: rgba(2, 8, 23, 0.75); }

/* Primary glass: dense, legible, restrained */
.glass-panel {
    background: var(--glass-primary);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.glass-panel:hover { border-color: rgba(56, 189, 248, 0.30); }

/* Floating glass: lighter so the 3D scene stays visible behind it */
.hud-floating-glass {
    background: var(--glass-floating);
    backdrop-filter: blur(14px) saturate(135%);
    -webkit-backdrop-filter: blur(14px) saturate(135%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* Secondary glass: selectable cards */
.glass-card {
    background: var(--glass-secondary);
    border: 1px solid rgba(56, 189, 248, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}
.glass-card::before { background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.06), transparent 65%); }
.glass-card:hover {
    border-color: rgba(34, 211, 238, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}
.glass-card.selected {
    background: var(--bg-elevated);
    border-color: rgba(34, 211, 238, 0.70);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}

/* Main menu: cinematic, less dense, same navy glass */
#solarVignetteOverlay { background: radial-gradient(circle at 50% 45%, rgba(2, 8, 23, 0.10) 0%, rgba(2, 8, 23, 0.74) 100%) !important; }
#mainMenuOverlay h1 { letter-spacing: 0.04em; text-shadow: 0 4px 28px rgba(2, 8, 23, 0.95); }
#mainMenuOverlay button.glass-panel {
    background: var(--glass-secondary);
    border-color: rgba(34, 211, 238, 0.30) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s, background 0.28s, box-shadow 0.28s;
}
#mainMenuOverlay button.glass-panel:hover {
    background: rgba(13, 33, 61, 0.94);
    border-color: rgba(34, 211, 238, 0.65) !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4) !important;
}
#mainMenuOverlay button.glass-panel:nth-of-type(2) { border-color: rgba(45, 212, 191, 0.30) !important; }
#mainMenuOverlay button.glass-panel:nth-of-type(2):hover { border-color: rgba(45, 212, 191, 0.65) !important; }
.menu-tagline { color: var(--text-secondary); letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) {
    .animate-ping, .nexi-float, .nexi-ring, .ops-dot-live { animation: none !important; }
}

/* ================= PHASE 2: OPS-DASHBOARD LAYOUT (rail · workstation · 3D center · ops panel) ================= */
:root { --rail-w: 58px; --ops-w: 296px; --radius-panel: 12px; }
body { color: var(--text-primary); }
.glass-panel { border-radius: var(--radius-panel); }
.rounded-2xl.glass-panel { border-radius: 14px; }

/* ---- Command header ---- */
.ops-header {
    background: rgba(4, 14, 30, 0.96);
    border-bottom: 1px solid rgba(56, 189, 248, 0.14);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    padding: 7px 12px;
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
}
.ops-brand { display: flex; align-items: center; gap: 9px; padding: 3px 6px 3px 3px; border-radius: 10px; }
.ops-brand:hover { background: rgba(13, 33, 61, 0.7); }
.ops-brand-mark {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(160deg, rgba(34, 211, 238, 0.18), rgba(45, 212, 191, 0.08));
    border: 1px solid rgba(34, 211, 238, 0.38); color: var(--accent-cyan); font-size: 18px;
}
.ops-divider { width: 1px; height: 28px; background: rgba(56, 189, 248, 0.14); }
.ops-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px;
    font: 600 9.5px/1.5 'JetBrains Mono', monospace; letter-spacing: 0.02em; max-width: 100%;
}
.ops-chip-teal { background: rgba(45, 212, 191, 0.10); color: #5eead4; border: 1px solid rgba(45, 212, 191, 0.28); }
.ops-status {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 7px;
    font: 700 9.5px/1.1 'JetBrains Mono', monospace; letter-spacing: 0.06em; white-space: nowrap;
    border: 1px solid transparent;
}
.ops-status-go { background: rgba(16, 214, 160, 0.10); color: #34d399; border-color: rgba(16, 214, 160, 0.32); }
.ops-status-caution { background: rgba(251, 191, 36, 0.10); color: #fbbf24; border-color: rgba(251, 191, 36, 0.32); }
.ops-status-nogo { background: rgba(251, 113, 133, 0.10); color: #fb7185; border-color: rgba(251, 113, 133, 0.36); }
.ops-status-net { background: rgba(13, 33, 61, 0.7); color: var(--text-secondary); border-color: rgba(56, 189, 248, 0.18); font-weight: 600; }
.ops-status-net:hover { border-color: rgba(56, 189, 248, 0.42); }
.ops-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,0.04); }
.ops-dot-live { background: #10d6a0; animation: opsPulse 2.4s ease-in-out infinite; }
@keyframes opsPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.ops-telemetry-strip { display: flex; align-items: stretch; gap: 5px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.ops-telemetry-strip::-webkit-scrollbar { display: none; }
.ops-tm {
    flex: 0 0 auto; padding: 4px 8px 5px; border-radius: 9px;
    background: rgba(9, 26, 51, 0.82); border: 1px solid rgba(56, 189, 248, 0.12);
    transition: border-color .2s ease;
}
.ops-tm:hover { border-color: rgba(56, 189, 248, 0.34); }
.ops-tm-label { display: flex; align-items: center; gap: 4px; font: 600 9px/1.2 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ops-tm-label i { font-size: 11px; color: var(--accent-blue); }
.tm-value { font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; }
@media (max-width: 1439px) { .tm-value { font-size: 11px; } .ops-tm { padding: 4px 6px 5px; } .ops-tm-label { font-size: 8.5px; } }
@media (min-width: 1680px) { .tm-value { font-size: 13px; } .ops-tm { min-width: 92px; padding: 5px 10px; } }

.ops-profile { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 3px; border-radius: 10px; background: rgba(9, 26, 51, 0.72); border: 1px solid rgba(56, 189, 248, 0.16); }
.ops-icon-btn {
    width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 9px;
    color: var(--text-secondary); background: rgba(9, 26, 51, 0.72); border: 1px solid rgba(56, 189, 248, 0.14); font-size: 16px;
}
.ops-icon-btn:hover { color: var(--text-primary); border-color: rgba(34, 211, 238, 0.45); background: rgba(13, 33, 61, 0.95); }
.ops-icon-btn.is-active { color: var(--accent-cyan); border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.10); }
.ops-icon-btn-sm { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }
.ops-badge {
    position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: #fb7185; color: #1a0610; font: 800 9.5px/16px 'JetBrains Mono', monospace; text-align: center;
    border: 1.5px solid #061329;
}
.ops-badge.is-warn { background: #fbbf24; }
.ops-primary-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px;
    color: #04212b; background: linear-gradient(180deg, #2dd4bf, #22b8cf); border: 1px solid rgba(94, 234, 212, 0.65);
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.18); white-space: nowrap;
}
.ops-primary-btn:hover { filter: brightness(1.08); }
.ops-primary-btn i { font-size: 16px; }

/* ---- Workspace grid ---- */
.main-workspace { padding: 8px; gap: 8px; }
.ops-rail {
    display: flex; flex-direction: row; justify-content: space-between; gap: 4px; padding: 6px;
    background: rgba(4, 14, 30, 0.92); border: 1px solid rgba(56, 189, 248, 0.14); border-radius: var(--radius-panel);
    overflow-x: auto; scrollbar-width: none;
}
.ops-rail-group { display: flex; flex-direction: row; align-items: center; gap: 4px; }
.ops-rail-sep { width: 1px; height: 22px; background: rgba(56, 189, 248, 0.16); margin: 0 2px; }
.ops-rail-btn {
    position: relative; flex: 0 0 auto; width: 42px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    color: var(--text-muted); font-size: 19px; border: 1px solid transparent;
}
.ops-rail-btn:hover { color: var(--text-primary); background: rgba(13, 33, 61, 0.85); border-color: rgba(56, 189, 248, 0.16); }
.ops-rail-btn.is-active { color: #5eead4; background: rgba(45, 212, 191, 0.12); border-color: rgba(45, 212, 191, 0.38); }
.ops-rail-btn.is-active::before {
    content: ''; position: absolute; left: -7px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf;
}
.ops-rail-count {
    position: absolute; top: 3px; right: 3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px;
    background: rgba(34, 211, 238, 0.2); color: #a5f3fc; font: 700 8.5px/14px 'JetBrains Mono', monospace;
}
.ops-rail-btn::after {
    content: attr(data-label); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(-4px);
    white-space: nowrap; padding: 5px 9px; border-radius: 7px; pointer-events: none; opacity: 0;
    background: rgba(6, 19, 41, 0.97); border: 1px solid rgba(56, 189, 248, 0.28); color: var(--text-primary);
    font: 600 11px/1.2 'Inter', sans-serif; letter-spacing: 0; box-shadow: 0 8px 22px rgba(0,0,0,0.45);
    transition: opacity .16s ease, transform .16s ease; z-index: 60;
}
.ops-rail-btn:hover::after, .ops-rail-btn:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 1023px) {
    .ops-rail-btn::after { display: none; }
    .ops-rail-btn.is-active::before { left: 9px; right: 9px; top: auto; bottom: -7px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
}
.ops-side { display: none; }

@media (min-width: 1024px) {
    .main-workspace {
        padding: 8px 10px 10px 8px; gap: 8px;
        grid-template-columns: var(--rail-w) minmax(360px, 31fr) minmax(0, 69fr);
    }
    .main-workspace.ops-open { grid-template-columns: var(--rail-w) minmax(340px, 29fr) minmax(0, 71fr) var(--ops-w); }
    .main-workspace.ws-collapsed { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
    .main-workspace.ws-collapsed.ops-open { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--ops-w); }
    .ops-rail { flex-direction: column; overflow: visible; height: 100%; min-height: 0; padding: 7px 7px; }
    .ops-rail-group { flex-direction: column; }
    .ops-rail-sep { width: 22px; height: 1px; margin: 3px 0; }
    .right-workspace { grid-template-rows: minmax(300px, 1fr) auto !important; }
}
.main-workspace.ws-collapsed #workstationPanel { display: none !important; }
.main-workspace.ops-open .ops-side { display: flex; }
@media (max-width: 1023px) { .main-workspace.ops-open .ops-side { display: flex; min-height: 420px; } }

/* Workstation panel adapts to its own width (container queries) */
#workstationPanel { container-type: inline-size; container-name: ws; }
@container ws (max-width: 470px) {
    #busPowerGrid, #busBatteryGrid, #busShieldGrid, #orbitSelectionGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #payloadInstrumentsGrid { grid-template-columns: minmax(0, 1fr) !important; }
    #directiveArchitectureSummary .grid, #scenarioBriefBox .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@container ws (max-width: 380px) {
    #scenarioCardsContainer, #busStructureGrid, #commsSelectionGrid, #rocketSelectionGrid, #specialistStatusGrid { grid-template-columns: minmax(0, 1fr) !important; }
}
#workstationTabsBar { display: none !important; }
.ws-collapse-btn { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--text-muted); border: 1px solid rgba(56, 189, 248, 0.14); }
.ws-collapse-btn:hover { color: var(--text-primary); border-color: rgba(56, 189, 248, 0.4); }

/* 3D viewport adapts its HUD to the available width */
#threeViewportPanel { container-type: inline-size; container-name: vp; }
@container vp (max-width: 980px) {
    [id^="camBtn-"] > span, #expandViewportLabel { display: none; }
    [id^="camBtn-"] { padding-left: 8px !important; padding-right: 8px !important; }
}
@container vp (max-width: 640px) {
    #viewportSubLabel { display: none; }
}

/* ---- Bottom operations dashboard ---- */
.ops-dashboard { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; container-type: inline-size; container-name: dash; }
.ops-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ops-section-title { font: 600 11px/1.3 'Space Grotesk', 'Inter', sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-primary); white-space: nowrap; }
.ops-dash-grid { display: grid; grid-template-columns: 1.05fr 1.15fr 1.25fr 0.95fr; gap: 7px; min-height: 0; }
@container dash (max-width: 640px) { .ops-dash-grid { grid-template-columns: 1fr 1fr; } }
.main-workspace:not(.ops-open) .ops-dashboard { padding-right: 64px; }
.ops-dash-card {
    min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 7px 9px 8px; border-radius: 10px;
    background: rgba(9, 26, 51, 0.72); border: 1px solid rgba(56, 189, 248, 0.10);
}
.ops-card-title { display: flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; font: 600 9.5px/1.2 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }
.ops-card-title i { color: var(--accent-teal); font-size: 12px; }
.ops-k { font: 500 10px/1.3 'Inter', sans-serif; color: var(--text-muted); white-space: nowrap; }
.ops-v { font: 600 11px/1.3 'JetBrains Mono', monospace; color: var(--text-primary); min-width: 0; text-align: right; }
.ops-v-soft { font-family: 'Inter', sans-serif; font-weight: 500; color: var(--text-secondary); }
.ops-bar { width: 100%; height: 5px; border-radius: 99px; background: rgba(30, 50, 82, 0.75); overflow: hidden; }
.ops-bar-thin { height: 3px; margin-top: 2px; }
.ops-bar-fill { height: 100%; border-radius: 99px; transition: width .35s ease; }
.ops-link { font: 600 9.5px/1 'Inter', sans-serif; letter-spacing: 0.04em; text-transform: none; color: var(--accent-blue); }
.ops-link:hover { color: var(--text-primary); text-decoration: underline; }
.ops-ghost-btn {
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px;
    font: 600 10px/1 'JetBrains Mono', monospace; color: #7dd3fc; background: rgba(13, 33, 61, 0.8); border: 1px solid rgba(56, 189, 248, 0.25);
}
.ops-ghost-btn:hover { border-color: rgba(56, 189, 248, 0.55); color: var(--text-primary); }
.ops-ghost-green { color: #34d399; border-color: rgba(16, 214, 160, 0.35); }
.ops-sys-row { display: flex; align-items: center; gap: 6px; min-width: 0; font: 500 10.5px/1.3 'Inter', sans-serif; color: var(--text-secondary); }
.ops-sys-row i { color: var(--accent-blue); font-size: 12px; flex: 0 0 auto; }
.ops-sys-row b { color: var(--text-primary); font-weight: 600; }
.ops-pill { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 5px; font: 600 9.5px/1.5 'JetBrains Mono', monospace; background: rgba(34, 211, 238, 0.08); color: #a5f3fc; border: 1px solid rgba(34, 211, 238, 0.2); white-space: nowrap; }
.ops-alert { display: flex; align-items: flex-start; gap: 6px; padding: 4px 7px; border-radius: 7px; border: 1px solid; font: 500 10px/1.35 'Inter', sans-serif; cursor: pointer; min-width: 0; }
.ops-alert b { font: 700 9.5px/1.35 'JetBrains Mono', monospace; letter-spacing: 0.02em; }
.ops-alert-critical { background: rgba(251, 113, 133, 0.07); border-color: rgba(251, 113, 133, 0.32); color: #fecdd3; }
.ops-alert-critical i { color: #fb7185; }
.ops-alert-warning { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.28); color: #fde68a; }
.ops-alert-warning i { color: #fbbf24; }
.ops-alert-nominal { background: rgba(16, 214, 160, 0.06); border-color: rgba(16, 214, 160, 0.28); color: #a7f3d0; }
.ops-alert-nominal i { color: #10d6a0; }
.ops-alert:hover { filter: brightness(1.12); }

/* ---- Right operations panel ---- */
.ops-side { flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.ops-side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 12px 8px; border-bottom: 1px solid rgba(56, 189, 248, 0.10); }
.ops-side-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 7px 8px 0; }
.ops-side-tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 7px; border-radius: 8px 8px 0 0;
    color: var(--text-muted); font: 600 10px/1 'Inter', sans-serif; border-bottom: 2px solid transparent;
}
.ops-side-tab i { font-size: 15px; }
.ops-side-tab:hover { color: var(--text-primary); background: rgba(13, 33, 61, 0.6); }
.ops-side-tab.is-active { color: #67e8f9; border-bottom-color: #22d3ee; background: rgba(34, 211, 238, 0.07); }
.ops-side-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 7px 12px 6px; border-top: 1px solid rgba(56, 189, 248, 0.10); font: 500 9.5px/1.3 'Inter', sans-serif; color: var(--text-muted); }
.ops-src { display: inline-block; padding: 0 4px; margin-right: 3px; border-radius: 4px; font: 700 8.5px/1.6 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
.ops-src-model { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; }
.ops-src-sim { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; }
.ops-src-nm { background: rgba(101, 125, 153, 0.18); color: #9db2ca; }
.ops-side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 10px; }
.ops-side-body .tab-anim { animation: tabSlideFade 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.ops-group-title { margin: 10px 0 4px; font: 600 9.5px/1.2 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.ops-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 6px; padding: 5px 0; border-bottom: 1px dashed rgba(56, 189, 248, 0.09); }
.ops-row:last-child { border-bottom: none; }
.ops-row-k { font: 500 11px/1.3 'Inter', sans-serif; color: var(--text-secondary); min-width: 0; }
.ops-row-v { font: 600 11.5px/1.3 'JetBrains Mono', monospace; color: var(--text-primary); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ops-row-v.is-nm { color: var(--text-muted); font-weight: 500; }
.ops-row-v.is-good { color: #34d399; } .ops-row-v.is-warn { color: #fbbf24; } .ops-row-v.is-bad { color: #fb7185; }
.ops-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.ops-hero-cell { padding: 7px 8px; border-radius: 9px; background: rgba(9, 26, 51, 0.8); border: 1px solid rgba(56, 189, 248, 0.10); min-width: 0; }
.ops-hero-cell .k { font: 600 9px/1.2 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ops-hero-cell .v { font: 700 15px/1.3 'JetBrains Mono', monospace; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-hero-cell .u { font-size: 10px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
.ops-note { margin-top: 8px; padding: 7px 9px; border-radius: 8px; background: rgba(101, 125, 153, 0.08); border: 1px solid rgba(101, 125, 153, 0.2); font: 500 10.5px/1.45 'Inter', sans-serif; color: var(--text-secondary); }
.ops-side-foot { display: flex; gap: 6px; align-items: flex-start; padding: 8px 64px 10px 12px; border-top: 1px solid rgba(56, 189, 248, 0.10); font: 500 9.5px/1.4 'Inter', sans-serif; color: var(--text-muted); }
.ops-side-foot i { color: var(--accent-blue); margin-top: 1px; }

/* ---- ATLAS guide: compact floating avatar ---- */
#nexiMinimizedBtn {
    padding: 5px; border-radius: 16px; background: rgba(5, 18, 36, 0.92); border: 1px solid rgba(34, 211, 238, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
#nexiMinimizedBtn:hover { transform: none; border-color: rgba(34, 211, 238, 0.8); }
#nexiMinimizedBtn .nexi-mini-text { display: none; max-width: 230px; }
#nexiMinimizedBtn:hover .nexi-mini-text, #nexiMinimizedBtn:focus-visible .nexi-mini-text { display: block; }
.nexi-status-dot { position: absolute; right: 2px; bottom: 2px; width: 10px; height: 10px; border-radius: 999px; background: #2dd4bf; border: 2px solid #061329; }
#nexiExpandedPanel { background: rgba(5, 18, 36, 0.96); border-color: rgba(34, 211, 238, 0.35) !important; }
#nexiExpandedPanel > div:first-child { background: rgba(6, 19, 41, 0.98) !important; }
#nexiSpeechText { font-size: 12px; line-height: 1.55; color: var(--text-primary); }

/* ---- Explorer & menu polish ---- */
#solarExplorerOverlay .hud-floating-glass { background: rgba(5, 18, 36, 0.86); }
#solarTimelineFooter { transition: opacity .25s ease; }
@media (min-width: 1024px) { #solarTimelineFooter { margin-right: 64px; } }
#solarTimelineFooter.is-spotlight { border-color: rgba(167, 139, 250, 0.75) !important; box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35), 0 10px 40px rgba(0,0,0,0.5); }
.solar-nav-btn { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 9px; border: 1px solid transparent; text-align: left; color: var(--text-secondary); }
.solar-nav-btn:hover { background: rgba(13, 33, 61, 0.8); color: var(--text-primary); }
.solar-nav-btn.is-active { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.42); color: var(--text-primary); }
.solar-nav-btn .dot { width: 9px; height: 9px; border-radius: 999px; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255,255,255,0.05); }
.solar-nav-btn.is-moon { padding-left: 22px; }
.solar-nav-sep { height: 1px; margin: 6px 4px; background: rgba(56, 189, 248, 0.12); }
#mainMenuOverlay .grid > button { text-align: left; }
#mainMenuOverlay .grid > button .w-12.h-12 { background: rgba(13, 33, 61, 0.9) !important; border-color: rgba(56, 189, 248, 0.32) !important; box-shadow: none !important; }
#mainMenuOverlay > div:last-child { padding-right: 72px; }

.ops-crew-row { display: flex; align-items: center; gap: 7px; padding: 3px 5px; border-radius: 8px; border: 1px solid rgba(56, 189, 248, 0.08); background: rgba(5, 18, 36, 0.6); cursor: pointer; min-width: 0; }
.ops-crew-row:hover { border-color: rgba(34, 211, 238, 0.4); }
.ops-crew-row.is-bad { border-color: rgba(251, 113, 133, 0.35); }
.ops-crew-row .av { width: 24px; height: 24px; border-radius: 7px; overflow: hidden; flex: 0 0 auto; border: 1px solid rgba(56, 189, 248, 0.25); background: #020617; }
.ops-crew-row .who { min-width: 0; flex: 1; font: 600 10.5px/1.2 'JetBrains Mono', monospace; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-crew-row .who small { display: none; font: 500 9px/1.2 'Inter', sans-serif; color: var(--text-muted); letter-spacing: 0.04em; }
.ops-crew-row .st { flex: 0 1 auto; font: 600 10px/1.2 'JetBrains Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; text-align: right; }
/* Directive pane: let scenario cards keep their natural height and scroll inside the pane on short screens */
#tab-directive > #scenarioCardsContainer { flex: 1 0 auto !important; }
.ops-dashboard { max-height: min(42vh, 380px); }
.ops-dash-grid { overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 767px) {
    #opsCommandBar > div { flex-wrap: wrap; row-gap: 6px; }
    #headerTelemetryStrip { order: 10; flex-basis: 100%; justify-content: flex-start; }
}

/* ================= PHASE 3: LET'S EXPLORE — mirrors the Play Game ops layout ================= */
.explore-shell {
    background-color: var(--bg-deep-space);
    background-image:
        radial-gradient(circle at 18% 10%, rgba(13, 33, 61, 0.55) 0%, transparent 46%),
        radial-gradient(circle at 85% 90%, rgba(6, 19, 41, 0.80) 0%, transparent 52%),
        linear-gradient(rgba(56, 189, 248, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.012) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    user-select: none;
}
#solarSystemStageShell.is-explore #solarVignetteOverlay,
#solarSystemStageShell.is-explore #solarSystemCanvasMount { display: none; }
.explore-workspace {
    flex: 1; min-height: 0; display: grid; gap: 8px; padding: 8px;
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
}
@media (min-width: 1024px) {
    .explore-workspace {
        padding: 8px 10px 10px 8px; overflow: hidden;
        grid-template-columns: var(--rail-w) minmax(0, 1fr) 272px;
    }
    .explore-workspace.ex-panels-hidden { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
}
@media (min-width: 1280px) { .explore-workspace { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--ops-w); } }
.explore-workspace.ex-panels-hidden #solarDossierCard,
.explore-workspace.ex-panels-hidden #solarTimelineFooter { display: none !important; }

.explore-center { display: grid; grid-template-rows: minmax(300px, 1fr) auto; gap: 8px; min-height: 0; min-width: 0; }
@media (max-width: 1023px) { .explore-center { grid-template-rows: 62vh auto; } }
.explore-workspace.ex-panels-hidden .explore-center { grid-template-rows: minmax(0, 1fr); }
#explorerViewportPanel { min-height: 0; container-type: inline-size; container-name: exvp; background: #02050B; }
#explorerViewportMount canvas { width: 100% !important; height: 100% !important; }
@container exvp (max-width: 860px) { .ex-cam-btn > span, #explorerExpandLabel, #solarCleanViewBtn > span { display: none; } }
#explorerViewportPanel.ex-expanded { box-shadow: 0 0 0 100vmax rgba(2, 5, 11, 0.88), 0 32px 90px rgba(0,0,0,0.96) !important; }

.ex-cam-btn {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px;
    font: 600 11px/1.2 'JetBrains Mono', monospace; color: #cbd5e1; border: 1px solid transparent;
}
.ex-cam-btn:hover { color: #fff; background: rgba(30, 41, 59, 0.7); }
.ex-cam-btn.is-active { color: #a5f3fc; background: rgba(34, 211, 238, 0.18); border-color: rgba(34, 211, 238, 0.5); }
.ex-hud-btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
    font: 600 9.5px/1.5 'JetBrains Mono', monospace; color: #cbd5e1;
    background: rgba(11, 18, 32, 0.9); border: 1px solid rgba(51, 65, 85, 0.8);
}
.ex-hud-btn:hover { color: #fff; border-color: rgba(56, 189, 248, 0.45); }
.ex-hud-btn.is-on { color: #a5f3fc; background: rgba(34, 211, 238, 0.16); border-color: rgba(34, 211, 238, 0.45); }

/* Rail: celestial glyphs sized roughly by body class */
.ex-rail-btn { height: 36px; }
@media (max-height: 760px) and (min-width: 1024px) { .ex-rail-btn { height: 31px; } #solarNavRail .ops-rail-group { gap: 2px; } }
.ex-rail-dot {
    display: block; border-radius: 999px; position: relative;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 35%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 45%, #000) 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
.ex-rail-dot.has-ring::after {
    content: ''; position: absolute; left: -5px; right: -5px; top: 50%; height: 4px; transform: translateY(-50%) rotate(-18deg);
    border: 1px solid color-mix(in srgb, var(--c) 70%, #fff); border-radius: 999px; opacity: 0.85;
}
.ex-rail-moon-tag { position: absolute; bottom: 1px; font: 600 7px/1 'JetBrains Mono', monospace; color: var(--text-muted); letter-spacing: 0.04em; }
.ops-rail-btn.is-active .ex-rail-moon-tag { color: #5eead4; }
#solarNavRail { display: flex; }
#solarNavRail .ops-rail-btn::after { z-index: 80; }

/* Bottom dashboard */
#solarTimelineFooter { margin-right: 0 !important; }
.ex-dash-grid { grid-template-columns: 1fr 1.5fr 1.15fr; }
@container dash (max-width: 640px) { .ex-dash-grid { grid-template-columns: 1fr 1fr; } }
.ex-history-card { display: flex; align-items: flex-start; gap: 9px; min-height: 0; }
.ex-history-card > div:first-child { width: 38px !important; height: 38px !important; }
.ex-history-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ex-mini { display: flex; gap: 6px; align-items: flex-start; font: 500 10.5px/1.35 'Inter', sans-serif; color: var(--text-secondary); min-width: 0; }
.ex-mini i { margin-top: 2px; font-size: 11px; flex: 0 0 auto; }
.ex-mini span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex-mini b { color: var(--text-primary); font-weight: 600; }

/* Right info panel */
.ex-side { display: flex !important; flex-direction: column; min-height: 0; }
@media (max-width: 1023px) { .ex-side { min-height: 480px; } }
.ex-side-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ex-glyph { width: 30px; height: 30px; border-radius: 999px; flex: 0 0 auto;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c, #38bdf8) 35%, #fff) 0%, var(--c, #38bdf8) 45%, color-mix(in srgb, var(--c, #38bdf8) 40%, #000) 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 18px color-mix(in srgb, var(--c, #38bdf8) 30%, transparent); }
.ex-row { grid-template-columns: 92px minmax(0, 1fr) auto; align-items: start; }
.ex-row-v { white-space: normal; text-align: right; font-size: 11px; line-height: 1.4; font-family: 'Inter', sans-serif; font-weight: 600; }
.ex-hero-v { font-size: 13px !important; }
.ex-bullet { display: flex; gap: 7px; align-items: flex-start; padding: 4px 0; font: 500 11px/1.45 'Inter', sans-serif; color: var(--text-secondary); }
.ex-bullet i { color: var(--accent-teal); margin-top: 3px; flex: 0 0 auto; }
.ex-bullet b { color: var(--text-primary); font-weight: 600; }
.ex-mission { margin-top: 6px; padding: 7px 9px; border-radius: 9px; background: rgba(9, 26, 51, 0.8); border: 1px solid rgba(56, 189, 248, 0.10); font: 500 10.5px/1.45 'Inter', sans-serif; color: var(--text-secondary); }
.ex-mission b { color: var(--text-primary); font: 600 11.5px/1.3 'Space Grotesk', 'Inter', sans-serif; }
.ex-mission-k { display: inline-block; min-width: 54px; margin-right: 4px; font: 600 9px/1.4 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ex-side-actions { padding: 8px 12px; border-top: 1px solid rgba(56, 189, 248, 0.10); }
#explorerTelemetryStrip .tm-value { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1365px) { #solarScaleModeBadge { display: none; } }
@media (max-width: 1599px) {
    #explorerTelemetryStrip .tm-value { max-width: 6.6rem; }
    #explorerCommandBar .ex-hide-md { display: none; }
}

/* ===== 16. Planetary engine UI: catalog, moon strip, layers ===== */
.ex-float-panel {
    position: absolute; z-index: 25; top: 66px; left: 12px; width: min(350px, calc(100% - 24px));
    max-height: calc(100% - 132px); overflow: auto; padding: 10px 11px; border-radius: 14px;
    background: rgba(6, 12, 24, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.26); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    font-size: 11px; color: #e2e8f0; scrollbar-width: thin;
}
.ex-layer-panel { left: auto; right: 12px; width: min(280px, calc(100% - 24px)); }
.ex-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font: 700 12px/1.2 'Space Grotesk', 'Inter', sans-serif; }
.ex-cat-group { margin-top: 9px; }
.ex-cat-title { font: 600 9.5px/1.2 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; color: #7dd3fc; margin-bottom: 5px; }
.ex-cat-btn, .ex-chip {
    display: inline-flex; align-items: center; gap: 5px; margin: 0 4px 4px 0; padding: 3px 8px; border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(15, 23, 42, 0.72); color: #e2e8f0;
    font: 500 11px/1.25 'Inter', sans-serif; cursor: pointer; white-space: nowrap;
}
.ex-cat-btn:hover, .ex-chip:hover { border-color: rgba(56, 189, 248, 0.6); color: #fff; }
.ex-cat-btn.is-active, .ex-chip.is-active { background: rgba(14, 165, 233, 0.22); border-color: rgba(56, 189, 248, 0.78); color: #e0f2fe; }
.ex-cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); flex: none; }
.ex-cat-moonrow { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 3px; }
.ex-cat-parent { font: 600 9.5px/1.2 'JetBrains Mono', monospace; color: #94a3b8; width: 60px; flex: none; margin-bottom: 4px; }
.ex-cat-more { font: 600 10px/1.2 'JetBrains Mono', monospace; color: #7dd3fc; padding: 3px 6px; margin-bottom: 4px; border-radius: 6px; }
.ex-cat-more:hover { background: rgba(56, 189, 248, 0.12); }
.ex-cat-note { margin-top: 9px; font-size: 10px; color: #94a3b8; line-height: 1.4; }
.ex-moon-strip {
    position: absolute; z-index: 21; left: 10px; right: 10px; bottom: var(--ex-strip-bottom, 46px);
    display: flex; flex-wrap: nowrap; overflow-x: auto; align-items: center; padding: 4px 8px; border-radius: 12px;
    background: rgba(6, 12, 24, 0.74); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.2); scrollbar-width: thin;
}
.ex-moon-strip .ex-chip { margin: 0 4px 0 0; }
.ex-chip-more { color: #7dd3fc; font-family: 'JetBrains Mono', monospace; }
.ex-strip-k { font: 600 9.5px/1.2 'JetBrains Mono', monospace; text-transform: uppercase; color: #7dd3fc; margin-right: 8px; white-space: nowrap; }
.ex-strip-sep { width: 1px; height: 16px; background: rgba(148, 163, 184, 0.3); margin: 0 7px 0 3px; flex: none; }
.ex-layer-row { display: flex; gap: 8px; width: 100%; text-align: left; padding: 5px 5px; border-radius: 8px; color: #cbd5e1; align-items: flex-start; }
.ex-layer-row:hover { background: rgba(56, 189, 248, 0.08); }
.ex-layer-row.is-on { color: #e0f2fe; }
.ex-layer-row.is-on i { color: #38bdf8; }
.ex-layer-row i { font-size: 14px; margin-top: 1px; }
.ex-layer-row small { display: block; font-size: 9.5px; color: #94a3b8; }
.ops-ghost-btn.is-on { border-color: rgba(56, 189, 248, 0.6); color: #e0f2fe; background: rgba(14, 165, 233, 0.14); }
@media (max-width: 640px) { .ex-float-panel { top: 96px; max-height: calc(100% - 160px); } }

/* ===== 17. Play Game experience modes & mission launcher ===== */
#missionLauncherOverlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px;
    background: radial-gradient(ellipse at 50% 0%, rgba(14, 116, 144, 0.28), rgba(2, 6, 23, 0.94) 60%), rgba(2, 6, 23, 0.9); backdrop-filter: blur(10px); }
#missionLauncherOverlay.hidden { display: none; }
.ml-shell { width: min(1240px, 100%); margin: auto 0; }
.ml-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ml-skip { font: 600 11px 'JetBrains Mono', monospace; color: #94a3b8; padding: 6px 10px; border: 1px solid rgba(148,163,184,.25); border-radius: 8px; }
.ml-skip:hover { color: #fff; border-color: rgba(56,189,248,.5); }
.ml-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 600 10.5px 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.ml-steps .is-on { color: #67e8f9; } .ml-steps .is-done { color: #34d399; }
.ml-title { font: 800 clamp(22px, 3vw, 32px)/1.15 'Space Grotesk', 'Inter', sans-serif; color: #fff; margin-top: 10px; }
.ml-sub { color: #94a3b8; font-size: 13.5px; margin: 6px 0 16px; max-width: 760px; }
.ml-grid { display: grid; gap: 14px; }
.ml-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ml-grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ml-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; color: #e2e8f0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 13, 26, 0.92)); border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 40px rgba(0,0,0,.35); transition: transform .15s, border-color .15s, box-shadow .15s; }
.ml-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--acc) 60%, transparent); }
.ml-card.is-sel { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 18px 44px color-mix(in srgb, var(--acc) 25%, transparent); }
.ml-card-top { display: flex; justify-content: space-between; align-items: center; }
.ml-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 22px; color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent); }
.ml-tag, .ml-badge { font: 700 9.5px 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .07em; color: var(--acc); padding: 3px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); align-self: flex-start; }
.ml-name { font: 800 17px/1.2 'Space Grotesk', 'Inter', sans-serif; color: #fff; margin-top: 4px; }
.ml-who, .ml-dest { font-size: 12px; color: #94a3b8; display: flex; gap: 5px; align-items: center; }
.ml-blurb { font-size: 13px; line-height: 1.45; color: #cbd5e1; }
.ml-list { display: grid; gap: 4px; font-size: 12px; color: #cbd5e1; margin-top: 2px; }
.ml-list li { display: flex; gap: 6px; align-items: flex-start; } .ml-list i { color: var(--acc); margin-top: 2px; }
.ml-note { font: 500 10.5px 'JetBrains Mono', monospace; color: #64748b; margin-top: auto; padding-top: 8px; }
.ml-cta { font: 700 12px 'Inter', sans-serif; color: var(--acc); display: flex; gap: 6px; align-items: center; }
.ml-globe { width: 110px; height: 110px; align-self: center; filter: drop-shadow(0 8px 20px rgba(0,0,0,.6)); }
.ml-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11.5px; margin-top: 4px; padding-top: 8px; border-top: 1px solid rgba(148,163,184,.14); }
.ml-facts dt { color: #64748b; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; padding-top: 2px; }
.ml-facts dd { color: #e2e8f0; } .ml-dim { color: #334155; }
.ml-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; }
.ml-back { color: #94a3b8; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.ml-go { padding: 11px 20px; border-radius: 12px; background: linear-gradient(90deg, #22d3ee, #34d399); color: #04121c; font: 800 14px 'Inter', sans-serif; display: flex; gap: 8px; align-items: center; }
.ml-go:disabled { opacity: .4; cursor: not-allowed; }
#xpModeBadge { font: 700 10px 'JetBrains Mono', monospace; padding: 3px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }

/* Cadet guide bar */
#cadetGuideBar { border: 1px solid rgba(52, 211, 153, 0.4); background: linear-gradient(180deg, rgba(6, 78, 59, 0.28), rgba(2, 6, 23, 0.6)); border-radius: 14px; padding: 8px 10px; font-size: 12px; color: #d1fae5; }
.cg-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.cg-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.cg-step { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border-radius: 999px; font-size: 11px; color: #94a3b8; border: 1px solid rgba(148,163,184,.2); }
.cg-step span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 10px 'JetBrains Mono', monospace; background: rgba(148,163,184,.15); }
.cg-step.done { color: #6ee7b7; } .cg-step.done span { background: #059669; color: #fff; }
.cg-step.now { color: #fff; border-color: #34d399; background: rgba(52,211,153,.12); } .cg-step.now span { background: #34d399; color: #04121c; }
.cg-meters { display: flex; flex-wrap: wrap; gap: 4px; }
.cg-meter { display: grid; grid-template-columns: auto auto auto; gap: 0 5px; align-items: center; padding: 3px 8px; border-radius: 10px; border: 1px solid; font-size: 11px; }
.cg-meter small { grid-column: 1 / -1; font-size: 9.5px; opacity: .8; }
.cg-meter.ok { border-color: rgba(52,211,153,.4); color: #a7f3d0; } .cg-meter.bad { border-color: rgba(251,113,133,.5); color: #fecdd3; }
.cg-now { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin-top: 7px; line-height: 1.45; }
.cg-now small { display: block; color: #94a3b8; font-size: 10.5px; margin-top: 2px; }
.cg-actions { display: flex; gap: 6px; }
.cg-btn { padding: 6px 12px; border-radius: 10px; background: #34d399; color: #04121c; font-weight: 800; font-size: 12px; }
.cg-next { padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(52,211,153,.5); color: #a7f3d0; font-size: 12px; display: flex; gap: 5px; align-items: center; }

/* Interface complexity per mode (UI only — engine & data untouched) */
body.xp-cadet #diagnosticsAnalyzerPanel,
body.xp-cadet #missionOpsStageBar,
body.xp-cadet #coopRoleBar,
body.xp-engineer #coopRoleBar { display: none !important; }
body.xp-cadet #difficultySelect, body.xp-engineer #difficultySelect { pointer-events: none; opacity: .6; }

/* ===== 18. Spacecraft builder (Stages 2–4) ===== */
#tab-builder { gap: 8px; overflow-y: auto; padding-right: 2px; }
.bd-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 5px; }
.bd-navbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 9px; font-size: 11px; line-height: 1.15; color: #94a3b8; border: 1px solid rgba(148,163,184,.16); background: rgba(2,6,23,.5); text-align: center; }
.bd-navbtn i { font-size: 16px; }
#tab-builder { container-type: inline-size; }

.bd-navbtn.done { color: #6ee7b7; border-color: rgba(52,211,153,.3); }
.bd-navbtn.now { color: #fff; border-color: #22d3ee; background: rgba(34,211,238,.12); }
.bd-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bd-head h3 { font: 700 14px 'Space Grotesk', 'Inter', sans-serif; color: #fff; display: flex; gap: 6px; align-items: center; }
.bd-head h3 i { color: #22d3ee; }
.bd-head p { font-size: 12px; color: #cbd5e1; margin-top: 3px; line-height: 1.45; }
.bd-headbtns { display: flex; gap: 5px; flex: none; }
.bd-pri { padding: 6px 11px; border-radius: 9px; background: #22d3ee; color: #04121c; font-weight: 800; font-size: 12px; display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.bd-sec { padding: 6px 9px; border-radius: 9px; border: 1px solid rgba(148,163,184,.3); color: #cbd5e1; }
.bd-tip { font-size: 11.5px; color: #a7f3d0; background: rgba(6,78,59,.25); border: 1px solid rgba(52,211,153,.3); border-radius: 9px; padding: 6px 9px; display: flex; gap: 6px; }
.bd-totals { display: flex; flex-wrap: wrap; gap: 4px; font: 600 11px 'JetBrains Mono', monospace; }
.bd-totals span { padding: 3px 7px; border-radius: 7px; border: 1px solid; }
.bd-totals .ok { color: #6ee7b7; border-color: rgba(52,211,153,.35); } .bd-totals .bad { color: #fda4af; border-color: rgba(244,63,94,.45); }
.bd-slots { font-size: 11.5px; color: #cbd5e1; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 7px; }
.bd-card { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 9px; border-radius: 12px; border: 1px solid rgba(148,163,184,.18); background: rgba(2,6,23,.55); color: #e2e8f0; transition: border-color .15s, background .15s; }
.bd-card:hover { border-color: rgba(34,211,238,.5); }
.bd-card.sel { border-color: #22d3ee; background: rgba(8,51,68,.45); box-shadow: 0 0 0 1px rgba(34,211,238,.35); }
.bd-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.bd-thumb { width: 46px; height: 46px; }
.bd-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: rgba(34,211,238,.1); color: #67e8f9; font-size: 22px; }
.bd-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.bd-rec { font: 700 11px 'JetBrains Mono', monospace; color: #fcd34d; background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.4); padding: 2px 6px; border-radius: 999px; white-space: nowrap; }
.bd-on { font: 700 11px 'JetBrains Mono', monospace; color: #67e8f9; }
.bd-name { font: 700 12.5px/1.25 'Inter', sans-serif; color: #fff; }
.bd-name small { display: block; font: 500 11px 'JetBrains Mono', monospace; color: #64748b; margin-top: 1px; }
.bd-plain { font-size: 11.5px; color: #cbd5e1; line-height: 1.4; }
.bd-why { font-size: 11px; color: #a5f3fc; line-height: 1.4; }
.bd-tech { font-size: 11px; color: #64748b; line-height: 1.35; }
.bd-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; padding-top: 5px; border-top: 1px solid rgba(148,163,184,.12); }
.bd-specs dt { font: 600 11px 'JetBrains Mono', monospace; color: #64748b; text-transform: uppercase; }
.bd-specs dd { font-size: 11px; color: #e2e8f0; }
.bd-notes { display: grid; gap: 2px; }
.bd-note { font-size: 11px; line-height: 1.35; padding-left: 12px; position: relative; }
.bd-note::before { content: '●'; position: absolute; left: 0; font-size: 11px; top: 2px; }
.bd-note.ok { color: #6ee7b7; } .bd-note.warn { color: #fcd34d; } .bd-note.bad { color: #fda4af; }
.bd-grid-orbit { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bd-orbit-info { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid rgba(34,211,238,.25); background: rgba(8,47,73,.25); }
.bd-oviz { width: 100%; max-width: 200px; }
.bd-oi-specs { grid-template-columns: 1fr; border-top: 0; padding-top: 0; }
.bd-sliders { display: grid; gap: 6px; font-size: 11.5px; color: #cbd5e1; }
.bd-sliders input { width: 100%; accent-color: #22d3ee; }
@media (max-width: 720px) { .bd-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } .bd-orbit-info { grid-template-columns: 1fr; } }

/* Readiness checklist (Stage 5) */
.rd-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid; }
.rd-head.go { border-color: rgba(52,211,153,.55); background: rgba(6,78,59,.3); } .rd-head.nogo { border-color: rgba(244,63,94,.55); background: rgba(76,5,25,.3); }
.rd-head b { display: block; font: 800 20px 'Space Grotesk', 'Inter', sans-serif; color: #fff; }
.rd-head.go b { color: #6ee7b7; } .rd-head.nogo b { color: #fda4af; }
.rd-head small { font-size: 11.5px; color: #cbd5e1; }
.rd-k { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .1em; color: #94a3b8; }
.rd-head .bd-pri:disabled { background: #334155; color: #94a3b8; cursor: not-allowed; }
.rd-list { display: grid; gap: 5px; }
.rd-item { display: flex; gap: 8px; padding: 7px 9px; border-radius: 10px; border: 1px solid rgba(148,163,184,.14); background: rgba(2,6,23,.5); font-size: 11.5px; color: #cbd5e1; }
.rd-item b { color: #fff; font-size: 12px; }
.rd-item p { margin-top: 2px; line-height: 1.4; }
.rd-ic { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 12px; }
.rd-item.ok .rd-ic { background: rgba(52,211,153,.18); color: #6ee7b7; }
.rd-item.warn { border-color: rgba(245,158,11,.4); } .rd-item.warn .rd-ic { background: rgba(245,158,11,.18); color: #fcd34d; }
.rd-item.bad { border-color: rgba(244,63,94,.45); } .rd-item.bad .rd-ic { background: rgba(244,63,94,.18); color: #fda4af; }
.rd-st { margin-left: 6px; font: 600 11px 'JetBrains Mono', monospace; color: #64748b; }
.rd-why { color: #94a3b8; } .rd-how { color: #a5f3fc; }
.rd-fix { margin-left: 4px; color: #22d3ee; text-decoration: underline; font-size: 11px; }

/* Launch experience (Stage 6) */
#launchOverlay { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; text-align: center; }
#launchOverlay.hidden { display: none; }
#launchOverlay button { pointer-events: auto; }
#launchOverlay.lx-countdown { background: radial-gradient(circle at 50% 50%, rgba(2,6,23,.15), rgba(2,6,23,.55)); }
.lx-cd { font: 800 clamp(56px, 10vw, 120px)/1 'Space Grotesk', 'Inter', sans-serif; color: #fff; text-shadow: 0 0 30px rgba(245,158,11,.6); }
.lx-cd span { font-size: .45em; color: #fbbf24; margin-right: 4px; }
.lx-call { font: 700 14px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: #fde68a; min-height: 18px; }
.lx-warn { font-size: 12px; color: #fda4af; background: rgba(76,5,25,.6); border: 1px solid rgba(244,63,94,.5); padding: 5px 10px; border-radius: 8px; }
.lx-skip { margin-top: 6px; font: 600 11px 'JetBrains Mono', monospace; color: #cbd5e1; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(148,163,184,.35); background: rgba(2,6,23,.7); }
#launchOverlay.lx-seq { justify-content: flex-end; padding-bottom: 92px; }
.lx-step { pointer-events: auto; width: min(520px, calc(100% - 24px)); padding: 12px 14px; border-radius: 14px; background: rgba(2,6,23,.86); border: 1px solid rgba(34,211,238,.45); backdrop-filter: blur(10px); text-align: left; }
.lx-step b { display: block; font: 800 17px 'Space Grotesk', 'Inter', sans-serif; color: #fff; margin-top: 2px; }
.lx-step p { font-size: 12.5px; color: #cbd5e1; margin-top: 3px; line-height: 1.45; }
.lx-k { font: 700 11px 'JetBrains Mono', monospace; color: #67e8f9; letter-spacing: .08em; }
.lx-prog { display: flex; gap: 4px; margin-top: 8px; } .lx-prog i { flex: 1; height: 3px; border-radius: 2px; background: rgba(148,163,184,.25); } .lx-prog i.on { background: #22d3ee; }
#launchMilestoneBar { position: absolute; z-index: 25; left: 50%; transform: translateX(-50%); top: 106px; max-width: calc(100% - 24px); display: flex; gap: 4px; align-items: center; overflow-x: auto; padding: 5px 8px; border-radius: 10px; background: rgba(2,6,23,.78); border: 1px solid rgba(34,211,238,.25); scrollbar-width: none; }
#launchMilestoneBar.hidden { display: none; }
.lm-k { font: 700 11px 'JetBrains Mono', monospace; color: #64748b; margin-right: 4px; white-space: nowrap; }
.lm { font: 600 11px 'JetBrains Mono', monospace; color: #64748b; white-space: nowrap; padding: 2px 6px; border-radius: 6px; }
.lm.done { color: #6ee7b7; } .lm.now { color: #04121c; background: #22d3ee; }
#simObjectivesStrip { padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(34,211,238,.3); background: rgba(8,47,73,.25); }
#simObjectivesStrip .so-head b { color: #fff; font-size: 13px; margin-right: 8px; } #simObjectivesStrip .so-head span { color: #94a3b8; font-size: 12px; }
#simObjectivesStrip ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 12px; margin-top: 6px; }
#simObjectivesStrip li { font-size: 12px; color: #cbd5e1; display: flex; gap: 6px; align-items: center; } #simObjectivesStrip li.ok { color: #6ee7b7; }

/* Simplified dashboard (Cadet / Engineer) */
#simpleDashPanel { padding: 10px 12px; }
.sd-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.sd-head b { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .08em; color: #e2e8f0; }
.sd-head span { font-size: 11.5px; color: #94a3b8; }
.sd-link { margin-left: auto; font-size: 11px; color: #22d3ee; }
.sd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sd-card { padding: 10px 12px; border-radius: 12px; border: 1px solid; background: rgba(2,6,23,.55); min-width: 0; }
.sd-card.ok { border-color: rgba(52,211,153,.4); --c: #34d399; } .sd-card.warn { border-color: rgba(245,158,11,.5); --c: #f59e0b; } .sd-card.bad { border-color: rgba(244,63,94,.55); --c: #f43f5e; }
.sd-top { display: flex; align-items: center; gap: 6px; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; color: #cbd5e1; }
.sd-top i { font-size: 18px; color: var(--c); }
.sd-top em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--c); border: 1px solid var(--c); padding: 1px 6px; border-radius: 999px; }
.sd-big { font: 800 26px/1.1 'Space Grotesk', 'Inter', sans-serif; color: #fff; margin-top: 6px; }
.sd-card p { font-size: 11.5px; color: #cbd5e1; line-height: 1.35; margin-top: 2px; min-height: 31px; }
.sd-bar { height: 7px; border-radius: 99px; background: rgba(148,163,184,.18); margin-top: 7px; overflow: hidden; }
.sd-bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.sd-card small { font-size: 11px; color: #64748b; }
.sd-card code { display: block; margin-top: 5px; font: 10px/1.35 'JetBrains Mono', monospace; color: #94a3b8; }
.sd-details { margin-top: 8px; border-top: 1px solid rgba(148,163,184,.15); padding-top: 6px; }
.sd-details summary { cursor: pointer; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .08em; color: #67e8f9; }
.sd-details dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 16px; margin-top: 6px; }
.sd-details dt { font: 600 11px 'JetBrains Mono', monospace; color: #64748b; text-transform: uppercase; }
.sd-details dd { font-size: 11.5px; color: #e2e8f0; }
@media (max-width: 900px) { .sd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The simple dashboard replaces the full telemetry dashboard in Cadet and Engineer; Mission Control keeps the original */
body.xp-engineer #diagnosticsAnalyzerPanel { display: none !important; }
#simpleDashPanel { max-height: 46vh; overflow-y: auto; }

/* ATLAS instructor lesson card */
.nx-card { margin-bottom: 8px; padding: 9px 10px; border-radius: 12px; border: 1px solid rgba(34,211,238,.35); background: rgba(8,47,73,.45); }
.nx-card.good { border-color: rgba(52,211,153,.5); background: rgba(6,78,59,.35); }
.nx-card.warn { border-color: rgba(245,158,11,.5); background: rgba(69,26,3,.35); }
.nx-title { display: flex; gap: 6px; align-items: center; font: 700 12.5px 'Inter', sans-serif; color: #fff; }
.nx-title i { color: #22d3ee; } .nx-card.good .nx-title i { color: #34d399; } .nx-card.warn .nx-title i { color: #f59e0b; }
.nx-card p { font-size: 12px; line-height: 1.45; color: #e2e8f0; margin-top: 3px; }
.nx-visual { margin-top: 6px; border-radius: 8px; background: rgba(2,6,23,.6); padding: 4px; }
.nx-visual svg { width: 100%; height: auto; display: block; }
.nx-choices { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.nx-choices button { font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(34,211,238,.5); color: #a5f3fc; background: rgba(2,6,23,.6); }
.nx-choices button:hover { background: rgba(34,211,238,.15); color: #fff; }

/* ===== 19. Mode-specific layouts ===== */
#opsWorkspace.ly-anim > * { animation: lyFade .35s ease both; }
@keyframes lyFade { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #opsWorkspace.ly-anim > * { animation: none; } }

/* --- CADET: left = progress / task / ATLAS · centre = 3D · bottom = 4 indicators + action --- */
body.xp-cadet #headerTelemetryStrip,
body.xp-cadet #headerOpsPanelBtn,
body.xp-cadet #opsSidePanel,
body.xp-cadet #workstationTabsBar,
body.xp-cadet #modeSelectorBar > div:first-child,
body.xp-cadet #modeSelectorBar button[onclick*="setCameraViewMode('pad')"],
body.xp-cadet #modeSelectorBar button[onclick*="applyOptimalPreset"],
body.xp-cadet #modeSelectorBar .ws-collapse-btn { display: none !important; }
body.xp-cadet #workstationPanel .tab-pane:not(#tab-builder) { display: none !important; }
body.xp-cadet #workstationPanel { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
body.xp-cadet #cadetGuideBar .cg-meters { display: none; }
body.xp-cadet #workstationPanel > * { flex-shrink: 0; }
body.xp-cadet #workstationPanel #tab-builder { flex: 0 0 auto; height: auto; min-height: 0; overflow: visible; }
body.xp-cadet #workstationPanel #modeSelectorBar { order: -2; }
body.xp-cadet #cadetGuideBar { order: -1; }
@media (min-width: 1024px) {
    body.xp-cadet .main-workspace, body.xp-cadet .main-workspace.ops-open { grid-template-columns: var(--rail-w) minmax(340px, 28fr) minmax(0, 72fr); }
}
body.xp-cadet #simpleDashPanel .sd-details:not([open]) { margin-top: 6px; }
#cadetNexiSlot { flex: 0 0 auto; }
body.xp-engineer #cadetNexiSlot { margin-top: 6px; }
#nexiWidgetContainer.nexi-docked { position: static !important; inset: auto !important; transform: none !important; max-width: none !important; width: 100% !important; padding: 0 !important; z-index: auto; }
#nexiWidgetContainer.nexi-docked #nexiExpandedPanel { margin-bottom: 0; max-height: 40vh; overflow-y: auto; box-shadow: none; }
#nexiWidgetContainer.nexi-docked #nexiMinimizedBtn { width: 100%; justify-content: flex-start; }

.cg-objs { display: grid; gap: 5px; margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(52,211,153,.2); }
.cg-objs > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cg-k { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: #6ee7b7; margin-right: 2px; }
.cg-obj { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.cg-obj.ok { color: #a7f3d0; border-color: rgba(52,211,153,.3); }
.cg-obj.bad { color: #fecdd3; border-color: rgba(244,63,94,.45); } .cg-obj.warn { color: #fde68a; border-color: rgba(245,158,11,.45); }

/* Bottom status + main action */
.sd-status { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: #cbd5e1; }
.sd-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sd-dot.go { background: #34d399; box-shadow: 0 0 8px #34d399; } .sd-dot.fix { background: #f43f5e; box-shadow: 0 0 8px #f43f5e; } .sd-dot.live { background: #22d3ee; animation: sdPulse 1.4s infinite; }
@keyframes sdPulse { 50% { opacity: .35; } }
.sd-main { margin-left: auto; padding: 8px 14px; border-radius: 10px; font: 800 12.5px 'Inter', sans-serif; display: flex; gap: 6px; align-items: center; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; transition: transform .15s, filter .15s; }
.sd-main:hover { transform: translateY(-1px); filter: brightness(1.08); }
.sd-main.go { background: linear-gradient(90deg, #22d3ee, #34d399); color: #04121c; }
.sd-main.fix { background: rgba(244,63,94,.18); color: #fecdd3; border: 1px solid rgba(244,63,94,.55); }

/* --- ENGINEER: configuration (builder + tabs) · viewport · engineering indicators --- */
body.xp-engineer #coopRoleBar { display: none !important; }
@media (min-width: 1024px) {
    body.xp-engineer .main-workspace { grid-template-columns: var(--rail-w) minmax(380px, 33fr) minmax(0, 67fr); }
}

/* --- MISSION CONTROL: original arrangement, readability & spacing tweaks only --- */
body.xp-director .tab-btn { min-height: 34px; }
body.xp-director .ops-dash-card { padding: 9px 11px; }
body.xp-director .tab-pane { scroll-padding-top: 8px; }
body.xp-director :is(button, [role="button"]):focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }
body.xp-cadet #workstationPanel > div:has(> #tab-builder) { flex: 0 0 auto !important; height: auto !important; overflow: visible !important; min-height: 0 !important; }
body.xp-cadet #tab-builder .bd-totals { display: none; }

/* ===== 20. Terminology tooltips & glossary ===== */
abbr.term { text-decoration: underline dotted rgba(103,232,249,.7); text-underline-offset: 2px; cursor: help; }
abbr.term:focus-visible { outline: 2px solid #22d3ee; outline-offset: 1px; border-radius: 2px; }
body:not(.xp-cadet) abbr.term { text-decoration-color: rgba(148,163,184,.45); }
#termTip { position: fixed; z-index: 100000; display: none; max-width: 300px; padding: 9px 11px; border-radius: 10px; background: rgba(4,12,26,.97); border: 1px solid rgba(34,211,238,.5); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 12px; color: #e2e8f0; line-height: 1.4; }
#termTip b { color: #67e8f9; font-size: 12.5px; } #termTip p { margin-top: 2px; } #termTip small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; }
#termTip a { display: inline-block; margin-top: 5px; font-size: 11px; color: #22d3ee; cursor: pointer; text-decoration: underline; }
#termGlossary { position: fixed; inset: 0; z-index: 99990; background: rgba(2,6,23,.75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
#termGlossary.hidden { display: none; }
.tg-box { width: min(860px, 100%); max-height: 86vh; display: flex; flex-direction: column; border-radius: 16px; background: rgba(6,13,28,.97); border: 1px solid rgba(34,211,238,.35); overflow: hidden; }
.tg-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(148,163,184,.15); }
.tg-head b { color: #fff; font: 700 15px 'Space Grotesk', 'Inter', sans-serif; display: flex; gap: 6px; align-items: center; white-space: nowrap; } .tg-head b i { color: #22d3ee; }
.tg-head input { flex: 1; min-width: 0; background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 6px 10px; color: #e2e8f0; font-size: 13px; }
.tg-head button { color: #94a3b8; font-size: 18px; }
#tgBody { overflow-y: auto; padding: 4px 14px 14px; }
#tgBody table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#tgBody th { position: sticky; top: 0; background: rgba(6,13,28,.98); text-align: left; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: #64748b; padding: 8px 6px; }
#tgBody td { padding: 7px 6px; border-top: 1px solid rgba(148,163,184,.1); color: #e2e8f0; vertical-align: top; }
#tgBody td b { color: #67e8f9; } #tgBody .tg-dim { color: #94a3b8; }

/* ===== 21. Mission feedback & progress ===== */
#pgToasts { position: fixed; right: 16px; bottom: 16px; z-index: 100001; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.pg-toast { pointer-events: auto; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(4,12,26,.96); border: 1px solid rgba(34,211,238,.45); box-shadow: 0 10px 30px rgba(0,0,0,.5); color: #e2e8f0; animation: pgIn .35s ease-out; transition: opacity .35s, transform .35s; }
.pg-toast.out { opacity: 0; transform: translateX(30px); }
.pg-toast > i { font-size: 24px; color: #22d3ee; flex: none; margin-top: 2px; }
.pg-toast small { display: block; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .1em; color: #67e8f9; }
.pg-toast b { display: block; font: 700 14px 'Space Grotesk', 'Inter', sans-serif; color: #fff; } .pg-toast p { font-size: 11.5px; color: #94a3b8; margin-top: 2px; line-height: 1.35; }
.pg-achievement { border-color: rgba(250,204,21,.6); } .pg-achievement > i, .pg-achievement small { color: #facc15; }
.pg-discovery { border-color: rgba(167,139,250,.6); } .pg-discovery > i, .pg-discovery small { color: #c4b5fd; }
.pg-unlock, .pg-challenge { border-color: rgba(52,211,153,.6); } .pg-unlock > i, .pg-unlock small, .pg-challenge > i, .pg-challenge small { color: #6ee7b7; }
.pg-fact > i, .pg-fact small { color: #93c5fd; } .pg-fact b { font: 500 12.5px 'Inter', sans-serif; }
@keyframes pgIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
#pgSummary { display: flex; gap: 14px; margin: 10px 0; padding: 12px; border-radius: 14px; background: rgba(15,23,42,.8); border: 1px solid rgba(34,211,238,.3); }
.pgs-grade { flex: none; width: 74px; height: 74px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid currentColor; }
.pgs-grade b { font: 800 34px 'Space Grotesk', sans-serif; line-height: 1; } .pgs-grade small { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .1em; }
.pgs-S { color: #facc15; } .pgs-A { color: #34d399; } .pgs-B { color: #22d3ee; } .pgs-C { color: #fbbf24; } .pgs-D { color: #fb7185; }
.pgs-main { flex: 1; min-width: 0; } .pgs-title { font: 700 14px 'Space Grotesk', sans-serif; color: #fff; }
.pgs-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #94a3b8; margin-top: 4px; } .pgs-row b { color: #e2e8f0; } .pgs-row em { color: #34d399; font-style: normal; font-size: 11px; }
.pgs-tips { margin-top: 8px; font-size: 12px; color: #cbd5e1; } .pgs-tips b { color: #67e8f9; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; } .pgs-tips ul { margin: 3px 0 0 16px; list-style: disc; } .pgs-tips li { margin: 2px 0; }
.pgs-btn { margin-top: 8px; font-size: 12px; padding: 5px 10px; border-radius: 8px; background: rgba(250,204,21,.12); border: 1px solid rgba(250,204,21,.4); color: #fde68a; }
@media (max-width: 600px) { #pgSummary { flex-direction: column; } }
#pgPanel { position: fixed; inset: 0; z-index: 99990; background: rgba(2,6,23,.75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
#pgPanel.hidden { display: none; }
.pgp-box { width: min(920px, 100%); max-height: 88vh; display: flex; flex-direction: column; border-radius: 16px; background: rgba(6,13,28,.97); border: 1px solid rgba(250,204,21,.35); overflow: hidden; }
.pgp-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(148,163,184,.15); }
.pgp-head b { font: 700 15px 'Space Grotesk', sans-serif; color: #fff; display: flex; gap: 6px; align-items: center; } .pgp-head b i { color: #facc15; }
.pgp-head small { flex: 1; color: #94a3b8; font-size: 12px; } .pgp-head button { color: #94a3b8; font-size: 18px; }
.pgp-body { overflow-y: auto; padding: 4px 14px 16px; } .pgp-body h4 { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin: 14px 0 6px; }
.pgp-best { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: #94a3b8; margin-top: 10px; } .pgp-best b { color: #e2e8f0; }
.pgp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.pgp-ach { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(148,163,184,.15); background: rgba(15,23,42,.6); opacity: .55; }
.pgp-ach.got { opacity: 1; border-color: rgba(250,204,21,.45); } .pgp-ach i { font-size: 22px; color: #64748b; } .pgp-ach.got i { color: #facc15; }
.pgp-ach b, .pgp-ch b, .pgp-d b { font-size: 12.5px; color: #fff; } .pgp-ach p, .pgp-ch p, .pgp-d p { font-size: 11.5px; color: #94a3b8; margin-top: 2px; line-height: 1.35; }
.pgp-ch { padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(148,163,184,.15); background: rgba(15,23,42,.6); }
.pgp-ch small { font: 700 11px 'JetBrains Mono', monospace; color: #64748b; } .pgp-ch.open small { color: #22d3ee; } .pgp-ch.done small { color: #34d399; } .pgp-ch.done { border-color: rgba(52,211,153,.45); } .pgp-ch.locked { opacity: .55; }
.pgp-d { padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(167,139,250,.25); background: rgba(15,23,42,.6); } .pgp-d i { color: #c4b5fd; } .pgp-d .pgp-dim { opacity: .55; }

/* ===== 22. Crew roles ===== */
.crew-explain { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(148,163,184,.15); font-size: 11.5px; color: #cbd5e1; }
.crew-explain > b { display: flex; gap: 5px; align-items: center; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; }
.crew-plain { margin-top: 4px; line-height: 1.4; }
.crew-list { margin: 4px 0 0 15px; list-style: disc; line-height: 1.4; } .crew-list.tech { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #94a3b8; }
.crew-st { margin-top: 5px; font-size: 11px; display: flex; gap: 5px; align-items: flex-start; } .crew-st.ok { color: #6ee7b7; } .crew-st.bad { color: #fda4af; }
#crewIntro { padding: 10px 12px; border-radius: 12px; background: rgba(34,211,238,.07); border: 1px solid rgba(34,211,238,.3); font-size: 12.5px; color: #e2e8f0; }
#crewIntro summary { cursor: pointer; font-weight: 700; color: #67e8f9; display: flex; gap: 6px; align-items: center; }
#crewIntro ol { margin: 6px 0 0 18px; list-style: decimal; line-height: 1.5; } #crewIntro p { margin-top: 6px; color: #94a3b8; font-size: 12px; }
#crewRoleNow { padding: 6px 8px; border-radius: 9px; background: rgba(15,23,42,.7); font-size: 11px; color: #cbd5e1; }
.crew-now-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; } .crew-now-head b { color: #fff; font-size: 11.5px; } .crew-now-head span { color: #94a3b8; }
.crew-now-tasks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .crew-now-tasks span { padding: 1px 7px; border-radius: 999px; background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.25); color: #a5f3fc; font-size: 11px; }
.crew-team { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: #64748b; font: 600 11px 'JetBrains Mono', monospace; }
.crew-chip { padding: 0 6px; border-radius: 6px; border: 1px solid; } .crew-chip.ok { color: #6ee7b7; border-color: rgba(52,211,153,.35); } .crew-chip.bad { color: #fda4af; border-color: rgba(251,113,133,.35); }


/* ===== 23. Responsive & accessibility ===== */
/* Readable floor for Tailwind micro-text inside PLAY GAME (Mission Control keeps a slightly denser 10.5px) */
body.xp-cadet .text-\[7px\], body.xp-cadet .text-\[8px\], body.xp-cadet .text-\[8\.5px\], body.xp-cadet .text-\[9px\], body.xp-cadet .text-\[9\.5px\], body.xp-cadet .text-\[10px\], body.xp-cadet .text-\[10\.5px\],
body.xp-engineer .text-\[7px\], body.xp-engineer .text-\[8px\], body.xp-engineer .text-\[8\.5px\], body.xp-engineer .text-\[9px\], body.xp-engineer .text-\[9\.5px\], body.xp-engineer .text-\[10px\], body.xp-engineer .text-\[10\.5px\] { font-size: 11px !important; line-height: 1.35; }
body.xp-director .text-\[7px\], body.xp-director .text-\[8px\], body.xp-director .text-\[8\.5px\], body.xp-director .text-\[9px\], body.xp-director .text-\[9\.5px\], body.xp-director .text-\[10px\] { font-size: 10.5px !important; }
/* Visible keyboard focus everywhere */
:focus-visible { outline: 2px solid #22d3ee !important; outline-offset: 2px; border-radius: 6px; }
[role="button"]:focus-visible, abbr.term:focus-visible { outline-offset: 1px; }
.aero-skip { position: fixed; left: 8px; top: -60px; z-index: 100002; padding: 8px 14px; border-radius: 10px; background: #22d3ee; color: #020617; font-weight: 700; font-size: 14px; transition: top .15s; }
.aero-skip:focus { top: 8px; }
/* Comfortable click/tap targets */
body[class*="xp-"] #opsWorkspace button, body[class*="xp-"] #opsCommandBar button, body[class*="xp-"] #simulationModal button, body[class*="xp-"] #coopLobbyModal button { min-height: 28px; min-width: 28px; }
@media (pointer: coarse) { body[class*="xp-"] button, body[class*="xp-"] [role="button"] { min-height: 40px; min-width: 40px; } }
/* Crowded rows wrap instead of shrinking */
.ops-rail-group { flex-wrap: wrap; }
/* Primary actions stand out from secondary ones */
.sd-main, #simNextPhaseBtn, .bd-go, .launcher-primary { box-shadow: 0 0 0 1px rgba(34,211,238,.55), 0 6px 18px rgba(34,211,238,.18); font-weight: 700; }
/* Stacked layouts (tablet portrait / phone): let panels grow, page scrolls — nothing hidden inside tiny scroll boxes */
@media (max-width: 1023px) {
    body.xp-cadet #workstationPanel { overflow: visible !important; max-height: none !important; height: auto !important; }
    #simpleDashPanel { max-height: none; }
    body[class*="xp-"] .main-workspace { align-content: start; flex: none; height: auto; }
    body.xp-cadet #workstationPanel, body.xp-cadet .right-workspace { min-height: auto; }
    body.xp-cadet #workstationPanel { height: auto !important; }
    #pgToasts { right: 8px; left: 8px; width: auto; bottom: 8px; }
    .tg-box, .pgp-box { max-height: 92vh; }
}
@media (max-width: 480px) { #tgBody table { font-size: 12px; } #tgBody th:nth-child(3), #tgBody td:nth-child(3) { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
/* Loading + friendly error states */
#aeroBoot { position: fixed; inset: 0; z-index: 100003; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: #020617; color: #e2e8f0; font: 500 15px 'Inter', system-ui, sans-serif; transition: opacity .4s; }
#aeroBoot.done { opacity: 0; pointer-events: none; }
#aeroBoot .ab-ring { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(34,211,238,.2); border-top-color: #22d3ee; animation: abSpin 1s linear infinite; }
#aeroBoot small { color: #94a3b8; font-size: 13px; max-width: 420px; text-align: center; padding: 0 16px; }
@keyframes abSpin { to { transform: rotate(360deg); } }
#aeroNotice { position: fixed; left: 50%; transform: translateX(-50%); top: 10px; z-index: 100000; max-width: calc(100% - 24px); padding: 9px 14px; border-radius: 10px; background: rgba(120,53,15,.95); border: 1px solid rgba(251,191,36,.5); color: #fef3c7; font-size: 13px; display: flex; gap: 10px; align-items: center; }
#aeroNotice button { color: #fde68a; text-decoration: underline; font-size: 13px; }

/* Header status chips & mode badge: readable */
body[class*="xp-"] #headerMissionStatusText, body[class*="xp-"] #headerMissionStatusText *, body[class*="xp-"] #headerRoomCode, body[class*="xp-"] #xpModeBadge, body[class*="xp-"] #glossaryBtn, body[class*="xp-"] #progressBtn { font-size: 11px !important; }

/* ===== 24. QA fixes (Stage 12) ===== */
/* Rows that were wider than a phone: wrap or scroll inside themselves, never the page */
#modeSelectorBar > div { flex-wrap: wrap; }
#headerTelemetryStrip { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
#headerTelemetryStrip::-webkit-scrollbar { display: none; }
html, body { overflow-x: hidden; }
@media (max-width: 1023px) {
    /* Floating ATLAS (Engineer / Mission Control) stays inside the screen and never covers the last controls */
    body[class*="xp-"]:not(.xp-cadet) #nexiWidgetContainer:not(.nexi-docked) { position: static !important; inset: auto !important; transform: none !important; width: auto !important; max-width: none !important; margin: 0 8px 12px !important; }
}

/* ===== 25. A.T.L.A.S interface states (Stage 1 of the A.T.L.A.S upgrade) ===== */
/* Consistent hover / press / disabled feedback on every control */
button, [role="button"], .tab-btn, .ops-rail-btn, .ops-icon-btn { transition: background-color .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s, opacity .15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:not(:disabled):active, [role="button"]:active { transform: scale(.97); }
button:disabled, button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: saturate(.5); }
/* Active tab / nav item: one clear indicator everywhere */
.tab-btn[aria-selected="true"] { box-shadow: inset 0 -2px 0 #22d3ee; }
.bd-navbtn[aria-current="step"], .ops-rail-btn[aria-current="page"] { box-shadow: 0 0 0 1px rgba(34,211,238,.55); }
.tab-pane:not(.hidden) { animation: atlasPane .18s ease-out; }
@keyframes atlasPane { from { opacity: 0; transform: translateY(4px); } }

/* ===== 26. Pad 3A9 flight controls ===== */
/* Sits below the milestone bar and above the bottom telemetry strip; scrolls inside itself on short viewports */
#ascentControlOverlay { width: 21.5rem; max-width: calc(100% - 24px); top: 9.4rem !important; max-height: calc(100% - 9.4rem - 3.6rem); overflow-y: auto; }
#padxControls { border-top: 1px solid rgba(148,163,184,.18); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: #cbd5e1; }
#padxControls button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(148,163,184,.3); background: rgba(15,23,42,.75); color: #e2e8f0; font: 600 11.5px 'Inter', sans-serif; }
#padxControls button:not(:disabled):hover { border-color: rgba(34,211,238,.6); background: rgba(34,211,238,.12); }
#padxControls .px-launch { width: 100%; min-height: 34px; border-color: rgba(34,211,238,.6); background: rgba(34,211,238,.16); color: #a5f3fc; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
#padxControls .px-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#padxControls .px-cams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#padxControls .px-cams button { justify-content: flex-start; }
#padxControls .px-cams button.on, #padxControls button[aria-pressed="true"] { border-color: #22d3ee; background: rgba(34,211,238,.22); color: #ecfeff; box-shadow: inset 0 -2px 0 #22d3ee; }
#padxControls .px-k, #padxControls .px-layer span { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; color: #94a3b8; }
#padxControls .px-layer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 5px 8px; border-radius: 8px; background: rgba(11,18,32,.9); border: 1px solid rgba(30,41,59,1); }
#padxControls .px-layer b { color: #67e8f9; font-size: 12px; }
#padxControls .px-foot { display: flex; gap: 8px; align-items: center; } #padxControls .px-foot span { color: #94a3b8; font-size: 11px; line-height: 1.3; }
#padxControls .px-note { color: #fde68a; font-size: 11.5px; line-height: 1.4; }
/* Phones: controls become a scrollable sheet along the bottom of the 3D view, leaving the flight visible above */
@media (max-width: 640px) { #ascentControlOverlay { top: auto !important; bottom: 8px; left: 8px; right: 8px !important; width: auto; max-width: none; max-height: 46%; } }
