/* ═══════════════════════════════════════════════════════════════════════════
   EXANAUT COMPONENTS — Station, Header, Dock, Buttons, Modals, etc.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   VARIANT SYSTEM — Shared CSS properties for component variants
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Fallback Defaults ── */
:root {
    --v-accent: var(--gold);
    --v-text: var(--text-pri);
    --v-border: var(--bulkhead);
    --v-bg: transparent;
    --v-dot: var(--text-sec);
}

/* ── Semantic & Decorative Variants ── */
/* Use with `data-variant` on new components or `data-tier` on legacy ones. */

/* Success / Gold (Bright) */
[data-variant="success"],
[data-tier="success"],
[data-tier="bright"] {
    --v-accent: var(--gold);
    --v-text: var(--gold-bright);
    --v-border: var(--gold-edge);
    --v-bg: var(--gold-wash);
    --v-dot: var(--gold-bright);
}

/* Warning / Caution */
[data-variant="warning"],
[data-tier="caution"] {
    --v-accent: var(--bronze-hot);
    --v-text: var(--bronze-text);
    --v-border: var(--bronze-edge);
    --v-bg: var(--bronze-wash);
    --v-dot: var(--bronze-hot);
}

/* Danger / Red */
[data-variant="danger"],
[data-tier="danger"],
[data-tier="red"] {
    --v-accent: var(--danger-text);
    --v-text: var(--danger-text);
    --v-border: var(--danger-line);
    --v-bg: var(--danger-wash);
    --v-dot: var(--danger-hot);
}

/* Info / Secondary */
[data-variant="info"],
[data-variant="secondary"] {
    --v-accent: var(--text-sec);
    --v-text: var(--text-sec);
    --v-border: var(--bulkhead);
    --v-bg: rgba(255,255,255,0.02);
    --v-dot: var(--text-sec);
}

/* Muted */
[data-variant="muted"],
[data-tier="muted"] {
    --v-accent: var(--text-muted);
    --v-text: var(--text-muted);
    --v-border: var(--shield);
    --v-bg: transparent;
    --v-dot: var(--text-ghost);
}

/* Decorative: Gold / Primary */
[data-variant="gold"],
[data-tier="gold"],
[data-variant="primary"] {
    --v-accent: var(--gold);
    --v-text: var(--gold);
    --v-border: var(--gold-edge);
    --v-bg: var(--gold-wash);
    --v-dot: var(--gold);
}

/* Decorative: Bronze */
[data-variant="bronze"],
[data-tier="bronze"],
[data-tier="bronze-bright"] {
    --v-accent: var(--bronze-text);
    --v-text: var(--bronze-text);
    --v-border: var(--bronze-edge);
    --v-bg: var(--bronze-wash);
    --v-dot: var(--bronze-hot);
}

/* ═══════════════════════════════════════════════════════════════════════
   ICON SYSTEM — Lucide line icons with font-scale sizing
   ═══════════════════════════════════════════════════════════════════════ */
.lucide {
  display: inline-flex;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.exa-icon { display: inline-flex; align-items: center; }
.exa-icon-xs { width: calc(12px * var(--font-scale)); height: calc(12px * var(--font-scale)); }
.exa-icon-sm { width: calc(16px * var(--font-scale)); height: calc(16px * var(--font-scale)); }
.exa-icon-md { width: calc(20px * var(--font-scale)); height: calc(20px * var(--font-scale)); }
.exa-icon-lg { width: calc(24px * var(--font-scale)); height: calc(24px * var(--font-scale)); }
.exa-icon-xl { width: calc(32px * var(--font-scale)); height: calc(32px * var(--font-scale)); }

/* ═══ HEADER ═══ */
.hud-header {
    display: flex;
    flex-direction: column;
    background: linear-gradient(168deg, rgba(14,14,13,0.95), rgba(9,9,8,0.95));
    border-bottom: 1px solid var(--gold-subtle);
    flex-shrink: 0;
    z-index: 100;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3), 0 2px 8px var(--shadow-deep);
}

.hud-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(40px * var(--font-scale));
    padding: calc(6px * var(--font-scale)) calc(16px * var(--font-scale));
    gap: calc(8px * var(--font-scale));
    flex-wrap: nowrap;
    overflow: visible;
}

.hud-header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.hud-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    justify-content: flex-end;
    min-width: 0;
}

/* (Notification log moved beneath dock — see .hud-notification-bar) */

.hud-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: calc(38px * var(--font-scale));
    box-sizing: border-box;
}

/* Shimmer brand text — golden gradient with chromatic aberration */
.hud-brand {
    font-family: 'Space Mono', monospace;
    font-size: calc(38px * var(--font-scale));
    font-weight: 700;
    letter-spacing: calc(7px * var(--font-scale));
    line-height: calc(38px * var(--font-scale));
    background: linear-gradient(
        135deg,
        var(--gold-dim) 0%,
        var(--gold) 30%,
        var(--gold-hot, var(--gold)) 50%,
        var(--gold) 70%,
        var(--gold-dim) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brand-shimmer 8s ease-in-out infinite;
    /* filter: drop-shadow removed v0.56.0 — GPU compositing layer */
    position: relative;
    white-space: nowrap;
}

.hud-brand::before,
.hud-brand::after {
    content: 'EXANAUT';
    position: absolute;
    top: 0; left: 0;
    background: inherit;
    background-size: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: inherit;
    filter: none;
    pointer-events: none;
}

.hud-brand::before {
    transform: translate(-1px, 0);
    opacity: 0.15;
    filter: hue-rotate(-25deg) brightness(1.2);
}

.hud-brand::after {
    transform: translate(1px, 0);
    opacity: 0.1;
    filter: hue-rotate(15deg) brightness(0.9);
}

@keyframes brand-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ═══ HEADER CONTROLS ═══ */
.hud-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.hud-control-label {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 4px;
}

/* Layout Controls */
.hud-layout-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hud-layout-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--xxs-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    white-space: nowrap;
}

.hud-layout-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: var(--gold-edge);
}

.hud-layout-btn.active {
    background: var(--gold-wash);
    color: var(--gold);
    border-color: var(--gold-edge);
    box-shadow: 0 0 0 3px var(--gold-wash);
    text-shadow: 0 0 4px hsla(42, 50%, 55%, 0.12);
}

/* Arrangement Controls */
.hud-arrangement-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hud-arrange-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--base-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.hud-arrange-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: var(--gold-edge);
}

.hud-arrange-btn.active {
    background: var(--gold-wash);
    color: var(--gold);
    border-color: var(--gold-edge);
    box-shadow: 0 0 0 3px var(--gold-wash);
    text-shadow: 0 0 4px hsla(42, 50%, 55%, 0.12);
}

/* Font Controls */
.hud-font-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hud-font-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--xs-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.hud-font-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: var(--gold-edge);
}

.hud-font-size {
    font-size: var(--xs-font);
    color: var(--text-pri);
    min-width: 40px;
    text-align: center;
}

/* Collapse All Controls */
.hud-collapse-controls {
    display: flex;
    align-items: center;
}

.hud-collapse-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--small-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.hud-collapse-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: var(--gold-edge);
}

/* No rotation - icon text changes via JS */
.hud-collapse-btn.collapsed {
    /* Icon changes from ▼ to ▲ via JavaScript */
}

/* Preset Controls */
.hud-preset-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Preset Gallery Button */
.hud-preset-gallery-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    color: var(--text-sec);
    font-size: var(--xs-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.hud-preset-gallery-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: var(--gold-dim);
}

.preset-btn-icon {
    font-size: var(--small-font);
}

.preset-btn-label {
    font-weight: 500;
}

@media (max-width: 768px) {
    .preset-btn-label {
        display: none;
    }
}

.hud-preset-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--xs-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.hud-preset-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: var(--gold-edge);
}

.hud-fuel {
    display: flex;
    align-items: center;
    gap: calc(6px * var(--font-scale));
    height: calc(32px * var(--font-scale));
    padding: 0 calc(10px * var(--font-scale));
    box-sizing: border-box;
    background: linear-gradient(165deg, var(--armor) 0%, var(--hull-deep) 100%);
    border: 1px solid var(--gold-edge);
    border-radius: var(--radius);
    font-size: var(--xs-font);
    color: var(--gold);
    font-weight: var(--weight-semibold);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 4px var(--shadow-warm);
}

.hud-fuel span:first-child {
    font-size: var(--xs-font);
}

.hud-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: calc(6px * var(--font-scale));
    height: calc(32px * var(--font-scale));
    padding: 0 calc(10px * var(--font-scale));
    box-sizing: border-box;
    background: linear-gradient(165deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
    font-size: var(--xs-font);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.hud-user:hover {
    background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border-color: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 4px var(--shadow-light);
}

.hud-avatar {
    width: calc(22px * var(--font-scale));
    height: calc(22px * var(--font-scale));
    background: linear-gradient(165deg, hsl(42, 22%, 24%), hsl(42, 22%, 16%));
    border: 1px solid var(--gold-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--xxs-font);
    color: var(--gold);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 3px var(--shadow-warm);
}

.hud-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: linear-gradient(168deg, rgba(14,14,13,0.97), rgba(8,8,7,0.97));
    border: 1px solid rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 200;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 32px var(--shadow-deep), 0 0 1px rgba(255,255,255,0.04);
}

.hud-user-arrow {
    opacity: 0.5;
    font-size: 10px;
}

.hud-user-menu.open {
    display: block;
    animation: menu-slide-in 0.12s ease-out;
}

@keyframes menu-slide-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hud-menu-item {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: var(--small-font);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-menu-item:hover {
    background: var(--gold-wash);
    color: var(--gold);
}

.hud-menu-divider {
    height: 1px;
    background: var(--bulkhead);
    margin: 4px 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY - Full-screen hi-tech shimmer during initial load
   ═══════════════════════════════════════════════════════════════════════════ */

.hud-loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.4s ease-out, visibility 0.4s;
}

.hud-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Scanline effect across entire overlay */
.loading-scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 149, 0, 0.02) 2px,
            rgba(255, 149, 0, 0.02) 4px);
    pointer-events: none;
}

.loading-scanline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg,
            rgba(255, 149, 0, 0.08) 0%,
            transparent 100%);
    animation: scanlineMove 2s ease-in-out infinite;
}

@keyframes scanlineMove {

    0%,
    100% {
        top: -100px;
    }

    50% {
        top: calc(100% + 100px);
    }
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    z-index: 1;
}

.loading-logo {
    font-size: calc(42px * var(--font-scale));
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 149, 0, 0.5);
    animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.loading-text {
    font-size: var(--base-font);
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: var(--bulkhead);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar-fill {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-hot));
    border-radius: 2px;
    animation: loadingBarFill 1.2s ease-in-out infinite;
}

@keyframes loadingBarFill {
    0% {
        width: 0%;
        margin-left: 0%;
    }

    50% {
        width: 50%;
        margin-left: 25%;
    }

    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Grid hidden state during loading */
.hud-grid.loading {
    opacity: 0;
}

.hud-grid.loading .hud-station {
    display: none;
}

/* Reveal animation for grid */
.hud-grid.reveal {
    animation: gridReveal 0.5s ease-out forwards;
}

@keyframes gridReveal {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Station reveal stagger - animation only, no persistent opacity:0 */
.hud-grid.reveal .hud-station {
    animation: stationReveal 0.4s ease-out forwards;
    animation-delay: calc(var(--station-index, 0) * 0.08s);
    /* NOTE: Do NOT set opacity:0 here - the animation handles initial state.
       Setting opacity:0 as base causes stations to disappear when animation
       is interrupted or class is toggled. The 'forwards' fill-mode keeps
       the final opacity:1 state after animation completes. */
}

@keyframes stationReveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ═══ STATION — Void-Luxury Panel Aesthetic ═══ */
/* Surface hierarchy: station panes sit in the 30% warm-content band,
   lifted above the 60% void chrome of header/dock. */
.hud-station {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(168deg, rgba(22, 22, 20, 0.95), rgba(14, 14, 13, 0.95));
    border: 1px solid rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--dur-slow) var(--ease-out),
                box-shadow var(--dur-slow) var(--ease-out),
                opacity 0.12s ease-out,
                transform 0.12s ease-out;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 4px 24px var(--shadow-warm),
        0 0 1px rgba(255,255,255,0.06);
}

.hud-station:hover {
    border-color: hsla(var(--gold-h), 40%, 45%, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 4px 24px var(--shadow-warm),
        0 0 1px rgba(255,255,255,0.06),
        0 0 20px -8px hsla(var(--gold-h), 50%, 50%, 0.08);
}

/* Panel corner brackets — subtle gold accents on hover */
.hud-station::before,
.hud-station::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    opacity: 0.18;
    pointer-events: none;
    z-index: 5;
    transition: opacity var(--dur-med) var(--ease-out);
}

.hud-station::before {
    top: 0; left: 0;
    border-top: 1px solid var(--gold);
    border-left: 1px solid var(--gold);
}

.hud-station::after {
    bottom: 0; right: 0;
    border-bottom: 1px solid var(--gold);
    border-right: 1px solid var(--gold);
}

.hud-station:hover::before,
.hud-station:hover::after {
    opacity: 0.55;
}

/* Active station — gold left edge accent + subtle glow */
.hud-station.active,
.hud-station.pane-active {
    border-left: 2px solid var(--gold-dim);
    background: linear-gradient(135deg, hsla(var(--gold-h), 28%, 38%, 0.05), rgba(22, 22, 20, 0.95) 22%);
}

.hud-station.active::before,
.hud-station.pane-active::before {
    border-top-color: var(--gold);
    border-left-color: var(--gold);
    opacity: 0.45;
}

.hud-station.active::after,
.hud-station.pane-active::after {
    border-bottom-color: var(--gold);
    border-right-color: var(--gold);
    opacity: 0.30;
}

.hud-station-header {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: linear-gradient(168deg, rgba(18, 18, 16, 0.98), rgba(12, 12, 11, 0.98));
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: var(--xxs-font);
    text-transform: uppercase;
    letter-spacing: 1px;
    gap: 6px;
    min-height: 40px;
    position: relative;
    z-index: 2;
}

/* Top row: Station ID, Department Label, Controls */
.hud-station-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.hud-station-header-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Header fullscreen button */
.header-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.header-expand-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--gold);
}

.hud-station-id {
    color: var(--text-muted);
    font-size: var(--xxs-font);
    flex-shrink: 0;
}

.hud-station-dept-label {
    color: var(--gold);
    font-size: var(--xxs-font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Department Quick Buttons - ALWAYS horizontal */
.hud-dept-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 2px;
    width: 100%;
    justify-content: flex-start;
}

.hud-dept-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 3px;
    font-size: var(--small-font);
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
    color: var(--text-muted);
}

.hud-dept-btn:hover {
    background: linear-gradient(168deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: var(--text-pri);
    border-color: rgba(255,255,255,0.10);
}

.hud-dept-btn.active {
    background: var(--gold-wash);
    color: var(--gold);
    border-color: var(--gold-edge);
    box-shadow: 0 0 0 2px var(--gold-wash);
    text-shadow: 0 0 4px hsla(42, 50%, 55%, 0.12);
}

.dept-btn-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Header collapse button */
.header-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.header-collapse-btn:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--gold);
}

/* Collapsed header state - hides department buttons row */
.hud-station-header.collapsed {
    padding: 8px 12px;
    gap: 0;
    min-height: 40px;
}

/* Collapsed header: center ID and label HORIZONTALLY, keep controls on right */
.hud-station-header.collapsed .hud-station-header-top {
    /* Keep flex-start alignment - no vertical centering */
    justify-content: flex-start;
    gap: 8px;
}

/* ID and label stay inline */
.hud-station-header.collapsed .hud-station-id {
    flex: 0 0 auto;
}

.hud-station-header.collapsed .hud-station-dept-label {
    flex: 1 1 auto;
    min-width: 0;
}

/* Controls stay at the end with normal flow */
.hud-station-header.collapsed .hud-station-header-controls {
    flex-shrink: 0;
    margin-left: auto;
}

.hud-station-header.collapsed .hud-dept-buttons {
    display: none;
    /* Hide department quick buttons row */
}

/* Keep info button visible when collapsed */
.hud-station-header.collapsed .dept-info-btn {
    display: inline-flex;
}

.hud-station-header.collapsed .header-expand-btn {
    display: inline-flex;
}

/* When station header is collapsed, hide the division tabs row too */
.hud-station.header-collapsed .hud-station-tabs {
    display: none;
}



/* ═══ DIVISION TABS ═══ */
.hud-station-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 8px;
    background: rgba(6, 6, 5, 0.7);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    min-height: 28px;
    align-items: flex-start;
    align-content: flex-start;
    flex-shrink: 0;
}

.hud-station-tabs.collapsed {
    flex-wrap: nowrap;
    overflow: hidden;
}

.hud-station-tab {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px 3px 0 0;
    color: var(--text-muted);
    font-size: var(--xxs-font);
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}

.hud-station-tab:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
}

.hud-station-tab.active {
    color: var(--gold);
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--gold-dim);
}

.hud-station-tab .tab-icon {
    margin-right: 4px;
}

.hud-station-tab .tab-label {
    display: inline;
}

/* Overflow button for collapsed tabs */
.hud-tabs-overflow {
    margin-left: auto;
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--xxs-font);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.hud-tabs-overflow:hover {
    color: var(--gold);
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
}

/* Overflow menu */
.hud-tabs-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 8px;
    background: linear-gradient(168deg, rgba(14,14,13,0.97), rgba(8,8,7,0.97));
    border: 1px solid rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
    padding: 4px 0;
    z-index: 100;
    min-width: 150px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 16px var(--shadow-deep), 0 0 1px rgba(255,255,255,0.04);
}

.hud-tabs-menu.open {
    display: block;
}

.hud-tabs-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: var(--xs-font);
    color: var(--text-pri);
}

.hud-tabs-menu-item:hover {
    background: var(--gold-wash);
    color: var(--gold);
}

/* Division tabs ALWAYS show icons + labels - NO EXCEPTIONS */
/* No responsive hiding, no narrow detection - labels visible at all times */

.hud-station-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    min-width: 0;
    animation: content-fade-in 0.15s ease-out;
    background: linear-gradient(168deg, rgba(30, 30, 28, 0.6) 0%, rgba(22, 22, 20, 0.85) 100%);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Responsive text policy - all content elements */
