/* SARAware — ops console styles. One accent (phosphor green) + neutrals; amber/red only for alerts. */
:root {
  --bg: #070b0d;
  --surface: #0c1316;
  --surface-2: #111a1e;
  --surface-3: #172328;
  --line: #1f2d33;
  --line-2: #2a3b42;
  --text: #dde8eb;
  --muted: #98abb2;
  --faint: #6c8088;
  --accent: #39f2a5;
  --accent-rgb: 57, 242, 165;
  --accent-ink: #03160e;
  --scope: var(--accent);
  --scope-rgb: var(--accent-rgb);
  --amber: #ffb020;
  --amber-rgb: 255, 176, 32;
  --red: #ff4d5e;
  --red-rgb: 255, 77, 94;
  --ground: #9ccaff;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  /* type scale */
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px; --fs-xl: 18px;
  --r: 6px;
  --panel-w: 392px;
  --head-h: 64px;
}
body.mode-replay { --scope: var(--amber); --scope-rgb: var(--amber-rgb); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 var(--fs-md)/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 5000; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r); font-weight: 600; }
.skip-link:focus { top: 8px; }
kbd { font: 500 10px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; color: var(--text); }

/* ------------------------------------------------------------ header */
.topbar {
  flex: 0 0 auto; min-height: var(--head-h);
  display: flex; align-items: center; gap: 20px; padding: 8px 16px;
  background: linear-gradient(180deg, #0b1215, #091013);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 1200;
}
body.mode-replay .topbar { background: linear-gradient(180deg, #1a1408, #120e06); border-bottom-color: rgba(var(--amber-rgb), .55); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { display: block; flex: none; line-height: 0; }
.brand-logo img { display: block; height: 48px; width: auto; max-width: none; } /* ~1.75:1 lockup: keeps SAR + AWARE legible */
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-mid { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.clock-label { font: 600 10px var(--mono); letter-spacing: .1em; color: var(--muted); }
.clock-value { font-size: var(--fs-lg); font-weight: 500; }
.role, .units { display: flex; align-items: center; gap: 6px; }
.seg-units .seg-btn { padding: 0 10px; font: 600 var(--fs-xs, 11px) var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.role-label { font: 600 10px var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.role select {
  height: 32px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 0 28px 0 10px; max-width: 210px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px; background-repeat: no-repeat;
}
body.role-pilot .role select { border-color: var(--accent); color: var(--accent); }

.sim-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border: 1px dashed var(--line-2); border-radius: var(--r); background: rgba(255,255,255,.04);
  font: 500 var(--fs-xs) var(--mono); letter-spacing: .08em; color: var(--muted); white-space: nowrap;
}
.sim-badge strong { color: var(--text); font-weight: 600; }
.sim-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1.6s ease-in-out infinite; }
.sim-badge[data-state="paused"] .sim-dot { background: var(--faint); box-shadow: none; animation: none; }
.sim-badge[data-state="replay"] { border-color: var(--amber); color: var(--amber); }
.sim-badge[data-state="replay"] .sim-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
@keyframes blink { 50% { opacity: .35; } }

/* ------------------------------------------------------------ layout */
.layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); transition: grid-template-columns .25s ease; }
.layout.panel-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.layout.panel-collapsed .panel { visibility: hidden; }
.scope { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.map { position: absolute; inset: 0; background: #05080a; }
body.mode-replay .scope::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 450; box-shadow: inset 0 0 0 2px rgba(var(--amber-rgb), .6), inset 0 0 80px rgba(var(--amber-rgb), .12); }

/* basemap treatments keep light maps legible under the scope */
.base-street .leaflet-tile-pane, .base-terrain .leaflet-tile-pane { filter: brightness(.68) contrast(1.1) saturate(.75); }
.base-satellite .leaflet-tile-pane { filter: brightness(.78) contrast(1.05) saturate(.85); }
.base-dark .leaflet-tile-pane, .base-darkStreets .leaflet-tile-pane { filter: brightness(.62) contrast(1.25) saturate(.6); }
body.mode-replay .leaflet-tile-pane { filter: sepia(.35) brightness(.75) !important; }

.radar-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
/* v17: pre-rendered sweep sprites, rotated on the compositor (transform only: no layout / repaint per frame) */
.sweep-pos, .sweep-rot { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.sweep-sprite { position: absolute; pointer-events: none; }

/* Leaflet chrome */
.leaflet-container { font-family: var(--sans); background: #05080a; }
.leaflet-control-attribution { background: rgba(7, 11, 13, .78) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: #bcd0d6 !important; }
.leaflet-control-zoom a { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--line-2) !important; }
.leaflet-control-zoom a:hover { background: var(--surface-3) !important; }
.leaflet-bar { border: 1px solid var(--line-2) !important; box-shadow: none !important; }
.leaflet-control-scale-line { background: rgba(7,11,13,.7); color: var(--muted); border-color: var(--muted); font: 10px var(--mono); }
.leaflet-bottom.leaflet-left { bottom: 0; }

/* ------------------------------------------------------------ map overlays (HTML) */
.map-tl { position: absolute; top: 12px; left: 12px; z-index: 1000; }
.map-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  background: rgba(12,19,22,.92); border: 1px solid var(--line-2); border-radius: var(--r); font-weight: 600;
  backdrop-filter: blur(6px);
}
.map-btn svg { width: 16px; height: 16px; color: var(--scope); }
.map-btn[aria-expanded="true"] { border-color: var(--scope); }
.layers-pop {
  margin-top: 8px; width: 300px; max-height: calc(100vh - 180px); overflow: auto;
  background: rgba(12,19,22,.97); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.pop-group { border: 0; margin: 0 0 12px; padding: 0; }
.pop-group legend { font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding: 0; }
.base-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.base-opt { position: relative; }
.base-opt input { position: absolute; opacity: 0; inset: 0; }
.base-opt span { display: block; text-align: center; padding: 6px 0; border: 1px solid var(--line-2); border-radius: 4px; font-size: var(--fs-sm); }
.base-opt input:checked + span { border-color: var(--scope); color: var(--scope); background: rgba(var(--scope-rgb), .08); }
.base-opt input:focus-visible + span { outline: 2px solid #9af7d0; outline-offset: 2px; }
.overlay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chk { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 4px; position: relative; cursor: pointer; }
.chk:hover { background: var(--surface-2); }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk-box { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 3px; display: grid; place-items: center; }
.chk input:checked + .chk-box { border-color: var(--scope); background: var(--scope); }
.chk input:checked + .chk-box::after { content: ''; width: 8px; height: 4px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.chk input:focus-visible + .chk-box { outline: 2px solid #9af7d0; outline-offset: 2px; }
.chk-text { font-size: var(--fs-md); }
.src { font: 600 9px var(--mono); letter-spacing: .08em; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--muted); }
.src-sim { border-style: dashed; }
.src-live { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }
.pop-note { margin: 0; font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.scope-readout {
  position: absolute; top: 12px; right: 12px; z-index: 900; display: flex; gap: 2px;
  font-size: var(--fs-xs); color: var(--muted);
}
.scope-readout span { background: rgba(7,11,13,.8); border: 1px solid var(--line); padding: 4px 8px; }
.scope-readout span:first-child { border-radius: 4px 0 0 4px; }
.scope-readout span:last-child { border-radius: 0 4px 4px 0; }
.scope-readout b { color: var(--scope); font-weight: 600; }

.legend { position: absolute; left: 12px; bottom: 44px; z-index: 900; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: calc(100% - 90px); }
.legend-item { font: 500 var(--fs-xs) var(--mono); background: rgba(7,11,13,.85); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 8px; color: var(--text); }
.legend-sim { border-style: dashed; }
.legend-live { border-color: rgba(var(--accent-rgb), .5); }
.legend-warn { border-color: rgba(var(--amber-rgb), .6); color: var(--amber); }

.replay-banner {
  position: absolute; top: auto; bottom: 72px; left: 50%; transform: translateX(-50%); z-index: 1100;
  display: flex; gap: 10px; align-items: center; padding: 6px 14px; border-radius: 4px;
  background: var(--amber); color: #1d1300; font-size: var(--fs-sm); font-weight: 600;
  box-shadow: 0 0 24px rgba(var(--amber-rgb), .35);
}
.replay-banner strong { font: 700 var(--fs-sm) var(--mono); letter-spacing: .16em; }
.replay-bar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1100;
  width: min(760px, calc(100% - 150px)); display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(20,15,6,.95); border: 1px solid rgba(var(--amber-rgb), .6); border-radius: 8px;
}
.replay-bar input[type="range"] { flex: 1; min-width: 80px; accent-color: var(--amber); }
.replay-time { font-size: var(--fs-sm); color: var(--amber); white-space: nowrap; }

/* toasts */
.toast-stack { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 1150; width: min(460px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  background: rgba(14,12,8,.96); border: 1px solid var(--line-2); border-left: 4px solid var(--muted); border-radius: 6px;
  padding: 10px 10px 10px 12px; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: toastIn .22s ease-out;
}
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .25s; }
.toast-caution { border-left-color: var(--amber); }
.toast-warning { border-left-color: var(--red); background: rgba(28,8,11,.96); }
.toast-level { font: 700 10px var(--mono); letter-spacing: .1em; padding: 2px 6px; border-radius: 3px; background: var(--surface-3); color: var(--muted); margin-top: 1px; }
.toast-caution .toast-level { background: var(--amber); color: #1d1300; }
.toast-warning .toast-level { background: var(--red); color: #fff; }
.toast-title { margin: 0; font-weight: 600; font-size: var(--fs-md); }
.toast-detail { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-xs); }
.toast-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

.panel-reopen {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-right: 0; border-radius: 8px 0 0 8px;
  font: 600 10px var(--mono); letter-spacing: .1em; writing-mode: vertical-rl;
}
.panel-reopen svg { width: 14px; height: 14px; writing-mode: horizontal-tb; }

/* ------------------------------------------------------------ markers */
.tgt-icon { background: none; border: 0; }
.tgt { position: relative; width: 28px; height: 28px; }
.tgt-glyph { position: absolute; inset: 0; will-change: transform; }
.tgt-glyph svg { width: 28px; height: 28px; overflow: visible; display: block; }
.tgt-uas .g-fill { fill: var(--scope); stroke: #02130b; stroke-width: 1.2; stroke-linejoin: round; }
.tgt-uas .g-dot { fill: #02130b; }
/* quadcopter glyph: dark outline under everything so it reads on dark, satellite and light maps */
.tgt-uas .q-o { fill: none; stroke: #02130b; stroke-width: 3.4; stroke-opacity: .85; }
.tgt-uas .q-arm-o { stroke-width: 4; stroke-linecap: round; }
.tgt-uas .q-arm { stroke: var(--scope); stroke-width: 2; stroke-linecap: round; fill: none; }
.tgt-uas .q-rotor { fill: #0b2a1f; fill: color-mix(in srgb, var(--scope) 24%, #02130b); stroke: var(--scope); stroke-width: 1.5; }
.tgt-uas .q-front { stroke: #fff; stroke: color-mix(in srgb, var(--scope) 45%, #fff); }      /* brighter front arms/rotors = nose */
.tgt-uas .q-nose { fill: #fff; fill: color-mix(in srgb, var(--scope) 35%, #fff); stroke: #02130b; stroke-width: 1; stroke-linejoin: round; }
.tgt-uas .q-rotor { stroke-width: 1;  }                                                   /* thin rotor ring */
.tgt-uas .q-prop { fill: var(--scope); stroke: none; }                                    /* 3-blade prop + hub */
.tgt-uas .q-prop.q-front { fill: #fff; fill: color-mix(in srgb, var(--scope) 45%, #fff); } /* front props = nose cue */
.tgt-uas .tgt-glyph { filter: drop-shadow(0 0 3px rgba(var(--scope-rgb), .55)); }
.tgt-manned .g-hollow { fill: rgba(8,12,14,.75); stroke: #f4f8fa; stroke-width: 1.6; }
.tgt-manned .g-rotor { stroke: #f4f8fa; stroke-width: 1.3; opacity: .85; }
.tgt-manned .g-nose { stroke: #f4f8fa; stroke-width: 2; }
.tgt-ground .tgt-glyph { transform: scale(.82); }
.tgt-ground .g-hollow { fill: rgba(8,12,14,.8); stroke: var(--ground); stroke-width: 1.6; }
.tgt-ground .g-dot { fill: var(--ground); }
.tgt-ground .g-line { stroke: var(--ground); stroke-width: 1.6; fill: none; }
/* v17: contrast halo on terrain / street / satellite maps. It sits on the <svg> (child of .tgt-glyph), so the
   glyph's own filter (custom-colour glow, sweep-hit `iridesce` pulse) still animates on the parent and stacks on
   top; no transform used (rotation is inline on .tgt-glyph). Tags, rings and leaders are untouched. */
.base-light .tgt-glyph svg { filter: drop-shadow(0 0 0.75px rgba(0,0,0,.95)) drop-shadow(0 0 2.5px rgba(0,0,0,.7)); }

.tgt-block {
  position: absolute; left: 34px; top: -16px; display: flex; flex-direction: column;
  background: rgba(5,9,11,.84); border-left: 2px solid var(--scope); padding: 2px 7px 3px;
  white-space: nowrap; line-height: 1.25; border-radius: 0 3px 3px 0; pointer-events: auto;
}
.tgt-block::before { content: ''; position: absolute; left: -10px; top: 50%; width: 9px; height: 1px; background: rgba(var(--scope-rgb), .7); transform: rotate(35deg); transform-origin: right; }
.tgt-name { font: 600 var(--fs-sm) var(--sans); color: var(--text); cursor: text; }
.tgt-data { font: 500 10px var(--mono); color: var(--muted); }
.tgt-kind { font: 700 8.5px var(--mono); letter-spacing: .1em; color: #f4f8fa; opacity: .8; }
.tgt-manned .tgt-block { border-left: 2px dashed #f4f8fa; background: rgba(5,9,11,.9); }
.tgt-manned .tgt-block::before { background: rgba(244,248,250,.7); }
.tgt-ground .tgt-block { border-left-color: var(--ground); top: -12px; left: 28px; }
.tgt-ground .tgt-block::before { background: rgba(156,202,255,.6); }
.tgt-ground .tgt-name { font-size: var(--fs-xs); }
.tgt.tag-left .tgt-block { left: auto; right: 34px; border-left: 0; border-right: 2px solid var(--scope); border-radius: 3px 0 0 3px; align-items: flex-end; }
.tgt.tag-left .tgt-block::before { left: auto; right: -10px; transform: rotate(-35deg); transform-origin: left; }
.tgt-manned.tag-left .tgt-block { border-right: 2px dashed #f4f8fa; }
.tgt-ground.tag-left .tgt-block { border-right-color: var(--ground); right: 28px; }
.tgt-leader { display: none; position: absolute; left: 14px; top: 14px; height: 1px; transform-origin: 0 50%; background: rgba(var(--scope-rgb), .75); box-shadow: 0 0 0 .5px rgba(2,19,11,.6); pointer-events: none; }
.tgt-manned .tgt-leader { background: rgba(244,248,250,.75); }
.tgt-ground .tgt-leader { background: rgba(156,202,255,.7); }
.tgt.conf-caution .tgt-leader { background: rgba(var(--amber-rgb), .85); }
.tgt.conf-warning .tgt-leader { background: rgba(var(--red-rgb), .9); }
.tgt.tag-moved .tgt-block::before { display: none; }   /* the leader line replaces the short tick */
.tgt.dim .tgt-leader { display: none !important; }
.tgt-edit { font: 600 var(--fs-sm) var(--sans); width: 150px; background: #000; border: 1px solid var(--scope); color: var(--text); padding: 1px 4px; border-radius: 3px; }

.tgt-ring { position: absolute; inset: -9px; border-radius: 50%; border: 2px solid transparent; pointer-events: none; }
.tgt.conf-caution .tgt-ring { border-color: var(--amber); box-shadow: 0 0 14px rgba(var(--amber-rgb), .8), inset 0 0 8px rgba(var(--amber-rgb), .5); animation: ringPulse .9s ease-in-out infinite; }
.tgt.conf-warning .tgt-ring { border-color: var(--red); box-shadow: 0 0 16px rgba(var(--red-rgb), .9), inset 0 0 8px rgba(var(--red-rgb), .6); animation: ringPulse .5s ease-in-out infinite; }
.tgt.conf-caution .tgt-block { border-left-color: var(--amber); }
.tgt.conf-warning .tgt-block { border-left-color: var(--red); }
@keyframes ringPulse { 50% { transform: scale(1.18); opacity: .65; } }

.tgt.selected::after {
  content: ''; position: absolute; inset: -7px; pointer-events: none;
  background:
    linear-gradient(#fff,#fff) top left / 8px 1.5px no-repeat, linear-gradient(#fff,#fff) top left / 1.5px 8px no-repeat,
    linear-gradient(#fff,#fff) top right / 8px 1.5px no-repeat, linear-gradient(#fff,#fff) top right / 1.5px 8px no-repeat,
    linear-gradient(#fff,#fff) bottom left / 8px 1.5px no-repeat, linear-gradient(#fff,#fff) bottom left / 1.5px 8px no-repeat,
    linear-gradient(#fff,#fff) bottom right / 8px 1.5px no-repeat, linear-gradient(#fff,#fff) bottom right / 1.5px 8px no-repeat;
}
.tgt.selected .tgt-block { background: rgba(5,9,11,.96); box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.tgt.stale .tgt-glyph { opacity: .45; }
.tgt.stale .tgt-block { border-left-style: dashed; border-left-color: var(--amber); }
.tgt.stale .tgt-data { color: var(--amber); }
.tgt.dim { opacity: .28; }
.tgt.dim .tgt-block { display: none; }

/* sweep "paint": color-true pulse ~1.1 s */
.tgt-burst { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(var(--scope-rgb), .0); pointer-events: none; }
.tgt.ping .tgt-glyph { animation: iridesce 1.1s ease-out; }
.tgt.ping .tgt-burst { animation: burst 1s ease-out; }
/* v13: the sweep paints the blip only; the data block (name tag) stays steady — no glow/brighten on ping */
.tgt.ping .tgt-block { animation: none; }
/* sweep paint: target keeps its own color (green by default) and pulses, no hue shift */
@keyframes iridesce {
  0%   { scale: 1; filter: brightness(1)   drop-shadow(0 0 0 rgba(var(--scope-rgb), 0)); }
  12%  { scale: 1.22; filter: brightness(1.6) drop-shadow(0 0 6px rgba(var(--scope-rgb), 1)) drop-shadow(0 0 14px rgba(var(--scope-rgb), .8)); }
  45%  { scale: 1.06; filter: brightness(1.25) drop-shadow(0 0 8px rgba(var(--scope-rgb), .6)); }
  100% { scale: 1; filter: brightness(1)   drop-shadow(0 0 3px rgba(var(--scope-rgb), .55)); }
}
@keyframes burst {
  0% { transform: scale(.5); border-color: rgba(var(--scope-rgb), .95); box-shadow: 0 0 12px rgba(var(--scope-rgb), .8); }
  100% { transform: scale(2.4); border-color: rgba(var(--scope-rgb), 0); box-shadow: 0 0 0 rgba(var(--scope-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .tgt.ping .tgt-glyph { animation: iridesceCalm 1.1s ease-out; }
  .tgt.ping .tgt-burst, .tgt.ping .tgt-block, .tgt-ring, .sim-dot { animation: none !important; }
  @keyframes iridesceCalm { 10% { filter: brightness(1.8); } }
}

/* ------------------------------------------------------------ panel */
.panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); position: relative; z-index: 1100; }
body.mode-replay .panel { border-left-color: rgba(var(--amber-rgb), .45); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; height: 48px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-handle { flex: 1; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; height: 100%; text-align: left; cursor: default; }
.handle-bar { display: none; }
.panel-title { font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.alert-pill { font: 700 10px var(--mono); letter-spacing: .06em; background: var(--amber); color: #1d1300; padding: 2px 7px; border-radius: 10px; animation: blink 1s ease-in-out infinite; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--muted); }
.icon-btn:hover { border-color: var(--line-2); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }

.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: var(--fs-md); font-weight: 500; white-space: nowrap; padding: 0 10px;
}
.btn:hover:not(:disabled) { border-color: var(--faint); background: var(--surface-3); }
.btn[aria-pressed="true"]:not(.btn-primary):not(.btn-amber) { border-color: rgba(var(--scope-rgb), .7); color: var(--scope); background: rgba(var(--scope-rgb), .07); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; min-width: 86px; }
.btn-primary:hover:not(:disabled) { background: #6af7bd; border-color: #6af7bd; }
.btn-primary[aria-pressed="true"] { background: var(--surface-2); color: var(--accent); }
.btn-amber { background: rgba(var(--amber-rgb), .12); color: var(--amber); border-color: rgba(var(--amber-rgb), .6); }
.btn-amber:hover:not(:disabled) { background: rgba(var(--amber-rgb), .2) !important; border-color: var(--amber) !important; }
.btn-ghost { background: none; }
.btn-ico { font-size: 10px; letter-spacing: -1px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; height: 32px; }
.seg-btn { background: var(--surface-2); border: 0; border-right: 1px solid var(--line-2); padding: 0 12px; font-weight: 500; font-size: var(--fs-md); }
.seg-btn:last-child { border-right: 0; }
.seg-btn[aria-pressed="true"] { background: rgba(var(--scope-rgb), .14); color: var(--scope); box-shadow: inset 0 -2px 0 var(--scope); }
.seg-sm .seg-btn { padding: 0 9px; font-family: var(--mono); font-size: var(--fs-sm); }
.seg-mode .seg-btn { padding: 0 14px; font: 600 var(--fs-sm) var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.seg-mode .seg-btn[data-mode="replay"][aria-pressed="true"] { background: var(--amber); color: #1d1300; box-shadow: none; }
.seg-btn:focus-visible { outline-offset: -2px; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; height: 42px; font-size: var(--fs-md); font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--scope); }
.tab:focus-visible { outline-offset: -3px; }
.tab-count { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--surface-3); color: var(--muted); min-width: 18px; }
.tab.has-alert .tab-count { background: var(--amber); color: #1d1300; }
.tab.flash { animation: tabFlash 1s ease-out; }
@keyframes tabFlash { 0% { background: rgba(var(--amber-rgb), .25); } 100% { background: transparent; } }
.tabpanel { flex: 1 0 auto; }

/* track rows */
.track-list { list-style: none; margin: 0; padding: 0; }
.trk { padding: 12px 16px 12px 16px; border-bottom: 1px solid var(--line); position: relative; cursor: pointer; }
.trk:hover { background: rgba(255,255,255,.02); }
.trk.is-selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--scope); }
.trk.is-dim { opacity: .45; }
.trk-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.trk-locate { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 6px; }
.trk-locate:hover { border-color: var(--scope); }
.trk-id { font-size: 10.5px; color: var(--muted); letter-spacing: .03em; }
.trk-glyph { width: 10px; height: 10px; flex: none; }
.trk-glyph-uas { background: var(--scope); clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%); }
.trk-glyph-ground { border: 1.5px solid var(--ground); border-radius: 2px; }
.trk-tag {
  min-width: 0; width: 100%; height: 30px; padding: 0 6px; background: transparent; border: 1px solid transparent; border-radius: 4px;
  font-size: var(--fs-lg); font-weight: 600; text-overflow: ellipsis;
}
.trk-tag:hover { border-color: var(--line-2); }
.trk-tag:focus { border-color: var(--scope); background: #060a0c; outline: none; box-shadow: 0 0 0 2px rgba(var(--scope-rgb), .25); }
.trk-hist-btn { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 6px; background: none; border: 1px solid transparent; border-radius: 4px; color: var(--muted); font-size: 10px; }
.trk-hist-btn svg { width: 13px; height: 13px; }
.trk-hist-btn:hover, .trk-hist-btn[aria-expanded="true"] { border-color: var(--line-2); color: var(--text); }
.trk-sub { margin: 4px 0 8px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-cpa { color: var(--amber); }
.trk-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; }
.trk-ground .trk-stats { grid-template-columns: 0.8fr 0.8fr 1.4fr 1fr; }
.st { min-width: 0; }
.st dt { font: 600 9.5px var(--mono); letter-spacing: .08em; color: var(--faint); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st dt .unit { letter-spacing: 0; text-transform: none; font-weight: 500; }
.st dd { margin: 0; font-size: var(--fs-lg); font-weight: 500; white-space: nowrap; }
.trk-ground .st dd { font-size: var(--fs-md); }
.st.lvl-caution dd { color: var(--amber); }
.st.lvl-warning dd { color: var(--red); }
.batbar { height: 3px; background: var(--surface-3); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.batbar span { display: block; height: 100%; background: rgba(var(--scope-rgb), .7); transition: width .4s; }
.batbar span.lvl-caution { background: var(--amber); }
.batbar span.lvl-warning { background: var(--red); }
.trk-hist { margin-top: 10px; padding: 10px; border: 1px solid var(--line-2); border-radius: 6px; background: #080d10; cursor: default; }
.hist-h { margin: 0 0 6px; font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hist-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--fs-xs); }
.hist-list li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.hist-list li.current { color: var(--text); }
.hist-name { font-family: var(--sans); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-span { white-space: nowrap; }

.risk { font: 700 9.5px var(--mono); letter-spacing: .08em; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--faint); }
.risk-MED { color: var(--amber); border-color: rgba(var(--amber-rgb), .7); }
.risk-HIGH { color: #fff; background: var(--red); border-color: var(--red); }

.sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.section-h { margin: 0 0 10px; font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hint { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.tabpanel > .hint { padding: 0 16px 14px; }
.risk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.risk-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 8px 10px; background: var(--surface-2); border-radius: 6px; }
.risk-pair { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-num { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); }
.risk-list .risk-empty { display: block; color: var(--muted); font-size: var(--fs-sm); background: none; padding: 0; }

.switch-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; font-size: var(--fs-md); }
.switch-track { width: 34px; height: 20px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .15s; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch[aria-checked="true"] .switch-track { background: rgba(var(--accent-rgb), .25); border-color: var(--accent); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(14px); background: var(--accent); }
.switch-label::after { content: ' · off'; color: var(--faint); font-family: var(--mono); font-size: var(--fs-xs); }
.switch[aria-checked="true"] .switch-label::after { content: ' · on'; color: var(--accent); }

.alert-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow: auto; }
.alert-log li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; font-size: var(--fs-xs); padding: 4px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.alert-log .log-empty { display: block; color: var(--muted); border: 0; }
.log-time { color: var(--faint); }
.log-lvl { font: 700 9px var(--mono); letter-spacing: .08em; color: var(--muted); }
.log-caution .log-lvl { color: var(--amber); }
.log-warning .log-lvl { color: var(--red); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.kv dt { font: 600 9.5px var(--mono); letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.kv dd { margin: 0; font-size: var(--fs-lg); }

.footnote { margin: auto 0 0; padding: 12px 16px 16px; font-size: var(--fs-xs); color: var(--faint); border-top: 1px solid var(--line); }

.fatal { position: fixed; inset: auto 16px 16px 16px; z-index: 9999; background: var(--red); color: #fff; padding: 12px 16px; border-radius: 6px; font-weight: 600; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .brand-sub { display: none; }
  :root { --panel-w: 352px; }
}
@media (max-width: 1120px) {
  .topbar { flex-wrap: wrap; gap: 8px 14px; }
  .topbar-mid { margin-left: 0; order: 3; width: 100%; }
  .topbar-right { margin-left: auto; }
}
@media (max-width: 820px) {
  :root { --drawer-head: 52px; }
  .topbar { padding: 8px 12px; }
      .clock-value { font-size: var(--fs-md); }
  .layout { display: block; position: relative; }
  .scope { position: absolute; inset: 0 0 var(--drawer-head) 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 64%; border-left: 0; border-top: 1px solid var(--line-2);
    border-radius: 12px 12px 0 0; box-shadow: 0 -12px 30px rgba(0,0,0,.5);
  }
  .panel.drawer-closed .panel-body { display: none; }
  .panel-head { height: var(--drawer-head); }
  .drawer-handle { cursor: pointer; flex-wrap: wrap; justify-content: center; position: relative; }
  .handle-bar { display: block; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
  .panel-collapse, .panel-reopen { display: none !important; }
  .replay-bar { width: calc(100% - 24px); flex-wrap: wrap; bottom: 12px; }
  .replay-bar input[type="range"] { order: -1; flex-basis: 100%; }
  .scope-readout { display: none; }
  .legend { bottom: 70px; }
  .leaflet-bottom.leaflet-left { bottom: 30px; }
  .layers-pop { width: min(300px, calc(100vw - 24px)); max-height: calc(100dvh - 260px); }
}
@media (max-width: 480px) {
  .topbar-right { gap: 10px; }
  .sim-badge { padding: 0 8px; height: 28px; font-size: 10px; gap: 6px; }
  .clock-label { font-size: 9px; }
  .role select { max-width: 160px; }
  .seg-mode .seg-btn { padding: 0 10px; }
  .topbar-mid { flex-wrap: wrap; gap: 8px 10px; }
  .seg-units .seg-btn { padding: 0 8px; }
  .trk-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .st dd { font-size: var(--fs-md); }
  .st dt .unit { display: none; }
  .toolbar { gap: 4px; }
  .toolbar .btn { padding: 0 9px; }
}

/* ------------------------------------------------------------ declutter: filter bar, selection card, eye toggles */
.map-tl { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; max-width: calc(100% - 290px); }
.map-tl .layers-pop { position: absolute; top: 42px; left: 0; margin-top: 0; z-index: 2; }
.map-tl .layers-pop[hidden] { display: none !important; }
.filterbar {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 2px;
  background: rgba(12,19,22,.92); border: 1px solid var(--line-2); border-radius: var(--r); backdrop-filter: blur(6px);
}
.filt {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 4px;
  background: none; border: 1px solid transparent; color: var(--text); font-size: var(--fs-sm); font-weight: 600;
}
.filt:hover { background: var(--surface-3); }
.filt-ico { width: 15px; height: 15px; flex: none; color: var(--scope); }
.filt[data-cat="ground"] .filt-ico { color: var(--ground); }
.filt[data-cat="manned"] .filt-ico { color: #e8eef1; }
.filt-n { font-size: 10.5px; color: var(--muted); min-width: 10px; padding: 1px 5px; border-radius: 3px; background: var(--surface-3); }
.filt[aria-pressed="true"] { border-color: rgba(var(--scope-rgb), .35); background: rgba(var(--scope-rgb), .06); }
.filt.is-off { color: var(--faint); }
.filt.is-off .filt-lbl { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.filt.is-off .filt-ico { color: var(--faint); opacity: .7; }
.filt.is-off .filt-n { background: none; color: var(--faint); }
.filt-reset { color: var(--scope); font-weight: 600; border-left: 1px solid var(--line-2); border-radius: 0 4px 4px 0; margin-left: 2px; }

.sel-card {
  position: absolute; top: 42px; left: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: max-content; max-width: calc(100vw - 24px);
  padding: 8px 8px 8px 12px; background: rgba(12,19,22,.95); border: 1px solid rgba(var(--scope-rgb), .55);
  border-radius: var(--r); box-shadow: 0 6px 18px rgba(0,0,0,.45); backdrop-filter: blur(6px);
}
.sel-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sel-kind { font-size: 9.5px; letter-spacing: .1em; color: var(--scope); }
.sel-name { font-weight: 600; font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sel-id { font-size: 10.5px; color: var(--muted); }
.sel-actions { display: flex; gap: 6px; }
.btn-sm { height: 28px; padding: 0 9px; font-size: var(--fs-sm); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 28px; padding: 0; font-size: 16px; }

.trk-head { display: flex; }
.trk-head .trk-tag { flex: 1 1 auto; min-width: 0; }
.trk-eye {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; flex: none;
  background: none; border: 1px solid transparent; border-radius: 4px; color: var(--muted);
}
.trk-eye svg { width: 15px; height: 15px; }
.trk-eye .eye-off { display: none; }
.trk-eye.is-off .eye-on { display: none; }
.trk-eye.is-off .eye-off { display: block; }
.trk-eye:hover { border-color: var(--line-2); color: var(--text); }
.trk-eye.is-off { color: var(--amber); border-color: rgba(255,176,32,.45); }
.trk.is-hidden > :not(.trk-head) { opacity: .4; }
.trk.is-hidden .trk-head > :not(.trk-eye) { opacity: .5; }
.trk.is-hidden .trk-tag { text-decoration: line-through; }
.list-h { padding: 12px 16px 0; margin-bottom: 4px; }
.trk-glyph-manned { border: 1.5px dashed #e8eef1; border-radius: 50%; }

.tgt-icon.is-hidden { display: none !important; }
.log-show {
  grid-column: 3; justify-self: start; margin-top: 2px; height: 22px; padding: 0 8px; font-size: 10.5px;
  background: none; border: 1px solid var(--line-2); border-radius: 4px; color: var(--scope);
}
.log-show:hover { border-color: var(--scope); }

@media (max-width: 820px) {
  .map-tl { max-width: calc(100% - 24px); }
}
@media (max-width: 480px) {
  .filt { padding: 0 7px; gap: 5px; }
  .map-tl .layers-pop, .sel-card { top: 84px; }
  .sel-name { max-width: 150px; }
}
.trk-locate { flex: none; white-space: nowrap; }
.filt { white-space: nowrap; }

/* ------------------------------------------------------------ geolocation chip, Locate me, you-are-here */
.geo-chip {
  position: absolute; top: 44px; right: 12px; z-index: 900; display: inline-flex; align-items: center; gap: 6px;
  max-width: min(320px, calc(100% - 24px)); padding: 3px 9px; border-radius: 4px; cursor: pointer;
  font: 500 var(--fs-xs) var(--mono); color: var(--muted); background: rgba(7,11,13,.85); border: 1px solid var(--line-2);
}
.geo-chip .geo-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-chip .geo-ico { width: 12px; height: 12px; flex: none; color: var(--muted); }
.geo-chip:hover { color: var(--text); }
.geo-chip:focus-visible { outline: 2px solid var(--scope); outline-offset: 2px; }
.geo-chip[data-state="locating"] .geo-ico { color: #4aa8ff; animation: geo-pulse 1.1s ease-in-out infinite; }
.geo-chip[data-state="fix"] { color: var(--text); border-color: rgba(74,168,255,.55); }
.geo-chip[data-state="fix"] .geo-ico { color: #4aa8ff; }
.geo-chip[data-state="default"] .geo-ico, .geo-chip[data-state="url"] .geo-ico { color: var(--muted); }
@keyframes geo-pulse { 50% { opacity: .35; } }
.btn-locate { display: inline-flex; align-items: center; gap: 5px; }
.btn-locate .btn-svg { width: 14px; height: 14px; flex: none; }
.btn-locate[aria-busy="true"] .btn-svg { color: #4aa8ff; animation: geo-pulse 1.1s ease-in-out infinite; }
.you-icon { background: none; border: 0; }
.you-dot { position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #4aa8ff; border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(74,168,255,.25), 0 0 10px rgba(74,168,255,.8); }
.you-tag { position: absolute; left: 20px; top: 1px; font: 600 9px var(--mono); letter-spacing: .1em; color: #cfe6ff; background: rgba(7,11,13,.8); border: 1px solid rgba(74,168,255,.6); border-radius: 3px; padding: 0 4px; }
@media (max-width: 820px) { .geo-chip { top: auto; bottom: 104px; right: 12px; } }
@media (prefers-reduced-motion: reduce) { .geo-chip .geo-ico, .btn-locate .btn-svg { animation: none !important; } }

/* ------------------------------------------------------------ per-target colors */
/* marker: --scope / --scope-rgb are overridden inline on .tgt.has-color (drones, glow, sweep bloom, tag edge) */
.tgt-manned.has-color .g-hollow, .tgt-manned.has-color .g-rotor, .tgt-manned.has-color .g-nose { stroke: var(--tc); }
.tgt-manned.has-color .tgt-glyph, .tgt-ground.has-color .tgt-glyph { filter: drop-shadow(0 0 3px rgba(var(--scope-rgb), .6)); }
.tgt-manned.has-color .tgt-kind { color: var(--tc); }
.tgt-ground.has-color .g-hollow, .tgt-ground.has-color .g-line { stroke: var(--tc); }
.tgt-ground.has-color .g-dot { fill: var(--tc); }
.tgt.has-color .tgt-block::before { background: rgba(var(--scope-rgb), .75); }
.tgt.has-color:not(.conf-caution):not(.conf-warning):not(.stale) .tgt-block { border-left-color: var(--tc); }
.tgt.has-color.tag-left:not(.conf-caution):not(.conf-warning):not(.stale) .tgt-block { border-right-color: var(--tc); }
.tgt.has-color .tgt-name { color: color-mix(in srgb, var(--tc) 40%, #ffffff); }
/* safety cues always win: the ring stays red/amber; the tag edge follows the alert */
.tgt.conf-caution.tag-left .tgt-block { border-right-color: var(--amber); }
.tgt.conf-warning.tag-left .tgt-block { border-right-color: var(--red); }

/* swatch trigger (rows + selection card) */
.color-sw {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; flex: none; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer; --sw: var(--scope);
}
.color-sw:hover, .color-sw[aria-expanded="true"] { border-color: var(--line-2); }
.color-sw:focus-visible { outline: 2px solid var(--scope); outline-offset: 1px; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 0 3px rgba(255,255,255,.35); }
.color-sw.is-def .color-dot { background: conic-gradient(var(--sw) 0 50%, transparent 0) border-box; border: 1.5px solid var(--sw); box-shadow: none; }
.btn.color-sw.sel-color { width: 28px; }
.trk.has-color .trk-glyph-uas { background: var(--tc); }
.trk.has-color .trk-glyph-ground, .trk.has-color .trk-glyph-manned { border-color: var(--tc); }
.trk.has-color { box-shadow: inset 3px 0 0 var(--tc); }
.trk.is-hidden .trk-head > .color-sw { opacity: .5; }
.hist-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.hist-dot.is-def { border: 1px dashed var(--muted); }
.hist-h-col { margin-top: 10px; }

/* palette popover */
.color-pop {
  position: fixed; z-index: 3000; width: 228px; padding: 10px; border-radius: 8px;
  background: rgba(10,16,19,.98); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(0,0,0,.6);
}
.color-pop[hidden] { display: none; }
.cp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: var(--fs-xs); color: var(--muted); }
.cp-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-hover { color: var(--text); white-space: nowrap; }
.cp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cp-sw {
  position: relative; height: 36px; border-radius: 6px; border: 1px solid var(--line-2); background: #0b1215; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.cp-sw .cp-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 8px var(--sw); }
.cp-sw:hover { border-color: var(--muted); }
.cp-sw:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cp-sw[aria-pressed="true"] { border-color: #fff; }
.cp-check { position: absolute; right: 3px; top: 1px; font-size: 10px; color: #fff; display: none; }
.cp-sw[aria-pressed="true"] .cp-check { display: block; }
.cp-def .cp-dot { display: none; }
.cp-def-lbl { font: 600 10px var(--mono); color: var(--muted); letter-spacing: .06em; }
.cp-custom { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.cp-custom-lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.cp-input { width: 64px; height: 26px; padding: 0 2px; background: #0b1215; border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; }
.cp-input:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.cp-note { font-size: 10.5px; color: var(--text); }
.cp-note:empty { display: none; }
.cp-foot { margin: 8px 0 0; font-size: 10.5px; color: var(--faint); }
@media (max-width: 480px) { .color-sw { width: 26px; } .color-pop { width: min(240px, calc(100vw - 16px)); } }

/* ------------------------------------------------------------ aircraft source: SIM / RECEIVER chip, receiver aircraft */
.adsb-chip {
  position: absolute; top: 72px; right: 12px; z-index: 900; display: inline-flex; align-items: center; gap: 6px;
  max-width: min(320px, calc(100% - 24px)); padding: 3px 9px; border-radius: 4px; cursor: pointer;
  font: 500 var(--fs-xs) var(--mono); color: var(--muted); background: rgba(7,11,13,.85); border: 1px solid var(--line-2);
}
.adsb-chip .adsb-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adsb-chip .adsb-ico { width: 12px; height: 12px; flex: none; }
.adsb-chip:hover { color: var(--text); }
.adsb-chip:focus-visible { outline: 2px solid var(--scope); outline-offset: 2px; }
.adsb-chip[data-state="live"] { color: var(--text); border-color: rgba(var(--scope-rgb), .6); }
.adsb-chip[data-state="live"] .adsb-ico { color: var(--scope); }
.adsb-chip[data-state="connecting"] .adsb-ico { animation: geo-pulse 1.1s ease-in-out infinite; }
.adsb-chip[data-state="error"] { color: #e8d9ff; border-style: dashed; border-color: #8f86a8; }
.adsb-chip[data-state="error"] .adsb-txt::before { content: "⚠ "; }
@media (max-width: 820px) { .adsb-chip { top: auto; bottom: 132px; right: 12px; } }
@media (prefers-reduced-motion: reduce) { .adsb-chip .adsb-ico { animation: none !important; } }
/* air-medical (HEMS): white cross badge + kind label; never red (red is reserved for alerts) */
.tgt-med .tgt-kind::before { content: "✚ "; }
.tgt-med::after { content: "✚"; position: absolute; left: 21px; top: -5px; font: 700 10px/1 var(--mono); color: #f4f8fa; text-shadow: 0 0 3px #000; pointer-events: none; }
.trk-med .trk-glyph::after { content: "✚"; font: 700 9px var(--mono); margin-left: 2px; color: var(--text); }
/* above the ceiling: lower priority, dimmed but visible (alerts still evaluate them) */
.tgt.high:not(.conf-caution):not(.conf-warning) { opacity: .5; }
.tgt.high .tgt-data::after { content: " · HIGH"; }
.trk.is-high { opacity: .62; }
.trk.is-emerg { box-shadow: inset 3px 0 0 #ff4d5e; }
.trk.is-stale .st-alt dd, .trk.is-stale .st-gs dd { opacity: .55; }

/* ------------------------------------------------------------ SARAware branding + demo indicator */
/* neutral (not amber/red: those mean CAUTION/WARNING here), solid outline, always visible */
.sim-badge:not([data-state="replay"]) { border-style: solid; border-color: rgba(232, 240, 244, .42); background: rgba(232, 240, 244, .07); }
.sim-badge strong { letter-spacing: .1em; }
.sim-badge .sw-short { display: none; }
.sim-state { color: var(--muted); margin-left: 2px; }
@media (max-width: 480px) {
  .sim-badge .sw-long { display: none; }
  .sim-badge .sw-short { display: inline; }
}
@media (max-width: 1120px) { .brand-logo img { height: 44px; } }
@media (max-width: 820px) { .brand-logo img { height: 40px; } }
@media (max-width: 480px) { .brand-logo img { height: 36px; width: 36px; } } /* icon only (see <picture> in index.html) */

/* ------------------------------------------------------------ alert tiers, encounter types, separation rules (v12) */
/* ADVISORY uses a cyan/white two-tone DASHED ring. Custom target colors (incl. the palette's cyan and white)
   only tint glyphs and tag borders and never draw a ring, so a dashed ring always means "advisory";
   solid amber/red rings stay reserved for caution/warning. */
:root { --adv: #8be9ff; --adv-rgb: 139, 233, 255; }
.tgt.conf-advisory .tgt-ring { border: 2px dashed var(--adv); box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 0 10px rgba(var(--adv-rgb), .45); animation: ringSpin 6s linear infinite; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
.toast-advisory { border-left-color: var(--adv); background: rgba(8,16,20,.96); }
.toast-advisory .toast-level { background: transparent; color: var(--adv); box-shadow: inset 0 0 0 1px var(--adv); }
.log-advisory .log-lvl { color: var(--adv); }
.tier { display: inline-block; font: 700 9px var(--mono); letter-spacing: .08em; padding: 1px 5px; border-radius: 3px; vertical-align: 1px; }
.tier-advisory { color: var(--adv); box-shadow: inset 0 0 0 1px var(--adv); }
.tier-caution { background: var(--amber); color: #1d1300; }
.tier-warning { background: var(--red); color: #fff; }
.risk-pair .tier { margin-left: 6px; }
.alert-pill.pill-warning { background: var(--red); color: #fff; }

/* encounter-type tag: icon + short label (D↔D, D↔AC, ...) */
.enc-tag { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 1px 5px; border-radius: 3px; vertical-align: 1px;
  font: 700 9px var(--mono); letter-spacing: .06em; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.enc-ico { width: 26px; height: 10px; flex: none; }
.enc-da { color: #f4f8fa; border-color: rgba(244,248,250,.55); border-style: dashed; }
.enc-dd { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }
.enc-dp { color: var(--ground); border-color: rgba(156,202,255,.5); }
.toast-enc { display: flex; width: max-content; max-width: 100%; margin: 0 0 4px; font-size: 10px; padding: 2px 6px; }
.toast-enc .enc-ico { width: 31px; height: 12px; }
.alert-log .log-text .enc-tag { margin-right: 5px; }
.log-filter { margin: 0 0 8px; }
.alert-log[data-filter="dd"] li[data-enc]:not([data-enc="dd"]),
.alert-log[data-filter="da"] li[data-enc]:not([data-enc="da"]),
.alert-log[data-filter="other"] li[data-enc="dd"],
.alert-log[data-filter="other"] li[data-enc="da"] { display: none; }

/* default thresholds */
.th-details > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; border-radius: 4px; }
.th-details > summary::-webkit-details-marker { display: none; }
.th-details > summary::before { content: '▸'; color: var(--muted); font-size: 11px; width: 10px; transition: transform .15s; }
.th-details[open] > summary::before { transform: rotate(90deg); }
.th-details > summary .section-h { margin: 0; }
.th-badge { font-size: 9px; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .5); border-radius: 3px; padding: 0 5px; }
.th-intro { margin: 8px 0 10px; line-height: 1.9; }
.th-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; table-layout: fixed; }
.th-table th, .th-table td { padding: 3px 4px; text-align: left; font-size: var(--fs-sm); vertical-align: middle; }
.th-table thead th { font: 600 10px var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; width: 30%; }
.th-table tbody th { font-weight: 500; color: var(--text); }
.th-table .unit { color: var(--faint); font-family: var(--mono); font-size: var(--fs-xs); }
.th-msg { min-height: 1em; }
.th-msg.is-err, .sep-err { color: #ff8a96; }

/* shared form fields */
.th-table input, .fld input, .fld select {
  width: 100%; min-width: 0; height: 32px; padding: 0 8px; background: #060a0c; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text);
}
.th-table input:focus-visible, .fld input:focus-visible, .fld select:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; border-color: var(--scope); }
.th-table input[aria-invalid="true"], .fld input[aria-invalid="true"] { border-color: var(--red); }

/* separation rules */
.sep-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.sep-empty { color: var(--muted); font-size: var(--fs-sm); }
.sep-rule { padding: 8px 10px; background: var(--surface-2); border-radius: 6px; border-left: 3px solid var(--amber); }
.sep-rule:has(.sep-lvl-warning) { border-left-color: var(--red); }
.sep-rule.is-off { border-left-color: var(--line-2); }
.sep-rule.is-off .sep-name, .sep-rule.is-off .sep-sum { color: var(--faint); }
.sep-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sep-sw { padding: 2px 0; flex: none; }
.sep-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.sep-lvl { flex: none; font-size: 9px; font-weight: 700; letter-spacing: .08em; padding: 1px 5px; border-radius: 3px; }
.sep-lvl-caution { background: var(--amber); color: #1d1300; }
.sep-lvl-warning { background: var(--red); color: #fff; }
.sep-sum { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.sep-pair { color: var(--text); }
.sep-now { margin: 2px 0 6px; font-size: var(--fs-xs); color: var(--faint); }
.sep-now.lvl-caution { color: var(--amber); }
.sep-now.lvl-warning { color: var(--red); }
.sep-del.is-armed { color: #ff8a96; border-color: rgba(var(--red-rgb), .7); }
.sep-breaches { margin-bottom: 10px; }
.sep-breaches .risk-num { white-space: normal; }
.sep-form { margin-top: 4px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; display: grid; gap: 10px; }
.sep-form-h { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.fld { display: grid; gap: 4px; min-width: 0; }
.fld > label, .fld-set legend { font-size: var(--fs-sm); color: var(--text); font-weight: 500; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld-d { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.fld-set { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; min-width: 0; }
.fld-set legend { padding: 0; margin-bottom: 4px; }
.fld-set:disabled .opt { opacity: .5; }
.opt { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); cursor: pointer; padding: 2px 0; }
.opt input { margin: 2px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.opt em { font-style: normal; font-weight: 600; color: var(--accent); }
.sep-err { margin: 0; font-size: var(--fs-sm); }
@media (max-width: 420px) { .fld-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .tgt.conf-advisory .tgt-ring { animation: none !important; } }

/* v12: phones — with the drawer open, keep only the top (most severe, newest) toast over the map so the panel stays readable */
@media (max-width: 820px) {
  .layout:has(.panel:not(.drawer-closed)) .toast-stack .toast:nth-child(n+2) { display: none; }
  .toast-stack .toast:nth-child(n+3) { display: none; }
}

/* ===================== v13: alarm sound control, banner, collision alarm toasts, test buttons ===================== */
.snd { display: inline-flex; align-items: center; gap: 6px; }
.snd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 600 var(--fs-xs) var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.snd-ico { width: 18px; height: 18px; flex: none; }
.snd-ico .snd-spk { fill: currentColor; }
.snd-ico .snd-wave, .snd-ico .snd-x { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.snd-btn[data-state="on"] { color: var(--accent); border-color: rgba(var(--scope-rgb), .55); }
.snd-btn[data-state="on"] .snd-x { display: none; }
.snd-btn[data-state="muted"] { color: var(--muted); }
.snd-btn[data-state="muted"] .snd-wave { display: none; }
.snd-btn[data-state="blocked"] { color: #1d1300; background: var(--amber); border-color: var(--amber); animation: sndNudge 2.4s ease-in-out infinite; }
.snd-btn[data-state="blocked"] .snd-wave { display: none; }
.snd-btn:hover { filter: brightness(1.12); }
.snd-btn:focus-visible, .snd-ack:focus-visible, .toast-ack:focus-visible, .snd-banner button:focus-visible, .btn-test:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes sndNudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,176,32,.0); } 50% { box-shadow: 0 0 0 4px rgba(255,176,32,.28); } }
.snd-ack {
  height: 32px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--red); background: var(--red); color: #fff;
  font: 700 var(--fs-xs) var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; animation: ackPulse 1s ease-in-out infinite;
}
@keyframes ackPulse { 50% { background: #a3202f; } }

.snd-banner {
  position: absolute; left: 50%; bottom: 48px; transform: translateX(-50%); z-index: 1140;
  width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px;
  background: rgba(10,16,19,.96); border: 1px solid var(--amber); border-left-width: 4px; border-radius: var(--r);
  padding: 10px 8px 10px 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5); color: var(--text);
}
.snd-banner[hidden] { display: none; }
.snd-banner > svg { width: 22px; height: 22px; color: var(--amber); flex: none; }
.snd-banner p { margin: 0; flex: 1; font-size: var(--fs-sm); line-height: 1.35; }
.snd-banner .btn { flex: none; }
.snd-banner-x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; flex: none; }

/* collision alarm toast */
.toast-alarm.toast-warning { box-shadow: 0 0 0 1px rgba(255,77,94,.55), 0 12px 30px rgba(0,0,0,.45); animation: toastIn .22s ease-out, alarmEdge 1s ease-in-out .22s infinite; }
@keyframes alarmEdge { 50% { box-shadow: 0 0 0 2px rgba(255,77,94,.95), 0 12px 30px rgba(0,0,0,.45); } }
.toast-alarm.is-acked, .toast-alarm.is-cleared { animation: none; }
.toast-ack {
  pointer-events: auto; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border-radius: var(--r); border: 1px solid #fff; background: #fff; color: #3a0710; font: 700 var(--fs-xs) var(--mono); letter-spacing: .05em; text-transform: uppercase;
}
.toast-ack svg { width: 16px; height: 16px; }
.toast-ack:disabled { background: transparent; color: var(--muted); border-color: var(--line-2); }

/* test buttons */
.snd-tests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.snd-tests-h { flex-basis: 100%; font: 600 var(--fs-xs) var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.btn-test { justify-content: flex-start; height: auto; min-height: 32px; padding: 4px 10px; gap: 6px; display: inline-flex; align-items: center; font-size: var(--fs-sm); white-space: normal; text-align: left; }
.btn-test .tier { flex: none; }
.snd-tests-grp { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; align-items: center; }
.snd-tests-sub { flex-basis: 100%; font: 500 var(--fs-xs) var(--mono); letter-spacing: .06em; color: var(--muted); margin-top: 2px; }
.btn-test-sys { border-color: rgba(180,194,204,.35); }
.btn-test-emg { border-color: rgba(255,77,94,.55); border-style: dashed; }
.tier-sys { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px currentColor; }
.btn-test-adv { border-color: rgba(139,233,255,.45); }
.btn-test-cau { border-color: rgba(255,176,32,.45); }
.btn-test-war { border-color: rgba(255,77,94,.55); }
.tier-advisory { background: transparent; color: var(--adv); box-shadow: inset 0 0 0 1px var(--adv); }

@media (max-width: 820px) {
  .snd-banner { bottom: 14px; }
}
@media (max-width: 480px) {
  .snd-btn { padding: 0 8px; }
  .snd-btn[data-state="on"] .snd-label, .snd-btn[data-state="muted"] .snd-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .snd-banner { flex-wrap: wrap; }
  .snd-banner p { flex-basis: calc(100% - 64px); }
  .snd-banner .btn { margin-left: 32px; }
  .btn-test { flex: 1 1 calc(50% - 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .snd-btn[data-state="blocked"], .snd-ack, .toast-alarm.toast-warning { animation: none !important; }
}

/* ===================== v13: crisp text on high-DPI screens ===================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-synthesis: style; } /* never fake bold: every weight used is loaded */
/* centre text-bearing overlays with auto margins instead of translate(-50%): an odd width would put
   every glyph on a half pixel and blur it */
.toast-stack, .snd-banner { left: 0; right: 0; margin-inline: auto; transform: none; }
.replay-banner { left: 0; right: 0; margin-inline: auto; width: fit-content; transform: none; }
.replay-bar { left: 0; right: 0; margin-inline: auto; transform: none; }
.panel-reopen { top: 0; bottom: 0; margin-block: auto; height: fit-content; transform: none; }
/* map tags: no scale/filter on text; keep the glyph's GPU layer from dragging the tag along */
.tgt-block { transform: none; filter: none; }
/* v13 header fit: the sound control takes the room of the UNITS / VIEW captions on mid widths */
.snd-short { display: none; }
@media (max-width: 1440px) {
  .snd-long { display: none; }
  .snd-short { display: inline; }
  .topbar-mid .role-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ===================== v15: toast placement + persistent critical warnings ===================== */
/* non-critical pop-ups (advisory, caution, rule caution, link stale, notices, receiver lost): left stack under the
   map's top-left controls (and the selected-target card); critical red warnings stay top-centre */
.toast-side {
  position: absolute; left: 12px; top: var(--side-top, 120px); z-index: 1140; width: min(340px, calc(100% - 96px));
  max-height: calc(100% - var(--side-top, 120px) - 84px); overflow: hidden;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast-side:empty { display: none; }
.toast-side .toast { padding: 8px 8px 8px 10px; gap: 8px; }
.toast-side .toast-title { font-size: var(--fs-sm); }
.toast-state { margin: 6px 0 0; font: 700 10px var(--mono); letter-spacing: .08em; color: #ffd0d6; }
.toast-alarm.is-acked { border-left-color: rgba(255,77,94,.75); box-shadow: 0 0 0 1px rgba(255,77,94,.35), 0 12px 30px rgba(0,0,0,.45); }
.toast-alarm.is-acked .toast-level { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.toast-alarm.is-cleared { border-left-color: var(--scope); background: rgba(8,16,12,.96); }
.toast-alarm.is-cleared .toast-level { background: var(--surface-3); color: var(--muted); }
.toast-alarm.is-cleared .toast-state { color: var(--scope); }
.toast-alarm.is-acked .toast-x { opacity: .45; cursor: default; }

/* v15: toasts size to their content (no fixed stretched width); text wraps past the max width */
.toast-stack { width: calc(100% - 24px); max-width: 460px; align-items: center; }
.toast-side { width: auto; max-width: min(380px, calc(100% - 96px)); align-items: flex-start; }
.toast { width: fit-content; min-width: 240px; max-width: min(400px, 100%); box-sizing: border-box; }
.toast-title, .toast-detail { overflow-wrap: anywhere; }
.toast-detail, .toast-state { font-variant-numeric: tabular-nums; }
/* the live separation line in a critical toast: reserve room for the numbers so the box never changes width per tick */
.toast-alarm .toast-detail { min-width: min(47ch, 100%); }
@media (max-width: 820px) {
  .toast { max-width: 100%; }
  .toast-alarm .toast-detail { min-width: 0; }
}
@media (max-width: 820px) { .toast-alarm { width: 100%; } }

.fld-voice { margin-top: 8px; }
.fld-voice .hint { margin: 4px 0 0; }

/* ===================== v17: one left-side alert stack, compact cards, pulsing collision border ===================== */
/* every pop-up (critical warnings included) stacks on the left, below the top-left controls; JS (alerts.ui.placeStacks)
   fits it to the free map area: --side-top / --side-w / --side-h keep it clear of the side menus and chips */
.toast-stack { display: none; }
.toast-side {
  left: 12px; top: var(--side-top, 64px); width: auto;
  max-width: var(--side-w, min(340px, calc(100% - 24px))); max-height: var(--side-h, calc(100% - 140px));
  overflow: visible; gap: 8px; align-items: flex-start;
}
.toast-side .toast, .toast {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  width: max-content; min-width: 0; max-width: 100%; box-sizing: border-box;
  padding: 5px 10px 8px 10px;
}
.toast.is-overflow { display: none; }
.toast-side.is-scroll { height: var(--side-h); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto;
  padding: 3px 6px 3px 3px; margin: -3px 0 0 -3px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
/* level label: a small centred strip across the top; × sits top-right on the same strip */
.toast .toast-level { align-self: center; margin: 0; padding: 1px 8px; font-size: 9.5px; line-height: 14px; }
.toast-x {
  position: absolute; top: 2px; right: 2px; width: 24px; height: 22px; padding: 0; display: grid; place-items: center;
  border-radius: 4px; cursor: pointer;
}
.toast-x:hover { color: var(--text); background: rgba(255,255,255,.06); }
.toast-x:focus-visible { outline: 2px solid #fff; outline-offset: 0; color: var(--text); }
.toast-body { min-width: 0; }
.toast-side .toast-title, .toast-title { font-size: var(--fs-sm); line-height: 1.35; text-wrap: balance; }
.toast-alarm .toast-title { font-size: var(--fs-md); }
.toast-detail { text-wrap: balance; line-height: 1.4; }
.toast-enc { margin: 0 0 3px; }
/* critical live separation: two short lines; reserve just the numbers' width (mono ch) so the card never jitters */
.toast-alarm .toast-detail { white-space: pre-line; min-width: 24ch; text-wrap: wrap; }
.toast-ack { margin-top: 6px; padding: 0 10px; }
.toast-state { margin-top: 5px; }
.toast-more {
  pointer-events: auto; font: 600 var(--fs-xs) var(--mono); letter-spacing: .04em; color: var(--muted);
  background: rgba(12,19,22,.92); border: 1px dashed var(--line-2); border-radius: 4px; padding: 4px 9px; cursor: pointer;
}
.toast-more:hover { color: var(--text); }
.toast-more:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* collision / red rule warnings: the whole border pulses red (~1 s); silenced = steady dim red; cleared = green */
.toast-alarm.toast-warning { border: 1px solid var(--red); border-left-width: 4px; animation: toastIn .22s ease-out, alarmBorder 1s ease-in-out .22s infinite; }
@keyframes alarmBorder {
  0%, 100% { border-color: rgba(255,77,94,.45); box-shadow: 0 0 0 1px rgba(255,77,94,.25), 0 12px 30px rgba(0,0,0,.45); }
  50%      { border-color: #ff4d5e; box-shadow: 0 0 0 2px rgba(255,77,94,.95), 0 0 16px rgba(255,77,94,.55), 0 12px 30px rgba(0,0,0,.45); }
}
.toast-alarm.toast-warning.is-acked { animation: none; border-color: rgba(255,77,94,.6); box-shadow: 0 0 0 1px rgba(255,77,94,.3), 0 12px 30px rgba(0,0,0,.45); }
.toast-alarm.toast-warning.is-cleared { animation: none; border-color: rgba(var(--scope-rgb), .6); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
@media (prefers-reduced-motion: reduce) {
  .toast-alarm.toast-warning { animation: none !important; border-color: var(--red); box-shadow: 0 0 0 1px rgba(255,77,94,.7), 0 12px 30px rgba(0,0,0,.45); }
  .toast-alarm.toast-warning.is-acked { border-color: rgba(255,77,94,.6); }
  .toast-alarm.toast-warning.is-cleared { border-color: rgba(var(--scope-rgb), .6); }
}
@media (max-width: 820px) {
  .toast, .toast-side .toast { max-width: 100%; }
  .toast-alarm { width: auto; }
  .toast-alarm .toast-detail { min-width: 24ch; }
}

/* ===================== v17: collapsible track cards (aircraft) ===================== */
.list-h-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 12px; }
.list-h-row .list-h { flex: 1; min-width: 0; }
.list-tog {
  flex: none; margin-top: 10px; height: 24px; padding: 0 8px; background: none; border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--muted); font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.list-tog:hover { color: var(--text); border-color: var(--scope); }
.list-tog:focus-visible { outline: 2px solid var(--scope); outline-offset: 2px; }
.trk.is-collapsible { padding-top: 0; padding-bottom: 0; }
.trk.is-collapsible:not(.is-collapsed) { padding-bottom: 12px; }
.cc-sum {
  display: grid; grid-template-columns: 12px 12px minmax(0, 1fr) auto auto auto; align-items: center; column-gap: 8px;
  width: calc(100% + 32px); margin: 0 -16px; padding: 9px 16px; min-height: 40px; box-sizing: border-box;
  background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.cc-sum:hover { background: rgba(255,255,255,.03); }
.cc-sum:focus-visible { outline: 2px solid var(--scope); outline-offset: -2px; }
.cc-chev { width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); justify-self: center; transition: transform .15s; }
.cc-sum[aria-expanded="true"] .cc-chev { transform: rotate(45deg); }
.cc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-val { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-badge { font: 700 9.5px var(--mono); letter-spacing: .06em; padding: 2px 5px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; }
.cc-badge[hidden] { display: none; }
.cc-badge.cc-warning { color: #fff; background: var(--red); border-color: var(--red); }
.cc-badge.cc-caution { color: #111; background: var(--amber); border-color: var(--amber); }
.cc-badge.risk-MED { color: var(--amber); }
.cc-badge.risk-HIGH { color: var(--red); }
.cc-det { padding-top: 2px; }
.trk-manned .trk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
@media (prefers-reduced-motion: reduce) { .cc-chev { transition: none; } }
@media (max-width: 400px) { .cc-sum { column-gap: 6px; } .cc-val { font-size: 11px; } }

/* ===================== v17.2: fixed-size compact alert cards, leader lines, Panel tab clearance ===================== */
/* ONE card size for every level (collision / warning / caution / advisory / notice): fixed width, fixed height.
   Layout: [Ack · LEVEL · ×] strip, type chip, 2-line title, 2-line detail (clamped; full text in the title attr + log). */
.toast-side { --card-w: 256px; width: var(--card-w); max-width: var(--side-w, var(--card-w)); align-items: stretch; }
@media (max-width: 820px) { .toast-side { --card-w: 232px; } }
@media (max-width: 480px) { .toast-side { --card-w: 200px; } }
.toast-side .toast, .toast-side .toast-alarm {
  width: 100%; min-width: 0; max-width: 100%; flex: none;
  display: flex; flex-direction: column; gap: 2px; padding: 3px 6px 6px 9px; overflow: hidden;
}
.toast-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; height: 20px; column-gap: 4px; }
.toast-strip-l { justify-self: start; display: flex; min-width: 0; }
.toast-strip-r { justify-self: end; display: flex; }
.toast-side .toast .toast-level { align-self: center; justify-self: center; margin: 0; padding: 1px 8px; font-size: 9.5px; line-height: 14px; white-space: nowrap; }
.toast-side .toast-x { position: static; width: 22px; height: 20px; font-size: 16px; }
.toast-side .toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 3px; }
.toast-chiprow { display: flex; height: 16px; min-width: 0; overflow: hidden; }
.toast-side .toast-enc { display: inline-flex; align-items: center; height: 16px; margin: 0; padding: 0 6px; max-width: 100%; font-size: 9.5px; line-height: 14px; box-sizing: border-box; white-space: nowrap; overflow: hidden; }
.toast-side .toast-sys { font-weight: 600; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 3px; }
.toast-side .toast-title, .toast-side .toast-alarm .toast-title {
  margin: 0; font-size: 12.5px; line-height: 16px; height: 32px; font-weight: 600;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-wrap: pretty; overflow-wrap: anywhere;
}
.toast-side .toast-detail, .toast-side .toast-alarm .toast-detail {
  margin: 0; font-size: 11px; line-height: 14px; height: 28px; min-width: 0; color: #b5c0c4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; text-wrap: wrap; overflow-wrap: anywhere;
}
.toast-side .toast-alarm .toast-detail { white-space: pre-line; }
/* compact Ack · silence button in the strip (left of the centred level label) */
.toast-side .toast-ack {
  margin: 0; height: 20px; min-height: 0; padding: 0 7px 0 5px; gap: 4px; display: inline-flex; align-items: center; min-width: 0;
  font: 700 9.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; white-space: nowrap;
}
.toast-side .toast-ack svg { width: 12px; height: 12px; flex: none; }
.toast-side .toast-ack:disabled { padding: 0 5px; }
@media (max-width: 480px) {
  .toast-side .toast-ack { padding: 0 5px; }
  .toast-side .toast-ack span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* icon only; aria-label keeps the name */
  .toast-side .toast-title { font-size: 12px; }
}
/* every red card pulses (the existing alarmBorder animation), not only collision alarms: e.g. emergency squawk */
.toast-side .toast-warning:not(.is-acked):not(.is-cleared) { border: 1px solid var(--red); border-left-width: 4px; animation: toastIn .22s ease-out, alarmBorder 1s ease-in-out .22s infinite; }
@media (prefers-reduced-motion: reduce) {
  .toast-side .toast-warning:not(.is-acked):not(.is-cleared) { animation: none !important; border-color: #ff5d6c; box-shadow: 0 0 0 1px rgba(255,77,94,.85), 0 12px 30px rgba(0,0,0,.45); }
}
/* leader lines: thin line in the card's level colour, ring + dot at the conflict (midpoint of the pair / the target) */
.toast-leaders { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1139; pointer-events: none; overflow: hidden; }
.toast-leaders .ldr { color: var(--muted); }
.toast-leaders .ldr line { stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; opacity: .9; }
.toast-leaders .ldr .ldr-halo { stroke: rgba(4,7,9,.55); stroke-width: 3.5; opacity: 1; }
.toast-leaders .ldr circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.toast-leaders .ldr circle.ldr-dot { fill: currentColor; stroke: none; }
.toast-leaders .ldr-warning { color: var(--red); }
.toast-leaders .ldr-acked { color: rgba(255,77,94,.7); }
.toast-leaders .ldr-caution { color: var(--amber); }
.toast-leaders .ldr-advisory { color: var(--adv); }
.toast-leaders .ldr-cleared { color: var(--scope); }
.toast-leaders .ldr-hidden line:not(.ldr-halo) { stroke-dasharray: 4 3; }

/* Panel tab (collapsed panel): truly centred on the right edge (writing-mode vertical-rl turns margin-block into the
   horizontal axis, so the old `margin-block: auto` left it pinned at the top, over RING/RATE and the chips), and the
   top-right map controls step left by the tab's width so nothing can sit under it. */
.panel-reopen { top: 0; bottom: 0; margin: auto 0; height: fit-content; transform: none; }
.layout.panel-collapsed .scope { --tab-clear: 50px; }
.layout.panel-collapsed .scope-readout, .layout.panel-collapsed .geo-chip, .layout.panel-collapsed .adsb-chip { right: calc(12px + var(--tab-clear)); }
.layout.panel-collapsed .leaflet-right { right: var(--tab-clear); }
/* v17.12 Panel tab vs map rail: the tab was centred on the right edge, and the taller v17.10 rail (+TARGET) is
   bottom-anchored in the same column, so on short maps (1024x768, 1366x650 …) the tab covered CLUE. Distinct vertical
   zones now: the tab sits at the top of the right edge (the chips there already step left by --tab-clear) and the rail
   stays bottom-anchored, its height capped below the top-right zone (tab: 12 + ~62 px; RING/geo/ADS-B chips: to ~96 px),
   so the two can never meet: on a map too short to fit the rail it scrolls instead of sliding under the tab/chips. */
.panel-reopen { top: 12px; bottom: auto; margin: 0; }
.map-rail { max-height: calc(100% - 112px - 106px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.map-rail::-webkit-scrollbar { display: none; }
.toast-side .toast-enc .enc-ico { width: 26px; height: 10px; }
.toast-side .toast > .toast-strip, .toast-side .toast > .toast-body { align-self: stretch; width: 100%; box-sizing: border-box; }
.toast-side .toast.is-overflow { display: none; }

/* ===================== v17.3: narrower alert cards (200 / 184 / 168 px), icon-only type chip ===================== */
.toast-side { --card-w: 200px; }
@media (max-width: 820px) { .toast-side { --card-w: 184px; } }
@media (max-width: 480px) { .toast-side { --card-w: 168px; } }
.toast-side .toast, .toast-side .toast-alarm { gap: 1px; padding: 2px 4px 4px 7px; }
.toast-side .toast-warning:not(.is-acked):not(.is-cleared) { border-left-width: 3px; }
.toast-strip { height: 18px; column-gap: 2px; }
.toast-side .toast .toast-level { padding: 0 5px; font-size: 9px; line-height: 13px; letter-spacing: .06em; }
.toast-side .toast-x { width: 20px; height: 18px; font-size: 15px; }
.toast-side .toast-body { gap: 1px; padding-right: 2px; }
.toast-side .toast-title, .toast-side .toast-alarm .toast-title { font-size: 12px; line-height: 15px; height: 30px; }
.toast-side .toast-detail, .toast-side .toast-alarm .toast-detail { font-size: 10.5px; line-height: 13px; height: 26px; white-space: normal; letter-spacing: -.01em; }
/* the type chip is a small inline glyph at the start of the title */
.toast-side .toast-chiprow { display: inline; height: auto; overflow: visible; }
.toast-side .toast-enc { display: inline-flex; vertical-align: -2px; height: 13px; padding: 0 3px; margin: 0 4px 0 0; font-size: 8.5px; line-height: 11px; border-radius: 3px; }
.toast-side .toast-enc .enc-short { display: none; }
.toast-side .toast-enc .enc-ico { width: 23px; height: 9px; }
.toast-side .toast-sys-ico .enc-ico { width: 10px; height: 9px; }
.toast-side .toast-ack { height: 18px; padding: 0 5px 0 4px; gap: 3px; font-size: 9px; }
.toast-side .toast-ack svg { width: 11px; height: 11px; }
.toast-side .toast-ack.is-icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast-side .toast-ack.is-icon { padding: 0 4px; }
@media (max-width: 480px) { .toast-side .toast-title { font-size: 12px; } }

/* v17.3 helicopter glyph (option C), scoped to .g-heli so the fixed-wing plane's .g-hollow is unchanged */
.tgt-manned .g-heli { --hc: #f4f8fa; }
.tgt-manned.has-color .g-heli { --hc: var(--tc); }
.tgt-manned .g-heli .g-hollow { fill: rgba(8,12,14,.85); stroke: var(--hc); stroke-width: 1.5; stroke-linejoin: round; }
.tgt-manned .g-heli .g-rotor { stroke: var(--hc); stroke-width: 1.3; stroke-linecap: round; fill: none; opacity: 1; }
.tgt-manned .g-heli .g-boom { stroke: var(--hc); stroke-width: 1.5; stroke-linecap: round; fill: none; }
.tgt-manned .g-heli .g-nose { stroke: var(--hc); stroke-width: 1; fill: none; stroke-linecap: round; opacity: .9; }
.tgt-manned .g-heli .g-hub { fill: var(--hc); stroke: #02130b; stroke-width: .6; }
.tgt-manned .g-heli .h-o { stroke: #02130b; stroke-width: 3; stroke-linecap: round; fill: none; opacity: .8; }
.tgt-manned .g-heli .h-ro { stroke-width: 2.8; }
.tgt-manned .g-heli .g-disc { fill: none; stroke: var(--hc); stroke-width: .6; stroke-dasharray: 1.3 1.4; opacity: .45; }

/* ------------------------------------------------------------ v17.4 aircraft altitude ceiling */
.filt-ceil { gap: 5px; padding: 0 8px; border-left: 1px solid var(--line-2); border-radius: 0 4px 4px 0; margin-left: 1px; }
.filt-ceil .filt-ico { color: #e8eef1; }
.ceil-lbl { font-size: 10.5px; letter-spacing: .06em; color: var(--muted); }
.filt-ceil.is-set { border-color: rgba(255,176,32,.5); background: rgba(255,176,32,.07); }
.filt-ceil.is-set .ceil-lbl { color: var(--amber); font-weight: 700; letter-spacing: .02em; }
.filt-ceil.is-set .filt-ico { color: var(--amber); }
.filt-ceil[aria-expanded="true"] { border-color: var(--scope); }
.filt-ceil .ceil-n { background: rgba(255,176,32,.16); color: var(--amber); }
.filt-ceil .ceil-n::before { content: '−'; margin-right: 1px; }
.filt[data-cat="manned"].has-ceil .filt-n { color: var(--amber); }
.filt-ceil:focus-visible, .ceil-opt input:focus-visible + span { outline: 2px solid #9af7d0; outline-offset: 2px; }
.map-tl .ceil-pop { width: 252px; padding: 10px 12px; }
.ceil-pop .pop-group { margin-bottom: 8px; }
.ceil-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ceil-opt span { font-size: 10.5px; padding: 6px 0; letter-spacing: .02em; white-space: nowrap; }
.ceil-opt input:checked + span { border-color: var(--amber); color: var(--amber); background: rgba(255,176,32,.08); }
.ceil-opt:first-child input:checked + span { border-color: var(--scope); color: var(--scope); background: rgba(var(--scope-rgb), .08); }
.ceil-opt span:hover { border-color: var(--muted); }
.ceil-note { line-height: 1.35; }
/* panel rows: above the ceiling = dimmed, tagged */
.cc-ceil { flex: none; font-size: 8.5px; letter-spacing: .06em; padding: 1px 4px; border-radius: 3px; border: 1px dashed rgba(255,176,32,.55); color: var(--amber); white-space: nowrap; }
.cc-ceil[hidden] { display: none; }
.trk.is-ceil > :not(.trk-head) { opacity: .45; }
.trk.is-ceil .trk-head > :not(.trk-eye) { opacity: .55; }
.trk.is-ceil .cc-ceil { opacity: 1; }
.trk.is-ceil-ovr .cc-ceil { border-style: solid; }
/* map: shown above the ceiling only because it is in an alert */
.tgt.ceil-ovr .tgt-data { color: var(--amber); }
@media (max-width: 480px) {
  /* 375 px: People · Aircraft · ALT · Drones in one 351 px bar */
  .filterbar { gap: 1px; }
  .filt { padding: 0 5px; gap: 4px; font-size: 11.5px; }
  .filt-n { padding: 1px 4px; }
  .filt-ceil { padding: 0 5px; gap: 3px; }
  .filt-ceil:not(.is-set) .ceil-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .filt-ceil .ceil-u, .filt-ceil .ceil-n { display: none; } /* the amber Aircraft count ("0/2") carries the number */
  .filt-reset { padding: 0 6px; }
  /* with the Show-all chip present, category names go to the accessible name only (icons + counts stay) */
  .filterbar:has(#show-all:not([hidden])) .filt[data-cat] .filt-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ------------------------------------------------------------ v17.5 offset tags + thin leader */
/* every tag sits ~1 inch off its icon (markers.js placement); a 1 px low-opacity line in the target's colour joins them */
.tgt-block::before { display: none; }
.tgt-leader { height: 1px; background: var(--scope); opacity: .5; box-shadow: none; }
.tgt-manned .tgt-leader { background: #f4f8fa; opacity: .42; }
.tgt-ground .tgt-leader { background: var(--ground); opacity: .5; }
.tgt.has-color .tgt-leader { background: var(--tc); }
.tgt.conf-caution .tgt-leader { background: var(--amber); opacity: .55; }
.tgt.conf-warning .tgt-leader { background: var(--red); opacity: .55; }
.tgt.selected .tgt-leader { opacity: .8; }
.base-light .tgt-leader { box-shadow: 0 0 0 .5px rgba(0,0,0,.35); }

/* v17.6 header Locate me (left of LIVE/REPLAY), UTC clock removed */
.hdr-locate { height: 32px; padding: 0 12px; gap: 6px; font: 600 var(--fs-sm) var(--mono); letter-spacing: .08em; text-transform: uppercase; flex: none; }
.hdr-locate .btn-svg { width: 15px; height: 15px; }
.hdr-locate:hover:not(:disabled) { border-color: rgba(var(--scope-rgb), .7); color: var(--scope); }
.hdr-locate:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; }
.topbar-right { gap: 18px; }
@media (max-width: 480px) {
  .hdr-locate { width: 32px; padding: 0; }
  .hdr-locate .locate-label { display: none; }
}
/* v17.6 panel toolbar: Locate me moved to the header; Pause · rate · Trails · Clear · Base fit one row */
.toolbar { gap: 4px; padding: 12px; justify-content: space-between; }
.toolbar .btn { padding: 0 7px; }
.toolbar .btn-primary { min-width: 68px; }
.toolbar .seg-sm .seg-btn { padding: 0 6px; }

/* v17.6 Terrain HD basemap (warm light relief, blue water, blue-grey roads) + 5-option basemap grid */
.base-grid { grid-template-columns: repeat(3, 1fr); }
.leaflet-thdShade-pane { mix-blend-mode: multiply; }
.thd-base { filter: hue-rotate(-40deg) saturate(6) sepia(.12) brightness(1.03); }
.thd-shade { filter: grayscale(1) contrast(1.4) brightness(1.14); }
.thd-roads { filter: hue-rotate(195deg) saturate(.6) brightness(.9); }
.map.base-terrainHD { background: #fbf8f0; }

/* v17.6 alert card → zoom to the conflict */
.toast.is-zoomable { cursor: pointer; }
.toast.is-zoomable:hover { border-color: var(--faint); }
.toast.is-zoomable .toast-body { border-radius: 4px; }
.toast.is-zoomable .toast-body:focus-visible { outline: 2px solid #9af7d0; outline-offset: 3px; }
.tgt.zoom-ping .tgt-burst { border: 2px solid var(--zp, var(--scope)); animation: zoomPing 1.5s ease-out forwards; }
@keyframes zoomPing { 0% { transform: scale(.7); opacity: 1; } 70% { opacity: .55; } 100% { transform: scale(3.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tgt.zoom-ping .tgt-burst { animation: none; transform: scale(1.8); opacity: .8; } }

/* v17.7 ops panel starts collapsed on every load: on phones (≤820 px) "collapsed" means the closed drawer, so the
   desktop collapse class (present in the HTML from first paint) must not hide the drawer before ui.js runs */
@media (max-width: 820px) {
  .layout.panel-collapsed .panel { visibility: visible; }
  .layout.panel-collapsed .scope { --tab-clear: 0px; }
}

/* v17.7 voice: speed slider + Test voice (Alerts tab → Audio cues) */
.voice-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.voice-rate-l { font-size: var(--fs-sm); color: var(--muted, #9fb3ab); flex: none; }
.voice-row input[type="range"] { flex: 1 1 auto; min-width: 70px; accent-color: var(--scope); }
.voice-row input[type="range"]:focus-visible, #voice-test:focus-visible, #voice-select:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; }
.voice-row output { font-size: var(--fs-sm); width: 42px; text-align: right; flex: none; }
.voice-row .btn { flex: none; }

/* v17.7 header Display ▾ menu (units moved off the top bar) */
.dmenu { position: relative; flex: none; }
.hdr-display { height: 32px; padding: 0 10px 0 12px; gap: 6px; font: 600 var(--fs-sm) var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.hdr-display .btn-svg { width: 15px; height: 15px; }
.hdr-display .dmenu-caret { width: 10px; height: 10px; transition: transform .15s; }
.hdr-display[aria-expanded="true"] .dmenu-caret { transform: rotate(180deg); }
.hdr-display:hover, .hdr-display[aria-expanded="true"] { border-color: rgba(var(--scope-rgb), .7); color: var(--scope); }
.hdr-display:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; }
.dmenu-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1300; min-width: 232px; padding: 12px; display: grid; gap: 10px;
  background: var(--bg-2, #0e1517); border: 1px solid var(--line-2, #2a3a3f); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.dmenu-pop[hidden] { display: none; }
.dmenu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dmenu-l { font: 600 10px var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.dmenu-pop .seg-btn:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.dmenu-hint { margin: 0; font-size: var(--fs-xs, 11px); color: var(--faint); }
.dmenu-hint kbd { font: 600 10px var(--mono); padding: 1px 5px; border: 1px solid var(--line-2, #2a3a3f); border-radius: 4px; color: var(--muted); }
@media (max-width: 480px) { .hdr-display { width: 32px; padding: 0; } .hdr-display .display-label, .hdr-display .dmenu-caret { display: none; }
  .dmenu-pop { position: fixed; top: auto; right: 12px; left: auto; margin-top: 8px; } }

/* v17.7 Show path */
.trk-path { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; background: none; border: 1px solid transparent; border-radius: 4px; color: var(--muted); }
.trk-path svg { width: 15px; height: 15px; }
.trk-path:hover { border-color: var(--line-2); color: var(--text); }
.trk-path[aria-pressed="true"], .sel-path[aria-pressed="true"] { color: var(--scope); border-color: rgba(var(--scope-rgb), .6); background: rgba(var(--scope-rgb), .12); }
.trk-path:focus-visible, .sel-path:focus-visible, .sel-path-win:focus-visible, .dmenu-sel:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.sel-path-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sel-path-l { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sel-path-win, .dmenu-sel { height: 28px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; font: 500 var(--fs-sm) var(--mono); }
.sel-path-n { font-size: 10px; color: var(--faint); min-width: 0; flex: 1 1 auto; }
.sel-path-clear.is-arm { border-color: var(--amber); color: var(--amber); }
.dmenu-ic { width: 13px; height: 13px; vertical-align: -2px; }
.path-tip { font: 500 11px var(--mono); }
/* v17.7: phones — the extra path button must not squeeze the target name */
@media (max-width: 480px) {
  .trk-head { gap: 4px; }
  .trk-head .trk-eye, .trk-head .trk-path { width: 24px; }
  .trk-head .trk-hist-btn { padding: 0 3px; gap: 2px; }
  .trk-head .trk-locate { padding-left: 5px; padding-right: 5px; }
}

/* v17.8 Dark Streets: same dark base as Dark + light-grey street labels (Esri World Transportation, greyed) */
.ds-labels { filter: grayscale(1) brightness(.85) contrast(1.05); }
body.mode-replay .leaflet-dsRef-pane { filter: sepia(.35) brightness(.85); }
/* v17.11 Dark Streets vector map (MapLibre GL canvas in its own pane): replay tint like the tile pane */
body.mode-replay .leaflet-dsGL-pane { filter: sepia(.35) brightness(.75); }
.leaflet-dsGL-pane .leaflet-gl-layer { position: absolute; }

/* ============================================================ v17.9 Phase 1 (PLAN.md §2–3): menus, settings, clues, daylight, CP view */
/* header daylight chip (F5) */
.daywrap { position: relative; flex: none; }
.day-chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: var(--r); cursor: pointer;
  font: 500 var(--fs-sm) var(--mono); font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); white-space: nowrap; }
.day-chip:hover { border-color: var(--muted); }
.day-chip:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; }
.day-chip[data-level="amber"] { color: #ffd28a; border-color: rgba(var(--amber-rgb), .75); background: rgba(var(--amber-rgb), .12); }
.day-chip[data-level="red"] { color: #ffd0d5; border-color: var(--red); background: rgba(var(--red-rgb), .18); }
.day-chip[data-level="dark"] { color: #b9c7ff; border-color: #4b5a92; background: rgba(75,90,146,.18); }
.day-short { display: none; }
.day-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 1300; width: 270px; padding: 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0,0,0,.55); }
.day-pop[hidden] { display: none; }
.day-pop .kv { grid-template-columns: 1fr 1fr; }
.day-pop .kv dd { font-size: var(--fs-md); }
.day-pop .day-where { margin-top: 10px; }
@media (max-width: 1280px) and (min-width: 1121px) { .day-chip .day-long { display: none; } .day-chip .day-short { display: inline; } }
@media (max-width: 480px) { .day-chip { padding: 0 8px; height: 32px; } .day-chip .day-long { display: none; } .day-chip .day-short { display: inline; }
  .day-pop { position: fixed; left: 12px; right: 12px; width: auto; top: auto; margin-top: 8px; } }

/* Display ▾ menu additions */
.dmenu-btns { display: flex; gap: 6px; }
.dmenu-btns .btn[aria-pressed="true"] { color: var(--scope); border-color: rgba(var(--scope-rgb), .6); box-shadow: inset 0 -2px 0 var(--scope); }
.dmenu-sep { height: 1px; background: var(--line); margin: 0 -12px; }
.dmenu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; font: 500 var(--fs-md) var(--sans); text-align: left; cursor: pointer; }
.dmenu-item:hover { border-color: var(--muted); }
.dmenu-item:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }

/* panel: Tracks Air|Ground sub-tabs */
.subtabs { display: flex; margin: 0 0 12px; }
.subtabs .subtab { flex: 1; justify-content: center; gap: 6px; display: inline-flex; align-items: center; }
.subtab[aria-selected="true"] { background: rgba(var(--scope-rgb), .14); color: var(--scope); box-shadow: inset 0 -2px 0 var(--scope); }
.subtab:focus-visible { outline: 2px solid #9af7d0; outline-offset: -2px; }
.subpanel[hidden] { display: none; }
.tabpanel[hidden] { display: none; }

/* unified log filters (All · Traffic · Clues · System) */
.alert-log[data-filter="traffic"] li[data-cat]:not([data-cat="traffic"]),
.alert-log[data-filter="clue"] li[data-cat]:not([data-cat="clue"]):not([data-cat="search"]),
.alert-log[data-filter="system"] li[data-cat]:not([data-cat="system"]) { display: none; }
.alert-log li[data-cat="clue"] .log-lvl { color: #ffb347; }
.alert-log li.log-prev { opacity: .72; }
.alert-log li.log-prev:first-of-type, .alert-log li:not(.log-prev) + li.log-prev { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 6px; }
.btn-danger { color: #ffc0c6; border-color: rgba(var(--red-rgb), .6); }
.btn-danger:hover:not(:disabled) { background: rgba(var(--red-rgb), .14); border-color: var(--red); }
.btn-danger.is-armed { background: var(--red); color: #1a0306; border-color: var(--red); font-weight: 600; }

/* Settings dialog */
dialog.settings { width: min(560px, calc(100vw - 24px)); max-height: min(86dvh, 820px); padding: 0; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.65); overflow: hidden; }
dialog.settings[open] { display: flex; flex-direction: column; }
dialog.settings::backdrop { background: rgba(2,5,6,.62); }
.set-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px 16px; }
.set-title { margin: 0; font: 600 var(--fs-lg) var(--sans); }
.set-tabs { grid-template-columns: repeat(3, 1fr); position: static; }
.set-body { overflow: auto; padding: 4px 16px 16px; flex: 1 1 auto; min-height: 0; }
.spanel[hidden] { display: none; }
.spanel .sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.spanel .sec:last-child { border-bottom: 0; }
#sp-data .fld input { max-width: 320px; }
#inc-kv { grid-template-columns: repeat(3, 1fr); margin: 10px 0; }
@media (max-width: 480px) { dialog.settings { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 12px 12px 0 0; } }

/* map action rail (desktop) and ✚ FAB sheet (phone) */
.map-rail { position: absolute; right: 12px; bottom: 112px; z-index: 900; display: grid; gap: 4px; padding: 4px; border-radius: 8px;
  background: rgba(7,11,13,.85); border: 1px solid var(--line-2); }
.rail-btn { width: 52px; min-height: 44px; display: grid; place-items: center; gap: 1px; padding: 4px 0; border-radius: 6px; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--text); font: 600 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.rail-btn svg { width: 17px; height: 17px; }
.rail-btn:hover { background: var(--surface-3); border-color: var(--line-2); }
.rail-btn:focus-visible { outline: 2px solid #9af7d0; outline-offset: 0; }
.fab, .fab-sheet { display: none; }
@media (max-width: 820px) {
  .map-rail { display: none; }
  .fab { display: grid; place-items: center; position: absolute; right: 12px; bottom: 166px; z-index: 900; width: 44px; height: 44px; border-radius: 50%;
    font-size: 20px; line-height: 1; color: var(--accent-ink); background: var(--accent); border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.5); cursor: pointer; }
  .fab[aria-expanded="true"] { background: var(--surface-2); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
  .fab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .fab-sheet { display: grid; gap: 6px; position: absolute; right: 64px; bottom: 166px; z-index: 950; padding: 8px; border-radius: 10px; min-width: 180px;
    background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0,0,0,.55); }
  .fab-sheet[hidden] { display: none; }
  .fab-sheet .btn { justify-content: flex-start; height: 40px; }
}

/* clue markers (F4): diamond per type, short ID */
.clue-icon { background: none; border: 0; }
.clue { position: relative; width: 24px; height: 24px; color: var(--clue); filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.clue svg { width: 24px; height: 24px; display: block; overflow: visible; }
.clue .clue-o { fill: none; stroke: rgba(0,0,0,.85); stroke-width: 4.5; stroke-linejoin: round; }
.clue .clue-f { fill: color-mix(in srgb, var(--clue) 30%, rgba(7,11,13,.85)); stroke: var(--clue); stroke-width: 2.2; stroke-linejoin: round; }
.clue.clue-high .clue-f { fill: var(--clue); }
.clue.clue-high .clue-dot { fill: #070b0d; }
.clue.clue-low .clue-f { stroke-dasharray: 3 2; }
.clue .clue-dot { fill: var(--clue); }
.clue-lbl { position: absolute; left: 22px; top: -4px; padding: 0 4px; border-radius: 3px; font: 700 10px var(--mono); color: #070b0d; background: var(--clue);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6); white-space: nowrap; pointer-events: none; }
.clue.clue-pending { animation: cluePulse 1.2s ease-in-out infinite; }
@keyframes cluePulse { 50% { transform: scale(1.18); } }
.clue-icon:focus-visible { outline: none; }
.clue-icon:focus-visible .clue svg, .clue-icon.is-editing .clue svg { outline: 2px solid #fff; outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .clue.clue-pending { animation: none; } }

/* Search tab clue list */
.clue-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.clue-btn { width: 100%; display: grid; grid-template-columns: 12px auto 1fr auto auto; align-items: center; gap: 4px 8px; padding: 8px 10px; text-align: left; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: 400 var(--fs-sm) var(--sans); }
.clue-btn:hover { border-color: var(--line-2); }
.clue-btn:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.clue-sw { width: 11px; height: 11px; background: var(--clue); transform: rotate(45deg); border-radius: 1px; }
.clue-id { font-weight: 700; }
.clue-t { color: var(--muted); }
.clue-cf { font: 600 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--muted); }
.clue-cf-high { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }
.clue-cf-low { border-style: dashed; }
.clue-nt { grid-column: 2 / -1; color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clue-by { color: var(--faint); }

/* clue form: card at the top-left of the map (desktop), bottom sheet (phone) */
.clue-form { position: absolute; left: 12px; top: 100px; z-index: 1200; width: 320px; max-height: calc(100% - 112px); overflow: auto; display: grid; gap: 10px;
  padding: 12px 14px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.clue-form[hidden] { display: none; }
.clue-form-head { display: flex; align-items: center; justify-content: space-between; }
.clue-form-h { margin: 0; font: 600 var(--fs-lg) var(--sans); }
.clue-form textarea { width: 100%; resize: vertical; min-height: 48px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; font: 400 var(--fs-md) var(--sans); }
.clue-form textarea:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; border-color: var(--scope); }
.clue-conf { grid-auto-flow: column; justify-content: start; gap: 4px 14px; }
.clue-conf legend { grid-column: 1 / -1; }
.clue-pos { margin: 0; }
.clue-del { margin-left: auto; color: #ffc0c6; border-color: rgba(var(--red-rgb), .55); }
.clue-del.is-armed { background: var(--red); color: #1a0306; border-color: var(--red); font-weight: 600; }
@media (max-width: 820px) {
  .clue-form { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 72%; border-radius: 12px 12px 0 0; z-index: 1250; }
}

/* command-post view (F7) */
.cp-top, .cp-bot, .cp-hint { display: none; }
body.cp-view .cp-top:not([hidden]), body.cp-view .cp-bot:not([hidden]) { display: flex; }
body.cp-view .cp-hint:not([hidden]) { display: flex; }
body.cp-view .topbar, body.cp-view .panel, body.cp-view .panel-reopen, body.cp-view .map-tl, body.cp-view .map-rail, body.cp-view .fab, body.cp-view .fab-sheet,
body.cp-view .clue-form, body.cp-view .tdet, body.cp-view .map-ctx, body.cp-view .tlb, body.cp-view .scope-readout, body.cp-view .geo-chip, body.cp-view .adsb-chip, body.cp-view .sel-card, body.cp-view .leaflet-control-zoom,
body.cp-view .replay-bar, body.cp-view .legend, body.cp-view .toast-side, body.cp-view .toast-more, body.cp-view .layers-pop, body.cp-view .color-pop, body.cp-view .skip-link { display: none !important; }
body.cp-view .layout { display: block; height: 100dvh; }
body.cp-view .scope { position: fixed; inset: 0; width: 100vw; height: 100dvh; }
/* tags 2× via font sizes (not CSS zoom: the declutter measures offsetWidth and positions in unzoomed px) */
body.cp-view .tgt-block { padding: 4px 12px 5px; border-left-width: 3px; }
body.cp-view .tgt.tag-left .tgt-block { border-right-width: 3px; }
body.cp-view .tgt-name { font-size: 24px; }
body.cp-view .tgt-ground .tgt-name { font-size: 22px; }
body.cp-view .tgt-data { font-size: 20px; }
body.cp-view .tgt-kind { font-size: 15px; }
body.cp-view .leaflet-bottom { bottom: var(--cpb, 0px); }
body.cp-view .tgt-name { pointer-events: none; cursor: default; }
body.cp-view .clue { zoom: 1.5; }
.cp-top { position: absolute; top: 0; left: 0; right: 0; z-index: 1100; align-items: center; gap: 10px 22px; flex-wrap: wrap; padding: 10px 18px;
  background: linear-gradient(180deg, rgba(5,9,11,.95), rgba(5,9,11,.82)); border-bottom: 1px solid var(--line-2); font-size: 20px; }
.cp-inc { font-weight: 600; color: var(--text); }
.cp-time { font-size: 24px; font-weight: 600; color: var(--scope); }
.cp-day { font: 600 18px var(--mono); padding: 2px 10px; border-radius: 6px; border: 1px solid var(--line-2); }
.cp-day[data-level="amber"] { color: #ffd28a; border-color: var(--amber); background: rgba(var(--amber-rgb), .14); }
.cp-day[data-level="red"] { color: #fff; border-color: var(--red); background: rgba(var(--red-rgb), .35); }
.cp-day[data-level="dark"] { color: #c8d2ff; border-color: #4b5a92; }
.cp-counts { font-size: 17px; color: var(--muted); margin-left: auto; }
.cp-fit { font-size: 13px; color: var(--faint); }
.cp-fit[data-on="false"] { color: var(--amber); }
.cp-bot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1100; flex-direction: column; gap: 6px; padding: 10px 18px 14px;
  background: linear-gradient(0deg, rgba(5,9,11,.95), rgba(5,9,11,.82)); border-top: 1px solid var(--line-2); }
.cp-alert { font: 700 22px var(--sans); padding: 6px 12px; border-radius: 6px; color: var(--muted); border: 1px solid var(--line-2); }
.cp-alert[data-level="warning"] { color: #fff; background: rgba(var(--red-rgb), .85); border-color: var(--red); }
.cp-alert[data-level="caution"], .cp-alert[data-level="advisory"] { color: #1d1300; background: var(--amber); border-color: var(--amber); }
.cp-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 15px; color: var(--text); }
.cp-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-log .cp-l-warning { color: #ffb3bb; } .cp-log .cp-l-caution { color: #ffd28a; }
.cp-hint { position: absolute; top: 90px; right: 18px; z-index: 1150; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 10px; background: rgba(5,9,11,.92); border: 1px solid var(--line-2); font-size: var(--fs-md); box-shadow: 0 12px 30px rgba(0,0,0,.6); }
@media (max-width: 820px) {
  .cp-top { font-size: 14px; padding: 8px 12px; gap: 4px 12px; }
  .cp-time { font-size: 16px; } .cp-day { font-size: 13px; } .cp-counts { font-size: 12px; margin-left: 0; } .cp-fit { font-size: 11px; }
  .cp-alert { font-size: 15px; } .cp-log { font-size: 12px; }
}
@media (max-width: 480px) {
  body.cp-view .tgt-block { padding: 2px 7px 3px; border-left-width: 2px; }
  body.cp-view .tgt-name { font-size: var(--fs-sm); } body.cp-view .tgt-ground .tgt-name { font-size: var(--fs-xs, 11px); }
  body.cp-view .tgt-data { font-size: 10px; } body.cp-view .tgt-kind { font-size: 8.5px; }
}
@media (min-width: 481px) and (max-width: 820px) {
  body.cp-view .tgt-block { padding: 2px 7px 3px; }
  body.cp-view .tgt-name { font-size: 15px; } body.cp-view .tgt-ground .tgt-name { font-size: 14px; }
  body.cp-view .tgt-data { font-size: 13px; } body.cp-view .tgt-kind { font-size: 10px; }
}
body.cp-view .snd-banner { bottom: calc(var(--cpb, 0px) + 10px) !important; }

/* ============================================================ v17.10 targets by coordinate */
/* marker: bold equilateral triangle (apex up) round an original type glyph; bright stroke, dark halo */
.tmk-icon { background: none; border: 0; }
.tmk { position: relative; width: 28px; height: 28px; --tc: #f4f8fa; }
.tmk-tri { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; overflow: visible; display: block; pointer-events: none; }
.tmk-icon { cursor: pointer; }
.tmk-h { fill: rgba(5,9,11,.62); stroke: #04080a; stroke-width: 7.5; stroke-linejoin: round; stroke-opacity: .9; }
.tmk-f { fill: none; stroke: var(--tc); stroke-width: 3.4; stroke-linejoin: round; }
.tmk-tri .gh, .tl-ico .gh, .tg-ico .gh { fill: none; stroke: #04080a; stroke-width: 3.8; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: .9; }
.tmk-tri .gh .f, .tl-ico .gh .f, .tg-ico .gh .f { fill: #04080a; }
.tmk-tri .gm .m, .tl-ico .gm .m, .tg-ico .gm .m { fill: none; stroke: var(--tc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tmk-tri .gm .m.w, .tl-ico .gm .m.w { stroke-width: 2.6; }
.tmk-tri .gm .f, .tl-ico .gm .f, .tg-ico .gm .f { fill: var(--tc); stroke: none; }
.tmk .tgt-block { border-left-color: var(--tc); }
.tmk .tgt-block::before { display: none; }
.tmk .tgt-leader { background: var(--tc); opacity: .8; box-shadow: 0 0 0 .5px rgba(0,0,0,.6); }
.tmk .tgt-name { cursor: pointer; }
.tmk .tgt-data { display: flex; align-items: center; gap: 6px; color: var(--tc); font-weight: 700; letter-spacing: .06em; }
.tmk-ind { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font: 600 10px var(--mono); letter-spacing: 0; }
.tmk-ind svg { width: 10px; height: 10px; }
/* light maps (terrain, terrain HD, street, satellite): heavier dark shadow */
.base-light .tmk-tri { filter: drop-shadow(0 0 1px rgba(0,0,0,.95)) drop-shadow(0 1px 4px rgba(0,0,0,.8)); }
.base-light .tmk-h { stroke-width: 9.5; stroke-opacity: 1; fill: rgba(5,9,11,.74); }
.base-light .tmk-tri .gh { stroke-width: 4.4; stroke-opacity: 1; }
.tmk-icon:focus { outline: none; }
.tmk-icon:focus-visible .tmk-tri, .tmk-icon.is-open .tmk-tri { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px rgba(var(--scope-rgb), .7)); }
.tmk-icon.is-open .tmk-f { stroke-width: 4.2; }
/* placement pulse: an expanding ring 3×, the triangle pops once */
.tmk-ring { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 2px solid var(--tc); opacity: 0; pointer-events: none; }
.tmk.is-new .tmk-ring { animation: tmkRing 1.1s ease-out 3; }
.tmk.is-new .tmk-tri { animation: tmkPop .55s ease-out; }
@keyframes tmkRing { 0% { transform: scale(.55); opacity: .95; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes tmkPop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.tmk-pending { opacity: .85; }
.tmk-pending .tmk-f { stroke-dasharray: 6 4; animation: tmkDash 1s linear infinite; }
@keyframes tmkDash { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) {
  .tmk.is-new .tmk-ring, .tmk.is-new .tmk-tri, .tmk-pending .tmk-f { animation: none !important; }
  .tmk.is-new .tmk-ring { opacity: .8; transform: scale(1.25); } /* a static ring marks the new target instead */
}
@media (max-width: 820px) { .tmk-tri { width: 52px; height: 52px; margin: -26px 0 0 -26px; } }  /* triangle ≈ 38 px on phones, 44 px desktop */

/* right-click / long-press menu */
.map-ctx { position: absolute; z-index: 1300; min-width: 200px; padding: 4px; display: grid; gap: 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0,0,0,.6); }
.map-ctx[hidden] { display: none; }
.map-ctx-pos { margin: 2px 8px 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.map-ctx [role="menuitem"] { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 5px; border: 0; background: none; color: var(--text); font: 500 var(--fs-sm) var(--sans); text-align: left; cursor: pointer; }
.map-ctx [role="menuitem"]:hover, .map-ctx [role="menuitem"]:focus-visible { background: var(--surface-3); outline: 2px solid #9af7d0; outline-offset: -2px; }
.map-ctx [role="menuitem"][hidden] { display: none; }

/* place / edit form (shares the clue form card) */
.tgt-form { width: 380px; }
.tgt-coord-row { display: flex; gap: 6px; }
.tgt-coord-row input { flex: 1; font-family: var(--mono); }
.tgt-coord-row .btn { height: 32px; flex: none; }
.tgt-form .fld-opt { color: var(--faint); font-weight: 400; }
.tgt-parse { font-size: var(--fs-xs); min-height: 18px; }
.tgt-parse p { margin: 0; }
.tp-ok { color: var(--accent); }
.tp-ok b { color: var(--text); }
.tp-err { color: #ff8a96; font-weight: 500; }
.tp-empty { color: var(--muted); }
.tp-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; padding: 6px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.tp-grid dt { color: var(--muted); }
.tp-grid dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
/* icon picker: radio tiles (native radios: arrow keys move, Space selects) */
.tpick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tpick-opt { position: relative; display: block; cursor: pointer; }
.tpick-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tpick-tile { display: grid; justify-items: center; gap: 1px; padding: 5px 2px 4px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.tpick-tile .tl-ico { width: 30px; height: 30px; }
.tpick-l { font: 600 9.5px var(--mono); letter-spacing: .02em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tpick-opt:hover .tpick-tile { border-color: var(--line-2); }
.tpick-opt input:checked + .tpick-tile { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, var(--surface-2)); box-shadow: inset 0 0 0 1px var(--tc); }
.tpick-opt input:checked + .tpick-tile .tpick-l { color: var(--text); }
.tpick-opt input:focus-visible + .tpick-tile { outline: 2px solid #9af7d0; outline-offset: 1px; }
.tl-ico { width: 22px; height: 22px; display: block; overflow: visible; flex: none; }
.tl-ico .tmk-h { stroke-width: 6; }
.tl-ico .tmk-f { stroke-width: 4; }

/* Search tab list */
.tl-fmt { display: flex; align-items: center; gap: 8px; margin: 0 12px 6px 0; font-size: var(--fs-xs); color: var(--muted); }
.tl-fmt select { height: 28px; background: #060a0c; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 6px; }
.tl-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.tl-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 6px; padding: 4px 6px 4px 4px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--tc); border-radius: 6px; }
.tl-main { min-width: 0; display: grid; grid-template-columns: 24px auto 1fr; align-items: center; gap: 1px 8px; padding: 4px; text-align: left; background: none; border: 0; border-radius: 4px; color: var(--text); cursor: pointer; font: 400 var(--fs-sm) var(--sans); }
.tl-main:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.tl-main .tl-ico { grid-row: span 3; }
.tl-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ty { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-co, .tl-rel { grid-column: 2 / -1; font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.tl-co { color: var(--text); }
.tl-rel { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tl-acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tl-acts .btn { height: 26px; padding: 0 7px; font-size: var(--fs-xs); }
@media (max-width: 1100px) { .tl-row { grid-template-columns: 1fr; } .tl-acts { justify-content: flex-start; padding-left: 36px; } }
.clue-del.is-armed, .tl-acts .clue-del.is-armed { background: var(--red); color: #1a0306; border-color: var(--red); font-weight: 600; }
.alert-log[data-filter="target"] li[data-cat]:not([data-cat="target"]) { display: none; }
.alert-log li[data-cat="target"] .log-lvl { color: #ff5ad1; }

/* details window: side sheet (desktop), full-width bottom sheet (phone) */
.tdet { position: absolute; right: 76px; top: 56px; bottom: 16px; z-index: 1220; width: 400px; max-width: calc(100% - 100px); display: flex; flex-direction: column;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); border-top: 3px solid var(--tc, var(--accent)); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.tdet[hidden] { display: none; }
.tdet-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--line); }
.tdet-ico .tl-ico { width: 36px; height: 36px; }
.tdet-tt { flex: 1; min-width: 0; }
.tdet-h { margin: 0; font: 600 var(--fs-lg) var(--sans); overflow-wrap: anywhere; }
.tdet-type { margin: 0; font-size: var(--fs-xs); color: var(--tc, var(--muted)); font-weight: 600; }
.tdet-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 14px; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; }
.tdet-acts .clue-del { margin-left: auto; }
.tdet-coords { margin: 0; display: grid; gap: 2px; }
.tc-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 3px 0 3px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; }
.tc-row dt { font: 600 10px var(--mono); color: var(--muted); letter-spacing: .04em; }
.tc-row dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.tc-row .tc-b .btn { height: 26px; padding: 0 8px; font-size: var(--fs-xs); min-width: 62px; justify-content: center; }
.tc-row .btn.is-done { color: var(--accent); border-color: rgba(var(--accent-rgb), .6); }
.tdet-rel { margin: 0; font-size: 10.5px; }
.tdet-sec { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.tdet-sec .section-h { margin: 0; }
.tdet-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.tn { padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 3px; }
.tn-h { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: var(--fs-xs); }
.tn-t { color: var(--muted); font-size: 10.5px; }
.tn-by { font-weight: 600; color: var(--text); }
.tn-ed { font: 600 9px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(var(--amber-rgb), .5); border-radius: 3px; padding: 0 4px; }
.tn-x { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.tn-a { display: flex; gap: 4px; justify-content: flex-end; }
.tn-a .btn { height: 24px; padding: 0 7px; font-size: var(--fs-xs); }
.tn-edit textarea, .tdet-note-add textarea { width: 100%; resize: vertical; min-height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; font: 400 var(--fs-md) var(--sans); }
.tn-edit textarea:focus-visible, .tdet-note-add textarea:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; border-color: var(--scope); }
.tdet-note-add textarea[aria-invalid="true"], .tn-edit textarea[aria-invalid="true"] { border-color: var(--red); }
.tdet-note-add { display: grid; gap: 6px; justify-items: start; }
.tdet-note-add .fld { width: 100%; }
.tdet-err { color: #ff8a96; }
.tdet-notice { margin: 0; padding: 6px 8px; font-size: var(--fs-xs); color: #ffd58a; background: rgba(var(--amber-rgb), .08); border: 1px solid rgba(var(--amber-rgb), .35); border-radius: 6px; }
.tdet-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.tdet-photos li { display: grid; gap: 2px; min-width: 0; }
.tp-th { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: #000; cursor: zoom-in; }
.tp-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-th:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.tp-cap { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdet-photo-msg { margin: 0; }
.tdet-photo-msg:empty { display: none; }
.tdet-photo-msg.is-bad { color: #ff8a96; }
#tdet-photo-add { justify-self: start; }
@media (max-width: 820px) {
  .tdet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 82%; border-radius: 12px 12px 0 0; z-index: 1260; }
  .tgt-form { width: auto; max-height: 82%; }
}
@media (max-width: 420px) { .tpick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tpick-l { font-size: 8.5px; } .tc-row { grid-template-columns: 40px 1fr auto; gap: 6px; } }

/* photo lightbox */
.tlb { position: fixed; inset: 0; z-index: 5000; display: grid; grid-template-rows: auto 1fr auto; background: rgba(2,4,5,.94); color: var(--text); }
.tlb[hidden] { display: none; }
.tlb-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.tlb-h { margin: 0; font: 600 var(--fs-md) var(--sans); }
.tlb-top .icon-btn { width: 40px; height: 40px; font-size: 22px; color: var(--text); }
.tlb-stage { position: relative; min-height: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 0 8px; }
.tlb-img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; justify-self: center; align-self: center; box-shadow: 0 10px 40px rgba(0,0,0,.7); }
.tlb-stage { height: 100%; }
.tlb-nav { width: 44px; height: 64px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(12,19,22,.85); color: var(--text); font-size: 30px; cursor: pointer; }
.tlb-nav:disabled { opacity: .3; cursor: default; }
.tlb-nav:focus-visible { outline: 2px solid #9af7d0; }
.tlb-bot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.tlb-meta { margin: 0; font-size: 11px; color: var(--muted); }
.tlb-cap-f { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 240px; }
.tlb-cap-f label { font-size: var(--fs-sm); }
.tlb-cap-f input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; background: #060a0c; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text); }
.tlb-cap-f input:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.tlb-keys { margin: 0; font-size: 10.5px; color: var(--faint); }
@media (max-width: 560px) { .tlb-nav { width: 34px; height: 52px; font-size: 24px; } .tlb-stage { padding: 0 4px; gap: 4px; } .tlb-keys { display: none; } }

/* ===================== v17.13 Phase 2: search coverage (sectors) + IPP rings ===================== */
/* rail: 7 buttons now (Clue, IPP, Sector, Target, Base, Fit). Tighter and a little lower, still capped below the
   top-right Panel-tab zone (see v17.12 note above) so it scrolls rather than meeting the tab on short maps. */
.map-rail { bottom: 100px; gap: 3px; max-height: calc(100% - 100px - 106px); }
.rail-btn.is-on, .rail-btn[aria-pressed="true"] { background: rgba(var(--accent-rgb), .14); border-color: rgba(var(--accent-rgb), .6); color: var(--accent); }
.src-plan { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.fld-lbl { font-size: var(--fs-sm); color: var(--text); font-weight: 500; }

/* tool bars: top-left card like the clue form (desktop), bottom sheet (phone) */
.tool-bar { position: absolute; left: 12px; top: 100px; z-index: 1200; width: 320px; max-height: calc(100% - 112px); overflow: auto; display: grid; gap: 8px;
  padding: 10px 12px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.tool-bar[hidden] { display: none; }
.tool-bar .seg { width: 100%; }
.tool-bar .seg-btn { flex: 1 1 0; }
.tool-help { margin: 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.tool-stat { margin: 0; font-size: var(--fs-xs); color: var(--text); min-height: 1.2em; }
.tool-stat:empty { display: none; }
.draw-ring { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.draw-ring[hidden] { display: none; }
.draw-ring .fld input { width: 100%; }
.tool-bar kbd { margin-left: 4px; }
.map-xhair { position: absolute; left: 0; top: 0; z-index: 650; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: none;
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.7); }
.map-xhair::before, .map-xhair::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.map-xhair::before { left: 50%; top: -9px; bottom: -9px; width: 2px; margin-left: -1px; }
.map-xhair::after { top: 50%; left: -9px; right: -9px; height: 2px; margin-top: -1px; }
.map-xhair[hidden] { display: none; }
.leaflet-container.map-tool-on { cursor: crosshair; }
.leaflet-container.map-tool-on .leaflet-interactive, .leaflet-container.map-tool-on .leaflet-marker-icon { cursor: crosshair; }
.leaflet-container.map-tool-on .leaflet-marker-icon, .leaflet-container.map-tool-on .leaflet-marker-icon *, .leaflet-container.map-tool-on .leaflet-interactive,
.leaflet-container.map-tool-on .leaflet-tooltip { pointer-events: none !important; } /* every click reaches the map while drawing / picking */
body.map-tool-active .sel-card { visibility: hidden; }
@media (max-width: 820px) {
  .tool-bar { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 52%; border-radius: 12px 12px 0 0; z-index: 1250; gap: 6px; padding: 8px 12px 10px; }
  .tool-bar .tool-help { font-size: var(--fs-xs); }
  body.map-tool-active .fab, body.map-tool-active .fab-sheet { display: none !important; }
  .ipp-form { max-height: 80%; }
}
@media (max-width: 420px) { .draw-ring { grid-template-columns: 1fr 1fr; } }

/* map: coverage image, footprints, sector + ring labels */
.cov-img { image-rendering: pixelated; image-rendering: crisp-edges; }
.sec-lbl-icon, .ipp-lbl-icon { background: none; border: 0; }
.sec-lbl { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 600 11px var(--mono); color: #fff; padding: 2px 6px; border-radius: 4px;
  background: rgba(7,11,13,.82); border: 1px solid var(--sc, #fff); cursor: pointer; text-shadow: 0 1px 1px #000; }
.sec-lbl-icon:focus-visible { outline: none; }
.sec-lbl-icon:focus-visible .sec-lbl { outline: 2px solid #9af7d0; outline-offset: 1px; }
.ipp-lbl { display: inline-block; transform: translate(-50%, -100%); white-space: nowrap; font: 600 10.5px var(--mono); color: #fff; padding: 1px 5px; border-radius: 3px;
  background: rgba(7,11,13,.8); border: 1px solid rgba(255,255,255,.55); cursor: pointer; }
.ipp-lbl-example { border-style: dashed; color: #e8e8e8; }
.ipp-lbl-verified { border-color: rgba(var(--accent-rgb), .7); }
.ipp-lbl-user { border-color: #fff; }
.ipp-icon { background: none; border: 0; }
.ipp-icon svg { width: 30px; height: 30px; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.ipp-tag { position: absolute; left: 26px; top: -4px; font: 700 10px var(--mono); color: #fff; background: rgba(7,11,13,.85); border: 1px solid #fff; border-radius: 3px; padding: 0 4px; }
.ipp-icon:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; border-radius: 50%; }
.leaflet-popup.sar-pop .leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.leaflet-popup.sar-pop .leaflet-popup-tip { background: var(--surface); border: 1px solid var(--line-2); }
.leaflet-popup.sar-pop .leaflet-popup-content { margin: 10px 12px; font: 400 var(--fs-sm) var(--sans); line-height: 1.4; min-width: 200px; }
.leaflet-popup.sar-pop a.leaflet-popup-close-button { color: var(--muted); }
.sec-pop { display: grid; gap: 6px; }
.sec-pop p { margin: 0; }
.ipp-pop-warn, .ipp-warn { color: var(--amber); font-size: var(--fs-xs); margin: 0; }

/* scope readout COV + CP view IPP warning */
#ro-cov-w[hidden] { display: none; }
.cp-ipp { font: 600 var(--fs-xs) var(--mono); color: var(--amber); border: 1px solid rgba(var(--amber-rgb), .5); border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.cp-ipp[hidden] { display: none !important; }

/* Search tab: sectors list */
.sec-total { margin: 4px 12px 0 0; font-size: var(--fs-sm); color: var(--text); }
.sec-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.sec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; padding: 6px 6px 6px 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--sc); border-radius: 6px; }
.sec-main { display: flex; align-items: center; gap: 8px; min-width: 0; background: none; border: 0; color: var(--text); text-align: left; padding: 4px; border-radius: 4px; cursor: pointer; font: 500 var(--fs-sm) var(--sans); }
.sec-main:hover { background: var(--surface-3); }
.sec-main:focus-visible { outline: 2px solid #9af7d0; outline-offset: 0; }
.sec-sw { flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--sc); opacity: .85; }
.sec-txt { min-width: 0; overflow-wrap: anywhere; }
.sec-acts { display: flex; gap: 4px; }
.sec-acts .clue-del { margin-left: 0; }
.sec-bar { grid-column: 1 / -1; height: 6px; margin: 0 4px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sec-bar i { display: block; height: 100%; background: var(--sc); transition: width .4s ease; }
.sec-sub { grid-column: 1 / -1; margin: 0 4px; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.sec-as { color: var(--text); }
.sec-edit { grid-column: 1 / -1; display: grid; gap: 8px; padding: 8px 4px 2px; border-top: 1px solid var(--line); }
.sec-pal { display: flex; flex-wrap: wrap; gap: 6px; }
.sec-pal-o { position: relative; display: inline-grid; }
.sec-pal-o input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sec-pal-o span[style] { width: 26px; height: 26px; border-radius: 50%; background: var(--sc); border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); }
.sec-pal-o input:checked + span { border-color: #fff; }
.sec-pal-o input:focus-visible + span { outline: 2px solid #9af7d0; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sec-bar i { transition: none; } }
@media (max-width: 1100px) { .sec-row { grid-template-columns: 1fr; } .sec-acts { justify-content: flex-start; padding-left: 4px; } }

/* camera status */
.cam-status { margin-top: 10px; font-size: var(--fs-sm); }
.cam-status summary { cursor: pointer; color: var(--text); padding: 4px 0; }
.cam-list { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 2px; }
.cam-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--fs-xs); padding: 3px 4px; border-radius: 4px; background: var(--surface-2); }
.cam-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.cam-row.is-on .cam-dot { background: var(--accent); }
.cam-nm { font: 600 var(--fs-xs) var(--mono); }
.cam-st { color: var(--muted); }
.cam-why { flex-basis: 100%; padding-left: 16px; color: var(--muted); }

/* IPP card + form */
.ipp-card { display: grid; gap: 6px; margin-top: 6px; padding: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.ipp-l1, .ipp-l2 { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ipp-l2 { font-size: var(--fs-xs); color: var(--muted); }
.ipp-rings { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ipp-rings th, .ipp-rings td { text-align: left; padding: 3px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ipp-rings thead th { font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ipp-rings input { width: 72px; height: 28px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 6px; font: 500 var(--fs-sm) var(--mono); }
.ipp-rings input:focus-visible { outline: 2px solid #9af7d0; outline-offset: 1px; }
.ipp-rings input[aria-invalid="true"] { border-color: var(--red); }
.ipp-shown { margin-left: 6px; font-size: var(--fs-xs); color: var(--muted); }
.ipp-st { font: 600 9px var(--mono); letter-spacing: .06em; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line-2); white-space: nowrap; }
.ipp-st-verified { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }
.ipp-st-example { color: var(--amber); border: 1px dashed rgba(var(--amber-rgb), .6); }
.ipp-st-user { color: var(--text); border-color: var(--text); }
.ipp-src { overflow-wrap: anywhere; font-size: var(--fs-xs); }
.ipp-mk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ipp-mk label { font-size: var(--fs-sm); }
.ipp-mk select { height: 30px; min-width: 0; max-width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 6px; }
.ipp-use { margin-top: 6px; }
.ipp-use[hidden] { display: none; }
.ipp-prev { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ipp-prev li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.ipp-pct { font: 600 var(--fs-xs) var(--mono); color: var(--muted); }
#ipp-sec .ipp-warn { margin-top: 6px; }
.alert-log li[data-cat="search"] .log-lvl { color: #ffb347; }
body.cp-view .tool-bar, body.cp-view .map-xhair, body.cp-view .ipp-form { display: none !important; }
/* v17.13: on very short desktop maps the 6-button rail goes two-up (3 rows) instead of scrolling Fit out of view */
@media (min-width: 821px) and (max-height: 540px) { .map-rail { grid-template-columns: repeat(2, 52px); } }
.tool-bar .seg-btn { white-space: nowrap; padding: 0 6px; }
.tool-bar .btn-primary kbd { color: inherit; border-color: currentColor; opacity: .75; }
@media (hover: none) and (pointer: coarse) { .map-xhair { display: none !important; } } /* touch: the tap is the point */

/* ===================== v17.14 FAA airspace overlay (PLAN.md F3, js/airspace.js) ===================== */
.src-faa { white-space: nowrap; }
.as-group .overlay-list > li { display: grid; }
.as-st { display: block; margin: -4px 0 2px 30px; font: 500 var(--fs-xs) var(--mono); color: var(--muted); }
.as-st.is-err { color: var(--amber); }
.as-st.is-err::before { content: '⚠ '; }
.as-st.is-wait { color: var(--faint, var(--muted)); }
.as-tfr { display: inline-block; margin: 6px 4px 4px; font-size: var(--fs-sm); color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.as-tfr:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; border-radius: 2px; }
.as-disc { margin: 4px 4px 0; padding: 6px 8px; font-size: var(--fs-xs); line-height: 1.35; color: var(--amber); border: 1px solid rgba(var(--amber-rgb), .45); border-radius: 4px; background: rgba(var(--amber-rgb), .06); }
.as-disc strong { font-weight: 700; }

/* map: cells, outlines, labels (all under the radar / targets; panes asFillPane 352, asLblPane 362, asPtPane 366) */
.leaflet-asFill-pane svg path.as-int { cursor: help; }
.leaflet-asFill-pane path.as-cell:hover { stroke-opacity: 1; stroke-width: 1.6; }
.leaflet-asFill-pane path.as-cls:hover, .leaflet-asFill-pane path.as-sua:hover { stroke-width: 2.6; }
/* light / busy basemaps: stronger cell fill and stroke, dark halo under outlines so they read on imagery and paper maps */
.base-light .leaflet-asFill-pane path.as-cell:not(.as-cell-0) { fill-opacity: .2; stroke-opacity: .85; }
.base-light .leaflet-asFill-pane svg { filter: drop-shadow(0 0 .6px rgba(0,0,0,.95)); }
.base-satellite .leaflet-asFill-pane path.as-cell:not(.as-cell-0) { fill-opacity: .17; }
.as-ceil { display: flex !important; align-items: center; justify-content: center; pointer-events: none; }
.as-ceil span { font: 700 11px/1 var(--mono); letter-spacing: .02em; text-shadow: 0 0 2px #000, 0 0 3px #000, 0 0 5px rgba(0,0,0,.9); white-space: nowrap; }
.as-ceil small { font-size: 8px; font-weight: 600; margin-left: 1px; opacity: .85; }
.as-ceil-0 span { color: #ff6b79 !important; }
.as-name { pointer-events: none; }
.as-name span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 700 10px/1 var(--mono); letter-spacing: .08em; padding: 2px 5px; border: 1px dashed; border-radius: 3px; background: rgba(7,11,13,.72); text-shadow: 0 0 2px #000; }
.as-apt { overflow: visible; }
.as-apt svg { width: 16px; height: 16px; display: block; filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1px #000); }
.as-apt .as-g-ring { fill: rgba(7,11,13,.55); stroke: #6cc4ff; stroke-width: 1.6; }
.as-apt .as-g-tick { stroke: #6cc4ff; stroke-width: 1.8; stroke-linecap: round; }
.as-apt .as-g-h { stroke: #6cc4ff; stroke-width: 1.7; fill: none; }
.as-hp .as-g-ring { stroke: #d68cff; } .as-hp .as-g-h { stroke: #d68cff; }
.as-priv .as-g-ring, .as-priv .as-g-tick { stroke-dasharray: none; opacity: .8; }
.as-apt-id { position: absolute; left: 18px; top: 1px; font: 700 10px/1 var(--mono); color: #cfe9ff; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 0 2px #000, 0 0 3px #000, 0 0 4px #000; pointer-events: none; }
.as-hp .as-apt-id { color: #ecd2ff; }
.leaflet-asPt-pane .as-apt { cursor: help; }
.leaflet-asPt-pane .as-apt:focus-visible { outline: 2px solid #9af7d0; outline-offset: 2px; border-radius: 50%; }
/* map tools / command-post view: airspace never takes the click */
.map-tool-on .as-int, body.cp-view .as-int { pointer-events: none !important; }

/* popups */
.as-pop .as-pop-k { margin: 0 0 2px; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.as-pop .as-pop-h { margin: 0 0 6px; font-weight: 700; font-size: var(--fs-md); }
.as-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 6px; font-size: var(--fs-sm); }
.as-dl dt { color: var(--muted); }
.as-dl dd { margin: 0; font-family: var(--mono); }
.as-pop .as-pop-disc { margin: 6px 0 2px; padding: 4px 6px; font-size: var(--fs-xs); color: var(--amber); border: 1px solid rgba(var(--amber-rgb), .45); border-radius: 4px; }
.as-pop .as-pop-src { margin: 0; font-size: 10px; color: var(--muted); }
/* v17.14: with the facility-map grid on, controlled / SUA areas are clickable on their outline only (cells win inside) */
#map.as-uas-on .leaflet-asFill-pane path.as-cls, #map.as-uas-on .leaflet-asFill-pane path.as-sua { pointer-events: visibleStroke; }
