/* ARTEMIS II — Mission Simulation Dashboard
   Aesthetic ported from KNOW.MORE World Monitor */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Orbitron:wght@400;500;700;900&display=swap');

:root {
    /* Core — matched to world_monitor */
    --bg-black: rgb(0, 0, 0);
    --bg-dark: rgb(10, 10, 15);
    --bg-panel: rgba(10, 15, 20, 0.95);
    --bg-panel-hover: rgba(0, 255, 0, 0.05);
    --text-white: rgb(255, 255, 255);
    --text-primary: #e0e8e2;
    --text-secondary: #7a9a7e;
    --text-dim: #3a5a3e;

    /* Accent — green system from world_monitor */
    --accent-primary: #00ff00;
    --accent-secondary: #aaff00;
    --accent-muted: rgba(0, 255, 0, 0.6);
    --accent-orange: #ff8800;
    --accent-red: #ff3333;
    --accent-gold: #ffcc00;
    --accent-cyan: #00ccff;
    --accent-purple: #aa66ff;

    /* Borders */
    --border: rgba(0, 255, 0, 0.15);
    --border-glow: rgba(0, 255, 0, 0.3);

    /* Glows — from world_monitor */
    --glow-green: 0 0 3px rgba(0, 255, 0, 0.6);
    --glow-green-lg: 0 0 15px rgba(0, 255, 0, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2);
    --glow-lime: 0 0 6px rgba(170, 255, 0, 0.6);
    --glow-orange: 0 0 8px rgba(255, 136, 0, 0.3);

    /* Window styles */
    --window-bg: rgba(10, 15, 20, 0.95);
    --window-border: rgba(0, 255, 0, 0.2);
    --window-header: rgba(0, 0, 0, 0.8);

    /* Severity — from world_monitor */
    --color-critical: #ff3333;
    --color-high: #ff6600;
    --color-elevated: #ffaa00;
    --color-moderate: #aaff00;
    --color-low: #00ff00;

    --font-mono: 'JetBrains Mono', 'Monaco', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-black);
    color: var(--text-primary);
    font-family: var(--font-mono);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ---- HEADER ---- */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--window-header);
    border-bottom: 1px solid var(--border);
    height: 52px;
    z-index: 100;
    position: relative;
    backdrop-filter: blur(10px);
}

#header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

#header .logo svg {
    width: 32px;
    height: 32px;
}

#header .logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent-primary);
    text-shadow: var(--glow-green);
}

#header .logo .mission-tag {
    font-size: 10px;
    color: var(--accent-secondary);
    letter-spacing: 2px;
    font-weight: 500;
}

.powered-by-header {
    font-size: 8px;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-top: 1px;
}

.powered-by-header .ocn-brand {
    color: var(--accent-primary);
    font-weight: 700;
    text-shadow: var(--glow-green);
}

.ocn-brand-link {
    text-decoration: none;
    color: inherit;
}

.ocn-brand-link:hover .ocn-brand {
    text-shadow: var(--glow-green-lg);
}

#header .meta {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 12px;
}

.met-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--accent-primary);
    letter-spacing: 2px;
    text-shadow: var(--glow-green);
}

.utc-display {
    color: var(--text-secondary);
    font-size: 11px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--accent-primary);
    letter-spacing: 0.15em;
}

.connection-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: var(--glow-green);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---- MAIN LAYOUT ---- */
#main {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    grid-template-rows: 1fr;
    height: calc(100vh - 52px);
    gap: 1px;
    background: rgba(0, 255, 0, 0.08);
}

/* ---- LEFT PANEL — Telemetry ---- */
#panel-left {
    background: var(--bg-dark);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0; /* critical for flex/grid scrolling */
}

/* ---- CENTER — 3D View ---- */
#panel-center {
    background: var(--bg-black);
    position: relative;
    overflow: hidden;
}

#three-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#scene-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    pointer-events: none;
    z-index: 10;
}

#scene-overlay .spacecraft-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--accent-primary);
    text-shadow: var(--glow-green);
    letter-spacing: 2px;
}

#scene-overlay .distance-readout {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 4px;
}

#scene-controls {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

#scene-controls button {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 0, 0.15);
    color: var(--text-secondary);
    padding: 7px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