.hud-station-content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Content fade-in animation */
@keyframes content-fade-in {
    from {
        opacity: 0.7;
    }

    to {
        opacity: 1;
    }
}

/* Custom scrollbar styling - station content only */
.hud-station-content::-webkit-scrollbar {
    width: 6px;
}

.hud-station-content::-webkit-scrollbar-track {
    background: transparent;
}

.hud-station-content::-webkit-scrollbar-thumb {
    background: var(--bulkhead);
    border-radius: 3px;
}

.hud-station-content::-webkit-scrollbar-thumb:hover {
    background: var(--plate);
}

/* Firefox scrollbar for station content */
.hud-station-content {
    scrollbar-width: thin;
    scrollbar-color: var(--bulkhead) transparent;
}


/* ═══ DOCK ═══ */
.hud-dock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 6px 16px 4px;
    background: linear-gradient(168deg, rgba(14,14,13,0.95), rgba(9,9,8,0.95));
    border-top: 1px solid var(--gold-subtle);
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 -2px 8px var(--shadow-deep);
}

.hud-dock-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-dock-log {
    margin-left: 0;
}

/* STATIONS button — replaced by .dock-stations-btn in dock split layout */

.hud-dock-label {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-dock-divider {
    width: 1px;
    height: 24px;
    background: var(--bulkhead);
}

.hud-dock-status {
    font-size: var(--xs-font);
    color: var(--gold);
}

/* Station Hotkeys */
.hud-station-hotkey {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--xs-font);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.hud-station-hotkey:hover {
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
    color: var(--gold);
}

.hud-station-hotkey.active {
    background: var(--gold-wash);
    color: var(--gold);
    text-shadow: 0 0 4px hsla(42, 50%, 55%, 0.12);
}

.hud-station-hotkey.hidden {
    opacity: 0.3;
    pointer-events: none;
}


/* ═══ STATION CONTENT ═══ */
.station-title {
    font-family: 'Outfit', sans-serif;
    font-size: var(--h2-font);
    font-weight: var(--weight-bold);
    color: var(--gold);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.06em;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--gold-dim), transparent) 1;
    animation: title-fade-in 0.2s ease-out;
    text-shadow: 0 0 8px hsla(42, 50%, 55%, 0.15);
    /* Responsive - allow natural line breaks but don't break words */
    flex-wrap: wrap;
    overflow: hidden;
}

@keyframes title-fade-in {
    from {
        opacity: 0.6;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══ CARD SECTION — Static card with shadow lift surface ═══ */
/* Primary structural component for division content. Shadow-lifted card
   that floats above the station pane surface. Always open — no collapse.
   Part of the 30% warm-content band. */

.card-section {
    background: linear-gradient(168deg, rgba(22,22,20,0.93), rgba(16,16,14,0.93));
    border: none;
    border-radius: var(--radius-card);
    margin-bottom: var(--space-md);
    overflow: hidden;
    transition: box-shadow var(--dur-med) var(--ease-out);
    box-shadow: 0 2px 8px var(--shadow-warm), 0 1px 2px var(--shadow-deep);
}

.card-section:hover {
    box-shadow: 0 4px 12px var(--shadow-warm), 0 2px 4px var(--shadow-deep);
}

/* ── Variants ── */
.card-section--danger {
    border-left: 2px solid var(--danger);
}

/* ── Header (static display) ── */
.card-section-header {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-md) var(--space-xs);
    gap: var(--space-sm);
    user-select: none;
}

.card-section-icon {
    font-size: var(--sm-font);
    color: var(--gold-dim);
    flex-shrink: 0;
}

.card-section--danger .card-section-icon {
    color: var(--danger-text);
}

.card-section-title {
    font-size: var(--xs-font);
    font-weight: var(--weight-semibold);
    color: var(--text-sec);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex: 1;
}

.card-section-badge {
    font-size: calc(var(--xxs-font));
    font-family: 'Space Mono', monospace;
    padding: 1px 8px;
    border-radius: 3px;
    background: var(--gold-subtle);
    color: var(--gold);
    border: 1px solid var(--gold-cold);
}

.card-section-badge--bronze {
    background: var(--bronze-cold);
    color: var(--bronze-text);
    border-color: var(--bronze);
}

.card-section-badge--danger {
    background: var(--danger-cold);
    color: var(--danger-text);
    border-color: var(--danger);
}

/* ── Body ── */
.card-section-body {
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

/* ── Content helpers within card sections ── */
.card-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.card-stat-row:last-child { border-bottom: none; }

.card-stat-label {
    font-size: var(--sm-font);
    color: var(--text-sec);
}

.card-stat-value {
    font-family: 'Space Mono', monospace;
    font-size: var(--sm-font);
    color: var(--text-pri);
}

.card-stat-value.gold { color: var(--gold); }
.card-stat-value.bronze { color: var(--bronze-text); }
.card-stat-value.danger { color: var(--danger-text); }


.station-textarea {
    min-height: 100px;
    resize: vertical;
}

.station-select {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--void);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    color: var(--text-pri);
    font-size: var(--base-font);
    font-weight: var(--weight-normal);
    font-family: inherit;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23878787' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.station-select:focus {
    outline: none;
    border-color: var(--gold-dim);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 0 2px var(--gold-wash);
}

.station-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Compact variant for detail panels */
.arcology-detail .station-select {
    padding: 8px 12px;
    font-size: var(--xs-font);
    padding-right: 32px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ExaComponent Button System — 5 Tiers (Void-Luxury spec)
   Source of truth: sandbox/void-luxury-current.html
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── BASE ─── */
.exa-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 42px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-pri);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    transition:
        color var(--dur-med) var(--ease-out),
        border-color var(--dur-med) var(--ease-out),
        background var(--dur-med) var(--ease-out),
        box-shadow var(--dur-slow) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
}

.exa-btn:active {
    transform: translateY(1px);
    transition-duration: 0.05s;
}

.exa-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--void), 0 0 0 4px var(--gold-dim);
}

.exa-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
    filter: saturate(0.2) brightness(0.8);
    pointer-events: none;
}

.exa-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── SIZES ─── */
.exa-btn-lg { height: 50px; padding: 0 32px; font-size: calc(13px * var(--font-scale)); letter-spacing: 2px; }
.exa-btn-sm { height: 32px; padding: 0 14px; font-size: 10px; letter-spacing: 1px; }
.exa-btn-xs { height: 26px; padding: 0 10px; font-size: 10px; letter-spacing: 0.5px; }
.exa-btn-full { width: 100%; }

/* ─── PRIMARY ─── */
.exa-btn-primary {
    background: linear-gradient(165deg, var(--armor) 0%, var(--hull-deep) 100%);
    color: var(--gold);
    border-color: var(--gold-edge);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 4px var(--shadow-warm);
}

.exa-btn-primary::before {
    content: '';
    position: absolute;
    top: 5px; bottom: 5px; left: 0;
    width: 2px;
    background: var(--gold-dim);
    border-radius: 0 1px 1px 0;
    transition: background var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out),
                width var(--dur-med) var(--ease-out);
}

.exa-btn-primary::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 15% 50%, var(--gold-wash), transparent 65%);
    opacity: 0;
    transition: opacity var(--dur-med) var(--ease-out);
    pointer-events: none;
}

