/* ADS-B Colorado — "App Shell" design system (approved option 2).
   Zinc surfaces, system font for UI, mono reserved for data values.
   Selector names are a stable contract with app.js — restyle, never rename. */
:root {
  --bg: #09090b; --panel: #101013; --card: #17171b; --panel2: #1d1d22;
  --line: #26262b; --line2: #34343c;
  --fg: #e4e4e7; --dim: #8f8f99; --faint: #5c5c66;
  --cyan: #38cfdd; --cyan-dk: #0c2b30;
  --amber: #eac54f; --green: #4ade80; --red: #f4747c;
  --r: 8px; --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45; }
.mono, #count, #multi-note, .badge, #readout, .slider-lbl b, #lb-text,
.row .sub, .frow output, #metrics b, .review-context, #review-notes {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.hidden { display: none !important; }
.dim { color: var(--dim); }

/* ---------- header ---------- */
#hdr { display: flex; align-items: center; gap: 18px; height: 50px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
#title { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 12px;
  letter-spacing: 1.8px; color: var(--cyan); white-space: nowrap; }
#title .dim { font-weight: 400; letter-spacing: 0; }
#count { color: var(--dim); white-space: nowrap; font-size: 11.5px; }
#tabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 2px; }
.navtab { padding: 5px 14px; border-radius: 7px; color: var(--dim); text-decoration: none;
  white-space: nowrap; font-size: 12px; }
.navtab:hover { color: var(--fg); }
.navtab.active { background: var(--card); color: var(--fg); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line2), 0 1px 2px rgba(0, 0, 0, 0.4); }
#metrics { display: flex; gap: 16px; margin-left: auto; }
#metrics .m { display: flex; flex-direction: column; line-height: 1.15; }
#metrics label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
#metrics b { font-size: 13px; color: var(--fg); font-weight: 600; }

/* ---------- shell ---------- */
#main { display: flex; height: calc(100% - 50px); position: relative; }
/* controls: a movable, resizable popup docked left by default.
   Native CSS resize grabber (bottom-right); drag by its header. */
#side { position: absolute; left: calc(100% - 316px); top: 52px; z-index: 5;
  width: 302px; height: min(600px, calc(100% - 150px));
  min-width: 262px; min-height: 300px; max-width: 560px; max-height: calc(100% - 150px);
  display: flex; flex-direction: column;
  background: rgba(16, 16, 19, 0.95); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  resize: both; overflow: hidden; }
#side-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px; border-bottom: 1px solid var(--line); cursor: grab;
  user-select: none; flex: 0 0 auto; }
#side-head:active { cursor: grabbing; }
#side-head b { font-size: 12.5px; font-weight: 600; }
#side-close { width: 22px; height: 22px; background: none; border: none; border-radius: 6px;
  color: var(--faint); font-size: 15px; cursor: pointer; line-height: 1; }
#side-close:hover { color: var(--fg); background: var(--panel2); }
#panel-toggle, #list-toggle, #kbd-btn { width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--dim);
  cursor: pointer; }
#panel-toggle:hover, #list-toggle:hover, #kbd-btn:hover { color: var(--fg); border-color: var(--line2); }
#kbd-help { position: absolute; z-index: 30; top: 60px; left: 50%; transform: translateX(-50%);
  width: min(460px, 92%); padding: 14px 16px;
  background: rgba(16, 16, 19, 0.97); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; align-items: center;
  font-size: 12px; color: var(--dim); }
.kbd-grid kbd { display: inline-block; min-width: 20px; text-align: center; padding: 2px 6px;
  background: var(--panel2); border: 1px solid var(--line2); border-bottom-width: 2px;
  border-radius: 5px; color: var(--fg); font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px; }
body.nopanel #side { display: none; }
body.nolist #listcard { display: none; }
body.nopanel #panel-toggle, body.nolist #list-toggle {
  color: var(--cyan); border-color: var(--cyan-dk); }

/* control panel: card-grouped sections */
#filters { padding: 10px; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overflow-x: hidden; }
#filters input[type=range] { min-width: 40px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.pcard > h5 { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--faint);
  display: flex; align-items: center; justify-content: space-between; }
