/*
  ============================================================
  COPYRIGHT & AUTHORSHIP
  Designed and vibe coded by Touhid Bin Alam Khan
  Designed in Figma
  Developed with Claude Opus 5.5
  © 2026 Touhid Bin Alam Khan. All rights reserved.

  Unauthorized reproduction, redistribution, or reuse of this
  source code/design is not permitted without permission.
  ============================================================

  AUTHOR_B64:
  VG91aGlkIEJpbiBBbGFtIEtoYW4gLSBEZXNpZ25lZCBpbiBGaWdtYSwg
  dmliZSBjb2RlZCB3aXRoIENsYXVkZSBPcHVzIDUuNSAtIDIwMjY=
*/
:root {
  color-scheme: light;
  --paper: #e8eae6;        /* page ground: cool concrete */
  --sheet: #fafbf9;        /* panels */
  --well: #f0f2ee;         /* insets, tracks */
  --ink: #15181b;
  --ink-2: #4c5359;
  --ink-3: #7c838a;
  --rule: #d8dbd6;
  --hair: rgba(var(--ink-rgb), .09);
  --orange: #ff4f00;       /* International Orange: live, heat, brand */
  --orange-ink: #c43d02;
  --orange-soft: #ffeadf;
  --magenta: #c2178a;      /* the flight-plan route ("the magenta line") */
  --magenta-soft: #fbedf6;
  --cyan: #0b7fa6;         /* turbine, selected values */
  --cyan-soft: #e2f1f6;
  --violet: #6b3fd6;       /* scramjet */
  --violet-soft: #efe9fd;
  --good: #13804a;  --good-soft: #e2f2e8;
  --caution: #a86f00; --caution-soft: #fbf1d8;
  --warning: #c9283a; --warning-soft: #fbe3e5;
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #4a3aa7; /* validated categorical set */
  --stage: #eceeea;
  --glass: rgba(250, 251, 249, .8);
  --raised: #fafbf9;
  --ink-rgb: 21, 24, 27; --shadow-rgb: 21, 24, 27;
  --orange-rgb: 255, 79, 0; --orange-deep: #6d2604;
  --magenta-rgb: 194, 23, 138; --cyan-rgb: 11, 127, 166; --violet-rgb: 107, 63, 214; --good-rgb: 19, 128, 74;
  --caution-rgb: 168, 111, 0; --caution-deep: #6b4700; --warning-rgb: 201, 40, 58; --warning-deep: #7c1622;
  --stage-hi: #f6f7f4;
  --hilite: rgba(255, 255, 255, .7); --hilite-solid: #fff;
  --avatar: #e2e5e0; --ink-hover: #2a2f34;
  /* political map: six soft tints that sit under the magenta route without competing with it */
  --map-space: #dfe9ef; --map-ocean: #cfe5f2; --map-ocean-deep: #a9cde6; --map-grat: rgba(255, 255, 255, .55);
  --map-land: #ece3c9; --map-t0: #f0e2b6; --map-t1: #d3e5c0; --map-t2: #f3d3c3; --map-t3: #ddd6ee; --map-t4: #c9e3dc; --map-t5: #f2dccb; --map-ice: #f6f9fb;
  --map-border: rgba(110, 92, 70, .42); --map-coast: rgba(40, 98, 138, .55); --map-glow: rgba(255, 255, 255, .75);
  --map-river: #78b1d8; --map-admin: rgba(110, 92, 70, .5);
  --map-label: rgba(74, 62, 46, .7); --map-sea-label: rgba(30, 96, 142, .62); --map-city: #343b42; --map-label-halo: rgba(255, 255, 255, .78);
  --map-halo: rgba(255, 255, 255, .86);
  --map-night: rgba(16, 34, 70, .075); --night-swatch: rgba(16, 34, 70, .22);
  --switch-off: #cfd3cd; --knob: #fff;
  --track-a: #e3e6e1; --track-b: #f3f4f1; --handle-a: #ffffff; --handle-b: #d9dcd7;
  --btn-glass: rgba(255, 255, 255, .7); --btn-hover: #fff; --lamp-off: #c9cdc7;
  --tip-bg: #15181b; --tip-fg: #f1f2ef; --tip-fg-rgb: 241, 242, 239;
  --callout-bg: rgba(250, 251, 249, .92);
  --ramp: linear-gradient(90deg, #f3eee9 0%, #f7d6bd 18%, #f2a570 36%, #e26930 55%, #b8400f 73%, #6e2207 100%);
  --bar-label-a: #fff; --bar-label-b: #15181b;
  --scrim: rgba(21, 24, 27, .22);

  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-inst: "B612", "B612 Mono", ui-monospace, "SF Mono", Consolas, monospace; /* Airbus cockpit face, for live instrument values */

  --r-stage: 22px; --r-card: 16px; --r-ctl: 10px;
  --shadow-float: 0 1px 0 var(--hilite) inset, 0 10px 28px -14px rgba(var(--shadow-rgb), .32);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font: 400 14px/1.45 var(--f-ui); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 100; background: var(--ink); color: var(--sheet); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.i { width: 20px; height: 20px; flex: none; display: block; }
.inst { font-family: var(--f-inst); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }

/* ------------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px 14px; gap: 2px; z-index: 30;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 18px; color: var(--ink); }
.brand svg { width: 24px; height: 27px; }
.brand-dot { fill: var(--orange); }
.brand span { font-size: 10.5px; font-weight: 720; font-stretch: 125%; letter-spacing: .02em; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; width: 68px; padding: 9px 2px 8px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 560; line-height: 1.15; text-align: center;
  transition: color .15s, background-color .15s;
}
.nav-item .i { width: 21px; height: 21px; }
.nav-item:hover { color: var(--ink); background: rgba(var(--ink-rgb), .045); }
.nav-item.on { color: var(--ink); background: var(--sheet); box-shadow: 0 0 0 1px var(--hair), 0 2px 8px -3px rgba(var(--shadow-rgb), .16); }
.nav-item.on::before { content: ""; position: absolute; left: -8px; top: 50%; width: 3px; height: 18px; border-radius: 2px; background: var(--orange); transform: translateY(-50%); }

.main { min-width: 0; padding: 0 24px 40px 8px; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 25;
  display: flex; align-items: center; gap: 18px; padding: 14px 0 14px;
  background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tb-title { min-width: 0; flex: 1; }
.tb-title h1 { font-size: 23px; font-weight: 680; font-stretch: 118%; letter-spacing: -.01em; line-height: 1.15; text-wrap: balance; }
.tb-title p { margin-top: 3px; color: var(--ink-2); font-size: 13.5px; max-width: 72ch; min-height: 1.45em; }
.tb-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.clock { display: flex; align-items: baseline; gap: 5px; padding: 0 4px; }
.clock .inst { font-size: 15px; }
.clock small, .link-status span { font-size: 11.5px; color: var(--ink-3); }
.link-status { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.link-status b { font-size: 12px; font-weight: 400; color: var(--ink-2); min-width: 46px; }
.tb-pop-wrap { position: relative; }
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid transparent; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: rgba(var(--ink-rgb), .05); color: var(--ink); }
.icon-btn[aria-expanded="true"] { background: var(--sheet); border-color: var(--hair); }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
}
.me { border-radius: 50%; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--avatar); color: var(--ink-2); font-size: 12px; font-weight: 700; font-stretch: 112%; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px var(--hair);
}

/* segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(var(--ink-rgb), .055); }
.seg button {
  padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 560; color: var(--ink-2); white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"], .seg button[aria-selected="true"], .seg button.on {
  background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .1), 0 0 0 1px rgba(var(--ink-rgb), .04);
}
.flight-switch button { display: grid; text-align: left; padding: 5px 12px 5px 11px; line-height: 1.2; }
.flight-switch b { font-size: 12.5px; font-weight: 680; font-stretch: 112%; display: flex; align-items: center; gap: 6px; }
.flight-switch small { font-size: 11px; color: var(--ink-3); }
.flight-switch button.on b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(var(--orange-rgb), .16); }

/* popovers */
.pop {
  position: absolute; z-index: 40; background: var(--sheet); border-radius: 14px; padding: 12px;
  box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -16px rgba(var(--shadow-rgb), .35);
}
.pop-title { font-size: 12px; color: var(--ink-3); font-weight: 600; margin: 0 2px 8px; }
.alerts-pop { right: 0; top: 44px; width: min(380px, calc(100vw - 32px)); padding: 0; }
.alerts-pop header { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--hair); }
.alerts-pop header span { font-size: 12px; color: var(--ink-3); }
.alerts-pop ul { max-height: 360px; overflow: auto; padding: 4px 14px; }
.alerts-pop li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.alerts-pop li:last-child { border-bottom: 0; }
.alerts-pop li p { font-size: 13px; }
.alerts-pop li small { font-size: 11.5px; color: var(--ink-3); }
.alerts-pop li.done { opacity: .5; }

.sandbox-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; margin: 0 0 14px;
  border-radius: 12px; background: var(--orange-soft); color: var(--orange-deep); box-shadow: inset 0 0 0 1px rgba(var(--orange-rgb), .25);
}
.sandbox-bar p { flex: 1; font-size: 13px; }
.sandbox-bar .btn-ghost { background: var(--sheet); }

/* ------------------------------------------------------------------ primitives */
.card { position: relative; background: var(--sheet); border-radius: var(--r-card); padding: 18px 20px 18px; min-width: 0; box-shadow: 0 0 0 1px var(--hair); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 14.5px; font-weight: 640; letter-spacing: -.003em; }
.sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
p.sub.inst { font-size: 12px; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 4px 6px; border-radius: 8px; }
.link-btn .i { width: 16px; height: 16px; }
.link-btn:hover { color: var(--ink); background: var(--well); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); white-space: nowrap; transition: background-color .15s;
}
.btn-ghost:hover { background: var(--well); }
.btn-ghost:disabled { opacity: .4; cursor: default; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: var(--ink); color: var(--sheet);
}
.btn-primary .i { width: 14px; height: 14px; color: var(--orange); }
.btn-primary:hover { background: var(--ink-hover); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 580; white-space: nowrap; line-height: 1.35;
  color: var(--ink-2); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-good { color: var(--good); background: var(--good-soft); box-shadow: inset 0 0 0 1px rgba(var(--good-rgb), .2); }
.pill-caution { color: var(--caution); background: var(--caution-soft); box-shadow: inset 0 0 0 1px rgba(var(--caution-rgb), .22); }
.pill-warning { color: var(--warning); background: var(--warning-soft); box-shadow: inset 0 0 0 1px rgba(var(--warning-rgb), .2); }
.pill-live { color: var(--ink); background: var(--orange-soft); box-shadow: inset 0 0 0 1px rgba(var(--orange-rgb), .3); }
.pill-live-soft { color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), .2); }
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--orange); opacity: 0; animation: ping 2s ease-out infinite; }
.live-dot.good { background: var(--good); }
.live-dot.good::after { border-color: var(--good); }
@keyframes ping { 0% { transform: scale(.4); opacity: .7; } 80%, 100% { transform: scale(1.4); opacity: 0; } }