.exa-btn-primary:hover {
    color: var(--gold-bright);
    border-color: hsla(var(--gold-h), 35%, 45%, 0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 2px 8px var(--shadow-warm);
    background: linear-gradient(165deg, var(--armor-hot) 0%, var(--hull) 100%);
}

.exa-btn-primary:hover::before {
    background: var(--gold-bright);
    box-shadow: 0 0 6px var(--gold-glow);
    width: 2.5px;
}

.exa-btn-primary:hover::after { opacity: 1; }

.exa-btn-primary:active {
    background: linear-gradient(165deg, var(--hull-deep) 0%, var(--void) 100%);
    box-shadow: 0 1px 2px var(--shadow-deep), inset 0 1px 4px rgba(10,8,5,0.4);
}

/* ─── SECONDARY ─── */
.exa-btn-secondary {
    background: linear-gradient(165deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: var(--text-sec);
    border-color: rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.exa-btn-secondary:hover {
    background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    color: var(--text-pri);
    border-color: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 4px var(--shadow-light);
}

.exa-btn-secondary:active {
    background: linear-gradient(165deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

/* ─── GHOST ─── */
.exa-btn-ghost {
    color: var(--text-muted);
    border-color: var(--bulkhead);
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.exa-btn-ghost:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
    background: linear-gradient(168deg, var(--gold-wash), rgba(255,255,255,0.02));
}

.exa-btn-ghost.active {
    color: var(--gold);
    background: var(--gold-wash);
    border-bottom: 2px solid var(--gold);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ─── DANGER ─── */
.exa-btn-danger {
    background: linear-gradient(165deg, hsl(var(--danger-h), 30%, 14%) 0%, hsl(var(--danger-h), 25%, 10%) 100%);
    color: var(--danger-text);
    border-color: var(--danger-line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 4px var(--shadow-warm);
}

.exa-btn-danger::before {
    content: '';
    position: absolute;
    top: 5px; bottom: 5px; left: 0;
    width: 2px;
    background: var(--danger-cold);
    border-radius: 0 1px 1px 0;
    transition: background var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out);
}

.exa-btn-danger:hover {
    color: var(--danger-hot);
    border-color: hsla(var(--danger-h), 40%, 40%, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 8px var(--shadow-warm);
    background: linear-gradient(165deg, hsl(var(--danger-h), 32%, 16%) 0%, hsl(var(--danger-h), 28%, 11%) 100%);
}

.exa-btn-danger:hover::before {
    background: var(--danger-text);
    box-shadow: 0 0 5px var(--danger-glow);
}

.exa-btn-danger:active {
    background: linear-gradient(165deg, hsl(var(--danger-h), 25%, 10%) 0%, hsl(var(--danger-h), 20%, 7%) 100%);
}

/* Danger outline variant */
.exa-btn-danger-outline {
    background: transparent;
    color: hsl(var(--danger-h), 35%, 45%);
    border-color: hsla(var(--danger-h), 40%, 40%, 0.18);
}

.exa-btn-danger-outline:hover {
    background: var(--danger-wash);
    color: var(--danger-text);
    border-color: hsla(var(--danger-h), 35%, 40%, 0.20);
}

/* ─── CAUTION (bronze) ─── */
.exa-btn-caution {
    background: linear-gradient(165deg, hsl(var(--bronze-h), 22%, 14%) 0%, hsl(var(--bronze-h), 18%, 10%) 100%);
    color: var(--bronze-text);
    border-color: var(--bronze-line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 4px var(--shadow-warm);
    position: relative;
}

.exa-btn-caution::before {
    content: '';
    position: absolute;
    top: 5px; bottom: 5px; left: 0;
    width: 2px;
    background: var(--bronze-dim);
    border-radius: 0 1px 1px 0;
    transition: background var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out);
}

.exa-btn-caution:hover {
    color: var(--bronze-hot);
    border-color: hsla(var(--bronze-h), 30%, 38%, 0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 8px var(--shadow-warm);
    background: linear-gradient(165deg, hsl(var(--bronze-h), 26%, 16%) 0%, hsl(var(--bronze-h), 22%, 12%) 100%);
}

.exa-btn-caution:hover::before {
    background: var(--bronze-text);
    box-shadow: 0 0 5px var(--bronze-glow);
}

.exa-btn-caution:active {
    background: linear-gradient(165deg, hsl(var(--bronze-h), 18%, 10%) 0%, hsl(var(--bronze-h), 15%, 7%) 100%);
}


.station-help {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}


/* ═══ MODAL STYLES (inline overrides) ═══ */
/* Main .modal-header and .modal-title are defined in the VOID-LUXURY MODAL SYSTEM section below */

/* Modal title row - flex container for icon + title + info */
.modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Modal icon (emoji) - no special effects */
.modal-icon {
    font-size: calc(20px * var(--font-scale));
    filter: none;
}

/* Info button in modal header - smaller and positioned better */
.modal-info-btn {
    width: 16px;
    height: 16px;
    font-size: 10px;
    margin-left: 8px;
}


.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.campaign-milestones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-inline-action {
    margin-top: 8px;
}

.expedition-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.expedition-label-spacer {
    margin-top: 12px;
}

.expedition-modal-panel {
    background: linear-gradient(168deg, rgba(10,10,9,0.96), rgba(6,6,5,0.96));
    border: 1px solid var(--bulkhead);
    border-radius: 8px;
    padding: 12px;
    min-height: 160px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.expedition-summary {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.expedition-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.expedition-log,
.expedition-steps,
.expedition-artifacts {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.arcology-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Arcology detail panel — consistent typography via CSS variables */
.arcology-section {
    margin-top: 12px;
}

.arcology-section-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.arcology-section-label {
    font-size: var(--xs-font);
    color: var(--text-pri);
    font-weight: var(--weight-semibold);
    margin-bottom: 4px;
}

.arcology-section-value {
    font-size: var(--xxs-font);
    color: var(--text-muted);
}

.arcology-section-actions {
    display: flex;
    gap: 6px;
}

.arcology-hint-text {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.arcology-file-name {
    font-size: var(--xs-font);
    color: var(--text-pri);
}

.arcology-action-btn {
    font-size: var(--xxs-font) !important;
    padding: 4px 10px !important;
}

.arcology-card-icon {
    font-size: calc(16px * var(--font-scale));
    line-height: 1;
}

.arcology-card-name {
    font-size: var(--small-font);
    color: var(--text-pri);
    font-weight: var(--weight-semibold);
}

.arcology-card-desc {
    font-size: var(--xxs-font);
    color: var(--text-muted);
}

.arcology-card-status {
    margin-left: auto;
    font-size: var(--xxs-font);
    color: var(--text-muted);
}

.arcology-card-status.active {
    color: var(--gold);
}

.arcology-modal-text {
    font-size: var(--small-font);
    color: var(--text-pri);
    line-height: 1.6;
}

.arcology-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 12px;
}

@media (max-width: 1100px) {
    .arcology-panels {
        grid-template-columns: 1fr;
    }
}

.arcology-panel-list,
.arcology-panel-detail {
    min-width: 0;
}

.arcology-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(160deg, var(--armor), var(--hull));
    border: 1px solid var(--bulkhead);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.arcology-card.active {
    border-color: var(--gold);
    background: rgba(255, 149, 0, 0.08);
}

.arcology-card:hover {
    border-color: var(--text-muted);
}

.arcology-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arcology-detail {
    background: linear-gradient(168deg, rgba(10,10,9,0.96), rgba(6,6,5,0.96));
    border: 1px solid var(--bulkhead);
    border-radius: 8px;
    padding: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.repo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.repo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
    background: linear-gradient(168deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.repo-meta {
    font-size: var(--xxs-font);
    color: var(--text-muted);
}

.cipher-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cipher-row {
    display: flex;
    gap: 8px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--bulkhead);
    background: rgba(0, 0, 0, 0.15);
}

.form-field {
    margin-bottom: 20px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}


/* ═══ METALLIC COMPONENTS (Option B Aesthetic) ═══ */
.metric-card {
    padding: var(--space-md);
    background: linear-gradient(160deg, var(--plate) 0%, var(--bulkhead) 15%, var(--shield) 100%);
    border: 1px solid var(--bulkhead);
    border-top-color: var(--plate);
    border-radius: var(--radius-card);
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 6px var(--shadow-deep);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 16px var(--shadow-deep);
}


.metric-label {
    font-size: var(--xxs-font);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
}

.metric-value {
    font-size: calc(20px * var(--font-scale));
    font-weight: var(--weight-bold);
    color: var(--gold);
    letter-spacing: -0.02em;
    word-break: break-word;
}

.metric-value.amber-glow {
    color: var(--gold-hot);
}

.metric-sub {
    font-size: var(--xxs-font);
    font-weight: var(--weight-thin);
    color: var(--text-muted);
    margin-top: var(--space-xs);
    letter-spacing: 0.04em;
}

/* Transmissions Feed */
.transmissions-feed {
    background: linear-gradient(168deg, var(--bulkhead) 0%, var(--void) 100%);
    border: 1px solid var(--bulkhead);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.transmission-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--bulkhead);
    transition: background 0.15s;
}

.transmission-item:last-child {
    border-bottom: none;
}

.transmission-item:hover {
    background: rgba(255, 149, 0, 0.03);
}

.transmission-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, var(--plate) 0%, var(--bulkhead) 100%);
    border: 1px solid var(--bulkhead);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--lg-font);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.transmission-content {
    flex: 1;
    min-width: 0;
}

.transmission-title {
    color: var(--text-pri);
    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
    margin-bottom: 4px;
}

.transmission-text {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}

.transmission-meta {
    color: var(--text-muted);
    font-size: 10px;
    opacity: 0.6;
    margin-top: 6px;
}

/* Performance Cards */
.perf-card {
    padding: 16px;
    background: linear-gradient(160deg, var(--plate) 0%, var(--shield) 100%);
    border: 1px solid var(--bulkhead);
    border-radius: 8px;
    border-left: 3px solid var(--text-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.perf-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: var(--weight-medium);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.perf-value {
    color: var(--gold);
    font-size: calc(28px * var(--font-scale));
    font-weight: var(--weight-bold);
    letter-spacing: -0.02em;
}

.perf-bar {
    width: 100%;
    height: 4px;
    background: var(--bulkhead);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.perf-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    transition: width 0.3s;
}

/* Overseer Panel */
.overseer-panel {
    padding: 16px;
    background: linear-gradient(168deg, var(--plate) 0%, var(--bulkhead) 15%, var(--shield) 100%);
    border: 1px solid var(--text-muted);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px var(--shadow-deep);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--void);
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-row:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 8px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: var(--title-font);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: var(--xxs-font);
    color: var(--text-muted);
}

.stat-value {
    font-size: var(--large-font);
    font-weight: 600;
    color: var(--gold);
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--void);
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 3px solid var(--text-muted);
}

.log-icon {
    font-size: var(--base-font);
}

.log-content {
    flex: 1;
}

.log-title {
    font-size: var(--base-font);
    font-weight: 500;
}

.log-meta {
    font-size: var(--xs-font);
    color: var(--text-muted);
    margin-top: 4px;
}

.console {
    background: var(--void);
    border: 1px solid var(--bulkhead);
    border-radius: 4px;
    padding: 14px;
    font-size: var(--xs-font);
    max-height: 180px;
    overflow: auto;
}


/* ═══ EXA FORM CONTROLS ═══ */

.exa-label {
    display: block;
    font-size: var(--xxs-font);
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.exa-input,
.exa-textarea,
.exa-select {
    display: block;
    width: 100%;
    padding: calc(8px * var(--font-scale)) calc(10px * var(--font-scale));
    background: linear-gradient(168deg, rgba(14,14,13,0.95), rgba(9,9,8,0.95));
    color: var(--text-pri);
    border: 1px solid var(--bulkhead);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: var(--xs-font);
    line-height: 1.4;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
    transition: border-color 0.2s;
}

/* Monospace input variant for code/data entry */
.exa-input-mono {
  font-family: var(--font-data);
  letter-spacing: 0.02em;
}

.exa-input:focus,
.exa-textarea:focus,
.exa-select:focus {
    outline: none;
    border-color: var(--gold-subtle);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(var(--gold-rgb), 0.15);
}

.exa-input::placeholder,
.exa-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.exa-textarea {
    resize: vertical;
    min-height: 60px;
}

.exa-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

.exa-select option {
    background: var(--void-warm);
    color: var(--text-pri);
}

/* ── Toggle Switch ── */
.exa-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.exa-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.exa-toggle-track {
    position: relative;
    display: block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    background: var(--shield);
    border-radius: 999px;
    transition: background-color var(--dur-med) var(--ease-out);
}

.exa-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--plate);
    border-radius: 50%;
    transition: transform var(--dur-med) var(--ease-out),
                background-color var(--dur-med) var(--ease-out);
}

.exa-toggle input:checked ~ .exa-toggle-track { background: var(--gold-dim); }
.exa-toggle input:checked ~ .exa-toggle-track::after { background: var(--gold); transform: translateX(16px); }
.exa-toggle input:focus-visible ~ .exa-toggle-track { box-shadow: 0 0 0 2px var(--gold-glow); }

.exa-toggle--disabled,
.exa-toggle:has(input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
}

.exa-toggle-label { color: var(--text-pri); font-size: var(--sm-font); line-height: 1.4; }


/* ═══ EXA EMPTY STATE ═══ */

.exa-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(12px * var(--font-scale)) calc(12px * var(--font-scale));
    text-align: center;
    gap: 6px;
    min-height: 60px;
}

.exa-empty-icon {
    font-size: calc(16px * var(--font-scale));
    opacity: 0.5;
    line-height: 1;
}

.exa-empty-text {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}


/* ═══ EXA CARD ═══ */

.exa-card {
    background: linear-gradient(160deg, var(--armor), var(--hull));
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius-card);
    padding: calc(10px * var(--font-scale));
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.exa-card:hover {
    border-color: var(--plate);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 8px rgba(var(--gold-rgb), 0.08);
}

.exa-card-active {
    border-color: var(--gold-subtle);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 12px rgba(var(--gold-rgb), 0.15);
}


/* ═══ EXA CHIPS & PILLS ═══ */

.exa-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: var(--xxs-font);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--bulkhead);
    background: var(--hull);
    color: var(--text-muted);
}

.exa-chip-pending { border-color: var(--text-muted); color: var(--text-muted); }
.exa-chip-running { border-color: var(--gold-subtle); color: var(--gold); background: rgba(var(--gold-rgb), 0.08); }
.exa-chip-completed { border-color: var(--gold); color: var(--gold); background: var(--gold-wash); }
.exa-chip-failed { border-color: var(--danger-hot); color: var(--danger-hot); background: rgba(244,67,54,0.08); }

/* Extended status variants — used in factions, cipher, nexus */
.exa-chip-info { border-color: var(--gold-dim); color: var(--gold-ember); background: var(--gold-wash); }
.exa-chip-success { border-color: var(--gold); color: var(--gold-bright); background: hsla(42, 45%, 50%, 0.12); }
.exa-chip-warning { border-color: var(--bronze); color: var(--bronze-text); background: var(--bronze-wash); }
.exa-chip-muted { border-color: var(--bulkhead); color: var(--text-ghost); }
.exa-chip-default { border-color: var(--bulkhead); color: var(--text-muted); }

.exa-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: var(--xxs-font);
    font-family: var(--font-mono);
    border: 1px solid var(--bulkhead);
    background: var(--hull);
    color: var(--text-muted);
}

.exa-pill-success { border-color: var(--gold); color: var(--gold); }
.exa-pill-warn { border-color: var(--warning); color: var(--warning); }
.exa-pill-error { border-color: var(--danger-hot); color: var(--danger-hot); }


/* ═══ MODAL ═══ */
/* ═══════════════════════════════════════════════════════════════════════════
    VOID-LUXURY MODAL SYSTEM
    Use: .modal-overlay > .modal (.modal-{sm|md|lg|xl})
    Header: .modal-header + .modal-title
    Body: .modal-content + .modal-form with .form-group/.form-input
    Actions: .form-actions with .form-btn-secondary/.form-btn-primary
    Mobile: full-screen takeover (see @media rules below)
    ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 12px;
}

.modal-overlay.open {
    display: flex;
    animation: modal-fade-in 0.15s ease-out;
}

/* Mini-modal — for tooltips / info popups. Compact, centered, not fullscreen on mobile. */
.modal-mini .modal {
    width: min(380px, 90vw);
    height: auto;
    min-height: 0;
    max-height: 80vh;
}

.modal-mini .modal-header {
    padding: 12px 16px;
}

.modal-mini .modal-title {
    font-size: var(--sm-font);
}

.modal-mini .modal-content {
    padding: 12px 16px;
    font-size: var(--xs-font);
    line-height: 1.6;
    color: var(--text-sec);
}

.modal-mini .modal-content strong {
    color: var(--gold-bright);
    font-weight: 600;
}

.modal-mini .modal-content p {
    margin: 0 0 8px;
}

.modal-mini .modal-content p:last-child {
    margin-bottom: 0;
}

.modal-mini .modal-content em {
    color: var(--text-muted);
}

/* ── Info-modal hotkey layout ── */
.info-hotkeys {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    align-items: baseline;
}
.info-hotkeys dt {
    text-align: right;
    white-space: nowrap;
}
.info-hotkeys dd {
    margin: 0;
    color: var(--text-sec);
    font-size: var(--xs-font);
}
.info-section-label {
    grid-column: 1 / -1;
    color: var(--gold-bright);
    font-size: var(--xxs-font);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 0 2px;
    border-bottom: 1px solid var(--shield);
    margin-bottom: 2px;
}
.info-section-label:first-child {
    padding-top: 0;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

.modal {
    background: linear-gradient(168deg, var(--armor), var(--hull));
    border: 1px solid var(--shield);
    border-top: 1px solid var(--bulkhead);
    border-radius: var(--radius-card);
    width: min(1200px, 96vw);
    max-width: 96vw;
    height: auto;
    min-height: 0;
    max-height: calc(100svh - 24px);
    display: flex;
    flex-direction: column;
    overflow: visible;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 16px 48px var(--shadow-deep), 0 0 1px rgba(255,255,255,0.06);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(168deg, var(--hull), var(--hull-deep));
    border-bottom: 1px solid var(--gold-edge);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.modal-title {
    font-size: var(--large-font);
    font-weight: var(--weight-semibold);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 0 0 8px hsla(42, 50%, 55%, 0.15);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: linear-gradient(165deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: var(--title-font);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--dur-fast);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.modal-close:hover {
    background: var(--danger);
    color: var(--text-bright);
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-subtitle {
    font-size: var(--small-font);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.artifact-preview-body {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-form {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-field {
    flex: 1 1 0;
    min-width: 0;
}

.form-help-text {
    margin-top: 6px;
    font-size: var(--xs-font);
    color: var(--text-muted);
    line-height: 1.4;
}

.form-input-mono {
    font-family: "Space Mono", monospace;
    font-size: var(--small-font);
}

.form-textarea {
    min-height: 96px;
    resize: vertical;
}

.form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23878787' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

@media (max-width: 520px) {
    .form-row {
        flex-direction: column;
    }
}

/* Settings modal - clean flat design */
.settings-modal {
    /* Sizing inherited from base .modal (Bridge Stations gold standard) */
}

/* Remove double-padding: sections have their own padding */
.settings-modal .modal-content {
    padding: 0;
}

.settings-modal .settings-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--shield);
}

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

.settings-modal .settings-actions {
    padding: 16px 20px;
    text-align: right;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    font-size: var(--base-font);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--void);
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Settings toggle row */
.settings-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--void);
    border-radius: 4px;
    margin-bottom: 8px;
}

.settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.settings-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
    cursor: pointer;
}

.settings-toggle-text {
    color: var(--text-pri);
    font-size: var(--base-font);
}

.settings-toggle-hint {
    color: var(--text-muted);
    font-size: var(--xs-font);
    display: block;
    margin-top: 6px;
}

/* Arbiter autonomy slider labels */
.arbiter-autonomy-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--xs-font);
    color: var(--text-sec);
}

/* Settings info rows for account display */
.settings-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--void);
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
    margin-bottom: 8px;
}

.settings-info-label {
    color: var(--text-muted);
    font-size: var(--small-font);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.settings-info-value {
    color: var(--text-pri);
    font-size: var(--base-font);
    font-weight: var(--weight-medium);
}

/* Settings action buttons */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--bulkhead);
    margin-top: 8px;
}

.settings-btn-secondary {
    padding: 10px 20px;
    background: linear-gradient(165deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--small-font);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.settings-btn-secondary:hover {
    background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    color: var(--text-pri);
    border-color: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 1px 4px var(--shadow-light);
}

.settings-btn-secondary:active {
    background: linear-gradient(165deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    transform: translateY(1px);
}

.settings-btn-logout {
    padding: 10px 20px;
    background: linear-gradient(165deg, hsl(0,30%,14%) 0%, hsl(0,25%,10%) 100%);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    color: var(--danger-text);
    font-size: var(--small-font);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 4px var(--shadow-warm);
}

.settings-btn-logout:hover {
    background: linear-gradient(165deg, hsl(0,32%,16%) 0%, hsl(0,28%,11%) 100%);
    color: var(--danger-hot);
    border-color: var(--danger-hot);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 8px var(--shadow-warm);
}

.settings-btn-logout:active {
    background: linear-gradient(165deg, hsl(0,25%,10%) 0%, hsl(0,20%,7%) 100%);
    transform: translateY(1px);
}


/* ═══ PRESET GALLERY ═══ */
.preset-gallery-modal {
    /* Sizing inherited from base .modal (Bridge Stations gold standard) */
}

/* Preset tabs */
.preset-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    background: linear-gradient(168deg, rgba(18,18,16,0.95), rgba(12,12,11,0.95));
    border-bottom: 1px solid var(--bulkhead);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.preset-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: var(--weight-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-tab:hover {
    color: var(--text-pri);
    background: rgba(255, 255, 255, 0.03);
}

.preset-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* Desktop: Fixed 2x3 grid, consistent height */
.preset-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Rows grow to content without overflow */
    grid-template-rows: none;
    grid-auto-rows: minmax(220px, auto);
    gap: 12px;
    padding: 16px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
}

@media (max-width: 1100px) {
    .preset-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: single column with scroll */
@media (max-width: 600px) {
    .preset-gallery-modal {

@media (max-width: 600px) {
    .modal {
        width: 100vw;
        height: 100svh;
        max-width: 100vw;
        max-height: 100svh;
        min-height: 100svh;
        border-radius: 0;
    }

    .modal-overlay {
        padding: 0;
    }
}
        width: 100vw;
        height: 100svh;
        max-width: 100vw;
        max-height: 100svh;
        min-height: 100svh;
        border-radius: 0;
    }

    .preset-gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-rows: minmax(220px, auto);
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        align-content: start;
    }

    .preset-tabs {
        padding: 0 12px;
    }

    .preset-tab {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        font-size: 11px;
    }

    .preset-card {
        min-height: 0;
    }

    .preset-card-name>span,
    .preset-card-desc {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
}

.preset-loading-card {
    pointer-events: none;
    opacity: 0.6;
}

.preset-card {
    background: linear-gradient(160deg, var(--armor), var(--hull));
    border: 1px solid rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
    overflow: visible;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 2px 8px var(--shadow-warm);
    /* For ghost preview pseudo-element */
}

.preset-card:hover:not(.preset-empty-slot) {
    background: linear-gradient(160deg, var(--shield), var(--armor));
    border-color: var(--gold-edge);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 16px var(--shadow-warm), 0 0 12px -4px hsla(42, 50%, 50%, 0.08);
}

.preset-card-preview {
    height: 60px;
    background: var(--void);
    border-bottom: 1px solid var(--bulkhead);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
}

.preset-preview-cell {
    flex: 1;
    height: 100%;
    background: linear-gradient(168deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.preset-card-info {
    padding: 10px 12px;
}

.preset-card-name {
    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
    color: var(--text-pri);
    margin-bottom: 4px;
}

.preset-card-name>span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    display: block;
}

.preset-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-style: italic;
    opacity: 0.8;
}

.preset-card-meta {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    font-weight: var(--weight-normal);
}

/* No special formatting on strong - just regular text */
.preset-card-meta strong {
    color: var(--text-muted);
    font-weight: var(--weight-normal);
}

/* Detailed state info row */
.preset-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.preset-card-details .detail-depts {
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.preset-card-details .detail-collapsed {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Card actions row - separate from title for more space */
.preset-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--bulkhead);
}

/* Up/Down arrow buttons for reordering */
.preset-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(165deg, var(--bulkhead) 0%, var(--shield) 100%);
    border: none;
    color: var(--text-muted);
    font-size: var(--base-font);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Edit button for templates */
.preset-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(165deg, var(--bulkhead) 0%, var(--shield) 100%);
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.preset-edit-btn:hover {
    color: var(--gold);
    background: linear-gradient(165deg, var(--plate) 0%, var(--bulkhead) 100%);
}

.preset-order-btn:hover:not(:disabled) {
    color: var(--gold);
    background: linear-gradient(165deg, var(--plate) 0%, var(--bulkhead) 100%);
}

.preset-order-btn:active:not(:disabled) {
    background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    transform: scale(0.95);
}

.preset-order-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Delete button - same size as drag handle */
.preset-card-delete {
    width: 32px;
    height: 32px;
    font-size: var(--lg-font);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(165deg, var(--bulkhead) 0%, var(--shield) 100%);
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.preset-card-delete:hover {
    background: var(--danger-hot);
    color: white;
}

/* Empty slot styling - completely inert, NO effects whatsoever */
.preset-empty-slot {
    opacity: 0.35;
    cursor: default;
    pointer-events: none !important;
    transform: none !important;
    transition: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    background: linear-gradient(160deg, var(--armor), var(--hull)) !important;
    border-color: var(--bulkhead) !important;
}

.preset-empty-slot,
.preset-empty-slot *,
.preset-empty-slot::before,
.preset-empty-slot::after {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    filter: none !important;
}

.preset-empty-slot .preset-card-preview {
    background: var(--void) !important;
    border-bottom-color: var(--bulkhead) !important;
}

.preset-empty-slot .preset-preview-cell {
    background: var(--bulkhead) !important;
    border-color: var(--plate) !important;
}

.preset-empty-preview {
    background: var(--void) !important;
}

.preset-gallery-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.preset-gallery-empty-icon {
    font-size: calc(32px * var(--font-scale));
    margin-bottom: 16px;
    opacity: 0.5;
}

.preset-gallery-footer {
    border-top: 1px solid var(--bulkhead);
    padding: 16px 20px;
    text-align: center;
    background: linear-gradient(168deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.preset-gallery-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--gold);
    border: none;
    border-radius: 6px;
    color: var(--void);
    font-size: var(--small-font);
    font-weight: var(--weight-bold);
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preset-gallery-new-btn:hover {
    background: var(--gold-hot);
}

/* Footer message when full */
.preset-footer-message {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

/* Overseer: Add System Template button */
.preset-add-system-btn {
    padding: 4px 10px;
    background: linear-gradient(165deg, var(--bulkhead) 0%, var(--shield) 100%);
    border: none;
    border-radius: 4px;
    color: var(--gold);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.preset-add-system-btn:hover {
    background: linear-gradient(165deg, var(--plate) 0%, var(--bulkhead) 100%);
}

/* System preset delete button (Overseer only) */
.preset-system-delete {
    opacity: 0.7;
}

.preset-card:hover .preset-system-delete {
    opacity: 1;
}


/* ═══ SAVE TEMPLATE MODAL ═══ */
.save-template-modal {
    width: 380px;
    max-width: 95vw;
}

/* Remove double-padding: modal-content already has 24px,
   so save-template-form uses zero extra padding */
.save-template-modal .modal-content {
    padding: 0;
}

.save-template-form {
    padding: 16px 20px;
}

.save-template-form .exa-form-group {
    margin-bottom: 14px;
}

.save-template-form .exa-label {
    font-size: var(--xxs-font);
    margin-bottom: 4px;
}

.save-template-form .exa-input,
.save-template-form .exa-textarea {
    font-size: var(--xs-font);
    padding: calc(6px * var(--font-scale)) calc(8px * var(--font-scale));
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--armor);
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    color: var(--text-pri);
    font-size: var(--base-font);
    font-family: inherit;
    transition: all 0.15s;
}

.form-input:focus {
    background: var(--shield);
    border-color: var(--gold-dim);
    outline: none;
    box-shadow: 0 0 0 1px var(--gold-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-char-count {
    text-align: right;
    font-size: 10px;
    color: var(--text-ghost);
    margin-top: 2px;
}

.form-preview {
    padding: 10px 12px;
    background: var(--hull);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    margin-bottom: 14px;
}

.form-preview-label {
    font-size: 10px;
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-preview-info {
    font-size: var(--xs-font);
    color: var(--text-sec);
    line-height: 1.4;
}

.form-preview-info span {
    color: var(--gold);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--shield);
    margin-top: 4px;
}


/* ═══ INFO HELP SYSTEM (Click-to-reveal, responsive) ═══ */
/* 
 * TRUNCATION POLICY: Info popups must NEVER truncate or overflow station panels.
 * - Use position:fixed for portal-style rendering
 * - Calculate position in JS to stay within viewport
 * - Max-width relative to viewport, not parent
 */

/* Unified info button style - used everywhere */
.info-btn,
.dept-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(165deg, var(--plate) 0%, var(--bulkhead) 100%);
    border: none;
    border-radius: 50%;
    color: var(--text-pri);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    cursor: pointer;
    margin-left: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.info-btn:hover,
.dept-info-btn:hover {
    background: linear-gradient(165deg, var(--plate) 0%, var(--plate) 100%);
    color: var(--gold);
}

/* (info-popup system removed in v0.53.3 — tooltips now use mini-modals) */


/* ═══ SKELETON LOADERS ═══ */
.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--bulkhead) 25%, var(--plate) 50%, var(--bulkhead) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-line {
    height: 12px;
    margin: 8px 0;
}

.skeleton-line.tall {
    height: 20px;
}

.skeleton-block {
    height: 60px;
    margin: 12px 0;
}

/* Info button in section headers */
.section-header {
    display: flex;
    align-items: center;
    position: relative;
}


/* ═══ MAINTENANCE PAGE ═══ */

.maintenance-page {
    margin: 0;
    min-height: 100vh;
    background: var(--void);
    color: var(--text-pri);
    font-family: var(--font-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.maintenance-shell {
    width: min(720px, 96vw);
}

.maintenance-card {
    background: linear-gradient(168deg, rgba(22,22,20,0.95), rgba(14,14,13,0.95));
    border: 1px solid rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.maintenance-icon {
    font-size: calc(32px * var(--font-scale));
    margin-bottom: 10px;
}

.maintenance-title {
    color: var(--gold);
    font-size: calc(18px * var(--font-scale));
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.maintenance-message {
    font-size: calc(13px * var(--font-scale));
    color: var(--text-pri);
    line-height: 1.6;
    margin-bottom: 10px;
}

.maintenance-meta {
    font-size: 11px;
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════════════════
   COMMAND DIVISION — ARBITER CHAT + MANIFEST
   ═══════════════════════════════════════════════════════════════════════════ */

.arbiter-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    background: var(--void);
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
}

.arbiter-chat-message {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: var(--xxs-font);
    line-height: 1.4;
}

.arbiter-chat-message.user {
    align-self: flex-end;
    background: var(--bulkhead);
    color: var(--text-pri);
}

.arbiter-chat-message.arbiter {
    align-self: flex-start;
    background: linear-gradient(168deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: var(--text-pri);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.arbiter-chat-input {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.badge-card {
    background: linear-gradient(160deg, var(--armor), var(--hull));
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.badge-card.earned {
    border-color: var(--plate);
    color: var(--text-pri);
}

.badge-icon {
    font-size: calc(20px * var(--font-scale));
    margin-bottom: 6px;
}

.badge-title {
    font-size: var(--xxs-font);
    font-weight: 600;
    margin-bottom: 4px;
}

.badge-desc {
    font-size: 10px;
    color: var(--text-muted);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
    background: linear-gradient(160deg, var(--armor), var(--hull));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.timeline-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bulkhead);
    border-radius: 50%;
    font-size: var(--base-font);
}

.timeline-title {
    font-size: var(--xxs-font);
    color: var(--text-pri);
    margin-bottom: 2px;
}

.timeline-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
}


.regimen-approval-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(168deg, var(--plate) 0%, var(--bulkhead) 100%);
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.regimen-approval-status {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.regimen-approval-status.approved {
    color: var(--gold);
}

.routines-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.routine-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: linear-gradient(168deg, rgba(10,10,9,0.96), rgba(6,6,5,0.96));
    border: 1px solid var(--bulkhead);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.routine-label {
    font-size: var(--xxs-font);
    color: var(--text-pri);
    min-width: 90px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.routine-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.subroutine-chip {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: var(--xxs-font);
    font-weight: 600;
    background: var(--bulkhead);
    color: var(--text-muted);
}

.chip-pending {
    background: var(--bulkhead);
    color: var(--text-muted);
}

.chip-running {
    background: var(--gold);
    color: var(--void);
}

.chip-completed,
.chip-complete {
    background: var(--gold);
    color: var(--void);
}

.chip-failed {
    background: var(--danger-hot);
    color: var(--void);
}


/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICATION BAR (beneath dock — full-width status bar)
   ═══════════════════════════════════════════════════════════════════════════ */

.hud-notification-bar {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
    background: var(--hull);
    border-top: 1px solid var(--bulkhead);
}

.notification-console {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--font-scale));
    width: 100%;
    height: calc(22px * var(--font-scale));
    padding: 0 calc(12px * var(--font-scale));
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    justify-content: center;
}

.notification-log-label {
    font-family: var(--font-data);
    font-size: calc(8px * var(--font-scale));
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
    position: absolute;
    left: calc(12px * var(--font-scale));
}

.notification-summary {
    font-size: var(--xxs-font);
    color: var(--text-pri);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.notification-log-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(20px * var(--font-scale));
    height: calc(20px * var(--font-scale));
    background: none;
    border: 1px solid var(--bulkhead);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: calc(10px * var(--font-scale));
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    position: absolute;
    right: calc(12px * var(--font-scale));
}

.notification-log-btn:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
}

.notification-item {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--bulkhead);
    background: linear-gradient(160deg, var(--armor), var(--hull));
    font-size: var(--xxs-font);
    color: var(--text-pri);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.notification-item .notif-icon {
    font-size: 12px;
    line-height: 1;
    margin-top: 2px;
}

.notification-item.success {
    border-color: var(--gold-edge);
}

.notification-item.error {
    border-color: rgba(239, 68, 68, 0.6);
}

.notification-item.info {
    border-color: var(--bulkhead);
    background: rgba(255, 149, 0, 0.08);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SANCTUM UI
   ═══════════════════════════════════════════════════════════════════════════ */

.sanctum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.sanctum-card {
    background: linear-gradient(160deg, var(--plate) 0%, var(--bulkhead) 15%, var(--shield) 100%);
    border: 1px solid var(--plate);
    border-radius: 8px;
    padding: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.sanctum-card-title {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    margin-bottom: 6px;
}

.sanctum-card-value {
    font-size: var(--large-font);
    color: var(--text-pri);
    font-weight: 600;
}

.sanctum-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--xxs-font);
}

.sanctum-table th,
.sanctum-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--bulkhead);
    text-align: left;
}

.sanctum-table th {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.sanctum-table tr:hover td {
    background: rgba(255, 149, 0, 0.06);
}

.sanctum-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--bulkhead);
    color: var(--text-pri);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.sanctum-pill.success {
    background: var(--gold);
    color: var(--void);
}

.sanctum-pill.warn {
    background: var(--gold);
    color: var(--void);
}

.sanctum-pill.error {
    background: var(--danger-hot);
    color: var(--void);
}

.sanctum-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sanctum-form {
    display: grid;
    gap: 8px;
}

.sanctum-input,
.sanctum-textarea,
.sanctum-select {
    width: 100%;
    padding: 6px 8px;
    background: var(--void);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: var(--text-pri);
    font-size: var(--xxs-font);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.sanctum-textarea {
    min-height: 80px;
    resize: vertical;
}

.sanctum-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .notification-console {
        height: calc(22px * var(--font-scale));
        padding: 0 calc(8px * var(--font-scale));
    }
}

.notification-log-modal .modal-body {
    padding: 16px;
}

.notification-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.notification-log-empty {
    font-size: var(--xxs-font);
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

/* Notification log entries (rendered by exa-modals.js) */
.notif-log-entry {
    padding: 6px 0;
    border-bottom: 1px solid var(--bulkhead);
    font-size: var(--sm-font);
}
.notif-log-ts {
    color: var(--text-ghost);
    font-family: var(--font-data);
    font-size: var(--xs-font);
}
.notif-log-msg-info    { color: var(--text-sec); }
.notif-log-msg-success { color: var(--gold); }
.notif-log-msg-error   { color: var(--danger-text); }


/* ═══════════════════════════════════════════════════════════════════════════
   PANE STATES — Active + Fullscreen
   ═══════════════════════════════════════════════════════════════════════════ */

.hud-station.pane-active {
    border-color: var(--gold-cold);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 20px -8px var(--gold-glow),
        0 4px 16px var(--shadow-deep);
}

.hud-station.pane-active::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 40px; height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 0 0 4px 0;
    z-index: 10;
    opacity: 1;
}

.hud-station.pane-active::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 2px; height: 100%;
    background: linear-gradient(180deg, var(--gold-dim) 0%, transparent 60%);
    opacity: 0.6;
    z-index: 10;
}

/* Fullscreen: pane expands to fill entire grid */
.hud-station.pane-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    border-radius: 0;
    border: none;
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    background: var(--void, #0a0a0a);
}


/* ═══════════════════════════════════════════════════════════════════════════
   DOCK CONTROLS — New 8-button control system indicators
   ═══════════════════════════════════════════════════════════════════════════ */

.dock-controls-left,
.dock-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dock-controls-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dock-control-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.dock-control-label {
    font-family: var(--font-data);
    font-size: calc(7px * var(--font-scale));
    letter-spacing: calc(2px * var(--font-scale));
    color: var(--text-ghost);
    text-transform: uppercase;
    font-weight: 700;
}

/* D-pad layout */
.dock-dpad {
    display: grid;
    grid-template-columns: repeat(3, calc(28px * var(--font-scale)));
    grid-template-rows: repeat(3, calc(28px * var(--font-scale)));
    gap: 1px;
    justify-items: center;
    align-items: center;
}

.dock-dpad-mid {
    display: contents;
}

.dock-dpad-cross {
    font-size: calc(8px * var(--font-scale));
    color: var(--gold-cold);
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 2;
}

/* D-pad positions */
.dock-key-up { grid-column: 2; grid-row: 1; }
.dock-key-down { grid-column: 2; grid-row: 3; }
.dock-key-left { grid-column: 1; grid-row: 2; }
.dock-key-right { grid-column: 3; grid-row: 2; }

/* Key caps */
.dock-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    background: linear-gradient(168deg, var(--shield), var(--hull));
    border: 1px solid var(--bulkhead);
    border-radius: 3px;
    color: var(--text-muted);
    font-family: var(--font-data);
    font-size: calc(10px * var(--font-scale));
    font-weight: 700;
    letter-spacing: 0;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
    cursor: pointer;
}

.dock-key:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
    box-shadow: 0 0 6px -2px var(--gold-glow);
}

/* Face buttons in a cross shape (like the D-pad) */
.dock-face-cross {
    display: grid;
    grid-template-columns: repeat(3, calc(28px * var(--font-scale)));
    grid-template-rows: repeat(3, calc(28px * var(--font-scale)));
    gap: 1px;
    justify-items: center;
    align-items: center;
}

.dock-face-cross-mid {
    display: contents;
}

.dock-face-cross-center {
    font-size: calc(8px * var(--font-scale));
    color: var(--gold-cold);
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 2;
}

.dock-face {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    font-size: calc(11px * var(--font-scale));
    display: flex;
    align-items: center;
    justify-content: center;
    /* Prevent context menu on mobile long-press */
    -webkit-touch-callout: none;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Face cross positions — named classes (no inline styles) */
.dock-face-top    { grid-column: 2; grid-row: 1; }
.dock-face-left   { grid-column: 1; grid-row: 2; }
.dock-face-right  { grid-column: 3; grid-row: 2; }
.dock-face-bottom { grid-column: 2; grid-row: 3; }

/* Trigger pair (Q ◂▸ E) */
.dock-trigger-pair {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dock-trigger-sep {
    font-size: 8px;
    color: var(--text-ghost);
    letter-spacing: 1px;
}

/* Pane count controls */
.dock-pane-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dock-count-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(168deg, var(--shield), var(--hull));
    border: 1px solid var(--bulkhead);
    border-radius: 3px;
    color: var(--text-muted);
    font-family: var(--font-data);
    font-size: var(--base-font);
    font-weight: 700;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}

.dock-count-btn:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
}

.dock-count-display {
    font-family: var(--font-data);
    font-size: calc(13px * var(--font-scale));
    color: var(--gold-dim);
    min-width: calc(16px * var(--font-scale));
    text-align: center;
}

/* Consolidated station controls — Q [count] E */
.dock-station-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Station controls — 2x2 grid */
.dock-station-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

/* Shift+ hint text below station grid */
.dock-shift-hint {
    font-family: var(--font-data);
    font-size: calc(7px * var(--font-scale));
    color: var(--text-ghost);
    letter-spacing: 0.5px;
    text-align: center;
}

/* ═══ DOCK SINGLE-ROW LAYOUT ═══ */

/* Main row: NAV (left) | STATIONS (center) | ACTIONS (right) */
.dock-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.dock-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
}

.dock-section-left {
    justify-content: flex-start;
}

.dock-section-center {
    justify-content: center;
}

.dock-section-right {
    justify-content: flex-end;
}

/* Label row: [i] LABEL */
.dock-label-row {
    display: flex;
    align-items: center;
    gap: calc(4px * var(--font-scale));
    justify-content: center;
}

/* (Bridge Stations button, brightness slider removed in v0.53.3 — F key is now center of station X-cross) */

/* ═══ STATION X-CROSS ═══ */
/* X-shaped layout: Q and E at top corners, ⇧Q and ⇧E at bottom corners, F in center */
.dock-xcross {
    display: grid;
    grid-template-columns: repeat(3, calc(28px * var(--font-scale)));
    grid-template-rows: repeat(3, calc(28px * var(--font-scale)));
    gap: 1px;
    justify-items: center;
    align-items: center;
}

.dock-xcross-row {
    display: contents;
}

.dock-xkey {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    font-size: calc(9px * var(--font-scale));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Position keys on diagonals */
.dock-xkey-tl {
    grid-column: 1;
    grid-row: 1;
}

.dock-xkey-tr {
    grid-column: 3;
    grid-row: 1;
}

.dock-xkey-mid {
    grid-column: 2;
    grid-row: 2;
}

.dock-xkey-bl {
    grid-column: 1;
    grid-row: 3;
}

.dock-xkey-br {
    grid-column: 3;
    grid-row: 3;
}

/* Empty spaces in X pattern */
.dock-xcross-space {
    /* invisible spacer */
}

.dock-xcross-center-row {
    /* center row uses only middle cell */
}

/* ═══ ARBITER FULLSCREEN MODAL ═══ */
.arbiter-modal {
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transition: width var(--dur-fast) var(--ease-out),
                height var(--dur-fast) var(--ease-out),
                max-width var(--dur-fast) var(--ease-out);
}

.arbiter-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Header button styles for arrange/font/collapse in header bar */
.hud-arrange-btn,
.hud-font-btn,
.hud-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: var(--xs-font);
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}

.hud-arrange-btn:hover,
.hud-font-btn:hover,
.hud-collapse-btn:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
    background: var(--gold-wash);
}

.hud-arrange-btn.active {
    color: var(--gold);
    background: var(--gold-wash);
    border-bottom: 2px solid var(--gold);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Overseer badge in header */
.hud-overseer-badge {
    font-size: var(--sm-font);
}


/* ═══════════════════════════════════════════════════════════════════════════
   BRIDGE IMMERSIVE MODE (long-press 3)
   Hides header + dock + notification bar, grid fills viewport
   ═══════════════════════════════════════════════════════════════════════════ */

.bridge-immersive .hud-header,
.bridge-immersive .hud-dock,
.bridge-immersive .hud-notification-bar {
    display: none !important;
}

.bridge-immersive .hud-grid {
    flex: 1 1 auto;
    height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIVISION TEMPLATE UTILITIES
   Used by macro-based division templates (templates/divisions/**)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Station Title Parts ──────────────────────────────────────────────────── */
.title-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.title-text {
    /* inherits .station-title styling */
}

/* ── Layout Utilities ─────────────────────────────────────────────────────── */
.exa-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.exa-form-row {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    flex-wrap: wrap;
}

.exa-input-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.exa-btn-grid {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.exa-metrics-row {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.exa-spacer {
    flex: 1;
    min-width: var(--space-sm);
}

.exa-hidden {
    display: none !important;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.exa-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    flex-wrap: wrap;
}

/* ── Split Panel ──────────────────────────────────────────────────────────── */
.exa-split-panel {
    display: flex;
    gap: var(--space-md);
    min-height: 200px;
}

.exa-panel-main {
    flex: 1;
    min-width: 0;
}

.exa-panel-aside {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid var(--bulkhead);
    padding-left: var(--space-md);
}

/* ── Scroll Panel ────────────────────────────────────────────────────────── */
.exa-scroll-panel {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--plate) transparent;
}

.exa-scroll-panel::-webkit-scrollbar {
    width: 6px;
}

.exa-scroll-panel::-webkit-scrollbar-track {
    background: transparent;
}

.exa-scroll-panel::-webkit-scrollbar-thumb {
    background: var(--plate);
    border-radius: 3px;
}

/* ── Code Output ──────────────────────────────────────────────────────────── */
.exa-code-output {
    font-family: var(--font-data);
    font-size: var(--sm-font);
    background: var(--hull);
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-sec);
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 60px;
}

/* ── Bulk Action Bar ──────────────────────────────────────────────────────── */
.exa-bulk-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gold-subtle);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius);
    margin-bottom: var(--space-sm);
}

/* ── Labels & Hints ───────────────────────────────────────────────────────── */
.exa-subsection-label {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: var(--space-md) 0 var(--space-sm);
}

.exa-hint {
    font-family: var(--font-ui);
    font-size: 0.85em;
    color: var(--text-ghost);
    margin-left: var(--space-xs);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

/* ── Check Label (inline checkbox+label) ──────────────────────────────────── */
.exa-check-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-ui);
    font-size: var(--sm-font);
    color: var(--text-sec);
    cursor: pointer;
}

.exa-check-label input[type="checkbox"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   EXA FORM GROUP
   ═══════════════════════════════════════════════════════════════════════════ */

.exa-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ═══ Checkbox ═══ */

.exa-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: var(--body-font);
    color: var(--text-secondary);
}

.exa-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.exa-checkbox-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid var(--shield);
    border-radius: 3px;
    background: var(--hull);
    transition: all var(--dur-fast);
    flex-shrink: 0;
}

.exa-checkbox-mark::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(-45deg) scale(0);
    transition: transform var(--dur-fast);
}

.exa-checkbox input:checked + .exa-checkbox-mark {
    border-color: var(--gold);
    background: rgba(var(--gold-rgb, 255 215 0) / 0.1);
}

.exa-checkbox input:checked + .exa-checkbox-mark::after {
    transform: rotate(-45deg) scale(1);
}

.exa-checkbox input:focus-visible + .exa-checkbox-mark {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.exa-checkbox-label {
    line-height: 1.4;
}

/* ── Radio Group ────────────────────────────────────────────────────────── */
.exa-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}


/* ═══════════════════════════════════════════════════════════════════════════
   BADGE
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-family: var(--font-data);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 2px;
    border: 1px solid transparent;
}

.badge.muted {
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
}

.badge.gold {
    color: var(--gold);
    background: hsla(var(--gold-h), 50%, 45%, 0.10);
    border-color: hsla(var(--gold-h), 50%, 45%, 0.25);
}

.badge.bright {
    color: var(--gold-hot);
    background: hsla(var(--gold-h), 65%, 55%, 0.14);
    border-color: hsla(var(--gold-h), 75%, 60%, 0.35);
    box-shadow: 0 0 10px -2px hsla(var(--gold-h), 80%, 60%, 0.20),
                inset 0 0 8px -3px hsla(var(--gold-h), 70%, 60%, 0.12);
    text-shadow: 0 0 6px hsla(var(--gold-h), 80%, 65%, 0.25);
}

.badge.bronze {
    color: var(--bronze-text);
    background: var(--bronze-wash);
    border-color: var(--bronze-edge);
}

.badge.bronze-bright {
    color: var(--bronze-hot);
    background: hsla(var(--bronze-h), 35%, 40%, 0.12);
    border-color: hsla(var(--bronze-h), 40%, 45%, 0.28);
    box-shadow: 0 0 8px -2px var(--bronze-glow);
    text-shadow: 0 0 4px hsla(var(--bronze-h), 40%, 50%, 0.18);
}

.badge.caution {
    color: var(--bronze-hot);
    background: hsla(var(--bronze-h), 30%, 36%, 0.14);
    border-color: hsla(var(--bronze-h), 36%, 42%, 0.28);
    box-shadow: 0 0 8px -3px var(--bronze-glow);
}

.badge.red {
    color: var(--danger-text);
    background: var(--danger-wash);
    border-color: var(--danger-line);
    box-shadow: 0 0 8px -2px var(--danger-glow);
    text-shadow: 0 0 4px hsla(var(--danger-h), 45%, 45%, 0.2);
}

.badge .dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge.bright .dot { box-shadow: 0 0 6px currentColor; }

.badge.sm { padding: 2px 7px; font-size: 7px; gap: 3px; letter-spacing: 0.5px; }
.badge.sm .dot { width: 3px; height: 3px; }
.badge.lg { padding: 5px 14px; font-size: 11px; gap: 6px; letter-spacing: 1.5px; }
.badge.lg .dot { width: 7px; height: 7px; }


/* ═══════════════════════════════════════════════════════════════════════════
   ALERT
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: calc(13px * var(--font-scale));
    line-height: 1.6;
    transition: border-color var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out),
                background var(--dur-med) var(--ease-out);
    background: var(--gold-wash);
    border-color: var(--gold-edge);
    color: var(--gold);
    border-left: 3px solid var(--gold-dim);
}

.alert:hover {
    background: hsla(var(--gold-h), 50%, 50%, 0.12);
    box-shadow: 0 0 16px -4px var(--gold-glow),
                inset 0 1px 0 rgba(255,255,255,0.04);
}

.alert-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

.alert.warn {
    background: hsla(var(--gold-h), 65%, 55%, 0.10);
    border-color: hsla(var(--gold-h), 70%, 58%, 0.25);
    color: var(--gold-hot);
    border-left: 3px solid var(--gold-bright);
}

.alert.warn:hover {
    background: hsla(var(--gold-h), 70%, 55%, 0.16);
    box-shadow: 0 0 20px -4px hsla(var(--gold-h), 80%, 58%, 0.25);
}

.alert.caution {
    background: var(--bronze-wash);
    border-color: var(--bronze-edge);
    color: var(--bronze-text);
    border-left: 3px solid var(--bronze-dim);
}

.alert.caution:hover {
    background: hsla(var(--bronze-h), 35%, 40%, 0.12);
    box-shadow: 0 0 16px -4px var(--bronze-glow);
}

.alert.danger {
    background: var(--danger-wash);
    border-color: var(--danger-line);
    color: var(--danger-text);
    border-left: 3px solid var(--danger);
}

.alert.danger:hover {
    background: hsla(var(--danger-h), 55%, 50%, 0.12);
    box-shadow: 0 0 16px -4px var(--danger-glow);
}

.alert.muted-alert {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.06);
    color: var(--text-sec);
    border-left: 3px solid var(--text-ghost);
}

.alert.muted-alert:hover {
    background: rgba(255,255,255,0.04);
    box-shadow: 0 0 12px -4px rgba(255,255,255,0.05);
}

.alert-title {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.alert-body {
    font-family: var(--font-ui);
    font-size: calc(13px * var(--font-scale));
    color: var(--text-sec);
    line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════════════════════
   GAUGE / PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.gauge {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.gauge::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
        transparent 0px, transparent 9px,
        rgba(5,5,5,0.5) 9px, rgba(5,5,5,0.5) 10px);
    pointer-events: none;
    z-index: 1;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-ember));
    border-radius: 2px;
    transition: width 1.2s var(--ease-out);
    position: relative;
    width: 0%;
}

.gauge-fill::after {
    content: '';
    position: absolute;
    top: -4px; right: -2px; bottom: -4px;
    width: 12px;
    background: radial-gradient(ellipse at right, hsla(var(--gold-h), 55%, 50%, 0.3), transparent);
    border-radius: 50%;
}

.gauge-fill.bright {
    background: linear-gradient(90deg, var(--gold-ember), var(--gold-hot));
    box-shadow: 0 0 12px -2px hsla(var(--gold-h), 80%, 60%, 0.30);
}

.gauge-fill.bright::after {
    background: radial-gradient(ellipse at right, hsla(var(--gold-h), 85%, 65%, 0.6), transparent);
}

.gauge-fill.mid {
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    box-shadow: 0 0 8px -2px hsla(var(--gold-h), 60%, 50%, 0.20);
}

.gauge-fill.danger {
    background: linear-gradient(90deg, var(--danger-cold), var(--danger-text));
    box-shadow: 0 0 10px -2px var(--danger-glow);
}

.gauge-fill.danger::after {
    background: radial-gradient(ellipse at right, hsla(var(--danger-h), 70%, 55%, 0.5), transparent);
}

.gauge-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.gauge-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.gauge-value {
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--gold);
}

.gauge-value.danger { color: var(--danger-text); }


/* ═══════════════════════════════════════════════════════════════════════════
   PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.panel {
    background: linear-gradient(168deg, rgba(14, 14, 13, 0.95), rgba(9, 9, 8, 0.95));
    border: 1px solid rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 28px;
    position: relative;
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08),
                0 4px 24px var(--shadow-warm),
                0 0 1px rgba(255,255,255,0.06);
    transition: border-color var(--dur-slow) var(--ease-out),
                box-shadow var(--dur-slow) var(--ease-out);
    overflow: hidden;
}

.panel.panel-deep {
    background: linear-gradient(168deg, rgba(10, 10, 9, 0.96), rgba(6, 6, 5, 0.96));
    border-color: rgba(255,255,255,0.03);
    box-shadow: inset 0 -2px 8px rgba(0,0,0,0.3), 0 2px 16px var(--shadow-deep);
}

.panel.panel-raised {
    background: linear-gradient(168deg, rgba(22, 22, 20, 0.93), rgba(16, 16, 14, 0.93));
    border-color: rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12),
                0 8px 40px var(--shadow-deep),
                0 0 1px rgba(255,255,255,0.10);
}

.panel:hover {
    border-color: hsla(var(--gold-h), 40%, 45%, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1),
                0 4px 24px var(--shadow-warm),
                0 0 1px rgba(255,255,255,0.06),
                0 0 20px -8px hsla(var(--gold-h), 50%, 50%, 0.08);
}

.panel.flush { padding: 0; }

.panel-corners {
    position: absolute;
    inset: -1px;
    pointer-events: none;
    z-index: 1;
}

.panel-corners::before,
.panel-corners::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    opacity: 0.22;
    transition: opacity var(--dur-med) var(--ease-out);
}

.panel-corners::before { top: 0; left: 0; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); }
.panel-corners::after { bottom: 0; right: 0; border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold); }
.panel:hover .panel-corners::before,
.panel:hover .panel-corners::after { opacity: 0.55; }

.panel.panel-active {
    border-left: 2px solid var(--gold-dim);
    background: linear-gradient(135deg, hsla(var(--gold-h), 28%, 38%, 0.05), rgba(14, 14, 13, 0.95) 22%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 14px;
}

.panel.flush .panel-header {
    margin: 0;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.panel-title {
    font-size: 10px;
    letter-spacing: 2.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.panel-status {
    font-size: 10px;
    color: var(--gold-dim);
    font-family: var(--font-data);
    display: flex;
    align-items: center;
    gap: 7px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SHIMMER / LOADING SKELETON
   ═══════════════════════════════════════════════════════════════════════════ */

.shimmer {
    position: relative;
    overflow: hidden;
    background: var(--armor);
    border-radius: var(--radius);
    padding: 16px;
}

.shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        hsla(var(--gold-h), 40%, 50%, 0.06) 40%,
        hsla(var(--gold-h), 50%, 55%, 0.1) 50%,
        hsla(var(--gold-h), 40%, 50%, 0.06) 60%,
        transparent 100%);
    animation: shimmer-slide 2s ease-in-out infinite;
}

.shimmer-line {
    height: 10px;
    border-radius: 2px;
    margin-bottom: 10px;
    background: var(--shield);
}

.shimmer-line:last-child { margin-bottom: 0; }
.shimmer-line.w75 { width: 75%; }
.shimmer-line.w50 { width: 50%; }
.shimmer-line.w90 { width: 90%; }

@keyframes shimmer-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Pane loading — path-traverse shown during division swap & initial load ── */
.hud-station-content.pane-loading {
    position: relative;
}

/* Loader container — centered, holds LOADING text below the path */
.pane-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    z-index: 3;
    pointer-events: none;
}
.pane-loader-text {
    font-family: 'Space Mono', monospace;
    font-size: var(--xs-font);
    letter-spacing: 4px;
    color: var(--text-muted);
    animation: path-pulse 2.4s ease-in-out infinite;
}
/* Static path: three nodes connected by a line (on the pane, not the loader div) */
.hud-station-content.pane-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 12px;
    margin: -6px 0 0 -60px;
    background:
        radial-gradient(circle at 4px 6px, var(--gold-dim) 3px, transparent 3.5px) 0 0 / 8px 12px no-repeat,
        radial-gradient(circle at 4px 6px, var(--gold-dim) 3px, transparent 3.5px) 56px 0 / 8px 12px no-repeat,
        radial-gradient(circle at 4px 6px, var(--gold-dim) 3px, transparent 3.5px) 112px 0 / 8px 12px no-repeat,
        linear-gradient(var(--bulkhead), var(--bulkhead)) 4px 5.5px / 112px 1px no-repeat;
    animation: path-pulse 2.4s ease-in-out infinite;
    z-index: 1;
}
@keyframes path-pulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 0.7; }
}
/* Traversing dot — moves node-to-node along the path (on the pane) */
.hud-station-content.pane-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -61px;
    border-radius: 50%;
    background: var(--gold);
    animation: path-traverse 2.4s ease-in-out infinite;
    z-index: 2;
}
@keyframes path-traverse {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    25%      { opacity: 1; }
    50%      { transform: translateX(112px); opacity: 1; }
    75%      { opacity: 0.5; }
}