.frow { display: flex; gap: 6px; align-items: center; }
.frow.btnwrap { flex-wrap: wrap; }
.frow.btnwrap button { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.frow.btnwrap .info-btn { flex: 0 0 auto; }
#multi-note.warn { color: #e84fbe; border: 1px solid #e84fbe; border-radius: 7px;
  padding: 3px 9px; display: inline-block; font-weight: 600; }

/* full-width titled sliders with tick legends */
.bigslider { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px; }
.bs-head { display: flex; align-items: center; gap: 4px; }
.bs-head label { color: var(--dim); font-size: 11.5px; flex: 1; }
.bs-head b { color: var(--fg); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.bigslider input[type=range] { width: 100%; margin: 2px 0 0; accent-color: var(--cyan); height: 18px; }
.bs-ticks { display: flex; justify-content: space-between; padding: 0 6px;
  font-family: ui-monospace, Menlo, monospace; font-size: 8.5px; color: var(--faint); }
.bs-ticks span { position: relative; min-width: 8px; text-align: center; }
.bs-ticks span::before { content: ""; position: absolute; top: -4px; left: 50%; width: 1px; height: 3px;
  background: var(--line2); }
select, input[type=search] { background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line2); border-radius: 7px; padding: 5px 8px;
  font: inherit; font-size: 12px; width: 100%; min-width: 0; }
select:focus, input[type=search]:focus { outline: 1px solid var(--cyan); outline-offset: -1px; }
input[type=range] { flex: 1; accent-color: var(--cyan); }
.slider-lbl { white-space: nowrap; color: var(--dim); font-size: 11.5px; }
.slider-lbl b { color: var(--fg); font-size: 11px; }
#flagbox, #layerbox { display: flex; flex-wrap: wrap; gap: 5px 12px; }
#classbox, #ftbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.subhead { margin: 2px 0 -2px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); }
.cchip { min-width: 0; display: flex; align-items: center; justify-content: flex-start;
  gap: 5px; background: var(--panel2); border: 1px solid var(--line);
  color: var(--faint); border-radius: 6px; padding: 4px 6px; font: inherit;
  font-size: 10px; letter-spacing: 0.03em; cursor: pointer;
  overflow: hidden; white-space: nowrap; }
/* definitive show/hide state: green check = showing, red x = hidden */
.cchip::before { content: "\2715"; flex: 0 0 auto; font-size: 9px; font-weight: 700;
  color: var(--red); }
.cchip.on::before { content: "\2713"; color: var(--green); }
.cchip.on { background: var(--panel2); color: var(--fg); border-color: var(--line2);
  box-shadow: inset 0 0 0 1px var(--line2); }
.cchip:hover { color: var(--fg); }
#multi-btn, .mini-btn { height: 26px; background: var(--panel2); border: 1px solid var(--line2);
  color: var(--dim); border-radius: 7px; padding: 0 10px; font: inherit; font-size: 11px;
  letter-spacing: 0.04em; cursor: pointer; }