.annun {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 650; font-stretch: 108%;
  color: var(--ink-3); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); white-space: nowrap;
}
.annun-scram { color: var(--violet); background: var(--violet-soft); box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), .28); }
.annun-ab { color: var(--orange-ink); background: var(--orange-soft); box-shadow: inset 0 0 0 1px rgba(var(--orange-rgb), .3); }
.annun-dry { color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), .25); }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; font-weight: 560; color: var(--ink-3); padding: 0 8px 9px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.table td { padding: 11px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table b { font-weight: 640; }
.table small { font-size: 12px; }
.table tbody tr[tabindex] { cursor: pointer; }
.table tbody tr[tabindex]:hover td { background: rgba(var(--ink-rgb), .028); }
.table tbody tr.sel td { background: var(--well); }
.table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-3); margin-top: 12px; }
.legend.inline { margin-top: 2px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 18px; height: 0; border-top: 2px solid var(--ink); }
.lg-line.flown { border-color: var(--magenta); }
.lg-line.plan { border-top-style: dashed; border-color: var(--magenta); }
.lg-line.other { border-top-style: dashed; border-color: var(--ink-3); }
.lg-line.dash { border-top-style: dashed; border-color: var(--ink-3); }
.lg-hatch { width: 14px; height: 10px; border-radius: 2px; background: repeating-linear-gradient(-45deg, rgba(var(--cyan-rgb), .5) 0 1.4px, transparent 1.4px 4px); box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), .35); }
.lg-night { width: 14px; height: 10px; border-radius: 2px; background: var(--night-swatch); }
.lg-now { width: 2px; height: 12px; background: var(--orange); }
.lg-fix { width: 0; height: 0; border: 5px solid transparent; border-bottom: 8px solid var(--magenta); border-top: 0; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; }
.lg-dot.live { background: var(--orange); } .lg-dot.good { background: var(--good); } .lg-dot.caution { background: var(--caution); } .lg-dot.warning { background: var(--warning); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; user-select: none; }
.switch.row { display: flex; padding: 8px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 30px; height: 18px; border-radius: 9px; background: var(--switch-off); position: relative; transition: background-color .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(12px); }
.switch input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ------------------------------------------------------------------ overview */
.ov-top, .ov-row { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 16px; }
.ov-row { margin-top: 16px; }
.ov-top { --hero-h: clamp(560px, calc(100dvh - 104px), 820px); }
.ov-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; height: var(--hero-h); }
.adv-card { flex: 1 1 auto; min-height: 0; overflow: auto; }
.map-card { display: flex; flex-direction: column; }
.map-card .map-box { flex: 1 1 auto; min-height: 300px; height: auto; }
.dep-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 0; border-top: 1px solid var(--hair); }
.dep-list li:first-child { border-top: 0; padding-top: 0; }
.dep-main b { font-weight: 680; font-stretch: 110%; margin-right: 8px; }
.dep-main span { font-size: 13px; }
.dep-time { text-align: right; }
.dep-time b { font-weight: 620; }
.dep-time small { display: block; font-size: 11.5px; color: var(--ink-3); }
.dep-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12.5px; }

.stage {
  position: relative; height: var(--hero-h, 640px); border-radius: var(--r-stage); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 30%, var(--stage-hi), var(--stage) 70%);
  box-shadow: 0 0 0 1px var(--hair);
}
.twin-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; touch-action: none; }
.twin-canvas:active { cursor: grabbing; }
.stage.expanded { position: fixed; inset: 12px; z-index: 50; height: auto; box-shadow: 0 0 0 1px var(--hair), 0 30px 90px -20px rgba(var(--shadow-rgb), .45); }
body.stage-open .rail, body.stage-open .topbar { visibility: hidden; }
.st-loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; z-index: 3;
  font-size: 13px; color: var(--ink-3); background: var(--stage); transition: opacity .5s; text-align: center; padding: 24px;
}
.st-loading span { width: 120px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--ink-3), transparent) 0 0 / 50% 100% no-repeat, var(--rule); animation: load 1.1s linear infinite; }
@keyframes load { from { background-position: -60px 0, 0 0; } to { background-position: 180px 0, 0 0; } }
.st-loading.hide { opacity: 0; pointer-events: none; }

.glass, .st-views, .lever, .tool-group, .mode-chip, .st-hint, .st-read {
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), .07), var(--shadow-float);
}
.st-head { position: absolute; top: 16px; left: 18px; display: flex; align-items: center; gap: 12px; z-index: 2; pointer-events: none; }
.st-id small { display: block; font-size: 11.5px; color: var(--ink-3); }
.st-id b { font-size: 21px; font-weight: 720; font-stretch: 122%; letter-spacing: -.005em; line-height: 1.1; }
.mode-chip {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink);
}
.mode-chip .i { width: 15px; height: 15px; }
.mode-chip.live { cursor: default; }
.mode-chip.live .live-dot { background: var(--good); }
.mode-chip.live .live-dot::after { border-color: var(--good); }
.mode-chip.manual, .mode-chip.replay { background: var(--orange-soft); color: var(--orange-deep); box-shadow: 0 0 0 1px rgba(var(--orange-rgb), .3), var(--shadow-float); }
.mode-chip.manual::after, .mode-chip.replay::after { content: "Return to live"; margin-left: 4px; padding-left: 8px; border-left: 1px solid rgba(var(--orange-rgb), .25); font-weight: 500; }

.st-views { position: absolute; top: 14px; right: 14px; z-index: 2; border-radius: 12px; }
.st-views button { padding: 6px 10px; }

.st-inst { position: absolute; left: 18px; bottom: 18px; z-index: 2; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.st-mach { display: flex; align-items: baseline; gap: 8px; }
.st-mach .inst { font-size: 54px; line-height: .95; letter-spacing: -.04em; }
.st-mach small { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.st-mach[data-state="scram"] small { color: var(--violet); }
.st-mach[data-state="ab"] small { color: var(--orange-ink); }
.st-read { display: flex; gap: 0; border-radius: 12px; overflow: hidden; }
.st-read > div { padding: 8px 14px 9px; border-left: 1px solid var(--hair); }
.st-read > div:first-child { border-left: 0; }
.st-read dt { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.st-read dd { display: flex; align-items: baseline; gap: 4px; }
.st-read b { font-size: 16px; font-weight: 400; }
.st-read small { font-size: 11px; color: var(--ink-3); }
.st-warn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; background: var(--warning); color: #fff; }
.st-warn .i { width: 16px; height: 16px; }

/* power lever */
.lever { position: absolute; right: 14px; top: 64px; width: 132px; padding: 12px 12px 10px; border-radius: 16px; z-index: 2; }
.lv-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.lv-head b { font-size: 17px; color: var(--ink); font-weight: 400; }
.lv-body { display: flex; gap: 10px; height: 250px; margin: 12px 0 12px; }
.lv-scale { position: relative; width: 40px; font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.lv-scale span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.lv-scale span.ab { color: var(--orange-ink); }
.lv-track {
  position: relative; flex: 1; border-radius: 10px; cursor: ns-resize; touch-action: none;
  background: linear-gradient(90deg, var(--track-a), var(--track-b) 45%, var(--track-a));
  box-shadow: inset 0 1px 3px rgba(var(--shadow-rgb), .2), inset 0 0 0 1px rgba(var(--ink-rgb), .07);
}
.lv-ab { position: absolute; left: 0; right: 0; top: 0; height: 20%; border-radius: 10px 10px 0 0; background: repeating-linear-gradient(-45deg, rgba(var(--orange-rgb), .2) 0 3px, rgba(var(--orange-rgb), .06) 3px 7px); }
.lv-tick { position: absolute; left: 7px; right: 7px; height: 1px; background: rgba(var(--ink-rgb), .14); }
.lv-mil { position: absolute; left: -5px; right: -5px; top: 20%; height: 2px; margin-top: -1px; background: var(--ink); border-radius: 1px; }
.lv-fill { position: absolute; left: 6px; right: 6px; bottom: 6px; border-radius: 6px; background: linear-gradient(to top, rgba(var(--cyan-rgb), .1), rgba(var(--cyan-rgb), .38)); transition: background .2s; }
.lv-fill.ab { background: linear-gradient(to top, rgba(var(--cyan-rgb), .1), rgba(var(--cyan-rgb), .22) 55%, rgba(var(--orange-rgb), .45) 78%, rgba(var(--orange-rgb), .78)); }
.lv-target { position: absolute; right: -13px; width: 0; height: 0; border: 5px solid transparent; border-right: 7px solid var(--cyan); border-left: 0; transform: translateY(-50%); transition: top .4s; }
.lv-handle {
  position: absolute; left: -9px; right: -9px; height: 30px; transform: translateY(-50%); border-radius: 8px; pointer-events: none;
  background: linear-gradient(var(--handle-a), var(--handle-b));
  box-shadow: 0 7px 16px -5px rgba(var(--shadow-rgb), .5), 0 0 0 1px rgba(var(--ink-rgb), .16), inset 0 1px 0 var(--hilite-solid);
  display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 13px;
}
.lv-handle i { height: 2px; border-radius: 2px; background: rgba(var(--ink-rgb), .22); }
.lv-handle i:nth-child(2) { background: var(--orange); }
.lv-track.grab .lv-handle { box-shadow: 0 9px 20px -5px rgba(var(--shadow-rgb), .55), 0 0 0 1px rgba(var(--ink-rgb), .2), inset 0 1px 0 var(--hilite-solid); }
.lv-stages, .ab-pips { display: flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--ink-3); }
.lv-stages span, .ab-pips span { margin-right: 4px; }
.lv-stages i, .ab-pips i { flex: 1; height: 4px; min-width: 10px; border-radius: 2px; background: rgba(var(--ink-rgb), .1); transition: background-color .2s; }
.lv-stages i.on, .ab-pips i.on { background: var(--orange); }
.lv-btn {
  width: 100%; margin-top: 7px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 0; border-radius: 9px;
  font-size: 12px; font-weight: 650; color: var(--ink-2); background: var(--btn-glass); box-shadow: inset 0 0 0 1px var(--rule);
}
.lv-btn .i { width: 15px; height: 15px; }
.lv-btn:hover { color: var(--ink); background: var(--btn-hover); }
.lv-btn[aria-pressed="true"] { color: var(--ink); background: var(--btn-hover); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .3); }
.lv-athr { font-stretch: 110%; letter-spacing: .02em; }
.lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp-off); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .15); }
.lv-athr.on .lamp { background: var(--good); box-shadow: 0 0 0 3px rgba(var(--good-rgb), .16); }