/* ── Content fade-in after HTMX swap ── */
@keyframes content-fade-in {
    from { opacity: 0.7; }
    to   { opacity: 1; }
}
.hud-station-content.pane-loaded {
    animation: content-fade-in 0.15s ease-out;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CONSOLE / LOG VIEWER
   ═══════════════════════════════════════════════════════════════════════════ */

.console {
    background: linear-gradient(168deg, rgba(3,3,2,0.6), rgba(0,0,0,0.55));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.console::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 80%, hsla(var(--gold-h), 40%, 35%, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.console-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
    z-index: 1;
}

.console-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    flex: 1;
}

.console-body {
    padding: 8px 12px;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-data);
    font-size: 9px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 3px hsla(var(--gold-h), 50%, 50%, 0.08),
                 0 0.5px 0 hsla(50, 40%, 45%, 0.06);
}

.console-body:hover {
    text-shadow: 0 0 5px hsla(var(--gold-h), 55%, 55%, 0.14),
                 0 0.5px 0 hsla(50, 45%, 50%, 0.08);
}

.console-body::-webkit-scrollbar { width: 4px; }
.console-body::-webkit-scrollbar-track { background: transparent; }
.console-body::-webkit-scrollbar-thumb { background: var(--plate); border-radius: 2px; }

.log-line { display: flex; gap: 6px; white-space: nowrap; overflow: hidden; }
.log-time { color: var(--text-ghost); flex-shrink: 0; }
.log-level { flex-shrink: 0; font-weight: 700; width: 28px; }
.log-level.ok { color: var(--gold-ember); }
.log-level.info { color: var(--text-muted); }
.log-level.warn { color: var(--gold-hot); text-shadow: 0 0 6px hsla(var(--gold-h), 80%, 60%, 0.25); }
.log-level.err { color: var(--danger-text); text-shadow: 0 0 6px var(--danger-glow); }