#multi-btn:hover, .mini-btn:hover { border-color: var(--cyan); color: var(--fg); }
#multi-btn.on { background: var(--cyan); color: #06272c; border-color: var(--cyan); font-weight: 700; }
#multi-note { font-size: 10.5px; color: var(--dim); }
.gv { color: #ef8354; font-size: 9px; }
.gi { color: var(--cyan); font-size: 9px; }
.mchip { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }
.solo-btn, .play-btn { float: right; margin-left: 6px; padding: 1px 6px; background: none;
  color: var(--dim); border: 1px solid var(--line2); border-radius: 5px; font: inherit;
  font-size: 9px; letter-spacing: 0.06em; cursor: pointer; }
.solo-btn:hover { border-color: var(--cyan); color: var(--fg); }
.solo-btn.on { background: var(--cyan); color: #06272c; border-color: var(--cyan); font-weight: 700; }
.play-btn { color: var(--cyan); }
.play-btn:hover { background: var(--cyan); color: #06272c; border-color: var(--cyan); }
#lb-playback { background: var(--cyan); color: #06272c; border-color: var(--cyan); font-weight: 700; }
#lb-playback:hover { background: #67dde8; }
.row.hl { outline: 2px solid #fff; outline-offset: -2px; background: #1d232c; }
#lb-continue { margin-left: 10px; }
#replay.disabled { opacity: 0.4; pointer-events: none; }
#flagbox label, #layerbox label { color: var(--dim); cursor: pointer; white-space: nowrap;
  font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.chip { color: var(--dim); white-space: nowrap; font-size: 11px;
  display: inline-flex; align-items: center; }
.chip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; }

/* toggle-style switches for filter/layer checkboxes (basket .ckb stays a checkbox) */
#flagbox input[type=checkbox], #layerbox input[type=checkbox],
#destcolor-row input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: 0 0 auto;
  width: 28px; height: 16px; border-radius: 99px; background: var(--line2);
  position: relative; cursor: pointer; transition: background 0.15s; }
#flagbox input[type=checkbox]::before, #layerbox input[type=checkbox]::before,
#destcolor-row input[type=checkbox]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 99px; background: #cfcfd6; transition: left 0.15s; }
#flagbox input:checked, #layerbox input:checked, #destcolor-row input:checked {
  background: var(--cyan); }
#flagbox input:checked::before, #layerbox input:checked::before,
#destcolor-row input:checked::before { left: 14px; background: #06272c; }
input[type=checkbox].ckb { accent-color: var(--cyan); width: 13px; height: 13px; }

#basket-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: var(--card); font-size: 12px; }
#basket-bar b { color: var(--cyan); }
#basket-bar span { flex: 1; }
.ckb { margin-right: 7px; }

/* ---------- floating flight list card (option-5 style) ---------- */
#listcard { position: absolute; left: 14px; top: 14px; bottom: 98px; width: 322px; z-index: 4;
  min-width: 262px; min-height: 240px; max-width: 640px; max-height: calc(100% - 112px); resize: both;
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(15, 15, 18, 0.92); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#lc-head { display: flex; align-items: center; gap: 8px;
  padding: 11px 12px 9px 16px; border-bottom: 1px solid var(--line);
  cursor: grab; user-select: none; }
#lc-head:active { cursor: grabbing; }
#lc-head b { font-size: 13px; font-weight: 600; flex: 1; }
#lc-head span { font-size: 11px; }
#list-close { width: 22px; height: 22px; background: none; border: none; border-radius: 6px;
  color: var(--faint); font-size: 15px; cursor: pointer; line-height: 1; }
#list-close:hover { color: var(--fg); background: var(--panel2); }
#lc-labels { display: flex; gap: 5px; padding: 8px 12px 0; border-top: 1px solid var(--line); }
.ltag { flex: 1; min-width: 0; padding: 4px 2px; border-radius: 6px; font: inherit; font-size: 9px;
  letter-spacing: 0.03em; background: var(--panel2); border: 1px solid var(--line);
  color: var(--faint); cursor: pointer; white-space: nowrap; }