#scene-controls button:hover {
    background: rgba(0, 255, 0, 0.08);
    color: var(--text-primary);
    border-color: rgba(0, 255, 0, 0.3);
}

#scene-controls button.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-green);
    background: rgba(0, 255, 0, 0.12);
}

/* ---- RIGHT PANEL — Radio & DSN ---- */
#panel-right {
    background: var(--bg-dark);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0; /* critical for flex/grid scrolling */
}

/* ---- PANEL CARDS — world_monitor window style ---- */
.card {
    background: var(--window-bg);
    border: 1px solid var(--window-border);
    border-radius: 4px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    flex-shrink: 0; /* prevent cards from collapsing */
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--window-header);
}

.card-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--accent-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--glow-green);
}

.card-header .badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 1px;
    font-weight: 500;
}

.badge-live {
    background: rgba(0, 255, 0, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.badge-sim {
    background: rgba(255, 136, 0, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 136, 0, 0.3);
}

.card-body {
    padding: 10px 12px;
}

/* ---- TELEMETRY READOUTS ---- */
.telem-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.telem-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.telem-item.full-width {
    grid-column: 1 / -1;
}

.telem-label {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.telem-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.telem-value.large {
    font-size: 18px;
    color: var(--accent-primary);
    text-shadow: var(--glow-green);
}

.telem-value.warn { color: var(--accent-orange); }
.telem-value.danger { color: var(--accent-red); }
.telem-value.ok { color: var(--accent-primary); }
.telem-unit {
    font-size: 9px;
    color: var(--text-dim);
    margin-left: 4px;
    font-family: var(--font-mono);
}

/* ---- CREW ROSTER ---- */
.crew-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.crew-member {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 3px 3px 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.2s;
}

.crew-member:hover {
    background: rgba(0, 255, 0, 0.05);
}

.crew-name {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
}

.crew-role {
    font-size: 9px;
    color: var(--text-secondary);
}

.crew-agency {
    font-size: 8px;
    color: var(--accent-secondary);
    letter-spacing: 1px;
}

/* ---- DSN DISHES ---- */
.dsn-dish {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.dsn-dish:last-child { border-bottom: none; }

.dsn-dish:hover { background: rgba(0, 255, 0, 0.03); }

.dsn-dish.artemis-active {
    background: rgba(0, 255, 0, 0.06);
    border-left: 3px solid var(--accent-primary);
}

.dish-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.dish-icon.active {
    background: rgba(0, 255, 0, 0.12);
    box-shadow: var(--glow-green);
}

.dish-info {
    flex: 1;
    min-width: 0;
}

.dish-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.dish-target {
    font-size: 10px;
    color: var(--accent-orange);
}

.dish-meta {
    font-size: 9px;
    color: var(--text-dim);
}

/* ---- RADIO FREQUENCIES ---- */
.freq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.freq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
    border: 1px solid rgba(0, 255, 0, 0.08);
    transition: background 0.2s;
}

.freq-item:hover {
    background: rgba(0, 255, 0, 0.04);
}

.freq-name {
    font-size: 10px;
    color: var(--text-primary);
}

.freq-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: var(--accent-gold);
    letter-spacing: 1px;
}

.freq-band {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 2px;
    background: rgba(170, 102, 255, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(170, 102, 255, 0.3);
}

/* ---- WATERFALL / SPECTRUM DISPLAY ---- */
#waterfall-canvas {
    width: 100%;
    height: 120px;
    background: #000;
    border-radius: 3px;
    border: 1px solid rgba(0, 255, 0, 0.1);
}

#spectrum-canvas {
    width: 100%;
    height: 60px;
    background: #000;
    border-radius: 3px;
    border: 1px solid rgba(0, 255, 0, 0.1);
}

/* ---- SIGNAL STRENGTH METER ---- */
.signal-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.signal-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 20px;
}

.signal-bar {
    width: 4px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 1px;
    transition: background 0.3s, height 0.3s;
}

.signal-bar.active { background: var(--accent-primary); box-shadow: var(--glow-green); }
.signal-bar.active.warn { background: var(--accent-orange); }
.signal-bar.active.strong { background: var(--accent-primary); box-shadow: var(--glow-green-lg); }