.log-msg {
    color: var(--text-sec);
    overflow: hidden;
    text-overflow: ellipsis;
    transition: text-shadow 0.5s ease-out, color 0.15s ease-out;
}

.log-line:hover .log-msg {
    color: var(--text-bright);
    text-shadow: 0 0 6px hsla(var(--gold-h), 50%, 55%, 0.2);
    transition: text-shadow 0.05s ease-out, color 0.05s ease-out;
}

.log-line:last-child .log-msg::after {
    content: '▊';
    display: inline;
    color: var(--gold-dim);
    animation: cursor-blink 1.2s step-end infinite;
    margin-left: 2px;
    font-size: 8px;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   CONSOLE LOG — Section-level terminal output component
   ═══════════════════════════════════════════════════════════════════════════ */

.console-log {
    background: linear-gradient(168deg, rgba(3,3,2,0.7), rgba(0,0,0,0.65));
    border: none;
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 6px var(--shadow-deep), 0 1px 3px var(--shadow-warm);
    margin-bottom: var(--space-sm);
}

.console-log::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 80%, hsla(var(--gold-h), 40%, 35%, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.console-log-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
    z-index: 1;
}

.console-log-title {
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    font-weight: var(--weight-bold);
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
    flex: 1;
}

.console-log-meta {
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    color: var(--text-ghost);
}

.console-log-body {
    padding: var(--space-sm) var(--space-md);
    max-height: calc(240px * var(--font-scale));
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-data);
    font-size: var(--xs-font);
    line-height: 1.4;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 3px hsla(var(--gold-h), 50%, 50%, 0.08),
                 0 0.5px 0 hsla(50, 40%, 45%, 0.06);
}

.console-log-body:hover {
    text-shadow: 0 0 5px hsla(var(--gold-h), 55%, 55%, 0.14),
                 0 0.5px 0 hsla(50, 45%, 50%, 0.08);
}

.console-log-body::-webkit-scrollbar { width: 4px; }
.console-log-body::-webkit-scrollbar-track { background: transparent; }
.console-log-body::-webkit-scrollbar-thumb { background: var(--plate); border-radius: 2px; }

/* Live dot indicator for active logs */
.live-dot {
    width: calc(6px * var(--font-scale));
    height: calc(6px * var(--font-scale));
    background: var(--gold);
    border-radius: 50%;
    flex-shrink: 0;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--gold-glow); }
    50% { opacity: 0.4; box-shadow: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   DATA GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-cell {
    background: linear-gradient(160deg, var(--armor), var(--hull));
    padding: 18px 20px;
    border-left: 2px solid rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    transition: background var(--dur-med) var(--ease-out),
                border-left-color var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out);
}

.data-cell:hover { background: linear-gradient(160deg, rgba(18, 18, 16, 0.95), rgba(14, 14, 13, 0.95)); }

.data-cell.active {
    border-left-color: var(--gold-dim);
    background: linear-gradient(100deg, hsla(var(--gold-h), 30%, 30%, 0.07), var(--hull) 55%);
    box-shadow: inset 0 0 20px -10px hsla(var(--gold-h), 40%, 40%, 0.08);
}

.data-cell.warn-pulse {
    border-left-color: var(--danger);
    box-shadow: inset 0 0 16px -6px var(--danger-glow);
}

.data-val {
    font-size: calc(22px * var(--font-scale));
    font-weight: 400;
    font-family: var(--font-data);
    color: var(--text-bright);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: baseline;
    gap: 5px;
    transition: text-shadow 0.6s ease-out, color 0.15s ease-out;
}

.data-cell:hover .data-val {
    text-shadow: 0 0 8px hsla(var(--gold-h), 60%, 55%, 0.25);
    transition: text-shadow 0.05s ease-out, color 0.05s ease-out;
}

.data-val .unit { font-size: 11px; color: var(--gold-dim); }
.data-val .trend { font-size: 12px; margin-left: auto; }
.data-val .trend.up { color: var(--gold); }
.data-val .trend.down { color: var(--danger-text); }
.data-val .trend.flat { color: var(--text-ghost); }
.data-val.warn { color: var(--danger-hot); text-shadow: 0 0 20px var(--danger-glow); }

.data-label {
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ITEM CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.item-card {
    padding: 20px 24px;
    background: linear-gradient(160deg, var(--armor) 0%, var(--hull) 100%);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    transition: border-color var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out);
}