.ltag:hover { color: var(--fg); border-color: var(--line2); }
.ltag.on { background: #241a4d; border-color: #7a6ee0; color: #b6acff; font-weight: 700; }
#lc-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
#lc-labels + #lc-foot { border-top: none; }
.fbtn { flex: 1; height: 30px; border-radius: 8px; font: inherit; font-size: 12px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--dim); }
.fbtn:hover { border-color: var(--cyan); color: var(--fg); }
.fbtn.primary { background: var(--cyan); border-color: var(--cyan); color: #06272c; font-weight: 600; }
.fbtn.primary:hover { background: #67dde8; }
#list { flex: 1; overflow-y: auto; }
.row { padding: 9px 14px; border-bottom: 1px solid #16161a; cursor: pointer; }
.row:hover { background: var(--card); }
.row.sel { background: #0e2226; box-shadow: inset 2px 0 0 var(--cyan); }
.row .r1 { display: flex; align-items: baseline; gap: 7px; }
.row .reg { font-weight: 600; font-size: 13px; }
.row .typ { color: var(--faint); font-size: 10.5px;
  font-family: ui-monospace, Menlo, monospace; }
.rrsv { margin-left: auto; font-family: ui-monospace, Menlo, monospace;
  font-weight: 700; font-size: 13px; }
.rrsv.hot { color: var(--cyan); }
.rrsv.warm { color: #79b9c2; }
.rrsv.n { color: var(--faint); font-weight: 500; }
.row .sub { color: var(--dim); font-size: 10.5px; margin-top: 1px; }
.segv.g { color: var(--green); } .segv.a { color: var(--amber); }
.segv.r { color: var(--red); } .segv.n { color: var(--faint); }
/* per-row actions appear on hover to keep rows quiet */
.row .solo-btn, .row .play-btn { visibility: hidden; float: none; margin-left: 4px; }
.row:hover .solo-btn, .row:hover .play-btn, .row .solo-btn.on { visibility: visible; }
.badge { padding: 1.5px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; color: #101013; }
.badge.g { background: var(--green); } .badge.a { background: var(--amber); } .badge.r { background: var(--red); }
.badge.n { background: var(--panel2); color: var(--faint); border: 1px solid var(--line); font-weight: 500; }
.reviewtag { display: inline-block; margin-right: 5px; padding: 1px 5px;
  border: 1px solid var(--line2); border-radius: 5px; color: var(--dim); font-size: 9px; }
.reviewtag.control { border-color: var(--amber); color: var(--amber); }
.reviewtag.reviewed { border-color: var(--green); color: var(--green); }
.reviewtag.cand { border-color: var(--cyan); color: var(--cyan); }
.reviewtag.pend { border-color: #e84fbe; color: #e84fbe; }
.reviewtag.inrev { border-color: var(--cyan); color: var(--cyan); }
.reviewtag.ft { border-color: #7a6ee0; color: #9b8ff0; }
/* review status at a glance — red until labeled, green once labeled
   (placed after the kind colors so they win on combined classes) */
.reviewtag.unrev { border-color: var(--red); color: var(--red); }
.reviewtag.done { border-color: var(--green); color: var(--green); }
#noise-labels { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.mini-btn.primary { background: var(--cyan); color: #06272c; border-color: var(--cyan); font-weight: 600; }
.mini-btn.primary:hover { background: #67dde8; color: #06272c; }

/* toast confirmations (bottom-center, above the replay bar) */
#toast { position: absolute; bottom: 84px; left: 50%; transform: translateX(-50%);
  z-index: 20; padding: 9px 18px; background: rgba(16, 16, 19, 0.96);
  border: 1px solid var(--cyan); border-radius: 99px; color: var(--fg);
  font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap; }
#toast.err { border-color: #e84fbe; }

/* ---------- map + floating surfaces ---------- */
#mapwrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; }
.float-card, #style-panel, #load-banner, #replay, #review-panel, #learn-pop {
  background: rgba(16, 16, 19, 0.94); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); }
#style-btn { position: absolute; top: 10px; right: 52px; z-index: 6;
  width: 29px; height: 29px; background: var(--card); color: var(--dim);
  border: 1px solid var(--line2); border-radius: 8px; font-size: 14px; cursor: pointer;
  box-shadow: var(--shadow); }
#style-btn:hover { color: var(--fg); border-color: var(--cyan); }
#style-panel { position: absolute; top: 46px; right: 52px; z-index: 8; width: 256px;
  padding: 12px 14px; }
.style-head { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; color: var(--fg); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; }
.style-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.style-row label { flex: 0 0 122px; color: var(--dim); font-size: 11px; }
.style-row label b { color: var(--fg); font-family: ui-monospace, monospace; font-size: 10.5px; }
.style-row input[type=range] { flex: 1; accent-color: var(--cyan); min-width: 0; }
.style-row select { flex: 1; padding: 3px 6px; font-size: 11px; }

#load-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 7; min-width: 300px; max-width: min(540px, 90%); padding: 8px 16px 10px;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lb-text { color: var(--cyan); font-size: 12px; }
#lb-track { height: 3px; margin-top: 7px; background: var(--panel2); border-radius: 99px; }
#lb-bar { height: 100%; width: 0; background: var(--cyan); border-radius: 99px;
  transition: width 0.2s linear; }
#destcolor-row input[type=color] { width: 18px; height: 16px; padding: 0;
  border: 1px solid var(--line2); border-radius: 5px; background: none;
  margin-right: 4px; vertical-align: -3px; cursor: pointer; }
#replay { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; }
#play { width: 34px; height: 34px; background: var(--cyan); color: #06272c;
  border: none; border-radius: 99px; cursor: pointer; font-size: 12px; font-weight: 700; }
#play:hover { background: #67dde8; }
#readout { color: var(--fg); white-space: nowrap; min-width: 210px; text-align: right;
  font-size: 11.5px; }