.st-tools { position: absolute; right: 14px; bottom: 14px; z-index: 2; display: flex; gap: 8px; }
.tool-group { display: flex; border-radius: 12px; padding: 3px; gap: 2px; }
.tool-group button { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); }
.tool-group button .i { width: 18px; height: 18px; }
.tool-group button:hover { background: rgba(var(--ink-rgb), .06); color: var(--ink); }
.tool-group button[aria-pressed="true"], .tool-group button[aria-expanded="true"] { background: var(--ink); color: var(--sheet); }
.tool-group .z-val { width: 52px; font-size: 12px; color: var(--ink); }
.layers-pop { right: 0; bottom: 48px; width: 196px; display: grid; gap: 4px; }
.layers-pop .switch { padding: 6px 2px; }
.st-toast {
  position: absolute; left: 50%; top: 18px; z-index: 3; transform: translate(-50%, -6px); opacity: 0; pointer-events: none;
  padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--sheet); font-size: 12.5px; font-weight: 600;
  transition: opacity .2s, transform .2s;
}
.st-toast.on { opacity: 1; transform: translate(-50%, 0); }
.st-hint {
  position: absolute; right: 14px; bottom: 62px; z-index: 1; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; color: var(--ink-2); pointer-events: none; transition: opacity .6s; white-space: nowrap;
}
.st-hint.gone { opacity: 0; }

/* flight card */
.fc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fc-head h2 { font-size: 25px; font-weight: 720; font-stretch: 122%; letter-spacing: -.01em; line-height: 1.1; }
.fc-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.fc-route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 20px 0 10px; }
.fc-apt b { display: block; font-size: 22px; font-weight: 700; font-stretch: 118%; line-height: 1; }
.fc-apt span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.fc-apt.r { text-align: right; }
.fc-line { position: relative; height: 2px; margin-top: -14px; background: repeating-linear-gradient(90deg, var(--magenta) 0 5px, transparent 5px 10px); opacity: .9; }
.fc-flown { position: absolute; left: 0; top: 0; height: 2px; background: var(--magenta); transition: width 1s linear; }
.fc-tick { position: absolute; top: -4px; width: 1.5px; height: 10px; background: rgba(var(--ink-rgb), .3); border-radius: 1px; }
.fc-ac { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; display: grid; place-items: center; color: var(--orange); background: var(--sheet); border-radius: 50%; transition: left 1s linear; z-index: 1; }
.fc-ac .i { transform: rotate(90deg); width: 20px; height: 20px; }
.fc-times { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.fc-times b { color: var(--ink); font-weight: 600; }
.fc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 18px 0 16px; padding: 14px 0 0; border-top: 1px solid var(--hair); }
.fc-grid dt { font-size: 12px; color: var(--ink-3); }
.fc-grid dd { margin-top: 1px; }
.fc-grid dd b { font-size: 18px; font-weight: 620; font-stretch: 104%; }
.fc-grid dd small { font-size: 12px; color: var(--ink-3); }
.fc-crew { position: relative; display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--hair); }
.fc-crew > div { flex: 1; min-width: 0; }
.fc-crew b { display: block; font-size: 13.5px; font-weight: 620; }
.fc-crew small { font-size: 12px; color: var(--ink-3); }
.fc-crew .icon-btn { box-shadow: inset 0 0 0 1px var(--rule); }
.msg-pop { right: 0; bottom: 46px; width: 270px; display: grid; gap: 2px; }
.msg-pop button { text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.msg-pop button:hover { background: var(--well); }

/* propulsion card */
.dials { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.dial-cell { position: relative; text-align: center; }
.dial { width: 100%; max-width: 150px; display: block; margin: 0 auto; }
.d-track { fill: none; stroke: rgba(var(--ink-rgb), .1); stroke-width: 6; stroke-linecap: round; }
.d-amber { fill: none; stroke: rgba(var(--caution-rgb), .35); stroke-width: 6; }
.d-red { stroke: var(--warning); stroke-width: 2.4; stroke-linecap: round; }
.d-tick { stroke: var(--ink-3); stroke-width: 1; }
.d-fill { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; transition: stroke .2s; }
.d-needle { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.d-hub { fill: var(--ink); }
.dial-cell[data-state="amber"] .d-fill { stroke: var(--caution); }
.dial-cell[data-state="red"] .d-fill { stroke: var(--warning); }
.d-read {
  position: absolute; left: 50%; top: 0; margin-top: 50%; transform: translate(-50%, 4px);
  display: flex; align-items: baseline; gap: 2px; padding: 1px 6px; border-radius: 5px; background: var(--sheet);
  box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .22);
}
.d-read b { font-size: 13.5px; font-weight: 400; }
.d-read small { font-size: 10px; color: var(--ink-3); }
.dial-cell[data-state="amber"] .d-read { color: var(--caution); box-shadow: inset 0 0 0 1px var(--caution); }
.dial-cell[data-state="red"] .d-read { color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning); }
.d-label { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.prop-rows { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
.prop-rows > div { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; }
.prop-rows dt { font-size: 12.5px; color: var(--ink-2); }
.prop-rows dd { display: flex; align-items: center; gap: 10px; }
.prop-rows b { font-size: 12.5px; font-weight: 600; min-width: 64px; text-align: right; }
.meter { flex: 1; height: 5px; border-radius: 3px; background: var(--well); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .05); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--ink); transition: width .25s; }

/* map */
.map-box { position: relative; height: 300px; border-radius: 12px; overflow: hidden; background: var(--map-space); box-shadow: inset 0 0 0 1px var(--hair); }
.map-box.big { height: 540px; }
.map-box.wide { height: 360px; }
.map-box.map-failed::after { content: "The map could not load. Check your connection and reload."; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--ink-3); }
.map-svg { display: block; position: absolute; inset: 0; touch-action: pan-x pan-y; cursor: grab; }
.map-svg:active { cursor: grabbing; }
.map-svg path, .map-svg line { vector-effect: non-scaling-stroke; }
.m-outline { fill: none; stroke: rgba(var(--ink-rgb), .12); }
.m-grat { fill: none; stroke: var(--map-grat); stroke-width: .6; }
.m-glow { fill: none; stroke: var(--map-glow); stroke-width: 5; stroke-linejoin: round; }
.m-c { fill: var(--map-land); stroke: none; transition: filter .15s; }
.m-c.t-0 { fill: var(--map-t0); } .m-c.t-1 { fill: var(--map-t1); } .m-c.t-2 { fill: var(--map-t2); }
.m-c.t-3 { fill: var(--map-t3); } .m-c.t-4 { fill: var(--map-t4); } .m-c.t-5 { fill: var(--map-t5); } .m-c.t-ice { fill: var(--map-ice); }
@media (hover: hover) { .m-c:hover { filter: brightness(.94) saturate(1.25); } }
:root[data-appearance="dark"] .m-c:hover { filter: brightness(1.25); }
.m-lakes { fill: var(--map-ocean); stroke: var(--map-coast); stroke-width: .5; }
.m-rivers { fill: none; stroke: var(--map-river); stroke-width: .8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.m-admin { fill: none; stroke: var(--map-admin); stroke-width: .9; stroke-dasharray: 4 3; display: none; }
.map-svg.z-admin .m-admin { display: inline; }
.m-borders { fill: none; stroke: var(--map-border); stroke-width: .75; stroke-linejoin: round; }
.m-coast { fill: none; stroke: var(--map-coast); stroke-width: .8; stroke-linejoin: round; }
.m-night path { fill: var(--map-night); }
.m-geo-labels { pointer-events: none; }
.m-cl text { font: 650 9px var(--f-ui); font-stretch: 112%; letter-spacing: .1em; fill: var(--map-label); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--map-label-halo); stroke-width: 2.4px; stroke-linejoin: round; }
.m-cl.s2 text { font-size: 10.5px; letter-spacing: .14em; }
.m-cl.s3 text { font-size: 12px; letter-spacing: .2em; }
.m-sub text { font: 600 8.5px var(--f-ui); letter-spacing: .14em; fill: var(--map-label); fill-opacity: .72; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--map-label-halo); stroke-width: 2.2px; stroke-linejoin: round; }
.m-sea text { font: italic 500 10.5px var(--f-ui); letter-spacing: .1em; fill: var(--map-sea-label); text-anchor: middle; dominant-baseline: central; }
.m-city circle { fill: var(--map-city); stroke: var(--map-label-halo); stroke-width: 1.2; }
.m-city text { font: 550 9.5px var(--f-ui); fill: var(--map-city); paint-order: stroke; stroke: var(--map-label-halo); stroke-width: 2.6px; stroke-linejoin: round; }
.m-corridor { stroke: rgba(var(--cyan-rgb), .55); stroke-width: .9; }
.m-hatch { fill: rgba(var(--cyan-rgb), .5); }
.m-route-plan { fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 3 4; opacity: .75; }
.m-route-plan.sel { stroke: var(--magenta); stroke-width: 2; stroke-dasharray: 5 5; opacity: .9; }
.m-route-flown { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.m-route-flown.sel { stroke: var(--magenta); stroke-width: 2.8; }
.m-fix path { fill: var(--sheet); stroke: var(--magenta); stroke-width: 1.2; }
.m-fix rect { fill: var(--magenta); }
.m-fix text { font: 9.5px var(--f-inst); fill: var(--ink-2); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; }
.m-apt circle { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.4; }
.m-apt.main circle { fill: var(--ink); stroke: var(--sheet); stroke-width: 1.6; }
.m-apt text { font: 650 10.5px var(--f-ui); font-stretch: 110%; fill: var(--ink); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; }
.m-ac-glyph { fill: var(--ink-2); stroke: var(--sheet); stroke-width: 1.2; }
.m-ac.sel .m-ac-glyph { fill: var(--orange); }
.m-ac-halo { fill: rgba(var(--orange-rgb), .18); animation: halo 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.m-leader { stroke: var(--ink-3); stroke-width: .8; fill: none; }
.m-block { font: 9.5px var(--f-inst); fill: var(--ink); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; }
.m-ac:not(.sel) .m-block { fill: var(--ink-2); }
.m-gnd circle { stroke: var(--sheet); stroke-width: 1.4; }
.m-gnd.tone-good circle { fill: var(--good); } .m-gnd.tone-caution circle { fill: var(--caution); } .m-gnd.tone-warning circle { fill: var(--warning); }
.m-gnd text { font: 9.5px var(--f-inst); fill: var(--ink); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; }
.map-zoom { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 11px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 1px rgba(var(--ink-rgb), .07), var(--shadow-float); }
.map-zoom button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); }
.map-zoom button:hover { background: rgba(var(--ink-rgb), .06); color: var(--ink); }
.map-zoom .i { width: 17px; height: 17px; }
.map-hint { position: absolute; left: 12px; bottom: 12px; z-index: 2; font-size: 11.5px; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; }
.map-hint.fades { transition: opacity .6s; }
.map-hint.gone { opacity: 0; }
.map-hint .touch { display: none; }
@media (hover: none) and (pointer: coarse) { .map-hint .fine { display: none; } .map-hint .touch { display: inline; } }
.map-note {
  position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%) scale(.96); opacity: 0; pointer-events: none;
  padding: 8px 14px; border-radius: 999px; background: rgba(21, 24, 27, .78); color: #f1f2ef; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: opacity .2s, transform .2s;
}
.map-note.on { opacity: 1; transform: translate(-50%, -50%); }
.lg-sea { width: 14px; height: 10px; border-radius: 2px; background: linear-gradient(135deg, var(--map-ocean), var(--map-ocean-deep)); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .08); }
.lg-land { width: 14px; height: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--map-t0) 0 33%, var(--map-t1) 33% 66%, var(--map-t2) 66%); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .08); }