.item-card:hover {
    border-color: rgba(255,255,255,0.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 12px var(--shadow-light);
}

.item-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.item-title { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.item-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }
.item-actions { display: flex; gap: 6px; align-items: center; }

.item-card[role="button"] {
    cursor: pointer;
}

.item-card--active {
    border-color: var(--gold-dim);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 12px var(--gold-glow);
}

/* --- Variants --- */

.item-card--gold {
    border-left: 2px solid var(--gold);
}

.item-card--bronze {
    border-left: 2px solid var(--bronze);
}

.item-card--danger {
    border-left: 2px solid var(--danger);
}

.item-card--muted {
    opacity: 0.7;
    transition: opacity var(--dur-fast) var(--ease-out),
                border-color var(--dur-med) var(--ease-out),
                box-shadow var(--dur-med) var(--ease-out);
}

.item-card--muted[role="button"]:hover {
    opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LIVE DOT
   ═══════════════════════════════════════════════════════════════════════════ */

.live-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 8px var(--gold-glow);
    position: relative;
    flex-shrink: 0;
}

.live-dot.red {
    background: var(--danger-text);
    box-shadow: 0 0 8px var(--danger-glow);
}

.live-dot-sm { width: 4px; height: 4px; }


/* ═══════════════════════════════════════════════════════════════════════════
   DIVIDER / SEPARATOR
   ═══════════════════════════════════════════════════════════════════════════ */

.sec-divider {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 48px 0;
    opacity: 0.3;
}

.sec-divider::before,
.sec-divider::after {
    content: '';
    flex: 1;
    height: 1px;
}

.sec-divider::before { background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.sec-divider::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

.sec-divider-diamond {
    width: 5px; height: 5px;
    background: var(--gold-dim);
    transform: rotate(45deg);
    flex-shrink: 0;
    margin: 0 8px;
}

.sec-divider-sm { margin: 24px 0; }
.sec-divider-lg { margin: 64px 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Particles layer */
.login-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.login-particle {
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 3px;
    background: var(--gold-glow);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--gold-glow);
    animation: login-float-up 10s linear infinite;
}

@keyframes login-float-up {
    0%   { transform: translateY(0) scale(1); opacity: 0.7; }
    100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

/* Container — centers card vertically */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 5;
}

/* Card */
.login-card {
    background: linear-gradient(180deg, var(--armor) 0%, var(--hull) 100%);
    border: none;
    border-radius: var(--radius);
    padding: 40px clamp(20px, 3.5vw, 36px);
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 10;
    box-shadow:
        0 8px 32px var(--shadow-warm),
        0 2px 8px var(--shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
    overflow: hidden;
}

/* Login logo: scales to fit card content width on any viewport.
   calc((100vw - 88px) * 0.18) tracks available content (48px container + 40px card padding).
   Clamp floors at 32px (tiny phones), caps at full --font-scale size (desktop).
   Letter-spacing in em stays proportional to font-size automatically. */
.login-brand .hud-brand {
    font-size: clamp(32px, calc((100vw - 88px) * 0.18), calc(38px * var(--font-scale)));
    letter-spacing: 0.184em;
    line-height: 1.1;
}

/* Suppress chromatic aberration on login — prevents doubling effect */
.login-brand .hud-brand::before,
.login-brand .hud-brand::after {
    display: none;
}

/* Tab switcher for login — flexes the station tabs full-width */
.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--bulkhead);
}

.login-tabs .hud-station-tab {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    border-radius: 0;
    font-size: var(--xs-font);
}

/* Tab pane visibility */
.login-tab-pane { display: none; }
.login-tab-pane.active { display: block; }

/* Form layout */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Links row */
.login-link-row {
    text-align: center;
    margin-top: 8px;
}

.login-link {
    color: var(--gold-dim);
    text-decoration: none;
    font-size: var(--xs-font);
    transition: color var(--dur-fast) var(--ease-out);
}
.login-link:hover { color: var(--gold); }

/* Hint text */
.login-hint {
    color: var(--text-sec);
    font-size: var(--sm-font);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Forgot password success */
.login-success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.login-success-icon {
    font-size: calc(32px * var(--font-scale));
    color: var(--gold);
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INLINE SVG ICONS (.exa-icon)
   ═══════════════════════════════════════════════════════════════════════════ */
.exa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: var(--icon-size, 16px);
    height: var(--icon-size, 16px);
    flex-shrink: 0;
}
.exa-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
/* Icons inside tab buttons */
.tab-icon .exa-icon,
.tab-icon svg {
    width: 14px;
    height: 14px;
}
/* Station header icon sizing */
.hud-avatar .exa-icon {
    --icon-size: 18px;
    color: var(--gold);
}
.fuel-icon .exa-icon {
    --icon-size: 14px;
}
.hud-overseer-badge .exa-icon {
    --icon-size: 12px;
    color: var(--gold);
}
/* Stat/modal icons inherit parent size */
.stat-icon .exa-icon,
.modal-icon .exa-icon {
    --icon-size: 20px;
}
.empty-state-icon .exa-icon {
    --icon-size: 32px;
    opacity: 0.5;
}
}


/* ═══════════════════════════════════════════════════════════════════════════
   NEW COMPONENTS v0.56.0 — Tabs, Navigation, Feedback, Layout, Display
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TABS ── */

.exa-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--shield);
}

.exa-tab {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.exa-tab:hover {
    color: var(--text-pri);
}
.exa-tab:focus-visible {
    outline: 2px solid var(--gold-edge);
    outline-offset: -2px;
}
.exa-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
.exa-tab-icon {
    margin-right: var(--space-xs);
}
.exa-tab-label {
    /* Ensures label truncates at extreme scales */
    overflow: hidden;
    text-overflow: ellipsis;
}

.exa-tabs-pill {
    border-bottom: none;
    gap: var(--space-xs);
    padding: 2px;
    background: var(--void);
    border-radius: var(--radius);
}
.exa-tabs-pill .exa-tab {
    border-bottom: none;
    border-radius: var(--radius);
    padding: var(--space-xs) var(--space-sm);
}
.exa-tabs-pill .exa-tab.active {
    background: var(--armor);
    color: var(--gold);
    border: 1px solid var(--gold-edge);
}

.exa-tab-panel {
    display: none;
}
.exa-tab-panel.active {
    display: block;
}

/* ── BREADCRUMB ── */

.exa-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
}
.exa-breadcrumb li + li::before {
    content: '›';
    color: var(--text-ghost);
    padding: 0 var(--space-xs);
}
.exa-breadcrumb a {
    color: var(--text-sec);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}
.exa-breadcrumb a:hover {
    color: var(--gold);
}
.exa-breadcrumb .current span {
    color: var(--text-pri);
}

/* ── PAGINATOR ── */

.exa-paginator {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font-data);
    font-size: var(--xs-font);
}
.exa-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: calc(28px * var(--font-scale));
    height: calc(28px * var(--font-scale));
    padding: 0 var(--space-xs);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-sec);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}
.exa-page-btn:hover:not(.disabled):not(.active) {
    background: var(--gold-wash);
    border-color: var(--gold-edge);
    color: var(--gold);
}
.exa-page-btn.active {
    background: var(--gold-wash);
    border-color: var(--gold);
    color: var(--gold);
    font-weight: var(--weight-bold);
}
.exa-page-btn.disabled {
    opacity: 0.3;
    cursor: default;
}
.exa-page-ellipsis {
    padding: 0 var(--space-xs);
    color: var(--text-ghost);
}

/* ── STEPPER ── */

.exa-stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}
.exa-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    text-align: center;
    min-width: 0;
}
.exa-step-marker {
    width: calc(28px * var(--font-scale));
    height: calc(28px * var(--font-scale));
    border-radius: 50%;
    border: 2px solid var(--shield);
    background: var(--void);
    color: var(--text-ghost);
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    font-weight: var(--weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: all var(--dur-med) var(--ease-out);
}
.exa-step.active .exa-step-marker {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-wash);
}
.exa-step.completed .exa-step-marker {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--void);
}
.exa-step-label {
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
    color: var(--text-ghost);
    margin-top: var(--space-xs);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.25;
}
.exa-step.active .exa-step-label { color: var(--gold); }
.exa-step.completed .exa-step-label { color: var(--text-sec); }
.exa-step-connector {
    position: absolute;
    top: calc(14px * var(--font-scale));
    left: calc(50% + 18px * var(--font-scale));
    right: calc(-50% + 18px * var(--font-scale));
    height: 2px;
    background: var(--shield);
}
.exa-step.completed .exa-step-connector {
    background: var(--gold);
}

/* ── TOAST ── */

.exa-toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    border: 1px solid;
    animation: toast-in 0.3s var(--ease-out);
}
.exa-toast-info {
    background: hsla(210, 30%, 15%, 0.95);
    border-color: hsla(210, 40%, 40%, 0.3);
    color: hsl(210, 40%, 75%);
}
.exa-toast-success {
    background: hsla(42, 30%, 12%, 0.95);
    border-color: var(--gold-edge);
    color: var(--gold);
}
.exa-toast-warn {
    background: hsla(42, 30%, 12%, 0.95);
    border-color: var(--gold-edge);
    color: var(--gold);
}
.exa-toast-danger {
    background: hsla(0, 30%, 12%, 0.95);
    border-color: var(--danger-line);
    color: var(--danger-text);
}
.exa-toast-icon { flex-shrink: 0; }
.exa-toast-msg { flex: 1; }
.exa-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: calc(16px * var(--font-scale));
    padding: 0 2px;
    transition: opacity var(--dur-fast) var(--ease-out);
}
.exa-toast-close:hover { opacity: 1; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── QUICK JUMP OVERLAY ── */

.quick-jump-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-jump-panel {
    background: var(--hull);
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    padding: 24px 32px;
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}
.quick-jump-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.quick-jump-title {
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--gold);
    font-weight: var(--weight-semibold);
    letter-spacing: 1px;
}
.quick-jump-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}
.quick-jump-dept {
    margin-bottom: 12px;
}
.quick-jump-dept-label {
    font-family: var(--font-data);
    font-size: 10px;
    color: var(--text-ghost);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.quick-jump-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.quick-jump-btn {
    padding: 4px 10px;
    background: var(--shield);
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    color: var(--text-sec);
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    transition: color var(--dur-fast), border-color var(--dur-fast);
}
.quick-jump-btn:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
}

/* ── PROGRESS BAR ── */

.exa-progress {
    width: 100%;
}
.exa-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
    color: var(--text-sec);
    margin-bottom: var(--space-xs);
}
.exa-progress-value {
    font-family: var(--font-data);
    color: var(--text-pri);
}
.exa-progress-track {
    height: 6px;
    background: var(--shield);
    border-radius: 3px;
    overflow: hidden;
}
.exa-progress-sm .exa-progress-track { height: 3px; }
.exa-progress-lg .exa-progress-track { height: 10px; }
.exa-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--dur-med) var(--ease-out);
}
.exa-progress-fill.gold { background: var(--gold); }
.exa-progress-fill.bronze { background: var(--bronze); }
.exa-progress-fill.danger { background: var(--danger); }
.exa-progress-fill.muted { background: var(--text-ghost); }

/* ── CODE BLOCK ── */

.exa-code {
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    background: var(--void);
    overflow: hidden;
}
.exa-code-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--armor);
    border-bottom: 1px solid var(--shield);
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
}
.exa-code-title {
    color: var(--text-pri);
    font-weight: var(--weight-semibold);
}
.exa-code-lang {
    color: var(--text-ghost);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.exa-code-spacer { flex: 1; }
.exa-code-copy {
    background: none;
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: var(--xs-font);
    transition: all var(--dur-fast) var(--ease-out);
}
.exa-code-copy:hover {
    color: var(--gold);
    border-color: var(--gold-edge);
}
.exa-code-body {
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-data);
    font-size: var(--xs-font);
    line-height: 1.6;
    color: var(--text-pri);
    overflow-x: auto;
    tab-size: 4;
}
.exa-code-body code {
    font-family: inherit;
    background: none;
}

/* ── ACCORDION ── */

.exa-accordion {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.exa-accordion-item {
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    overflow: hidden;
}
.exa-accordion-item + .exa-accordion-item {
    margin-top: -1px;
}
.exa-accordion-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--armor);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: var(--small-font);
    font-weight: var(--weight-semibold);
    color: var(--text-pri);
    list-style: none;
    transition: background var(--dur-fast) var(--ease-out);
    user-select: none;
}
.exa-accordion-header::-webkit-details-marker { display: none; }
.exa-accordion-header::marker { display: none; content: ''; }
.exa-accordion-header:hover { background: var(--shield); }
.exa-accordion-icon { flex-shrink: 0; }
.exa-accordion-title { flex: 1; }
.exa-accordion-chevron {
    color: var(--text-ghost);
    transition: transform var(--dur-fast) var(--ease-out);
    font-size: var(--xs-font);
}
.exa-accordion-item[open] .exa-accordion-chevron {
    transform: rotate(90deg);
}
.exa-accordion-body {
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-sec);
    border-top: 1px solid var(--shield);
}

/* ── DATA TABLE ── */

.exa-table-wrap {
    width: 100%;
}
.exa-table-scroll {
    overflow-x: auto;
}
.exa-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
}
.exa-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-sm);
    font-weight: var(--weight-semibold);
    font-size: var(--xxs-font);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-ghost);
    border-bottom: 1px solid var(--shield);
    white-space: nowrap;
}
.exa-table td {
    padding: var(--space-sm) var(--space-sm);
    color: var(--text-pri);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
.exa-table.striped tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.015);
}
.exa-table.compact th,
.exa-table.compact td {
    padding: var(--space-xs) var(--space-sm);
}
.exa-table tbody tr:hover {
    background: var(--gold-wash);
}
.exa-table .align-right { text-align: right; }
.exa-table .align-center { text-align: center; }

/* ── TIMELINE ── */

.exa-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: calc(14px * var(--font-scale));
}
.exa-timeline::before {
    content: '';
    position: absolute;
    left: calc(5px * var(--font-scale));
    top: calc(6px * var(--font-scale));
    bottom: calc(6px * var(--font-scale));
    width: 2px;
    background: var(--shield);
}
.exa-timeline-event {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    position: relative;
}
.exa-timeline-marker {
    flex-shrink: 0;
    position: absolute;
    left: calc(-14px * var(--font-scale));
    top: calc(8px * var(--font-scale));
}
.exa-timeline-dot {
    display: block;
    width: calc(10px * var(--font-scale));
    height: calc(10px * var(--font-scale));
    border-radius: 50%;
    background: var(--shield);
    border: 2px solid var(--armor);
}
.exa-timeline-event.success .exa-timeline-dot { background: var(--gold); }
.exa-timeline-event.running .exa-timeline-dot { background: var(--bronze); }
.exa-timeline-event.warn .exa-timeline-dot { background: var(--gold-hot); }
.exa-timeline-event.danger .exa-timeline-dot { background: var(--danger); }
.exa-timeline-content { flex: 1; min-width: 0; }
.exa-timeline-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.exa-timeline-label {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
    font-weight: var(--weight-medium);
    word-break: break-word;
}
.exa-timeline-time {
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    color: var(--text-ghost);
    white-space: nowrap;
}
.exa-timeline-detail {
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
    color: var(--text-muted);
    margin-top: 2px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── TOOLBAR (macro) ── */

.exa-toolbar-center { justify-content: center; }
.exa-toolbar-end { justify-content: flex-end; }
.exa-toolbar-between { justify-content: space-between; }
.exa-toolbar-gap-xs { gap: var(--space-xs); }
.exa-toolbar-gap-md { gap: var(--space-md); }
.exa-toolbar-gap-lg { gap: var(--space-lg); }

/* ── CARD GRID ── */

.exa-card-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 3), 1fr);
    gap: var(--grid-gap, var(--space-md));
}
@media (max-width: 768px) {
    .exa-card-grid {
        grid-template-columns: 1fr;
    }
}


/* ── TILE GRID — Section-level metric/KPI dashboard grid ── */

.exa-tile-grid {
    display: grid;
    grid-template-columns: repeat(var(--tile-cols, 3), 1fr);
    gap: var(--space-sm);
}
@media (max-width: 960px) {
    .exa-tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .exa-tile-grid {
        grid-template-columns: 1fr;
    }
}

.exa-tile {
    background: linear-gradient(168deg, rgba(22,22,20,0.6), rgba(16,16,14,0.6));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-card);
    padding: var(--space-md);
    text-align: center;
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.exa-tile:hover {
    border-color: var(--gold-edge);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.exa-tile-value {
    font-family: var(--font-data);
    font-size: calc(18px * var(--font-scale));
    font-weight: var(--weight-bold);
    color: var(--gold);
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--space-xs);
}

.exa-tile--danger .exa-tile-value { color: var(--danger-text); }
.exa-tile--bronze .exa-tile-value { color: var(--bronze-text); }

.exa-tile-trend {
    font-size: var(--xxs-font);
}
.exa-tile-trend.up { color: var(--gold); }
.exa-tile-trend.down { color: var(--danger-text); }
.exa-tile-trend.stable { color: var(--text-muted); }

.exa-tile-label {
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: var(--space-xs);
}

.exa-tile-sub {
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    color: var(--text-ghost);
    margin-top: var(--space-xs);
}


/* ── FORM ROW ── */

.exa-form-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}
.exa-form-row-label {
    flex: 0 0 140px;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    font-weight: var(--weight-semibold);
    color: var(--text-sec);
    padding-top: var(--space-xs);
}
.exa-required {
    color: var(--danger);
    margin-left: 2px;
}
.exa-form-row-control {
    flex: 1;
    min-width: 0;
}

/* ── FORM ACTIONS ── */

.exa-form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    padding-top: var(--space-md);
    border-top: 1px solid var(--shield);
    margin-top: var(--space-md);
}
.exa-form-actions-start { justify-content: flex-start; }
.exa-form-actions-center { justify-content: center; }
.exa-form-actions-between { justify-content: space-between; }

/* ── DETAIL LIST ── */

.exa-detail-list {
    margin: 0;
    padding: 0;
}
.exa-detail-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.exa-detail-row:last-child { border-bottom: none; }
.exa-detail-row dt {
    flex: 0 0 140px;
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-ghost);
}
.exa-detail-row dd {
    flex: 1;
    margin: 0;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
}
.exa-detail-row dd.mono {
    font-family: var(--font-data);
}

/* ── SEARCH INPUT ── */

.exa-search {
    position: relative;
    display: flex;
    align-items: center;
}
.exa-search-icon {
    position: absolute;
    left: var(--space-sm);
    color: var(--text-ghost);
    pointer-events: none;
    font-size: var(--xs-font);
}
.exa-search-field {
    width: 100%;
    font-family: var(--font-data);
    font-size: var(--xs-font);
    padding: var(--space-xs) var(--space-sm) var(--space-xs) calc(var(--space-lg) + 2px);
    background: var(--void);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    color: var(--text-pri);
    outline: none;
    transition: border-color var(--dur-fast) var(--ease-out);
}
.exa-search-field:focus {
    border-color: var(--gold-edge);
}
.exa-search-field::placeholder {
    color: var(--text-ghost);
}