.signal-label {
    font-size: 10px;
    color: var(--text-secondary);
}

.signal-dbm {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--accent-primary);
    margin-left: auto;
}

/* ---- TIMELINE ---- */
.timeline {
    position: relative;
    padding-left: 16px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 255, 0, 0.15);
}

.timeline-event {
    position: relative;
    padding: 4px 0 8px 12px;
    font-size: 10px;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--text-dim);
}

.timeline-event.completed::before {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-green);
}

.timeline-event.current::before {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    animation: pulse-dot 1.5s infinite;
}

.timeline-event.upcoming::before {
    background: transparent;
    border-color: var(--text-dim);
}

.event-name {
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 1px;
}

.event-time {
    color: var(--text-dim);
    font-size: 9px;
}

.event-desc {
    color: var(--text-secondary);
    font-size: 9px;
    margin-top: 2px;
}

/* ---- WEBSDR SOURCES ---- */
.sdr-source {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.sdr-source:hover {
    background: rgba(0, 255, 0, 0.05);
}

.sdr-capable {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sdr-capable.yes { background: var(--accent-primary); box-shadow: var(--glow-green); }
.sdr-capable.no { background: var(--accent-red); opacity: 0.5; }

.sdr-name {
    font-size: 10px;
    color: var(--text-primary);
    flex: 1;
}

.sdr-location {
    font-size: 9px;
    color: var(--text-dim);
}

/* ---- AUDIO CONTROLS ---- */
.audio-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.audio-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 255, 0, 0.1);
    border-radius: 4px;
    padding: 8px 6px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.audio-btn:hover {
    background: rgba(0, 255, 0, 0.06);
    border-color: rgba(0, 255, 0, 0.3);
    color: var(--text-primary);
}

.audio-btn.active {
    background: rgba(0, 255, 0, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--glow-green);
}

.audio-btn.active .audio-icon {
    color: var(--accent-primary);
    text-shadow: var(--glow-green);
}

.audio-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.audio-icon {
    font-size: 10px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.audio-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.vol-label {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    width: 28px;
}

.vol-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: rgba(0, 255, 0, 0.15);
    border-radius: 2px;
    outline: none;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: var(--glow-green);
}

.vol-value {
    color: var(--text-secondary);
    width: 32px;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
}

.audio-info {
    font-size: 9px;
    color: var(--text-dim);
    padding: 4px 0 0;
    line-height: 1.4;
    min-height: 24px;
}

/* ---- FLOATING VIDEO WINDOW (world_monitor style) ---- */
.video-window {
    position: fixed;
    width: 480px;
    height: 320px;
    min-width: 320px;
    min-height: 220px;
    background: var(--window-bg);
    border: 1px solid var(--window-border);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 900;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    overflow: hidden;
    bottom: 20px;
    right: 20px;
    transition: opacity 0.2s, transform 0.2s;
}

.video-window.hidden {
    display: none;
}

.video-window.focused {
    z-index: 950;
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 255, 0, 0.15);
}

.video-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--window-header);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.video-window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent-primary);
}

.video-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: var(--glow-green);
    animation: pulse-dot 2s infinite;
}

.video-window-controls {
    display: flex;
    gap: 4px;
}

.video-window-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.15);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.video-window-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    color: var(--accent-primary);
    border-color: rgba(0, 255, 0, 0.4);
}

.video-window-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

.video-window-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-window-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 255, 0, 0.3) 50%);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 255, 0, 0.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 0, 0.4); }

/* ---- ANIMATIONS ---- */
@keyframes scan-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.08;
    animation: scan-line 8s linear infinite;
    pointer-events: none;
    z-index: 1000;
}

/* ---- MOBILE NAV TABS ---- */
.mobile-nav {
    display: none;
}

/* ============================================================
   MOBILE RESPONSIVE — iPhone / small screens
   ============================================================ */