/* ---------- control review panel (movable, resizable, always above tools) ---------- */
#review-panel { position: absolute; z-index: 9; top: 12px;
  left: max(346px, calc(50% - 270px));
  width: min(520px, calc(100% - 700px)); min-width: 340px; min-height: 220px;
  padding: 12px 14px; resize: both; overflow: auto; }
#review-head { cursor: grab; user-select: none; }
.review-flight { margin: 6px 0 2px; font-size: 12.5px; color: var(--fg); }
.review-flight b { color: var(--cyan); font-size: 13.5px; letter-spacing: 0.03em; }
.review-flight span { color: var(--dim); white-space: pre-wrap; }
#review-saved.saved-ok { color: var(--green); }
#review-saved.saved-missing { color: var(--red); }
#review-head:active { cursor: grabbing; }
#review-close { width: 22px; height: 22px; flex: 0 0 auto; background: none; border: none;
  border-radius: 6px; color: var(--faint); font-size: 15px; cursor: pointer; line-height: 1; }
#review-close:hover { color: var(--fg); background: var(--panel2); }
#pending-actions { margin: 0 0 8px; }
#pending-actions button { border-color: #7a3b66; color: #e88fd0; }
#pending-actions button:hover { border-color: #e84fbe; color: #fff; }
#pending-actions #pending-accept { border-color: var(--cyan-dk); color: var(--cyan); }
#pending-actions #pending-accept:hover { border-color: var(--cyan); }
.review-head, .review-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#review-source { color: var(--cyan); font-weight: 600; font-size: 12px; }
.review-context { margin-top: 5px; font-size: 10.5px; line-height: 1.5; }
.review-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.review-reason { padding: 2px 7px; border: 1px solid var(--line2); border-radius: 99px;
  color: var(--fg); background: var(--panel2); font-size: 9.5px; cursor: help;
  font-family: ui-monospace, monospace; }
.review-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.review-actions button, .review-tools button { padding: 5px 9px; background: var(--panel2);
  color: var(--dim); border: 1px solid var(--line2); border-radius: 7px; font: inherit;
  font-size: 10px; letter-spacing: 0.03em; cursor: pointer; }
.review-actions button:hover, .review-tools button:hover { border-color: var(--cyan); color: var(--fg); }
.review-actions button.on { color: #06272c; border-color: var(--cyan); background: var(--cyan); font-weight: 700; }
#review-notes { width: 100%; margin: 8px 0; resize: vertical; padding: 6px 8px;
  color: var(--fg); background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 7px; font-size: 11px; }
#review-export { color: var(--cyan); }

/* ---------- educational hover layer (learn.js) ---------- */
.info-btn { background: none; border: none; padding: 0 3px; font: inherit; font-size: 11px;
  color: var(--faint); cursor: pointer; vertical-align: 1px; }
.info-btn:hover { color: var(--cyan); }
.term { border-bottom: 1px dotted var(--faint); cursor: help; }
#learn-pop { position: fixed; z-index: 99; max-width: min(340px, 92vw); padding: 12px 14px;
  color: var(--fg); font-size: 12px; line-height: 1.55; }
#learn-pop b { display: block; margin-bottom: 4px; color: #fff; font-size: 12.5px; }
#learn-pop .k { color: var(--faint); text-transform: uppercase; font-size: 9px; letter-spacing: 0.06em; }
#learn-pop div + div { margin-top: 5px; }
#learn-pop .try { color: var(--cyan); }

