:root {
    color-scheme: dark;
    --bg: #080b12;
    --bg-deep: #04060a;
    --surface: #0d121b;
    --surface-2: #111925;
    --panel: #121a26;
    --panel-2: #182230;
    --chrome: #222d3a;
    --line: #2b3a4b;
    --line-hot: #69d8ff;
    --text: #e8edf3;
    --muted: #8a9aab;
    --silver: #c7d0d9;
    --cyan: #2de2e6;
    --blue: #2b7cff;
    --magenta: #ff2a8a;
    --green: #9cff57;
    --amber: #ffc857;
    --red: #ff5d78;
    --chart-bg: #080d14;
    --shadow: 0 22px 70px rgba(0, 0, 0, .42);
    --radius: 18px;
    --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg-deep); scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(43, 124, 255, .13), transparent 30rem),
        radial-gradient(circle at 88% 18%, rgba(255, 42, 138, .08), transparent 28rem),
        linear-gradient(145deg, #06090f 0%, #090e16 48%, #070a10 100%);
    font-family: var(--sans);
    overflow-x: hidden;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.background-grid {
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: .32;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(45, 226, 230, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 226, 230, .055) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 86%);
    animation: grid-drift 22s linear infinite;
}
.background-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 35%, rgba(45,226,230,.08) 49%, transparent 61%);
    transform: translateX(-100%);
    animation: grid-scan 9s ease-in-out infinite;
}
.scanline {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: .055;
    background: repeating-linear-gradient(to bottom, transparent 0 3px, #fff 4px);
    mix-blend-mode: soft-light;
}

.app-shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 26px; }
.topbar {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 4px 14px;
}
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; text-decoration: none; }
.brand img { display: block; width: clamp(230px, 34vw, 470px); height: auto; object-fit: contain; filter: drop-shadow(0 0 18px rgba(45,226,230,.11)); }
.brand-copy { display: grid; gap: 2px; border-left: 1px solid var(--line); padding-left: 16px; }
.brand-copy strong { font: 700 .9rem/1 var(--mono); letter-spacing: .15em; color: var(--silver); }
.brand-copy small { color: var(--muted); font: 600 .68rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.topbar-meta { display: flex; align-items: center; gap: 9px; min-width: max-content; color: var(--muted); font-family: var(--mono); }
.topbar-meta strong { color: var(--cyan); font-size: .95rem; letter-spacing: .08em; }
.clock-label { font-size: .64rem; letter-spacing: .18em; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(156,255,87,.7); animation: live-pulse 2s ease-in-out infinite; }

.status-ribbon {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(180deg, rgba(31,42,56,.86), rgba(13,18,27,.92));
    box-shadow: 0 16px 42px rgba(0,0,0,.22);
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: max-content;
    padding: 6px 9px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font: 700 .63rem/1 var(--mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    background: rgba(0,0,0,.22);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.good { color: var(--green); }
.badge.warn { color: var(--amber); }
.badge.bad { color: var(--red); }

.command-nav {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(10, minmax(94px, 1fr));
    border: 1px solid var(--line);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    background: rgba(9,14,22,.93);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}
.nav-button {
    position: relative;
    min-height: 58px;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px;
    font: 700 .72rem/1 var(--mono);
    letter-spacing: .04em;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}
.nav-button:last-child { border-right: 0; }
.nav-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-button::after { content: ""; position: absolute; left: 16%; right: 16%; bottom: 0; height: 2px; background: transparent; box-shadow: none; transition: .2s ease; }
.nav-button:hover { color: var(--text); background: rgba(45,226,230,.05); }
.nav-button.active { color: var(--cyan); background: linear-gradient(180deg, rgba(45,226,230,.08), rgba(43,124,255,.035)); }
.nav-button.active::after { left: 7%; right: 7%; background: linear-gradient(90deg, var(--blue), var(--cyan), var(--magenta)); box-shadow: 0 0 12px rgba(45,226,230,.5); }

.view-stage { width: min(1160px, 100%); margin: 24px auto 0; min-height: 58vh; }
.app-view[hidden] { display: none !important; }
.app-view.view-enter { animation: view-in .36s cubic-bezier(.2,.8,.2,1) both; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 2px 14px; }
.view-heading h1 { margin: 3px 0 0; font-size: clamp(1.55rem, 3.3vw, 2.55rem); line-height: 1.03; letter-spacing: -.035em; }
.eyebrow, .panel-kicker, .kicker { margin: 0; color: var(--cyan); font: 700 .66rem/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.section-code { color: #657588; font: 700 .72rem/1 var(--mono); letter-spacing: .12em; }

.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(24,34,48,.96), rgba(12,18,27,.97));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.025);
}
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(45,226,230,.055), transparent 24%, transparent 75%, rgba(255,42,138,.035));
}
.panel-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 70px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(38,49,64,.72), rgba(20,28,40,.4));
}
.panel-header h2 { margin: 3px 0 0; font-size: 1rem; letter-spacing: .015em; }
.panel-body { position: relative; z-index: 1; padding: 18px; }
.panel-body > :first-child { margin-top: 0; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-footer { position: relative; z-index: 1; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font: .72rem/1.4 var(--mono); }
.panel-footer strong { color: var(--silver); }

.hero-panel { min-height: 320px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
.hero-copy { position: relative; z-index: 2; padding: clamp(24px, 4vw, 46px); display: flex; flex-direction: column; justify-content: center; }
.hero-copy h2 { max-width: 720px; margin: 8px 0 13px; font-size: clamp(1.55rem, 3vw, 2.65rem); letter-spacing: -.035em; }
.hero-copy > p:not(.kicker) { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.65; }
.hero-specs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-specs span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(4,9,15,.55); color: var(--silver); font: 700 .7rem/1 var(--mono); }
.hero-specs b { color: var(--cyan); font-size: .58rem; letter-spacing: .12em; }
.hero-art { position: relative; min-height: 300px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, rgba(43,124,255,.12), transparent 68%); }
.hero-art::before { content: ""; position: absolute; width: 300px; height: 300px; border: 1px solid rgba(45,226,230,.12); border-radius: 50%; box-shadow: 0 0 0 46px rgba(45,226,230,.025), 0 0 0 92px rgba(43,124,255,.018); }
.hero-art img { position: relative; z-index: 1; width: min(100%, 390px); height: auto; object-fit: contain; mix-blend-mode: screen; filter: drop-shadow(0 0 24px rgba(45,226,230,.13)); }
.radar-sweep { position: absolute; z-index: 2; width: 250px; height: 250px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 80%, rgba(45,226,230,.15) 94%, rgba(45,226,230,.42) 100%); mask-image: radial-gradient(circle, transparent 0 10%, #000 12% 100%); animation: radar 6s linear infinite; }

.launch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.launch-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    min-height: 92px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--text);
    text-align: left;
    background: linear-gradient(135deg, rgba(24,34,48,.93), rgba(10,16,24,.97));
    cursor: pointer;
    box-shadow: 0 14px 36px rgba(0,0,0,.22);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.launch-card:hover { transform: translateY(-2px); border-color: #50677f; box-shadow: 0 18px 44px rgba(0,0,0,.3), 0 0 25px rgba(45,226,230,.045); }
.launch-card svg { width: 28px; height: 28px; fill: none; stroke: var(--cyan); stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.launch-card span { display: grid; gap: 4px; }
.launch-card strong { font-size: .92rem; }
.launch-card small { color: var(--muted); }
.launch-card i { color: #4f6072; font: 700 .66rem/1 var(--mono); font-style: normal; }

.two-column, .history-overview, .history-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two-column + .panel, .panel + .two-column, .panel + .history-columns, .history-overview + .panel, .panel + .panel, .detail-grid { margin-top: 12px; }
.compact-panel { min-height: 180px; }

.terminal-panel { overflow: visible; }
.terminal-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #0a1018; }
.terminal-toolbar button, .range-buttons button {
    border: 1px solid #3a4a5d;
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--silver);
    background: #121b27;
    cursor: pointer;
    font: 700 .67rem/1 var(--mono);
    letter-spacing: .04em;
}
.terminal-toolbar button:hover, .range-buttons button:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-field { display: flex; align-items: center; gap: 8px; min-width: min(100%, 310px); flex: 1 1 250px; border: 1px solid #334256; border-radius: 8px; padding-left: 9px; background: #080d14; }
.filter-field span { color: #718397; font: 700 .58rem/1 var(--mono); letter-spacing: .12em; }
.filter-field input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 7px 9px 7px 0; color: var(--text); background: transparent; font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: .7rem/1 var(--mono); }
.check input { accent-color: var(--cyan); }
.terminal {
    position: relative;
    z-index: 1;
    min-height: 400px;
    max-height: 58vh;
    margin: 0;
    padding: 16px;
    overflow: auto;
    color: #d9f9ff;
    background:
        linear-gradient(rgba(45,226,230,.015) 50%, transparent 50%),
        #05090e;
    background-size: 100% 4px;
    font: 500 .79rem/1.48 var(--mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-shadow: 0 0 8px rgba(45,226,230,.12);
}
.terminal.empty { color: #708294; }
.code-line { display: block; padding: 13px 14px; border: 1px solid #2b4153; border-radius: 10px; color: var(--cyan); background: #080e16; font: .78rem/1.5 var(--mono); overflow-wrap: anywhere; }
.warning-list { margin: 0; padding-left: 18px; color: var(--muted); font-family: var(--mono); font-size: .75rem; line-height: 1.55; }
.warning-list li::marker { color: var(--amber); }
.hidden { display: none !important; }

.inline-status, .metric-inline { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; color: var(--muted); font: .68rem/1.2 var(--mono); }
.inline-status strong, .metric-inline b { color: var(--cyan); }
.metric-inline span { display: inline-flex; gap: 5px; }
.metric-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 18px; }
.metric, .history-metric, .packetpath-preview-metric {
    border: 1px solid #2d4052;
    border-radius: 11px;
    padding: 14px;
    background: linear-gradient(145deg, #0b1119, #0e1620);
}
.metric strong, .history-metric strong, .packetpath-preview-metric strong { display: block; color: var(--cyan); font: 700 1.55rem/1 var(--mono); text-shadow: 0 0 14px rgba(45,226,230,.18); }
.metric span, .history-metric span, .packetpath-preview-metric span { display: block; margin-top: 7px; color: var(--muted); font: 700 .61rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.stat-list { display: grid; grid-template-columns: minmax(130px, .65fr) minmax(0, 1.35fr); gap: 0; margin: 0; border: 1px solid #29394b; border-radius: 10px; overflow: hidden; }
.stat-list dt, .stat-list dd { margin: 0; padding: 9px 11px; border-bottom: 1px solid #243344; min-width: 0; overflow-wrap: anywhere; }
.stat-list dt { color: #7d8fa3; background: rgba(7,12,19,.52); font: 700 .66rem/1.35 var(--mono); letter-spacing: .035em; }
.stat-list dd { color: var(--silver); font: 600 .72rem/1.35 var(--mono); }
.stat-list dt:nth-last-of-type(1), .stat-list dd:nth-last-of-type(1) { border-bottom: 0; }
.value-good { color: var(--green) !important; }
.value-warn { color: var(--amber) !important; }
.value-bad { color: var(--red) !important; }

.table-wrap { position: relative; z-index: 1; overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font: .73rem/1.4 var(--mono); }
th, td { padding: 10px 12px; border-bottom: 1px solid #253547; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; color: #99aabb; background: #101824; font-size: .61rem; letter-spacing: .09em; text-transform: uppercase; }
td { color: #c5d2de; }
tbody tr:hover td { background: rgba(45,226,230,.028); color: #edfaff; }

.detail-grid { display: grid; gap: 10px; }
.detail-panel { border-radius: 12px; }
.detail-panel summary { position: relative; z-index: 1; cursor: pointer; list-style: none; padding: 13px 16px; color: var(--silver); font: 700 .76rem/1.3 var(--mono); background: linear-gradient(180deg, #1d2836, #151e2a); }
.detail-panel summary::-webkit-details-marker { display: none; }
.detail-panel summary::before { content: "+"; display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 8px; border: 1px solid #4b6075; border-radius: 5px; color: var(--cyan); }
.detail-panel[open] summary::before { content: "−"; }
.detail-panel summary span { margin-left: 8px; color: #6f8194; font-weight: 500; }

.history-chart { position: relative; z-index: 1; display: block; width: 100%; min-height: 220px; }
.range-buttons { display: flex; gap: 5px; }
.range-buttons button.active { border-color: var(--cyan); color: #061014; background: var(--cyan); box-shadow: 0 0 15px rgba(45,226,230,.16); }
.history-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.history-caption, .station-note { color: var(--muted); line-height: 1.55; font-size: .78rem; }
.uptime-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.uptime-card { display: grid; gap: 5px; padding: 13px; border: 1px solid #2c3e51; border-radius: 10px; background: #0c131d; }
.uptime-card h3 { margin: 0; color: var(--silver); font-size: .75rem; }
.uptime-card strong { font: 700 1.2rem/1 var(--mono); }
.uptime-card span { color: var(--muted); font: .65rem/1.3 var(--mono); }
.history-empty { color: var(--muted); }

/* PacketPath preview restyle; the functional preview CSS remains separate. */
.packetpath-preview-shell { margin-top: 0; }
.packetpath-preview-body { padding: 14px; gap: 14px; }
.packetpath-preview-map-wrap { border-color: #2d4053; border-radius: 12px; background: radial-gradient(circle at 12% 45%, rgba(45,226,230,.09), transparent 18rem), #070c12; }
.packetpath-preview-legend { border-color: #28394a; background: rgba(7,12,18,.92); }
.packetpath-preview-metric { padding: 12px; }
.packetpath-preview-dot.root, .packetpath-preview-line.confirmed { background: var(--green); }
.packetpath-preview-edge.confirmed { stroke: var(--green); }
.packetpath-preview-edge.passive { stroke: #355268; }
.packetpath-preview-node.root circle { fill: var(--green); }
.packetpath-preview-node.digi circle { fill: var(--cyan); }
.packetpath-preview-node.station circle { fill: #d7e7f2; }
.packetpath-preview-node text { fill: var(--text); stroke: #070c12; }
.packetpath-preview-open { margin-top: auto; }

.native-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 13px;
    border: 1px solid #3d5368;
    border-radius: 9px;
    color: var(--cyan);
    background: linear-gradient(180deg, #162231, #0d151f);
    text-decoration: none;
    font: 700 .69rem/1 var(--mono);
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.native-link:hover { border-color: var(--cyan); transform: translateY(-1px); box-shadow: 0 0 22px rgba(45,226,230,.08); }
.native-link svg, .endpoint-card svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.endpoint-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 16px; }
.endpoint-card { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 13px; border: 1px solid #2b3d50; border-radius: 10px; background: #0b121b; text-decoration: none; }
.endpoint-card span { color: #728499; font: 700 .61rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.endpoint-card code { color: var(--silver); font: .72rem/1.45 var(--mono); overflow-wrap: anywhere; }
.endpoint-card a { color: var(--cyan); text-decoration: none; font: 700 .68rem/1 var(--mono); }
.endpoint-link { color: var(--silver); transition: border-color .2s ease, transform .2s ease; }
.endpoint-link:hover { border-color: var(--magenta); transform: translateY(-1px); }
.endpoint-link strong { font-size: .78rem; }
.endpoint-link svg { color: var(--magenta); }

.station-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr); gap: 12px; }
.station-art-panel { display: grid; place-items: center; min-height: 520px; padding: 20px; background: radial-gradient(circle, rgba(43,124,255,.12), transparent 65%), linear-gradient(145deg, #0d141e, #090e15); }
.station-art-panel img { width: min(100%, 520px); height: auto; object-fit: contain; filter: drop-shadow(0 0 32px rgba(45,226,230,.12)); }
.station-stack { display: grid; gap: 12px; align-content: start; }

.footer { display: flex; justify-content: space-between; gap: 16px; margin: 20px auto 0; padding: 12px 4px 0; border-top: 1px solid rgba(74,92,112,.38); color: #617286; font: .64rem/1.35 var(--mono); }
.noscript { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; padding: 12px; border: 1px solid var(--red); background: #2b0a12; color: #ffdfe6; text-align: center; }

@keyframes view-in { from { opacity: 0; transform: translateY(8px) scale(.995); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes live-pulse { 0%,100% { opacity: .65; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes radar { to { transform: rotate(360deg); } }
@keyframes grid-drift { to { background-position: 46px 46px, 46px 46px; } }
@keyframes grid-scan { 0%,45% { transform: translateX(-110%); } 75%,100% { transform: translateX(110%); } }

@media (max-width: 1080px) {
    .command-nav { display: flex; overflow-x: auto; border-radius: 0 0 14px 14px; scrollbar-width: none; }
    .command-nav::-webkit-scrollbar { display: none; }
    .nav-button { min-width: 118px; border-right: 1px solid var(--line); }
    .endpoint-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
    .app-shell { width: min(100% - 20px, 1320px); padding-top: 10px; }
    .topbar { min-height: 78px; }
    .brand img { width: clamp(210px, 52vw, 360px); }
    .brand-copy { display: none; }
    .status-ribbon { border-radius: 12px 12px 0 0; }
    .hero-panel { grid-template-columns: 1fr; }
    .hero-art { min-height: 230px; border-top: 1px solid var(--line); }
    .hero-art img { width: min(76%, 340px); }
    .radar-sweep { width: 210px; height: 210px; }
    .two-column, .history-overview, .history-columns, .station-layout { grid-template-columns: 1fr; }
    .station-art-panel { min-height: 360px; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .endpoint-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
    .app-shell { width: min(100% - 12px, 1320px); }
    .topbar { gap: 8px; padding-top: 5px; }
    .brand img { width: min(66vw, 280px); }
    .topbar-meta { font-size: .72rem; }
    .topbar-meta strong { font-size: .78rem; }
    .clock-label { display: none; }
    .status-ribbon { padding: 7px; gap: 6px; }
    .badge { padding: 5px 7px; font-size: .56rem; }
    .command-nav { margin-bottom: 0; }
    .nav-button { min-width: 88px; min-height: 54px; flex-direction: column; gap: 4px; font-size: .6rem; }
    .nav-button svg { width: 17px; height: 17px; }
    .view-stage { margin-top: 18px; }
    .view-heading { align-items: center; }
    .view-heading h1 { font-size: 1.58rem; }
    .section-code { display: none; }
    .hero-copy { padding: 22px 18px; }
    .hero-copy h2 { font-size: 1.55rem; }
    .hero-art { min-height: 190px; }
    .launch-grid { grid-template-columns: 1fr; }
    .launch-card { min-height: 80px; }
    .panel { border-radius: 13px; }
    .panel-header { align-items: flex-start; min-height: 62px; padding: 12px; }
    .panel-header > .badge { margin-left: auto; }
    .panel-body { padding: 12px; }
    .terminal-toolbar { padding: 8px; }
    .terminal { min-height: 360px; max-height: 62vh; padding: 11px; font-size: .7rem; }
    .metric-grid { padding: 12px; }
    .metric strong, .history-metric strong { font-size: 1.3rem; }
    .stat-list { grid-template-columns: 42% 58%; }
    .stat-list dt, .stat-list dd { padding: 8px 9px; font-size: .64rem; }
    th, td { padding: 8px 9px; white-space: nowrap; }
    .inline-status, .metric-inline { justify-content: flex-start; }
    .range-buttons { width: 100%; }
    .range-buttons button { flex: 1; padding-inline: 7px; }
    .history-metrics { grid-template-columns: 1fr 1fr; }
    .packetpath-preview-body { padding: 9px; }
    .packetpath-preview-map-wrap { min-height: 245px; }
    .packetpath-preview-side { gap: 9px; }
    .station-art-panel { min-height: 290px; }
    .station-art-panel img { width: min(90%, 390px); }
    .footer { flex-direction: column; gap: 4px; padding-inline: 4px; }
}

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

#packetpath-preview-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--muted);
    text-align: center;
    pointer-events: none;
    font: .75rem/1.5 var(--mono);
}
#packetpath-preview-empty[hidden] { display: none; }