/* charts */
.chart { display: block; width: 100%; height: 100%; overflow: visible; }
.profile-box { height: 300px; }
.chart .grid { stroke: rgba(var(--ink-rgb), .07); }
.chart .ax { font: 10.5px var(--f-ui); font-variant-numeric: tabular-nums; fill: var(--ink-3); }
.chart .ax-title { font: 600 11px var(--f-ui); fill: var(--ink-2); }
.chart .tick { stroke: var(--ink-3); }
.chart .ph-sep { stroke: rgba(var(--ink-rgb), .1); stroke-dasharray: 2 3; }
.chart .ph-label { font: 500 10.5px var(--f-ui); fill: var(--ink-3); }
.chart .ph-label.on { fill: var(--ink); font-weight: 650; }
.chart .area { fill: rgba(var(--ink-rgb), .055); }
.chart .planned { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .flown { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart .now { stroke: var(--orange); stroke-width: 1.5; }
.chart .now-dot { fill: var(--orange); stroke: var(--sheet); stroke-width: 2; }
.chart .cross { stroke: var(--ink-2); stroke-width: .8; stroke-dasharray: 2 2; }
.chart .hover-dot { fill: var(--sheet); stroke: var(--ink); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .s-area { fill-opacity: .07; }
.chart .s-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .s-end { fill: var(--sheet); stroke-width: 2; }
.chart .bar { fill: rgba(var(--ink-rgb), .2); }
.chart .bar.last { fill: var(--ink); }
.chart .route-plan { fill: none; stroke: var(--magenta); stroke-width: 1.6; stroke-dasharray: 5 5; opacity: .75; }
.chart .route-flown { fill: none; stroke: var(--magenta); stroke-width: 2.4; }
.fp-vsd .chart .area { fill: rgba(var(--magenta-rgb), .06); }
.chart .v-fix { stroke: rgba(var(--magenta-rgb), .25); stroke-dasharray: 2 3; }
.chart .v-fix-label { font: 9.5px var(--f-inst); fill: var(--ink-2); }
.chart .v-fix-label.apt { font: 700 11px var(--f-ui); fill: var(--ink); }
.gantt .g-wkend { fill: rgba(var(--ink-rgb), .028); }
.gantt .g-row { font: 650 12px var(--f-ui); font-stretch: 108%; fill: var(--ink); }
.gantt .g-item { cursor: pointer; }
.gantt .g-item:hover rect, .gantt .g-item:focus rect { filter: brightness(.94); }
.gantt .g-label { font: 600 11px var(--f-ui); fill: var(--bar-label-a); pointer-events: none; }
.gantt .g-item[data-type="hsi"] .g-label, .gantt .g-item[data-type="tps"] .g-label { fill: var(--bar-label-b); }
.gantt .now { stroke: var(--orange); stroke-width: 1.5; }
.gantt .now-label { font: 650 10.5px var(--f-ui); fill: var(--orange-ink); }

.tip {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; max-width: 260px;
  background: var(--tip-bg); color: var(--tip-fg); padding: 8px 10px; border-radius: 9px; font-size: 12px; line-height: 1.4;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
}
.tip b { display: block; font-size: 12.5px; font-weight: 650; }
.tip > span { display: block; color: rgba(var(--tip-fg-rgb), .7); }
.tip dl { display: grid; grid-template-columns: auto auto; gap: 1px 14px; margin-top: 5px; }
.tip dt { color: rgba(var(--tip-fg-rgb), .65); }
.tip dd { text-align: right; font-variant-numeric: tabular-nums; }

/* departures + advisories */
.dep-card .table td small { margin-left: 2px; }
.adv-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--hair); }
.adv-list li:first-child { border-top: 0; padding-top: 2px; }
.adv-body p { font-size: 13.5px; }
.adv-body small { font-size: 12px; color: var(--ink-3); }
.adv-body small b { color: var(--ink-2); font-weight: 600; }
.adv.done { opacity: .55; }
.adv-ack { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.adv-ack .i { width: 15px; height: 15px; }
.sev { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; }
.sev .i { width: 17px; height: 17px; }
.sev-caution { color: var(--caution); background: var(--caution-soft); }
.sev-advisory { color: var(--cyan); background: var(--cyan-soft); }
.sev-info { color: var(--ink-3); background: var(--well); }

/* ------------------------------------------------------------------ telemetry */
.pfd-strip { display: grid; grid-template-columns: 1.25fr repeat(5, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.pfd-cell { padding: 14px 18px 15px; border-left: 1px solid var(--hair); display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.pfd-cell:first-child { border-left: 0; }
.pfd-cell > span:first-child { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.pfd-cell b { font-size: 24px; font-weight: 400; line-height: 1.1; white-space: nowrap; }
.pfd-cell small { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.pfd-cell.main b { font-size: 36px; letter-spacing: -.03em; }
.pfd-cell .annun { align-self: flex-start; }
.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.eng-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.eng-col + .eng-col { padding-left: 22px; border-left: 1px solid var(--hair); }
.eng-col h3 { font-size: 13px; font-weight: 640; margin-bottom: 6px; }
.eng-dials { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eng-list { margin-top: 12px; }
.eng-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--hair); font-size: 12.5px; }
.eng-list dt { color: var(--ink-3); }
.eng-list dd { color: var(--ink-2); white-space: nowrap; }
.eng-list dd b { color: var(--ink); font-weight: 620; }
.eng-list > div[data-state="caution"] dd, .eng-list > div[data-state="caution"] dd b { color: var(--caution); }
.eng-list > div[data-state="warning"] dd, .eng-list > div[data-state="warning"] dd b { color: var(--warning); }
.ab-pips { width: 140px; margin-top: 4px; }
.streams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.stream-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.stream-head span { font-size: 12.5px; color: var(--ink-2); font-weight: 560; }
.stream-head b { font-size: 13.5px; font-weight: 400; }
.stream-box { height: 132px; }
.thermal { position: relative; height: 300px; }
.thermal canvas { position: absolute; inset: 0; }
.therm-callouts { position: absolute; inset: 0; pointer-events: none; }
.callout { position: absolute; width: 0; height: 0; }
.callout i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--sheet); box-shadow: 0 0 0 1.5px var(--ink); }
.callout span {
  position: absolute; left: 0; white-space: nowrap; font-size: 11px; color: var(--ink-2); padding: 4px 8px 5px; border-radius: 8px;
  background: var(--callout-bg); box-shadow: 0 0 0 1px var(--hair), 0 6px 14px -8px rgba(var(--shadow-rgb), .35);
}
.callout span b { font-size: 13px; color: var(--ink); font-weight: 400; }
.callout span small { display: block; font-size: 10.5px; color: var(--ink-3); }
.callout.above span { transform: translate(-50%, calc(-100% - 10px)); }
.callout.below span { transform: translate(-50%, 10px); }
.ramp-legend { position: relative; margin-top: 12px; padding-bottom: 18px; }
.ramp-bar { display: block; height: 8px; border-radius: 4px; background: var(--ramp); box-shadow: inset 0 0 0 1px var(--hair); }
.ramp-ticks span { position: absolute; top: 12px; transform: translateX(-50%); font: 10.5px var(--f-inst); color: var(--ink-3); }
.ramp-ticks span:first-child { transform: none; }
.ramp-ticks span:nth-last-child(2) { transform: translateX(-100%); }
.ramp-ticks span.u { left: auto !important; right: 0; top: -20px; transform: none; font-family: var(--f-ui); }
.sys-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sys { padding: 12px 12px 13px; border-radius: 12px; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); min-width: 0; }
.sys b { display: block; font-size: 13px; font-weight: 620; margin-top: 6px; }
.sys small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.sys-state { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; color: var(--good); }
.sys-state .i { width: 14px; height: 14px; }
.sys-caution { background: var(--caution-soft); box-shadow: inset 0 0 0 1px rgba(var(--caution-rgb), .25); }
.sys-caution .sys-state { color: var(--caution); }
.sys-warning { background: var(--warning-soft); box-shadow: inset 0 0 0 1px rgba(var(--warning-rgb), .25); }
.sys-warning .sys-state { color: var(--warning); }

/* ------------------------------------------------------------------ flight plan */
.fp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; grid-template-areas: "map legs" "vsd legs"; gap: 16px; }
.fp-map { grid-area: map; } .fp-legs { grid-area: legs; } .fp-vsd { grid-area: vsd; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 560; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); transition: background-color .15s, color .15s; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--sheet); box-shadow: none; }
.fp-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--hair); }
.fp-sum dt { font-size: 12px; color: var(--ink-3); }
.fp-sum dd { font-size: 13.5px; font-weight: 600; margin-top: 1px; }
.legs td { padding: 9px 8px; }
.legs tr.passed td { color: var(--ink-3); }
.legs tr.next td { background: var(--magenta-soft); }
.legs tr.next td:first-child { box-shadow: inset 3px 0 0 var(--magenta); }
.fix-name { display: inline-flex; align-items: center; gap: 5px; font: 12.5px var(--f-inst); }
.fix-name .i { width: 14px; height: 14px; color: var(--good); }
.fix-name.airport { font: 700 13px var(--f-ui); font-stretch: 112%; }
.fix-name.event { color: var(--magenta); }
.legs tr.passed .fix-name.event { color: var(--ink-3); }
.vsd-box { height: 230px; }