.maplibregl-ctrl-attrib { background: rgba(9, 9, 11, 0.6) !important; }
.maplibregl-ctrl-attrib a { color: var(--dim) !important; }
.maplibregl-ctrl-group { background: var(--card) !important; border-radius: 8px !important;
  box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button { background: var(--card) !important; }
.maplibregl-ctrl-group button span { filter: invert(0.8); }

/* ---------- mobile: MAP / FLIGHTS / FILTERS views + bottom nav ----------
   One view at a time, switched by the fixed bottom bar (#mnav, built by
   app.js on <=820px). The map is always underneath; FLIGHTS shows the list
   card, FILTERS slides the controls sheet up. Selecting a flight returns to
   the map view so the track is immediately visible. */
#grab { display: none; }
#mnav { display: none; }
@media (max-width: 820px) {
  html, body { overflow-x: hidden; }
  #side-head { display: none; }
  #hdr { gap: 10px; padding: 0 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #title .dim { display: none; }
  #count { font-size: 10px; }
  #tabs { gap: 1px; padding: 2px; flex: 0 0 auto; }
  .navtab { padding: 6px 9px; font-size: 10px; }
  #metrics { flex: 1; min-width: 0; overflow-x: auto; flex-wrap: nowrap; gap: 12px;
    -webkit-overflow-scrolling: touch; }
  #metrics .m { flex: 0 0 auto; }

  /* bottom navigation — 44px+ touch targets, safe-area aware */
  #mnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; gap: 6px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: rgba(13, 16, 23, 0.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  #mnav button { flex: 1; min-height: 46px; background: none; border: 1px solid var(--line);
    border-radius: 10px; color: var(--dim); font-size: 12px; font-weight: 600;
    letter-spacing: 0.08em; cursor: pointer; }
  #mnav button.on { color: var(--fg); border-color: var(--cyan); background: var(--panel2); }
  #mnav button b { display: block; font-size: 9px; font-weight: 400; color: var(--faint); }

  /* controls popup -> full slide-up sheet, hidden unless FILTERS view */
  #side { position: fixed; left: 0; right: 0; top: auto; z-index: 30;
    bottom: calc(58px + env(safe-area-inset-bottom));
    width: auto; min-width: 0; max-width: none; max-height: none;
    height: 0; min-height: 0; border: none;
    overflow: hidden; resize: none; border-radius: 14px 14px 0 0; box-shadow: none;
    transition: height 0.25s ease; }
  body.mview-filters #side { height: min(72vh, 640px);
    border: 1px solid var(--line); border-bottom: none; }
  body.nopanel #side { display: flex; } /* desktop hide-toggle must not kill the sheet */

  /* list card: full-width dock, only in FLIGHTS view */
  #listcard { display: none; }
  body.mview-list #listcard { display: flex; position: fixed; left: 8px; right: 8px;
    width: auto; min-width: 0; max-width: none; top: 58px; resize: none;
    bottom: calc(64px + env(safe-area-inset-bottom)); max-height: none; min-height: 0; }
  #lc-head { cursor: default; }
  .row { padding: 12px 14px; }  /* finger-sized rows */
  .row .ckb { width: 18px; height: 18px; }

  /* replay bar above the bottom nav, 44px touch targets, full-width scrubber */
  #replay { bottom: calc(58px + env(safe-area-inset-bottom)); flex-wrap: wrap; padding: 8px 10px; }
  #play { width: 48px; height: 44px; font-size: 15px; }
  #replay .info-btn { min-height: 44px; }
  #readout { flex: 1; min-width: 0; text-align: right; font-size: 11px; }
  #scrub { flex: 1 1 100%; order: 5; height: 28px; }
  /* review panel: base rule pins left at 346px (off a 430px screen) — force
     full-width mobile geometry and kill the desktop drag/resize affordances */
  #review-panel { top: 8px; left: 8px; right: 8px; width: auto; min-width: 0;
    min-height: 0; max-height: 56vh; overflow-y: auto; resize: none; }
  #review-panel [data-review-label], #pending-actions button {
    min-height: 40px; }
  #review-notes { min-height: 56px; font-size: 13px; }
  /* hosted identity chip sits above the nav (inline style needs the override);
     hidden while the list/filters views cover that corner */
  #who-chip { bottom: calc(62px + env(safe-area-inset-bottom)) !important; }
  body:has(#replay:not(.hidden)) #who-chip { display: none !important; } /* replay bar owns that corner */
  body.mview-list #who-chip, body.mview-filters #who-chip { display: none !important; }
  /* map-floating controls hide under the full-screen list/filter views */
  body.mview-list #style-btn, body.mview-filters #style-btn,
  body.mview-list #style-panel, body.mview-filters #style-panel,
  body.mview-list .maplibregl-ctrl-top-right, body.mview-filters .maplibregl-ctrl-top-right {
    display: none; }
  #hdr { scrollbar-width: none; }
  #hdr::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) {
  #metrics label { font-size: 8px; }
  #metrics b { font-size: 11px; }
}