@media (max-width: 900px) {

    /* Header compact */
    #header {
        padding: 6px 12px;
        height: 44px;
    }

    #header .logo svg { width: 24px; height: 24px; }

    #header .logo h1 {
        font-size: 14px;
        letter-spacing: 2px;
    }

    #header .logo .mission-tag { font-size: 8px; }
    .powered-by-header { font-size: 7px; }

    .met-display {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .utc-display { font-size: 9px; }
    .connection-status { font-size: 8px; }

    /* Main layout — single column, scrollable */
    #main {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 44px - 48px); /* header + mobile nav */
        gap: 0;
        background: var(--bg-black);
        overflow: hidden;
    }

    /* Panels become swipeable tabs */
    #panel-left,
    #panel-center,
    #panel-right {
        display: none;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #panel-left.mobile-active,
    #panel-center.mobile-active,
    #panel-right.mobile-active {
        display: flex;
    }

    /* 3D scene fills the space */
    #panel-center.mobile-active {
        display: block;
        min-height: 100%;
    }

    /* Scene controls — bigger touch targets */
    #scene-controls {
        bottom: 8px;
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        padding: 0 8px;
    }

    #scene-controls button {
        padding: 10px 10px;
        font-size: 9px;
        min-height: 36px;
    }

    /* Scene overlay */
    #scene-overlay {
        top: 8px;
        left: 8px;
    }

    /* Mobile bottom nav tabs */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 48px;
        background: var(--window-header);
        border-top: 1px solid var(--border);
        z-index: 800;
        backdrop-filter: blur(10px);
    }

    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: none;
        border: none;
        color: var(--text-dim);
        font-family: var(--font-mono);
        font-size: 8px;
        letter-spacing: 0.1em;
        cursor: pointer;
        padding: 4px;
        transition: color 0.2s;
    }

    .mobile-nav-btn.active {
        color: var(--accent-primary);
    }

    .mobile-nav-btn .nav-icon {
        font-size: 18px;
        line-height: 1;
    }

    /* Cards — larger text, bigger tap targets */
    .card-header {
        padding: 10px 12px;
    }

    .card-header h3 {
        font-size: 11px;
    }

    .card-body {
        padding: 12px;
    }

    .telem-value {
        font-size: 16px;
    }

    .telem-value.large {
        font-size: 22px;
    }

    .telem-label {
        font-size: 10px;
    }

    .telem-unit {
        font-size: 10px;
    }

    /* Crew grid — single column on small phones */
    .crew-grid {
        grid-template-columns: 1fr 1fr;
    }

    .crew-member {
        padding: 10px;
    }

    .crew-name { font-size: 12px; }
    .crew-role { font-size: 10px; }

    /* DSN dishes — bigger */
    .dsn-dish { padding: 10px; }
    .dish-name { font-size: 13px; }
    .dish-target { font-size: 11px; }
    .dish-meta { font-size: 10px; }

    /* Audio buttons — bigger touch targets */
    .audio-controls {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .audio-btn {
        padding: 12px 8px;
        font-size: 10px;
        min-height: 44px;
    }

    /* Frequency list */
    .freq-item {
        padding: 10px;
    }

    .freq-name { font-size: 11px; }
    .freq-value { font-size: 12px; }

    /* SDR sources */
    .sdr-source {
        padding: 10px;
        min-height: 44px;
    }

    .sdr-name { font-size: 12px; }

    /* Timeline */
    .timeline-event {
        padding: 6px 0 10px 14px;
        font-size: 11px;
    }

    .event-name { font-size: 11px; }
    .event-desc { font-size: 10px; }

    /* Volume slider — bigger thumb for touch */
    .vol-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    /* Floating video window — full width bottom */
    .video-window {
        width: 100% !important;
        height: 200px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 48px !important;
        top: auto !important;
        border-radius: 0;
        min-width: unset;
        min-height: unset;
    }

    .video-window-resize { display: none; }

    /* Scan line off on mobile — saves battery */
    .scan-line { display: none; }

    /* Signal meter */
    .signal-bar { width: 6px; }

    /* Spectrum canvases */
    #spectrum-canvas { height: 50px; }
    #waterfall-canvas { height: 100px; }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 380px) {
    .crew-grid { grid-template-columns: 1fr; }
    .audio-controls { grid-template-columns: 1fr; }
    .telem-grid { grid-template-columns: 1fr; }

    #header .logo h1 { font-size: 12px; }
    .met-display { font-size: 11px; }
}