/* ------------------------------------------------------------------ fleet */
.fl-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.ac-cell { display: inline-flex; align-items: center; gap: 9px; }
.ac-cell b { font-stretch: 112%; }
.mini-pf { width: 20px; height: 20px; }
.mini-pf path { fill: var(--ink-2); }
.fd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fd-head h2 { font-size: 30px; font-weight: 720; font-stretch: 122%; letter-spacing: -.01em; line-height: 1.05; }
.fd-body { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 18px; margin-top: 16px; }
.fd-drawing { background: var(--well); border-radius: 12px; padding: 10px 6px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--hair); }
.planform { width: 100%; max-width: 220px; height: auto; display: block; }
.pf-body { fill: var(--ink); }
.pf-reg { font: 700 9px var(--f-inst); fill: var(--sheet); fill-opacity: .8; letter-spacing: .14em; }
.dim path { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.dim text { font: 10px var(--f-inst); fill: var(--ink-2); }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.spec dt { font-size: 12px; color: var(--ink-3); }
.spec dd { font-size: 15px; font-weight: 620; margin-top: 1px; }
.fd-util { margin-top: 16px; }
.fd-util-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-2); font-weight: 560; }
.fd-util-head small { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.bars-box { height: 118px; margin-top: 6px; }
.fd-checks { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.fd-checks h3 { font-size: 13px; font-weight: 640; margin-bottom: 4px; }
.fd-checks li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.fd-checks li:last-child { border-bottom: 0; }
.fd-checks li b { font-weight: 600; flex: 1; }
.fd-checks li span { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ------------------------------------------------------------------ maintenance + logbook */
.mx-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.mx-summary > div { padding: 16px 20px 17px; border-left: 1px solid var(--hair); min-width: 0; }
.mx-summary > div:first-child { border-left: 0; }
.mx-summary b { display: block; font-size: 30px; font-weight: 650; font-stretch: 116%; letter-spacing: -.02em; line-height: 1.05; }
.mx-summary b small { font-size: 15px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.mx-summary span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.mx-gantt { margin-top: 16px; }
.gantt-box { width: 100%; }
.mx-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.tail-seg { max-width: 100%; overflow-x: auto; margin-bottom: 8px; }
.life-list li { padding: 11px 0; border-bottom: 1px solid var(--hair); }
.life-list li:last-child { border-bottom: 0; }
.life-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.life-top b { font-weight: 600; }
.life-top span { font-family: var(--f-inst); font-size: 13px; }
.life-bar { position: relative; height: 6px; border-radius: 3px; background: var(--well); margin: 7px 0 5px; box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), .05); }
.life-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--good); }
.life-bar em { position: absolute; top: -3px; bottom: -3px; width: 1px; background: rgba(var(--ink-rgb), .25); }
.life-caution .life-bar i { background: var(--caution); }
.life-warning .life-bar i { background: var(--warning); }
.life-warning .life-top span { color: var(--warning); }
.life-list small { font-size: 12px; color: var(--ink-3); }
.wo-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.wo-list li:last-child { border-bottom: 0; }
.wo-id { font: 11.5px var(--f-inst); color: var(--ink-3); margin-right: 6px; }
.wo-main b { font-size: 13.5px; font-weight: 600; }
.wo-main small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.wo-tags { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }

.lb-card { margin-top: 16px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; }
.tabs button { padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 560; color: var(--ink-2); white-space: nowrap; }
.tabs button:hover { background: var(--well); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--sheet); }
.tabs .count { margin-left: 6px; font: 11.5px var(--f-inst); opacity: .65; }
.lb-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.search, .select { position: relative; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink-3); }
.search:focus-within, .select:focus-within { box-shadow: inset 0 0 0 1.5px var(--cyan); }
.search .i, .select .i { width: 16px; height: 16px; }
.search input { border: 0; outline: 0; background: transparent; width: 220px; max-width: 46vw; font-size: 13px; color: var(--ink); }
.select select { appearance: none; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); padding-right: 18px; cursor: pointer; }
.select .i { position: absolute; right: 8px; pointer-events: none; }
.lb-table th.sortable { padding: 0; }
.lb-table th.sortable button { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 9px; font-weight: 560; color: inherit; }
.lb-table th.num.sortable button { flex-direction: row-reverse; }
.lb-table th.sortable .i { width: 13px; height: 13px; opacity: .45; }
.lb-table th[aria-sort="ascending"], .lb-table th[aria-sort="descending"] { color: var(--ink); }
.route-cell { display: inline-flex; align-items: center; gap: 6px; }
.route-cell .muted { font-size: 12px; margin-right: 2px; }
.route-cell .i { width: 14px; height: 14px; color: var(--ink-3); }
.lb-table tr.empty td { text-align: center; padding: 34px 8px; color: var(--ink-3); white-space: normal; }
.lb-table tr.empty b { color: var(--ink); }
.lb-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.pager { display: flex; gap: 6px; }