/* ── RANGE INPUT ── */

.exa-range {
    width: 100%;
}
.exa-range-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-xs);
}
.exa-range-label {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-sec);
}
.exa-range-output {
    font-family: var(--font-data);
    font-size: var(--xs-font);
    color: var(--gold);
}
.exa-range-track {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--shield);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.exa-range-track::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: calc(14px * var(--font-scale));
    height: calc(14px * var(--font-scale));
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--void);
    cursor: pointer;
    transition: box-shadow var(--dur-fast) var(--ease-out);
}
.exa-range-track::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 4px var(--gold-wash);
}
.exa-range-track::-moz-range-thumb {
    width: calc(14px * var(--font-scale));
    height: calc(14px * var(--font-scale));
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--void);
    cursor: pointer;
}

/* ── TAG INPUT ── */

.exa-tag-input {
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    background: var(--void);
    padding: var(--space-xs);
    transition: border-color var(--dur-fast) var(--ease-out);
}
.exa-tag-input:focus-within {
    border-color: var(--gold-edge);
}
.exa-tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
}
.exa-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px var(--space-xs);
    background: var(--gold-wash);
    border: 1px solid var(--gold-edge);
    border-radius: var(--radius);
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    color: var(--gold);
}
.exa-tag-remove {
    background: none;
    border: none;
    color: var(--text-ghost);
    cursor: pointer;
    padding: 0 2px;
    font-size: calc(12px * var(--font-scale));
    line-height: 1;
}
.exa-tag-remove:hover { color: var(--danger); }
.exa-tag-field {
    flex: 1;
    min-width: 80px;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-data);
    font-size: var(--xs-font);
    color: var(--text-pri);
    padding: 2px var(--space-xs);
}
.exa-tag-field::placeholder { color: var(--text-ghost); }

/* ── FILE UPLOAD ── */

.exa-file-upload {
    border: 2px dashed var(--shield);
    border-radius: var(--radius);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
    position: relative;
}
.exa-file-upload:hover,
.exa-file-upload.dragover {
    border-color: var(--gold-edge);
    background: var(--gold-wash);
}
.exa-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.exa-file-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}
.exa-file-icon {
    font-size: calc(24px * var(--font-scale));
    color: var(--text-ghost);
}
.exa-file-label {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-muted);
}
.exa-file-list {
    margin-top: var(--space-sm);
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    color: var(--text-sec);
}

/* ── AVATAR ── */

.exa-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--armor);
    border: 1px solid var(--shield);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.exa-avatar-xs { width: calc(20px * var(--font-scale)); height: calc(20px * var(--font-scale)); }
.exa-avatar-sm { width: calc(28px * var(--font-scale)); height: calc(28px * var(--font-scale)); }
.exa-avatar-md { width: calc(36px * var(--font-scale)); height: calc(36px * var(--font-scale)); }
.exa-avatar-lg { width: calc(48px * var(--font-scale)); height: calc(48px * var(--font-scale)); }
.exa-avatar-xl { width: calc(64px * var(--font-scale)); height: calc(64px * var(--font-scale)); }
.exa-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.exa-avatar-initials {
    font-family: var(--font-ui);
    font-weight: var(--weight-bold);
    color: var(--text-sec);
    letter-spacing: 0.03em;
}
.exa-avatar-xs .exa-avatar-initials { font-size: var(--xxs-font); }
.exa-avatar-sm .exa-avatar-initials { font-size: var(--xxs-font); }
.exa-avatar-md .exa-avatar-initials { font-size: var(--xs-font); }
.exa-avatar-lg .exa-avatar-initials { font-size: var(--small-font); }
.exa-avatar-xl .exa-avatar-initials { font-size: var(--base-font); }
.exa-avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 25%;
    height: 25%;
    min-width: 6px;
    min-height: 6px;
    border-radius: 50%;
    border: 2px solid var(--armor);
}
.exa-avatar-status.online { background: var(--gold); }
.exa-avatar-status.away { background: var(--gold); }
.exa-avatar-status.busy { background: var(--danger); }
.exa-avatar-status.offline { background: var(--text-ghost); }
.exa-avatar-group {
    display: flex;
}
.exa-avatar-group .exa-avatar + .exa-avatar {
    margin-left: calc(-8px * var(--font-scale));
}
.exa-avatar-overflow {
    background: var(--shield);
}

/* ── TOOLTIP ── */

.exa-tooltip-wrap {
    position: relative;
    display: inline-flex;
}
.exa-tooltip {
    position: absolute;
    z-index: 1000;
    padding: var(--space-xs) var(--space-sm);
    background: var(--armor);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: var(--xxs-font);
    color: var(--text-pri);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
}
.exa-tooltip-wrap:hover .exa-tooltip,
.exa-tooltip-wrap:focus-within .exa-tooltip {
    opacity: 1;
}
.exa-tooltip-top {
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
}
.exa-tooltip-bottom {
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
}
.exa-tooltip-left {
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
}
.exa-tooltip-right {
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
}

/* ── KBD ── */

.exa-kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: var(--font-data);
    font-size: var(--xxs-font);
    color: var(--text-pri);
    background: var(--armor);
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius);
    box-shadow: inset 0 -1px 0 var(--shield);
    line-height: 1.4;
    white-space: nowrap;
}
.exa-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.exa-kbd-sep {
    color: var(--text-ghost);
    font-size: var(--xxs-font);
    padding: 0 1px;
}

/* ── SKELETON ── */

.exa-skeleton {
    background: linear-gradient(90deg, var(--armor) 25%, var(--shield) 50%, var(--armor) 75%);
    background-size: 200% 100%;
    animation: skeleton-sweep 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
.exa-skeleton-round { border-radius: 50%; }
.exa-skeleton-line {
    height: calc(10px * var(--font-scale));
    margin-bottom: var(--space-xs);
}
.exa-skeleton-line:last-child { margin-bottom: 0; }
.exa-skeleton-text {
    display: flex;
    flex-direction: column;
}
.exa-skeleton-card {
    padding: var(--space-md);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    background: var(--armor);
}

@keyframes skeleton-sweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── DROPDOWN ── */

.exa-dropdown {
    position: relative;
    display: inline-flex;
}
.exa-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-sec);
    background: var(--armor);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}
.exa-dropdown-trigger:hover {
    border-color: var(--gold-edge);
    color: var(--text-pri);
}
.exa-dropdown-caret {
    font-size: var(--xxs-font);
    color: var(--text-ghost);
    transition: transform var(--dur-fast) var(--ease-out);
}
.exa-dropdown.open .exa-dropdown-caret {
    transform: rotate(180deg);
}
.exa-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    z-index: 500;
    min-width: 160px;
    background: var(--armor);
    border: 1px solid var(--shield);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--shadow-deep);
    padding: var(--space-xs) 0;
    display: none;
}
.exa-dropdown.open .exa-dropdown-menu { display: block; }
.exa-dropdown-left { left: 0; }
.exa-dropdown-right { right: 0; }
.exa-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out);
}
.exa-dropdown-item:hover { background: var(--gold-wash); }
.exa-dropdown-item.danger { color: var(--danger-text); }
.exa-dropdown-item.danger:hover { background: var(--danger-wash); }
.exa-dropdown-item.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.exa-dropdown-item-icon { flex-shrink: 0; }
.exa-dropdown-divider {
    height: 1px;
    background: var(--shield);
    margin: var(--space-xs) 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Component Library v0.57.0 — Drawer, Spinner, Popover, List Group,
   Description List, Segmented, Split Button, Callout, Number Input,
   Copy Button, Command Palette, Tree View
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Drawer / Offcanvas ─────────────────────────────────────────────────── */
.exa-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity var(--dur-normal) var(--ease-out);
}
.exa-drawer-backdrop.visible { opacity: 1; }
.exa-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: var(--hull);
    border: 1px solid var(--shield);
    box-shadow: 0 0 40px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform var(--dur-normal) var(--ease-out);
}
.exa-drawer--right { right: 0; transform: translateX(100%); }
.exa-drawer--left  { left: 0;  transform: translateX(-100%); }
.exa-drawer.open { transform: translateX(0); }
.exa-drawer--sm { width: min(calc(320px * var(--font-scale)), 96vw); }
.exa-drawer--md { width: min(calc(400px * var(--font-scale)), 96vw); }
.exa-drawer--lg { width: min(calc(560px * var(--font-scale)), 96vw); }
.exa-drawer--full { width: 100%; }
.exa-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--shield);
}
.exa-drawer__title {
    font-family: var(--font-ui);
    font-size: var(--sm-font);
    color: var(--text-pri);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}
.exa-drawer__close {
    background: none;
    border: none;
    color: var(--text-sec);
    font-size: calc(20px * var(--font-scale));
    cursor: pointer;
    padding: calc(2px * var(--font-scale)) calc(6px * var(--font-scale));
    line-height: 1;
}
.exa-drawer__close:hover { color: var(--text-pri); }
.exa-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}
.exa-drawer__footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--shield);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .exa-drawer {
        width: 100% !important;
    }
}

/* ── Spinner ────────────────────────────────────────────────────────────── */
.exa-spinner {
    display: inline-block;
    border: 2px solid var(--shield);
    border-top-color: var(--gold-hot);
    border-radius: 50%;
    animation: exa-spin 0.7s linear infinite;
    vertical-align: middle;
}
.exa-spinner--xs { width: calc(12px * var(--font-scale)); height: calc(12px * var(--font-scale)); border-width: 1.5px; }
.exa-spinner--sm { width: calc(16px * var(--font-scale)); height: calc(16px * var(--font-scale)); border-width: 2px; }
.exa-spinner--md { width: calc(24px * var(--font-scale)); height: calc(24px * var(--font-scale)); border-width: 2px; }
.exa-spinner--lg { width: calc(36px * var(--font-scale)); height: calc(36px * var(--font-scale)); border-width: 3px; }
.exa-spinner--xl { width: calc(48px * var(--font-scale)); height: calc(48px * var(--font-scale)); border-width: 3px; }
.exa-spinner__label {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-sec);
    margin-left: var(--space-xs);
}
.exa-spinner-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
}
@keyframes exa-spin {
    to { transform: rotate(360deg); }
}

/* ── Popover ────────────────────────────────────────────────────────────── */
.exa-popover-wrap {
    position: relative;
    display: inline-block;
}
.exa-popover-trigger {
    background: none;
    border: 1px solid var(--shield);
    color: var(--text-sec);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: calc(2px * var(--font-scale)) calc(6px * var(--font-scale));
    font-size: var(--xs-font);
}
.exa-popover-trigger:hover { color: var(--text-pri); border-color: var(--gold-dim); }
.exa-popover {
    position: absolute;
    z-index: 1000;
    min-width: 200px;
    max-width: 320px;
    background: var(--hull);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 0;
}
.exa-popover--bottom { top: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
.exa-popover--top    { bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
.exa-popover--left   { right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.exa-popover--right  { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }
.exa-popover__title {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--shield);
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.exa-popover__body {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--xs-font);
    color: var(--text-sec);
    line-height: 1.5;
}
.exa-popconfirm__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md) var(--space-sm);
    border-top: 1px solid var(--shield);
}

/* ── List Group ─────────────────────────────────────────────────────────── */
.exa-list-group {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--shield);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.exa-list-group--flush { border: none; border-radius: 0; }
.exa-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--shield);
    transition: background var(--dur-fast) var(--ease-out);
}
.exa-list-item:last-child { border-bottom: none; }
.exa-list-item[role="button"] { cursor: pointer; }
.exa-list-item[role="button"]:hover { background: var(--gold-wash); }
.exa-list-item.active {
    background: var(--gold-wash);
    border-left: 2px solid var(--gold-hot);
    padding-left: calc(var(--space-md) - 2px);
}
.exa-list-item.disabled { opacity: 0.4; pointer-events: none; }
.exa-list-item__icon {
    flex-shrink: 0;
    font-size: var(--sm-font);
    color: var(--text-sec);
}
.exa-list-item__body { flex: 1; min-width: 0; }
.exa-list-item__label {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
    display: block;
}
.exa-list-item__label a {
    color: var(--text-pri);
    text-decoration: none;
}
.exa-list-item__label a:hover { color: var(--gold-hot); }
.exa-list-item__meta {
    font-size: 10px;
    color: var(--text-sec);
    display: block;
    margin-top: 1px;
}

/* Dash-style aliases — templates in migration from dash to BEM */
.exa-list-item-body    { flex: 1; min-width: 0; }
.exa-list-item-actions { display: flex; align-items: center; gap: var(--space-xs); flex-shrink: 0; }
.exa-list-item__actions { display: flex; align-items: center; gap: var(--space-xs); flex-shrink: 0; }

/* ── Fade-in utility ───────────────────────────────────────────────────── */
.exa-fade-in { animation: exa-fade-in-kf var(--dur-med, 200ms) var(--ease-out) both; }
@keyframes exa-fade-in-kf { from { opacity: 0; } to { opacity: 1; } }

/* ── Chevron indicator (list drill-down cue) ───────────────────────────── */
.exa-chevron {
    flex-shrink: 0;
    font-size: var(--lg-font);
    color: var(--text-ghost);
    line-height: 1;
    transition: color var(--dur-fast) var(--ease-out);
}
.exa-list-item:hover .exa-chevron { color: var(--gold-dim); }

/* ── Description List ───────────────────────────────────────────────────── */
.exa-desc-list {
    margin: 0;
    padding: 0;
}
.exa-desc-list--stacked .exa-desc-pair {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--shield);
}
.exa-desc-list--stacked .exa-desc-pair:last-child { border-bottom: none; }
.exa-desc-list--horizontal .exa-desc-pair {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--shield);
}
.exa-desc-list--horizontal .exa-desc-pair:last-child { border-bottom: none; }
.exa-desc-list--horizontal .exa-desc-term { flex: 0 0 140px; }
.exa-desc-list--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}
.exa-desc-term {
    font-family: var(--font-ui);
    font-size: 10px;
    color: var(--text-sec);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
}
.exa-desc-detail {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
    margin: 2px 0 0;
}
.exa-desc-detail.mono {
    font-family: var(--font-mono);
}

/* ── Segmented Control ──────────────────────────────────────────────────── */
.exa-segmented {
    display: inline-flex;
    background: var(--void);
    border: 1px solid var(--shield);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
}
.exa-segmented__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-sec);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    user-select: none;
}
.exa-segmented__item:hover { color: var(--text-pri); }
.exa-segmented__item.active {
    background: var(--gold-wash);
    color: var(--gold-hot);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.exa-segmented__icon { font-size: var(--sm-font); }
.exa-segmented--sm .exa-segmented__item { padding: 2px var(--space-sm); font-size: 10px; }
.exa-segmented--lg .exa-segmented__item { padding: var(--space-sm) var(--space-lg); font-size: var(--sm-font); }

/* ── Split Button ───────────────────────────────────────────────────────── */
.exa-split-btn {
    display: inline-flex;
    position: relative;
}
.exa-split-btn__main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.exa-split-btn__toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid rgba(255,255,255,0.15);
    padding-left: var(--space-xs);
    padding-right: var(--space-xs);
    min-width: auto;
}
.exa-split-btn__caret { font-size: 10px; }
.exa-split-btn__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1000;
    min-width: 180px;
    list-style: none;
    margin: 0;
    padding: var(--space-xs) 0;
    background: var(--hull);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.exa-split-btn__option {
    display: block;
    width: 100%;
    padding: var(--space-xs) var(--space-md);
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
    text-align: left;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
}
.exa-split-btn__option:hover { background: var(--gold-wash); }

/* ── Callout / Notice ───────────────────────────────────────────────────── */
.exa-callout {
    border-left: 3px solid var(--gold-dim);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-sm) 0;
    background: rgba(255,149,0,0.04);
}
.exa-callout--note    { border-left-color: var(--gold-dim); background: rgba(255,149,0,0.04); }
.exa-callout--tip     { border-left-color: var(--gold); background: var(--gold-wash); }
.exa-callout--info    { border-left-color: var(--info, #58a6ff); background: rgba(88,166,255,0.04); }
.exa-callout--warning { border-left-color: var(--caution, #d29922); background: rgba(210,153,34,0.04); }
.exa-callout--danger  { border-left-color: var(--danger-text); background: rgba(248,81,73,0.04); }
.exa-callout__header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}
.exa-callout__icon { font-size: var(--sm-font); }
.exa-callout__title {
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    font-weight: 600;
    color: var(--text-pri);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.exa-callout__body {
    font-size: var(--xs-font);
    color: var(--text-sec);
    line-height: 1.5;
}

/* ── Number Input ───────────────────────────────────────────────────────── */
.exa-number-input__wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--shield);
    border-radius: var(--radius-md);
    background: var(--void);
    overflow: hidden;
}
.exa-number-input__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--hull);
    border: none;
    color: var(--text-sec);
    font-size: var(--sm-font);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
}
.exa-number-input__btn:hover { color: var(--gold-hot); background: var(--gold-wash); }
.exa-number-input__btn:disabled { opacity: 0.3; cursor: default; }
.exa-number-input__field {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-pri);
    font-family: var(--font-mono);
    font-size: var(--xs-font);
    padding: var(--space-xs);
    -moz-appearance: textfield;
}
.exa-number-input__field::-webkit-outer-spin-button,
.exa-number-input__field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.exa-number-input__affix {
    font-size: var(--xs-font);
    color: var(--text-sec);
    padding: 0 2px;
}
.exa-number-input--sm .exa-number-input__btn { width: 26px; height: 26px; font-size: var(--xs-font); }
.exa-number-input--sm .exa-number-input__field { width: 44px; font-size: 10px; }
.exa-number-input--lg .exa-number-input__btn { width: 40px; height: 40px; font-size: 18px; }
.exa-number-input--lg .exa-number-input__field { width: 80px; font-size: var(--sm-font); }
.exa-number-input.disabled { opacity: 0.4; pointer-events: none; }

/* ── Copy Button / Copy Field ───────────────────────────────────────────── */
.exa-copy-btn__icon { margin-right: 2px; }
.exa-copy-field__wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--shield);
    border-radius: var(--radius-md);
    background: var(--void);
    overflow: hidden;
}
.exa-copy-field__input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-pri);
    font-family: var(--font-mono);
    font-size: var(--xs-font);
    padding: var(--space-xs) var(--space-sm);
    outline: none;
}
.exa-copy-field__input.masked {
    -webkit-text-security: disc;
    font-family: monospace;
}

/* ── Command Palette ────────────────────────────────────────────────────── */
.exa-cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}
.exa-cmd-palette {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    width: 560px;
    max-width: 90vw;
    background: var(--hull);
    border: 1px solid var(--gold-dim);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}
.exa-cmd-palette__search {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--shield);
}
.exa-cmd-palette__icon {
    color: var(--text-sec);
    font-size: var(--sm-font);
    flex-shrink: 0;
}
.exa-cmd-palette__input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-pri);
    font-family: var(--font-ui);
    font-size: var(--sm-font);
    outline: none;
}
.exa-cmd-palette__input::placeholder { color: var(--text-sec); }
.exa-cmd-palette__results {
    list-style: none;
    margin: 0;
    padding: var(--space-xs) 0;
    max-height: 320px;
    overflow-y: auto;
}
.exa-cmd-palette__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
}
.exa-cmd-palette__item:hover,
.exa-cmd-palette__item.active { background: var(--gold-wash); }
.exa-cmd-palette__item-icon {
    flex-shrink: 0;
    color: var(--text-sec);
    font-size: var(--sm-font);
}
.exa-cmd-palette__item-label {
    flex: 1;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
    color: var(--text-pri);
}
.exa-cmd-palette__item-hint {
    font-size: 10px;
    color: var(--text-sec);
}
.exa-cmd-palette__footer {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-xs) var(--space-lg);
    border-top: 1px solid var(--shield);
    font-size: 10px;
    color: var(--text-sec);
}

/* ── Tree View ──────────────────────────────────────────────────────────── */
.exa-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    font-size: var(--xs-font);
}
.exa-tree .exa-tree {
    padding-left: var(--space-lg);
}
.exa-tree__branch > .exa-tree__children {
    display: none;
    padding-left: var(--space-lg);
    list-style: none;
    margin: 0;
}
.exa-tree__branch.open > .exa-tree__children { display: block; }
.exa-tree__toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 3px var(--space-xs);
    cursor: pointer;
    color: var(--text-pri);
    border-radius: var(--radius-sm);
    transition: background var(--dur-fast) var(--ease-out);
}
.exa-tree__toggle:hover { background: var(--gold-wash); }
.exa-tree__arrow {
    font-size: 8px;
    color: var(--text-sec);
    transition: transform var(--dur-fast) var(--ease-out);
    display: inline-block;
    width: 12px;
    text-align: center;
}
.exa-tree__branch.open > .exa-tree__toggle .exa-tree__arrow { transform: rotate(90deg); }
.exa-tree__icon { font-size: var(--sm-font); }
.exa-tree__leaf {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 3px var(--space-xs) 3px calc(var(--space-xs) + 12px);
    color: var(--text-sec);
    border-radius: var(--radius-sm);
    cursor: default;
    transition: background var(--dur-fast) var(--ease-out);
}
.exa-tree__leaf:hover { background: var(--gold-wash); color: var(--text-pri); }


/* ═══ DYNAMIC CONTENT UTILITIES ═══════════════════════════════════════════
   Replaces all inline style="" patterns in hud.js.
   Rule: hud.js must NEVER use style="". Use these classes. */

/* ── List items — vertical list with separator borders ── */
.exa-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.exa-list-item:last-child { border-bottom: none; }

/* ── List item with padding (card-style rows) ── */
.exa-list-card {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.exa-list-card:last-child { border-bottom: none; }

/* ── Inset panel — void-background block ── */
.exa-inset {
    background: var(--void);
    border: 1px solid var(--bulkhead);
    border-radius: var(--radius-card);
    padding: var(--space-sm) var(--space-md);
}

/* ── Data label/value pairs in dynamic content ── */
.exa-data-label {
    font-size: var(--xxs-font);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.exa-data-value {
    font-family: var(--font-data);
    font-size: calc(18px * var(--font-scale));
    font-weight: var(--weight-bold);
    color: var(--gold);
    letter-spacing: -0.02em;
    word-break: break-word;
}
.exa-data-value--sm {
    font-size: var(--base-font);
}

/* ── Metric grid — replaces inline display:grid on metric-card wrappers ── */
.exa-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-sm);
}

/* ── Metric tile (replaces legacy .metric-card) ── */
.exa-metric {
    background: linear-gradient(168deg, rgba(22,22,20,0.6), rgba(16,16,14,0.6));
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-card);
    padding: var(--space-md);
    text-align: center;
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.exa-metric:hover {
    border-color: var(--gold-edge);
    box-shadow: 0 2px 8px var(--shadow-light);
}

/* ── Text utilities for dynamic content ── */
.exa-text-pri { color: var(--text-pri); font-size: var(--xs-font); }
.exa-text-sec { color: var(--text-sec); font-size: var(--xs-font); }
.exa-text-muted { color: var(--text-muted); font-size: var(--xxs-font); }
.exa-text-ghost { color: var(--text-ghost); font-size: var(--xxs-font); }
.exa-text-gold { color: var(--gold); font-size: var(--xxs-font); }
.exa-text-danger { color: var(--danger-text); font-size: var(--xxs-font); }
.exa-text-label { color: var(--text-pri); font-size: var(--xs-font); font-weight: var(--weight-semibold); }
.exa-text-center { text-align: center; }

/* ── Empty state for dynamic content (replaces inline opacity/padding) ── */
.exa-empty {
    text-align: center;
    padding: var(--space-md);
    color: var(--text-muted);
    font-size: var(--sm-font);
    opacity: 0.7;
}

/* ── Flex utilities ── */
.exa-flex { display: flex; }
.exa-flex-col { display: flex; flex-direction: column; }
.exa-flex-between { display: flex; justify-content: space-between; align-items: center; }
.exa-flex-1 { flex: 1; }
.exa-gap-xs { gap: var(--space-xs); }
.exa-gap-sm { gap: var(--space-sm); }
.exa-gap-md { gap: var(--space-md); }


/* ═══════════════════════════════════════════════════════════════════════════════
   EXA-FIX-001 — Missing CSS Class Definitions
   All classes use design tokens from tokens.css. Zero hardcoded values.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── FIX-010: Panel containers (38 references) ── */

.exa-panel {
  background: var(--armor);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-card);
  padding: calc(10px * var(--font-scale));
}

.exa-panel-void {
  background: linear-gradient(160deg, var(--void) 0%, var(--armor) 100%);
}

/* ── FIX-011: Detail view layout classes (33 references) ── */

/* Convention 1: hyphen-separated (core_detail, rig_detail, rig_frame_detail) */

.exa-detail-body { padding: calc(8px * var(--font-scale)); }

.exa-detail-section {
  margin-bottom: calc(12px * var(--font-scale));
}

.exa-detail-label {
  font-size: var(--xxs-font);
  color: var(--text-muted);
  margin-bottom: calc(2px * var(--font-scale));
}

.exa-detail-value {
  font-size: var(--xs-font);
  color: var(--text-pri);
}

.exa-detail-actions {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: calc(8px * var(--font-scale));
}

/* Convention 2: BEM double-underscore (artifact_detail) */

.exa-detail {
  padding: calc(8px * var(--font-scale));
}

.exa-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(8px * var(--font-scale));
}

.exa-detail__title {
  font-size: var(--sm-font);
  color: var(--text-pri);
  font-weight: 600;
}

.exa-detail__body {
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--font-scale));
}

.exa-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.exa-detail__preview {
  background: var(--armor);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-card);
  padding: calc(8px * var(--font-scale));
  overflow-x: auto;
}

/* ── FIX-012: Station text utilities (15 references) ── */

.station-text {
  font-size: var(--xxs-font);
  color: var(--text-sec);
}

.station-text-warning { color: var(--warning-text); }
.station-text-success { color: var(--success-text); }
.station-text-muted { color: var(--text-muted); }

/* ── FIX-013: Sanctum table grid layout (19 references) ── */

.sanctum-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: calc(4px * var(--font-scale));
  padding: calc(6px * var(--font-scale)) 0;
  border-bottom: 1px solid var(--bulkhead);
  color: var(--text-muted);
  font-size: var(--xxs-font);
}

.sanctum-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: calc(4px * var(--font-scale));
  padding: calc(6px * var(--font-scale)) 0;
  border-bottom: 1px solid var(--bulkhead);
}

.sanctum-table-cell { min-width: 0; }

.sanctum-table-primary {
  font-size: var(--xs-font);
  color: var(--text-pri);
}

.sanctum-table-meta {
  font-size: var(--xxs-font);
  color: var(--text-muted);
}

/* ── FIX-014: List, code block, form classes (14 references) ── */

.exa-list {
  display: flex;
  flex-direction: column;
  gap: calc(4px * var(--font-scale));
}

.exa-code-block {
  font-family: var(--font-mono);
  font-size: var(--xxs-font);
  color: var(--text-pri);
  background: var(--void);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-card);
  padding: calc(8px * var(--font-scale));
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.exa-form {
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--font-scale));
}

.exa-form-label {
  font-size: var(--xxs-font);
  color: var(--text-muted);
  margin-bottom: calc(2px * var(--font-scale));
}

.exa-form-help {
  font-size: var(--xxs-font);
  color: var(--text-muted);
  margin-top: calc(2px * var(--font-scale));
}

.exa-form-col {
  display: flex;
  flex-direction: column;
  gap: calc(4px * var(--font-scale));
}

/* ── FIX-015: Stat, badge, section label classes (9 references) ── */

.exa-stat-item {
  display: flex;
  flex-direction: column;
  gap: calc(2px * var(--font-scale));
}

.exa-stat-label {
  font-size: var(--xxs-font);
  color: var(--text-muted);
}

.exa-stat-value {
  font-size: var(--sm-font);
  color: var(--text-pri);
  font-weight: 600;
}

.exa-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.exa-badge-icon {
  font-size: var(--sm-font);
}

.exa-badge-name {
  font-size: var(--xs-font);
  color: var(--text-pri);
  font-weight: 600;
}

.exa-badge-desc {
  font-size: var(--xxs-font);
  color: var(--text-muted);
}

.exa-section-label {
  font-size: var(--xxs-font);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: calc(4px * var(--font-scale));
}

/* ── FIX-016: Sanctum version and build classes (15 references) ── */

.sanctum-versions {
  display: flex;
  flex-direction: column;
  gap: calc(4px * var(--font-scale));
}

.sanctum-version-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(6px * var(--font-scale));
  border-bottom: 1px solid var(--bulkhead);
}

.sanctum-version-tag {
  font-size: var(--xs-font);
  color: var(--text-pri);
  font-weight: 600;
}

.sanctum-version-meta {
  display: flex;
  gap: var(--space-sm);
  font-size: var(--xxs-font);
  color: var(--text-muted);
}

.sanctum-version-digest { font-family: var(--font-mono); }
.sanctum-version-created {}

.sanctum-builds {
  margin-top: calc(10px * var(--font-scale));
}

.sanctum-build-item {
  padding: calc(6px * var(--font-scale));
  border-bottom: 1px solid var(--bulkhead);
}

.sanctum-build-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sanctum-build-id {
  font-size: var(--xs-font);
  color: var(--text-pri);
  font-family: var(--font-mono);
}

.sanctum-build-meta {
  display: flex;
  gap: var(--space-sm);
  font-size: var(--xxs-font);
  color: var(--text-muted);
  margin-top: calc(2px * var(--font-scale));
}

.sanctum-build-trigger {}
.sanctum-build-duration {}
.sanctum-build-created {}

/* ── FIX-017: Sanctum card header and meta (3 references) ── */

.sanctum-card-header {
  font-size: var(--xxs-font);
  color: var(--text-muted);
  margin-bottom: calc(4px * var(--font-scale));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sanctum-card-meta {
  font-size: var(--xxs-font);
  color: var(--text-sec);
  margin-top: calc(4px * var(--font-scale));
}

/* ── FIX-020: Modal actions, text utilities, chip row ── */

.exa-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-top: calc(10px * var(--font-scale));
  padding-top: calc(8px * var(--font-scale));
  border-top: 1px solid var(--bulkhead);
}

.exa-text-success { color: var(--success-text); font-size: var(--xxs-font); }
.exa-text-mono { font-family: var(--font-mono); }

.exa-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* ── FIX-021: Arcology detail classes (21 references) ── */

.arcology-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: calc(10px * var(--font-scale));
}

.arcology-detail-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.arcology-icon { font-size: var(--lg-font); }

.arcology-title-text {
  font-size: var(--sm-font);
  color: var(--text-pri);
  font-weight: 600;
}

.arcology-detail-actions {
  display: flex;
  gap: var(--space-xs);
}

.arcology-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: calc(8px * var(--font-scale));
  margin-bottom: calc(10px * var(--font-scale));
}

.overview-stat {
  background: var(--armor);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-card);
  padding: calc(8px * var(--font-scale));
}

.overview-stat .exa-text-muted { margin-bottom: calc(2px * var(--font-scale)); }

.arcology-members,
.arcology-integrations {
  margin-top: calc(8px * var(--font-scale));
}

.member-item,
.integration-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(6px * var(--font-scale)) 0;
  border-bottom: 1px solid var(--bulkhead);
}

.member-actions,
.integration-actions {
  display: flex;
  gap: var(--space-xs);
}

.budget-overview {
  margin-top: calc(8px * var(--font-scale));
}

.budget-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: calc(8px * var(--font-scale));
}

.budget-stat {
  background: var(--armor);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-card);
  padding: calc(8px * var(--font-scale));
}

/* ── FIX-022: Remaining scattered CSS classes ── */

/* Comms chat area */
.exa-chat-area {
  background: var(--void);
  border: 1px solid var(--bulkhead);
  border-radius: var(--radius-card);
  padding: calc(8px * var(--font-scale));
  min-height: 200px;
  overflow-y: auto;
}

/* Preset gallery */
.preset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(4px * var(--font-scale));
}

.preset-card-title {
  font-size: var(--xs-font);
  color: var(--text-pri);
  font-weight: 600;
}

.preset-card-body {
  font-size: var(--xxs-font);
  color: var(--text-muted);
}

.preset-station-count {
  font-size: var(--xxs-font);
  color: var(--text-sec);
}

.preset-gallery-save-area {
  margin-top: calc(10px * var(--font-scale));
  padding-top: calc(8px * var(--font-scale));
  border-top: 1px solid var(--bulkhead);
}

/* Component-specific items */
.core-item,
.gear-item,
.arcology-item,
.stencil-item {
  padding: calc(6px * var(--font-scale));
  border-bottom: 1px solid var(--bulkhead);
  cursor: pointer;
  transition: background 0.15s;
}

.core-item:hover,
.gear-item:hover,
.arcology-item:hover,
.stencil-item:hover {
  background: var(--armor);
}

.rig-frame-item,
.rig-nexus-frame-item {
  padding: calc(6px * var(--font-scale));
  border-bottom: 1px solid var(--bulkhead);
  cursor: pointer;
  transition: background 0.15s;
}

.rig-frame-item:hover,
.rig-nexus-frame-item:hover {
  background: var(--armor);
}

/* Utility: metric row alias */
.exa-metric-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* Utilities */
.gap-xxs { gap: calc(2px * var(--font-scale)); }
.text-danger { color: var(--danger-text); }
.discover-spinner { display: inline-block; }
.faction-bulk-checkbox { cursor: pointer; }


/* ── Expedition Launcher (from directives.html) ───────────────────────── */

.exa-spinner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.exa-spinner::before {
  content: "⟳";
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: block;
}

.exa-success-message {
  padding: var(--space-sm);
  background: var(--color-success-bg);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-sm);
  color: var(--color-success);
  font-size: var(--font-size-sm);
}

.exa-error-message {
  padding: var(--space-sm);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  font-size: var(--font-size-sm);
}

.exa-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  color: var(--color-text-muted);
}

.exa-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}


/* ── Expedition Detail (from expedition_detail.html) ──────────────────── */

.exa-detail-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.exa-detail-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.exa-detail-title h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

.exa-detail-meta {
  display: flex;
  gap: var(--space-md);
  font-size: var(--font-size-sm);
}

.exa-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
}

.exa-detail-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.exa-detail-field label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exa-button-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.exa-log-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  background: var(--color-surface-sunken);
}

.exa-log-entry {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.exa-log-entry:last-child {
  border-bottom: none;
}

.exa-log-timestamp {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.exa-log-level {
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  white-space: nowrap;
}

.exa-log-level--info { color: var(--color-blue); }
.exa-log-level--warn { color: var(--color-amber); }
.exa-log-level--error { color: var(--color-red); }
.exa-log-level--debug { color: var(--color-text-muted); }

.exa-log-message {
  word-break: break-word;
}

.exa-modal-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
}

/* -----------------------------------------------------------------------------
 * Sanctum Modal (BRB-012)
 * -------------------------------------------------------------------------- */

.sanctum-modal .modal-content {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.sanctum-tab-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--bulkhead);
  flex-shrink: 0;
  background-color: var(--hull);
}

#sanctum-modal-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

/* Error panel for template debugging (BRB-004) */
.exa-error-panel {
  text-align: left;
  font-family: monospace;
  font-size: calc(var(--font-scale, 1) * 12px);
  background-color: var(--hull);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--text-pri);
  max-height: 400px;
  overflow-y: auto;
}
.exa-w-full { width: 100%; }

/* ═══ Immersive Exit Button (touch devices) ═══ */
.immersive-exit-btn {
  position: fixed;
  top: calc(8px * var(--font-scale));
  right: calc(8px * var(--font-scale));
  z-index: 10001;
  background: var(--hull-deep);
  color: var(--text-sec);
  border: 1px solid var(--shield);
  border-radius: var(--radius-sm);
  padding: calc(8px * var(--font-scale)) calc(12px * var(--font-scale));
  font-size: calc(16px * var(--font-scale));
  cursor: pointer;
  touch-action: manipulation;
  min-width: calc(44px * var(--font-scale));
  min-height: calc(44px * var(--font-scale));
  display: flex;
  align-items: center;
  justify-content: center;
}
.immersive-exit-btn:hover,
.immersive-exit-btn:active {
  background: var(--shield);
  color: var(--text-pri);
}