/* ------------------------------------------------------------------ sheet */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(var(--ink-rgb), 0); transition: background-color .2s; }
.sheet.open { background: var(--scrim); }
.sheet-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--sheet); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); box-shadow: -20px 0 50px -20px rgba(var(--shadow-rgb), .35);
}
.sheet-panel.wide { width: min(580px, 100%); }
.sheet.open .sheet-panel { transform: none; }
.sheet-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 14px; border-bottom: 1px solid var(--hair); }
.sheet-panel > header h2 { font-size: 18px; font-weight: 680; font-stretch: 112%; }
.sheet-body { padding: 18px 20px 28px; overflow: auto; flex: 1; }
.set-group + .set-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair); }
.set-group h3 { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.set-me { display: flex; align-items: center; gap: 10px; }
.set-me b { display: block; font-size: 13.5px; }
.set-me small { font-size: 12px; color: var(--ink-3); }
.keys { margin-top: 14px; }
.keys > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.keys dt { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.keys dt span { font-size: 11.5px; color: var(--ink-3); }
.keys dd { color: var(--ink-2); text-align: right; }
kbd { font: 600 11.5px var(--f-ui); min-width: 22px; padding: 2px 6px; border-radius: 6px; text-align: center; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule), 0 1px 0 var(--rule); }
.fd-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.fd-route b { display: block; font-size: 28px; font-weight: 720; font-stretch: 120%; line-height: 1; }
.fd-route span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.fd-route > div:last-child { text-align: right; }
.fd-route .i { color: var(--magenta); }
.note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-top: 14px; }
.note .i { width: 17px; height: 17px; }
.note.caution { background: var(--caution-soft); color: var(--caution-deep); }
.note.warning { background: var(--warning-soft); color: var(--warning-deep); }
.sheet-map { position: relative; height: 230px; border-radius: 12px; overflow: hidden; margin: 16px 0; background: var(--map-space); box-shadow: inset 0 0 0 1px var(--hair); }
.spec.cols { grid-template-columns: 1fr 1fr; }
.spec.cols dd { font-size: 14px; }
.sheet-crew { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.sheet-crew b { display: block; font-size: 13.5px; }
.sheet-crew small { font-size: 12px; color: var(--ink-3); }
.sheet-h { font-size: 13px; font-weight: 640; margin: 18px 0 8px; }
.sheet-profile { height: 210px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--tip-bg); color: var(--tip-fg); font-size: 13px; box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .5); animation: tin .22s ease-out; transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
.toast .i { width: 17px; height: 17px; color: #9fd0e2; }
.toast-good .i { color: #84d9a6; }
.toast-warning .i { color: #ffb19b; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .ov-top { grid-template-columns: 1fr; --hero-h: clamp(520px, 72vh, 700px); }
  .ov-side { display: grid; grid-template-columns: 1fr 1fr; height: auto; }
  .adv-card { max-height: none; }
  .fp-grid { grid-template-columns: 1fr; grid-template-areas: "map" "legs" "vsd"; }
  .tm-grid { grid-template-columns: 1fr; }
  .sys-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .topbar { flex-wrap: wrap; }
  .tb-tools { width: 100%; justify-content: flex-start; }
  .ov-row, .fl-grid, .mx-grid { grid-template-columns: 1fr; }
  .pfd-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pfd-cell:nth-child(4) { border-left: 0; }
  .pfd-cell:nth-child(n+4) { border-top: 1px solid var(--hair); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: center;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--sheet) 94%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 -1px 0 var(--hair);
  }
  .brand, .rail-foot .nav-item:last-child { display: none; }
  .rail-nav, .rail-foot { flex-direction: row; margin: 0; }
  .nav-item { width: auto; min-width: 50px; padding: 6px 4px; font-size: 9.5px; }
  .nav-item span { max-width: 56px; }
  .nav-item.on::before { left: 50%; top: -6px; width: 18px; height: 3px; transform: translateX(-50%); }
  .main { padding: 0 16px 96px; }
  .tb-title h1 { font-size: 20px; }
  .link-status { display: none; }
  .flight-switch { order: 5; width: 100%; overflow-x: auto; }
  .ov-side { grid-template-columns: 1fr; }
  .ov-top { --hero-h: 560px; }
  .stage { border-radius: 18px; }
  .st-views { top: auto; bottom: 64px; left: 12px; right: 12px; overflow-x: auto; justify-content: flex-start; }
  .st-inst { left: 14px; bottom: auto; top: 76px; }
  .st-mach .inst { font-size: 38px; }
  .st-read > div:nth-child(n+2) { display: none; }
  .topbar { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .lever { top: 66px; right: 10px; width: 96px; padding: 9px; }
  .lv-body { height: 150px; margin: 8px 0 10px; }
  .lv-scale { display: none; }
  .lv-btn { font-size: 11px; padding: 6px 0; }
  .lv-btn .i { display: none; }
  .st-id b { font-size: 18px; }
  .st-tools { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; }
  .st-hint { display: none; }
  .mx-summary { grid-template-columns: 1fr 1fr; }
  .mx-summary > div:nth-child(3) { border-left: 0; }
  .mx-summary > div:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .streams, .eng-cols { grid-template-columns: 1fr; }
  .eng-col + .eng-col { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--hair); }
  .sys-grid { grid-template-columns: 1fr 1fr; }
  .fd-body { grid-template-columns: 1fr; }
  .map-box.big { height: 420px; }
  .card { padding: 16px; }
  .pfd-strip { grid-template-columns: 1fr 1fr; }
  .pfd-cell:nth-child(n) { border-left: 0; border-top: 1px solid var(--hair); }
  .pfd-cell:nth-child(even) { border-left: 1px solid var(--hair); }
  .pfd-cell:nth-child(-n+2) { border-top: 0; }
  .search input { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ================================================================== dark theme
   Cockpit-dark rather than inverted: graphite panels, brighter avionics colours, additive glow in the 3D. */
:root[data-appearance="dark"] {
  color-scheme: dark;
  --paper: #0d0f11; --sheet: #15181b; --well: #1c2024; --raised: #2a2f35;
  --ink: #e9ebe8; --ink-2: #b2b8bd; --ink-3: #80888f; --rule: #2c3136; --hair: rgba(233, 235, 232, .08);
  --ink-rgb: 233, 235, 232; --shadow-rgb: 0, 0, 0;
  --orange: #ff5a14; --orange-ink: #ff7d45; --orange-soft: rgba(255, 90, 20, .15); --orange-rgb: 255, 90, 20; --orange-deep: #ffb592;
  --magenta: #e451b6; --magenta-soft: rgba(228, 81, 182, .13); --magenta-rgb: 228, 81, 182;
  --cyan: #43b9e0; --cyan-soft: rgba(67, 185, 224, .13); --cyan-rgb: 67, 185, 224;
  --violet: #a184ff; --violet-soft: rgba(161, 132, 255, .15); --violet-rgb: 161, 132, 255;
  --good: #3fc57d; --good-soft: rgba(63, 197, 125, .13); --good-rgb: 63, 197, 125;
  --caution: #e9b23c; --caution-soft: rgba(233, 178, 60, .13); --caution-rgb: 233, 178, 60; --caution-deep: #f3cf7e;
  --warning: #ff5f70; --warning-soft: rgba(255, 95, 112, .13); --warning-rgb: 255, 95, 112; --warning-deep: #ffa3ad;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #9085e9;
  --stage: #0b0c0e; --stage-hi: #121417; --glass: rgba(21, 24, 27, .74);
  --hilite: rgba(255, 255, 255, .04); --hilite-solid: rgba(255, 255, 255, .1);
  --avatar: #262b30; --ink-hover: #ffffff;
  --map-space: #0a0f15; --map-ocean: #10283b; --map-ocean-deep: #0a1828; --map-grat: rgba(140, 190, 230, .09);
  --map-land: #2c3328; --map-t0: #3a3527; --map-t1: #29392d; --map-t2: #3d2d2f; --map-t3: #302e43; --map-t4: #24393a; --map-t5: #3b3229; --map-ice: #46505a;
  --map-border: rgba(232, 222, 200, .26); --map-coast: rgba(120, 184, 228, .5); --map-glow: rgba(96, 160, 210, .14);
  --map-river: #2f6690; --map-admin: rgba(232, 222, 200, .3);
  --map-label: rgba(236, 230, 214, .6); --map-sea-label: rgba(128, 184, 224, .58); --map-city: #dfe3e6; --map-label-halo: rgba(12, 18, 26, .8);
  --map-halo: rgba(12, 18, 26, .86);
  --map-night: rgba(0, 0, 0, .2); --night-swatch: rgba(0, 0, 0, .5);
  --switch-off: #3a4046; --knob: #e9ebe8;
  --track-a: #1a1e22; --track-b: #23282d; --handle-a: #4a5056; --handle-b: #2c3136;
  --btn-glass: rgba(255, 255, 255, .04); --btn-hover: rgba(255, 255, 255, .09); --lamp-off: #3a4046;
  --tip-bg: #2b3035; --tip-fg: #eef0ed; --tip-fg-rgb: 238, 240, 237;
  --callout-bg: rgba(21, 24, 27, .92);
  --ramp: linear-gradient(90deg, #2a2421 0%, #5a2c14 18%, #9a3c0e 36%, #d9581a 55%, #f59a3a 73%, #ffe0a3 100%);
  --bar-label-a: #0e1012; --bar-label-b: #0e1012;
  --scrim: rgba(0, 0, 0, .55);
  --shadow-float: 0 1px 0 var(--hilite) inset, 0 12px 30px -14px rgba(0, 0, 0, .7);
}
:root[data-appearance="dark"] .stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 55% 45%, transparent 55%, rgba(0, 0, 0, .5) 100%);
}
.switch input:checked + span::after { background: var(--sheet); }

/* ================================================================== icons, nav, people */
.nav-item .i-fill { display: none; }
.nav-item.on .i-reg { display: none; }
.nav-item.on .i-fill { display: block; }
.avatar { background: var(--avatar); color: var(--ink-3); }
.avatar .i { width: 18px; height: 18px; }
b.tail { font-stretch: 112%; }
.fc-ac .i { width: 18px; height: 18px; }

/* ================================================================== advisories (bell + overview) */
.sev { width: 22px; height: 22px; border-radius: 0; background: none; }
.sev .i { width: 20px; height: 20px; }
.sev-caution, .sev-advisory, .sev-info { background: none; }
.note-row.read .sev { color: var(--ink-3); opacity: .65; }
.note-row.read p { color: var(--ink-3); }
.alerts-pop header { align-items: center; gap: 10px; }
.alerts-pop header > div { display: grid; gap: 1px; }
.alerts-pop header b { font-size: 14px; }
.alerts-pop ul { padding: 6px 8px; }
.alerts-pop li { grid-template-columns: 22px minmax(0, 1fr) 10px; gap: 10px; align-items: start; padding: 10px 8px; border-bottom: 0; border-radius: 10px; cursor: pointer; }
.alerts-pop li + li { border-top: 1px solid var(--hair); border-radius: 0 0 10px 10px; }
.alerts-pop li:hover { background: var(--well); }
.alerts-pop li.done { opacity: 1; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-top: 6px; }
.note-row.read .unread-dot { visibility: hidden; }
.link-btn:disabled { opacity: .45; cursor: default; background: none; }
.btn-ghost.sm { padding: 4px 9px; font-size: 12px; }
.adv-list li { grid-template-columns: 22px minmax(0, 1fr) auto; }
.adv.done, .adv.read { opacity: 1; }
.adv-ack { font-size: 12px; color: var(--ink-3); }

/* ================================================================== stage hint */
.st-hint { right: auto; bottom: auto; left: 50%; top: 62px; z-index: 2; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; }
.st-hint .i { width: 15px; height: 15px; }

/* ================================================================== dials (single SVG) */
.dial { max-width: 156px; }
.d-tick { stroke: rgba(var(--ink-rgb), .35); stroke-width: 1; }
.d-amber { fill: none; stroke: var(--caution); stroke-width: 2.5; stroke-linecap: butt; }
.d-red { stroke: var(--warning); stroke-width: 2.6; stroke-linecap: round; }
.d-box { fill: var(--sheet); stroke: rgba(var(--ink-rgb), .25); stroke-width: 1; }
.d-val { font: 13px var(--f-inst); fill: var(--ink); }
.d-unit { font-size: 8.5px; fill: var(--ink-3); }
svg .d-label { font: 10px var(--f-ui); fill: var(--ink-3); }
.dial-cell[data-state="amber"] .d-box { stroke: var(--caution); }
.dial-cell[data-state="amber"] .d-val { fill: var(--caution); }
.dial-cell[data-state="red"] .d-box { stroke: var(--warning); }
.dial-cell[data-state="red"] .d-val { fill: var(--warning); }

/* ================================================================== maintenance: wear map, bullets, availability */
.mx-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.mx-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.wear { margin: 0 -8px 4px; }
.wear-map { display: block; width: 100%; height: auto; }
.wm-body { fill: var(--well); stroke: rgba(var(--ink-rgb), .45); stroke-width: 1.1; stroke-linejoin: round; }
.wm-chine { fill: none; stroke: rgba(var(--ink-rgb), .14); stroke-width: 1; }
.wz { fill: rgba(var(--ink-rgb), .07); stroke: rgba(var(--ink-rgb), .35); stroke-width: 1; transition: fill .15s, stroke-width .15s; }
.wz.under { stroke-dasharray: 3 2.5; }
.wz.line { fill: none; stroke: rgba(var(--ink-rgb), .24); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.wz-caution { fill: rgba(var(--caution-rgb), .28); stroke: var(--caution); }
.wz-warning { fill: rgba(var(--warning-rgb), .3); stroke: var(--warning); }
.wz.line.wz-caution { fill: none; stroke: var(--caution); }
.wz.line.wz-warning { fill: none; stroke: var(--warning); }
.wz.hl { stroke-width: 2; fill: rgba(var(--ink-rgb), .16); }
.wz-caution.hl { fill: rgba(var(--caution-rgb), .45); }
.wz-warning.hl { fill: rgba(var(--warning-rgb), .45); }
.wz.line.hl { fill: none; stroke-width: 6.5; }
.wm-leader { fill: none; stroke: rgba(var(--ink-rgb), .35); stroke-width: 1; }
.wm-label { font: 600 11px var(--f-ui); fill: var(--ink); }
.wm-pct { font-family: var(--f-inst); font-weight: 400; }
.wm-warning .wm-pct { fill: var(--warning); }
.wm-caution .wm-pct { fill: var(--caution); }
.wm-ok, .wm-dir { font: 11px var(--f-ui); fill: var(--ink-3); }
.bl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 38%) 82px; gap: 16px; align-items: center; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; border-top: 1px solid var(--hair); outline-offset: -2px; }
.bl:first-child { border-top: 0; }
.bl.hl, .bl:hover { background: var(--well); }
.bl-name { min-width: 0; }
.bl-name b { display: block; font-size: 13px; font-weight: 600; }
.bl-name small { font-size: 11.5px; color: var(--ink-3); }
.bl-track { position: relative; height: 14px; }
.bl-track .z { position: absolute; top: 0; bottom: 0; }
.bl-track .z1 { left: 0; width: 75%; background: rgba(var(--ink-rgb), .06); border-radius: 3px 0 0 3px; }
.bl-track .z2 { left: 75%; width: 15%; background: rgba(var(--ink-rgb), .12); }
.bl-track .z3 { left: 90%; width: 10%; background: rgba(var(--ink-rgb), .21); border-radius: 0 3px 3px 0; }
.bl-bar { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--ink); }
.bl-caution .bl-bar { background: var(--caution); }
.bl-warning .bl-bar { background: var(--warning); }
.bl-proj { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink-2); }
.bl-val { display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; column-gap: 4px; text-align: right; }
.bl-val b { font: 400 13.5px var(--f-inst); }
.bl-val small { grid-column: 1 / -1; font-size: 11px; color: var(--ink-3); }
.bl-val .i { width: 15px; height: 15px; }
.bl-caution .bl-val b, .bl-caution .bl-val .i { color: var(--caution); }
.bl-warning .bl-val b, .bl-warning .bl-val .i { color: var(--warning); }
.bullet-key { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--hair); }
.bk-bar { width: 16px; height: 4px; border-radius: 2px; background: var(--ink); }
.bk-proj { width: 2px; height: 12px; border-radius: 1px; background: var(--ink-2); }
.bk-z { width: 14px; height: 10px; border-radius: 2px; }
.bk-z2 { background: rgba(var(--ink-rgb), .12); }
.bk-z3 { background: rgba(var(--ink-rgb), .21); }
.avail-box { height: 172px; }
.chart .av-bar { fill: rgba(var(--ink-rgb), .72); }
.chart .av-bar.past { fill: rgba(var(--ink-rgb), .2); }
.chart .av-bar.short { fill: var(--caution); }
.chart .av-bar.today { fill: var(--orange); }
.chart .need { stroke: var(--ink-2); stroke-dasharray: 4 3; stroke-width: 1.2; }
.chart .now-label { font: 650 10.5px var(--f-ui); fill: var(--orange-ink); }
.lg-need { width: 16px; height: 0; border-top: 1.5px dashed var(--ink-2); }
@media (max-width: 1040px) { .mx-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .bl { grid-template-columns: minmax(0, 1fr) 76px; }
  .bl-track { grid-column: 1 / -1; grid-row: 2; }
  .mx-life .card-head .seg { max-width: 100%; overflow-x: auto; }
}

.adv-list li { grid-template-columns: 22px minmax(0, 1fr); }
.adv-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 3px; }
.text-btn { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 2px 4px; margin: -2px -4px; border-radius: 6px; white-space: nowrap; }
.text-btn:hover { color: var(--ink); background: var(--well); }
/* the availability chart grows to meet the component-life column, so neither column ends early */
.mx-grid { align-items: stretch; }
.mx-side { grid-template-rows: auto 1fr; }
.mx-avail { display: flex; flex-direction: column; }
.mx-avail .avail-box { flex: 1 1 auto; height: auto; min-height: 172px; }
@media (max-width: 1040px) { .mx-avail .avail-box { height: 200px; flex: none; } }
@media (max-width: 760px) {
  .wo-id { display: block; margin: 0 0 2px; }
  .wo-list li { grid-template-columns: 1fr; gap: 8px; }
  .wo-tags { justify-content: flex-start; }
}

/* ================================================================== telemetry: systems range panel */
.tm-grid { align-items: stretch; }
.thermal-card { display: flex; flex-direction: column; }
.thermal-card .thermal { flex: 1 1 auto; min-height: 300px; height: auto; }
.sys-card { display: flex; flex-direction: column; }
.sys-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.sys-strip { display: flex; gap: 3px; }
.sys-strip i { width: 16px; height: 6px; border-radius: 3px; background: rgba(var(--good-rgb), .55); }
.sys-strip i.c { background: var(--caution); }
.sys-strip i.w { background: var(--warning); }
.sys-list { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; }
.sys-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) minmax(130px, 40%) 92px; gap: 12px; align-items: center; padding: 8px 8px; margin: 0 -8px; border-radius: 8px; border-top: 1px solid var(--hair); }
.sys-row:first-child { border-top: 0; }
.sys-row.c { background: rgba(var(--caution-rgb), .08); border-top-color: transparent; }
.sys-row.w { background: rgba(var(--warning-rgb), .08); border-top-color: transparent; }
.sys-row.c + .sys-row, .sys-row.w + .sys-row { border-top-color: transparent; }
.sys-st { display: grid; place-items: center; width: 18px; height: 18px; }
.sys-st .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(var(--good-rgb), .14); }
.sys-st .i { width: 17px; height: 17px; }
.sys-row.c .sys-st { color: var(--caution); }
.sys-row.w .sys-st { color: var(--warning); }
.sys-name { min-width: 0; }
.sys-name b { display: block; font-size: 13px; font-weight: 600; }
.sys-name small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge { position: relative; height: 24px; }
.gauge .zone { position: absolute; top: 13px; height: 5px; }
.gauge .zone.first { border-radius: 3px 0 0 3px; }
.gauge .zone.last { border-radius: 0 3px 3px 0; }
.gauge .zone.n { background: rgba(var(--good-rgb), .42); }
.gauge .zone.c { background: rgba(var(--caution-rgb), .6); }
.gauge .zone.w { background: rgba(var(--warning-rgb), .62); }
.gauge .ptr { position: absolute; top: 2px; width: 0; height: 20px; transition: left .6s cubic-bezier(.3, .7, .3, 1); }
.gauge .ptr::before { content: ""; position: absolute; left: -5px; top: 0; border: 5px solid transparent; border-top: 7px solid var(--ink); border-bottom: 0; }
.gauge .ptr::after { content: ""; position: absolute; left: -1px; top: 7px; width: 2px; height: 13px; border-radius: 1px; background: var(--ink); }
.gauge .ptr em { position: absolute; top: -3px; left: 7px; font: 700 9px var(--f-ui); font-style: normal; color: var(--ink-2); }
.gauge .ptr.alt em { left: auto; right: 7px; }
.pips { display: flex; gap: 4px; padding-top: 6px; }
.pips i { flex: 1; height: 5px; border-radius: 3px; background: rgba(var(--good-rgb), .55); }
.sys-val { text-align: right; white-space: nowrap; }
.sys-val b { font-size: 14px; font-weight: 400; }
.sys-val small { margin-left: 4px; font-size: 11px; color: var(--ink-3); }
.sys-row.c .sys-val b { color: var(--caution); }
.sys-row.w .sys-val b { color: var(--warning); }
.sys-key { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--hair); }
.sk { width: 16px; height: 5px; border-radius: 3px; }
.sk.n { background: rgba(var(--good-rgb), .42); }
.sk.c { background: rgba(var(--caution-rgb), .6); }
.sk.w { background: rgba(var(--warning-rgb), .62); }
.sk-ptr { width: 0; height: 0; border: 5px solid transparent; border-top: 7px solid var(--ink); border-bottom: 0; }
@media (max-width: 760px) {
  .sys-row { grid-template-columns: 18px minmax(0, 1fr) 84px; }
  .sys-row .gauge, .sys-row .pips { grid-column: 2 / -1; grid-row: 2; }
}
/* value column sizes to its content so dual readouts ("3,016 / 2,992 psi") never spill */
.sys-row { grid-template-columns: 18px minmax(0, 1fr) minmax(110px, 36%) minmax(72px, max-content); }
@media (max-width: 760px) { .sys-row { grid-template-columns: 18px minmax(0, 1fr) max-content; } .sys-val b { font-size: 13px; } }
/* one shared grid for every row (subgrid), so gauges line up and the value column fits the widest reading */
.sys-list { display: grid; grid-template-columns: 18px minmax(0, 1fr) minmax(110px, 36%) max-content; column-gap: 12px; align-content: space-between; }
.sys-row { grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: 12px; }
@media (max-width: 760px) {
  .sys-list { grid-template-columns: 18px minmax(0, 1fr) max-content; }
  .sys-row { grid-template-columns: subgrid; }
}

/* ================================================================== responsive, every width
   Phones get a bottom tab bar, a stacked 3D stage with the power lever on its side, card rows
   instead of wide tables and touch-sized targets. Nothing is dropped: whatever doesn't fit moves
   into a menu or onto its own row. */

/* power lever: positions come from custom properties, so the same markup works upright or on its side */
.lv-scale span { top: calc((100 - var(--at)) * 1%); }
.lv-tick { top: calc((100 - var(--at)) * 1%); }
.lv-fill { top: calc((1 - var(--cmd, 0)) * 100%); }
.lv-handle { top: calc((1 - var(--cmd, 0)) * 100%); }
.lv-target { top: calc((1 - var(--tgt, 0)) * 100%); }

.st-hint .touch { display: none; }
@media (hover: none) and (pointer: coarse) { .st-hint .fine { display: none; } .st-hint .touch { display: inline; } }

/* "More" only appears in the bottom bar on narrow phones */
.nav-more { display: none; }
.more-pop { left: calc(100% + 8px); bottom: 0; width: 240px; display: grid; gap: 2px; padding: 6px; }
.more-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; font-size: 14px; font-weight: 560; color: var(--ink); text-align: left; }
.more-item .i { width: 20px; height: 20px; color: var(--ink-2); }
.more-item:hover, .more-item.on { background: var(--well); }
.more-item.on .i { color: var(--orange); }

/* touch screens: bigger targets, and the 3D view lets vertical swipes scroll the page */
@media (pointer: coarse) {
  .icon-btn { width: 42px; height: 42px; }
  .tool-group button { width: 40px; height: 40px; }
  .map-zoom button { width: 38px; height: 38px; }
  .seg button { padding: 8px 12px; }
  .chip { padding: 8px 13px; }
  .tabs button { padding: 9px 13px; }
  .btn-ghost { padding: 8px 12px; }
  .link-btn { padding: 7px 8px; }
  .text-btn { padding: 6px 8px; margin: -6px -8px; }
  .lv-btn { padding: 9px 0; }
  .msg-pop button { padding: 11px 10px; }
  .twin-canvas { touch-action: pan-y !important; }
  .stage.expanded .twin-canvas { touch-action: none !important; }
}

/* short screens (phones held sideways, small laptops) */
@media (min-width: 761px) and (max-height: 640px) {
  .rail { overflow-y: auto; padding-top: 10px; scrollbar-width: none; }
  .brand { margin-bottom: 6px; }
  .brand span { display: none; }
  .nav-item { padding: 6px 2px 5px; gap: 2px; }
  .topbar { position: static; }
  .ov-top { --hero-h: clamp(380px, calc(100dvh - 24px), 560px); }
  .ov-side { height: auto; }
  .lv-body { height: clamp(100px, calc(var(--hero-h) - 274px), 250px); margin: 8px 0 10px; }
  .lv-scale { font-size: 9.5px; }
  .lever { top: 60px; padding-top: 10px; }
  .st-mach .inst { font-size: 42px; }
}

/* tablets */
@media (min-width: 761px) and (max-width: 1040px) {
  .tb-tools { gap: 10px; }
  .fd-body { grid-template-columns: minmax(0, 180px) minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
  /* top bar: title with bell and profile, then the summary, a status line and the flight switch */
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "title bell me" "lede lede lede" "clock link link" "switch switch switch";
    align-items: center; column-gap: 4px; row-gap: 8px; padding: 14px 0 14px;
  }
  .tb-title, .tb-tools { display: contents; }
  .tb-title h1 { grid-area: title; font-size: 22px; }
  .tb-title p { grid-area: lede; margin-top: -4px; min-height: 0; font-size: 13.5px; }
  .clock { grid-area: clock; padding: 0; }
  .link-status { grid-area: link; display: flex; justify-self: end; }
  .tb-pop-wrap { grid-area: bell; }
  .me { grid-area: me; margin-left: 2px; }
  .flight-switch { grid-area: switch; order: 0; width: auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); overflow: visible; }
  .flight-switch button { padding: 7px 12px; min-width: 0; }
  .flight-switch small { overflow: hidden; text-overflow: ellipsis; }
  .alerts-pop { position: fixed; top: 12px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 104px); display: flex; flex-direction: column; z-index: 80; }
  .alerts-pop ul { max-height: none; flex: 1 1 auto; min-height: 0; }

  /* bottom tab bar */
  .rail { justify-content: space-around; gap: 0; padding: 6px max(4px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); }
  .rail-nav, .rail-foot { display: contents; }
  .nav-item { flex: 1 1 0; min-width: 0; max-width: 96px; width: auto; padding: 7px 2px 6px; font-size: 10px; }
  .nav-item span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-foot .nav-item:last-child, #btnKeys { display: flex; }
  .more-pop { position: fixed; left: auto; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: min(280px, calc(100vw - 16px)); z-index: 60; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 32px); }
  .app > .main { padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .pfd-cell.main { padding: 14px 16px 13px; }

  /* 3D stage: the model gets its own row; controls sit underneath instead of on top of it */
  .ov-top { --hero-h: auto; }
  .stage {
    --twin-ox: 0; --view-h: clamp(250px, 76vw, 440px);
    display: grid; height: auto; grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "view" "views" "deck" "tools";
    grid-template-rows: auto var(--view-h) auto auto auto; padding-bottom: 12px;
  }
  .twin-canvas { position: relative; inset: auto; grid-area: view; justify-self: center; width: calc(100% - 24px); height: 100%; min-width: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--hair); }
  .st-head { position: relative; grid-area: head; top: auto; left: auto; padding: 14px 14px 10px; flex-wrap: wrap; row-gap: 8px; }
  .st-inst { position: relative; grid-area: view; left: auto; top: auto; bottom: auto; align-self: stretch; min-width: 0; padding: 10px 22px 10px; gap: 8px; }
  :root[data-appearance="dark"] .stage::after { display: none; }
  .st-mach .inst { font-size: 40px; }
  .st-read { margin-top: auto; align-self: flex-start; max-width: 100%; }
  .st-read > div, .st-read > div:nth-child(n+2) { display: block; padding: 6px 10px 7px; }
  .st-read dt { font-size: 10.5px; }
  .st-read b { font-size: 14px; }
  .st-views { position: relative; grid-area: views; top: auto; right: auto; bottom: auto; left: auto; margin: 10px 12px 0; display: flex; overflow-x: auto; scrollbar-width: none; }
  .st-views button { flex: 1 0 auto; }
  .st-hint { top: auto; bottom: auto; left: auto; right: 22px; transform: none; grid-area: view; align-self: start; justify-self: end; position: relative; margin-top: 66px; white-space: normal; max-width: 170px; border-radius: 12px; display: inline-flex; }
  .st-tools { position: relative; grid-area: tools; left: auto; right: auto; bottom: auto; margin: 10px 12px 0; justify-content: space-between; }

  /* the power lever lies on its side: idle at the left, max afterburner at the right */
  .lever { position: relative; grid-area: deck; top: auto; right: auto; width: auto; margin: 10px 12px 0; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
  .lv-head { grid-column: 1 / -1; }
  .lv-body { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; height: auto; margin: 0; }
  .lv-track { flex: none; height: 40px; margin: 9px 0 0; cursor: ew-resize; background: linear-gradient(180deg, var(--track-a), var(--track-b) 45%, var(--track-a)); }
  .lv-scale { display: block; order: 2; width: auto; height: 28px; margin: 4px 1px 0; }
  .lv-scale span { top: 0; right: auto; left: calc(var(--at) * 1%); transform: translateX(-50%); }
  .lv-scale span:first-child { top: 14px; transform: translateX(-100%); }
  .lv-scale span:last-child { transform: none; }
  .lv-ab { left: auto; right: 0; top: 0; bottom: 0; width: 20%; height: auto; border-radius: 0 10px 10px 0; }
  .lv-tick { top: 7px; bottom: 7px; left: calc(var(--at) * 1%); right: auto; width: 1px; height: auto; }
  .lv-mil { left: 80%; right: auto; top: -5px; bottom: -5px; width: 2px; height: auto; margin: 0 0 0 -1px; }
  .lv-fill { left: 6px; right: auto; top: 6px; bottom: 6px; width: calc(var(--cmd, 0) * (100% - 12px)); background: linear-gradient(to right, rgba(var(--cyan-rgb), .1), rgba(var(--cyan-rgb), .38)); }
  .lv-fill.ab { background: linear-gradient(to right, rgba(var(--cyan-rgb), .1), rgba(var(--cyan-rgb), .22) 55%, rgba(var(--orange-rgb), .45) 78%, rgba(var(--orange-rgb), .78)); }
  .lv-handle { top: -8px; bottom: -8px; left: calc(var(--cmd, 0) * 100%); right: auto; width: 30px; height: auto; transform: translateX(-50%); flex-direction: row; justify-content: center; padding: 12px 0; }
  .lv-handle i { width: 2px; height: auto; }
  .lv-target { top: auto; right: auto; bottom: -13px; left: calc(var(--tgt, 0) * 100%); border: 5px solid transparent; border-bottom: 7px solid var(--cyan); border-top: 0; transform: translateX(-50%); transition: left .4s; }
  .lv-stages { grid-column: 1 / -1; }
  .lv-btn { margin-top: 0; font-size: 12.5px; }
  .lv-btn .i { display: block; }

  .stage.expanded { inset: 0; border-radius: 0; grid-template-rows: auto minmax(200px, 1fr) auto auto auto; overflow-y: auto; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }

  /* maps */
  .map-box { height: 280px; }
  .map-box.big { height: 400px; }
  .map-box.wide { height: 320px; }
  .sheet-map { height: 220px; }

  /* telemetry: Mach gets the full first row */
  .pfd-strip { grid-template-columns: 1fr 1fr; }
  .pfd-cell:nth-child(n) { border-left: 0; border-top: 1px solid var(--hair); }
  .pfd-cell:first-child { grid-column: 1 / -1; border-top: 0; }
  .pfd-cell:last-child { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .pfd-cell:last-child > span:first-child { margin: 0; }
  .pfd-cell:nth-child(3), .pfd-cell:nth-child(5) { border-left: 1px solid var(--hair); }
  .sys-sum { align-items: flex-start; }
  .thermal-card .thermal { min-height: 250px; }
  /* the wear drawing keeps a legible size and scrolls sideways instead of shrinking its labels */
  .wear { overflow-x: auto; margin: 0 -16px 4px; padding: 0 8px; scrollbar-width: thin; }
  .wear-map { min-width: 560px; }

  /* logbook tools stretch to the card */
  .lb-card .card-head { flex-direction: column; align-items: stretch; }
  .lb-tools { width: 100%; }
  .search { flex: 1 1 180px; }
  .search input { width: 100%; max-width: none; }
  .lb-foot { flex-wrap: wrap; }
  .sheet-panel > header { padding: 14px 16px 12px; }
  .sheet-body { padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
}

/* narrow phones: four pages in the bar, the rest under More */
@media (max-width: 599px) {
  .nav-item[data-route="maintenance"], .nav-item[data-route="logbook"], #btnSettings, #btnKeys { display: none; }
  .nav-more { display: flex; }

  /* tables become stacked rows */
  .roster thead, .lb-table thead th:not(.sortable) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .roster, .roster tbody, .lb-table, .lb-table tbody { display: block; }
  .table-wrap:has(.roster), .table-wrap:has(.lb-table) { overflow: visible; margin: 0; }
  .roster tr, .lb-table tbody tr { display: grid; gap: 6px 12px; padding: 12px 10px; border-bottom: 1px solid var(--hair); align-items: center; }
  .roster tr:last-child, .lb-table tbody tr:last-child { border-bottom: 0; }
  .roster td, .lb-table tbody td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; }
  .roster td.num, .lb-table td.num { text-align: left; }
  .roster td[data-label]::before, .lb-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 1px; }
  .table tbody tr.sel td { background: none; }
  .table tbody tr.sel { background: var(--well); box-shadow: inset 3px 0 0 var(--orange); border-radius: 8px; }
  .table tbody tr.sel td:first-child { box-shadow: none; }
  .table tbody tr[tabindex]:hover td { background: none; }
  .table tbody tr[tabindex]:hover { background: rgba(var(--ink-rgb), .028); }

  .roster tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roster .c-tail { grid-column: 1 / 3; }
  .roster .c-status { grid-column: 3; justify-self: end; }
  .roster .c-where { grid-column: 1 / -1; color: var(--ink-2); margin-top: -4px; }

  .lb-table tbody tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lb-table .c-flight { grid-column: 1 / 3; grid-row: 1; }
  .lb-table .c-tail { grid-column: 3; grid-row: 1; color: var(--ink-2); }
  .lb-table .c-status { grid-column: 4; grid-row: 1; justify-self: end; }
  .lb-table .c-route { grid-column: 1 / -1; grid-row: 2; }
  .lb-table .route-cell { flex-wrap: wrap; }
  .lb-table tr.empty { display: block; }
  .lb-table tr.empty td { text-align: center; }
  /* sorting stays available as a row of buttons */
  .lb-table thead { display: block; }
  .lb-table thead tr { display: flex; align-items: center; gap: 6px; padding: 0 2px 10px; border-bottom: 1px solid var(--hair); }
  .lb-table thead tr::before { content: "Sort by"; font-size: 12px; color: var(--ink-3); margin-right: 2px; }
  .lb-table thead th.sortable { border: 0; padding: 0; }
  .lb-table th.sortable button { padding: 5px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule); }
  .lb-table th.num.sortable button { flex-direction: row; }
  .lb-table th[aria-sort="ascending"] button, .lb-table th[aria-sort="descending"] button { background: var(--ink); color: var(--sheet); box-shadow: none; }
}

/* small phones */
@media (max-width: 380px) {
  .app > .main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .tb-title h1 { font-size: 20px; }
  .fc-head h2 { font-size: 22px; }
  .fc-apt b { font-size: 19px; }
  .fd-head h2 { font-size: 26px; }
  .mx-summary b { font-size: 26px; }
  .mx-summary > div { padding: 14px; }
  .st-read > div, .st-read > div:nth-child(n+2) { padding: 5px 8px 6px; }
  .st-read b { font-size: 13px; }
  .st-read dt { font-size: 10px; }
  .tool-group button { width: 32px; height: 38px; }
  .tool-group .z-val { width: 42px; }
  .st-tools { flex-wrap: wrap; gap: 8px; }
  .st-views button { padding: 7px 8px; }
  .link-status span { display: none; }
  .nav-item { font-size: 9.5px; }
}
