/* Sat Globe — console frame (html.ui-console). DESIGN.md is the contract: tokens, type,
 * geometry per form, components, glossary. This file holds the tokens (on :root, for every
 * stylesheet), the frame and the shared primitives.
 *
 * One application frame around a full-bleed map, in the register of fielded C2 / ISR
 * software (Lattice, Gotham; the user's analyst-console and IGiS references):
 *
 *   ┌ top strip ── Sat Globe · search ········ sign in · DTG · presence · split · Globe|Map · More ┐
 *   │ rail │                                                      HUD (selected track) │
 *   │ ▢    │                    map, about 90% of the screen                            │
 *   │ ▢    │                                                                            │
 *   └ status bar ── position · lat/lon · elev · eye · scale ······ credits · tiles ────────┘
 *
 * Rules: an OPAQUE slate frame, no boxed buttons, no outlines on controls (hairlines on
 * panels only), one blue for selection (solid fill, white ink) and the focus ring, intent
 * colours for status only, 2525 colours on symbols only, drawing tools only while drawing,
 * hotkeys in tooltips, nothing floating that is not a panel, the HUD, the draw tray or a
 * toast. console.mjs builds the rail, the wordmark, the split control and the More menu
 * around the original controls (each new button clicks the original).
 *
 * Every rule is scoped `.ui-console:not(#x#x)`: the :not() with two ids lifts it over
 * adaptive.css / touch.css (one id at most) without !important.
 *
 *              strip               rail                    status bar      panels
 *   desktop    40                  48, icons               26              beside the rail
 *   tablet     56                  72, icon + caption      30              beside / bottom sheet
 *   phone ⟂    44                  52, icons               —               docked right
 *   phone      52 + 28 readouts    bottom bar 58           readout row     bottom sheet
 */

@font-face {
  font-family: "Public Sans";
  src: url("/vendor/fonts/PublicSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/vendor/fonts/PublicSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/vendor/fonts/PublicSans-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ================================================================ tokens
 * DESIGN.md, verbatim. Unscoped on :root so every stylesheet can read them; feature files
 * still write the DESIGN.md value as the var() fallback. Night (body.nvg) re-points them below. */
:root {
  --cx-space: #050607;                  /* behind the globe */
  --cx-frame: #111418;                  /* strip, rail, status bar: OPAQUE */
  --cx-panel: #1c2127;                  /* panels, sheets, menus, cards */
  --cx-raised: #252a31;                 /* rows on hover inside panels, inputs on panels */
  --cx-hover: #2f343c;                  /* hover wash on frame controls */
  --cx-line: rgba(255, 255, 255, .10);  /* hairlines */
  --cx-line-hi: rgba(255, 255, 255, .22);
  --cx-ink: #f6f7f9;
  --cx-dim: #abb3bf;
  --cx-mute: #8f99a8;
  --cx-select: #2d72d2;                 /* THE selection fill */
  --cx-select-ink: #fff;
  --cx-focus: #4c90f0;                  /* focus ring only */
  --cx-ok: #32a467;
  --cx-warn: #ec9a3c;
  --cx-bad: #e76a6e;
  --cx-font: "Public Sans", system-ui, sans-serif;
  --cx-mono: "IBM Plex Mono", ui-monospace, monospace;
  --cx-r: 2px;
  --cx-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  --cx-ctl: 28px;                       /* control height */
  --cx-row: 32px;                       /* list and menu row */
  --cx-pad-panel: 12px;
  --cx-cap: 600 11px/1.2 var(--cx-font);  /* caption: data labels only, uppercase */
  --cx-cap-track: .06em;
  /* Old names, kept as aliases (re-declared under Night: a var() resolves where declared). */
  --cx-solid: var(--cx-panel);
  --cx-glass-hi: var(--cx-hover);
  --cx-edge: var(--cx-line);
  --cx-edge-hi: var(--cx-line-hi);
  --cx-act: var(--cx-focus);
  --cx-act-fill: var(--cx-select);
  --cx-hud-bg: var(--cx-panel);
}
:root:is([data-input="touch"], [data-input="pen"]) { --cx-ctl: 44px; --cx-row: 44px; --cx-pad-panel: 16px; }

.ui-console:not(#x#x) {
  /* theme.css tokens, re-pointed: slate chrome, one blue for selection */
  --bg: #050607;
  --panel: #1c2127;
  --panel-2: #252a31;
  --hover: #2f343c;
  --on: #111418;
  --line: #2f343c;
  --line-hi: #404854;
  --text: #f6f7f9;
  --dim: #abb3bf;
  --mute: #8f99a8;
  --hi: #4c90f0;
  --hi-dim: #215db0;
  --hi-ink: #f6f7f9;
  --track: #2f343c;
  --track-edge: #5f6b7c;
  --ok: #32a467;
  --warn: #ec9a3c;
  --bad: #e76a6e;
  --font: "Public Sans", system-ui, sans-serif;
  --display: var(--font);
  --fw-1: 400;
  --fw-2: 600;
  --track-1: .01em;

  /* geometry (per form below) */
  --cx-strip-h: 40px;
  --cx-rail-w: 48px;
  --cx-stat-h: 26px;
  --cx-bar-h: 0px;                      /* phone portrait bottom bar */
  --cx-read-h: 0px;                     /* phone portrait readout row (inside the strip) */
  --cx-btn: 36px;                       /* rail buttons */
  --cx-tool: 36px;                      /* draw tray buttons */
  --cx-sbtn: 28px;                      /* strip controls */
  --cx-pad: 8px;
  --cx-gap: 8px;
  --cx-side-w: 340px;                   /* HUD, cards and the docked palette */
  --cx-top-edge: calc(var(--safe-t, 0px) + var(--cx-strip-h));
  --cx-left-edge: calc(var(--safe-l, 0px) + var(--cx-rail-w));
  --cx-bot-edge: calc(var(--safe-b, 0px) + var(--cx-stat-h) + var(--cx-bar-h));
  --cx-top: calc(var(--cx-top-edge) + var(--cx-pad));
  --cx-left: calc(var(--cx-left-edge) + var(--cx-pad));
  --cx-bot: calc(var(--cx-bot-edge) + var(--cx-pad));
  --cx-right: calc(var(--safe-r, 0px) + var(--cx-pad));
  --ad-sheet-dw: 340px;
  --ad-map-t: 0px; --ad-map-r: 0px; --ad-map-b: 0px; --ad-map-l: 0px;
  --ad-hud-b: var(--cx-bot);
  --ad-fab-b: var(--cx-bot);
  background: var(--bg);
}
/* Classification bars (import.mjs mountBanner): theme.css adds --banner-h to --safe-t/-b on
 * body.has-banner. Custom properties resolve where they are declared, so the edges computed
 * on <html> above would miss the bars; recompute them on body so the strip, rail, panels and
 * status bar all sit between the two bars. */
.ui-console:not(#x#x) body.has-banner {
  --cx-top-edge: calc(var(--safe-t, 0px) + var(--cx-strip-h));
  --cx-bot-edge: calc(var(--safe-b, 0px) + var(--cx-stat-h) + var(--cx-bar-h));
  --cx-top: calc(var(--cx-top-edge) + var(--cx-pad));
  --cx-bot: calc(var(--cx-bot-edge) + var(--cx-pad));
  --ad-hud-b: var(--cx-bot);
  --ad-fab-b: var(--cx-bot);
}
/* banner.mjs paints the marking on screen (box + packs + feeds); the box-only bars that
 * import.mjs keeps underneath stay hidden while it runs (they return if it fails to load). */
.ui-console:not(#x#x) body.cls-screen .cls-banner.imp-cls:not(.scr-cls) { display: none; }
/* Per form (DESIGN.md Layout table). */
.ui-console:not(#x#x)[data-form="tablet"] {
  --cx-strip-h: 56px; --cx-rail-w: 72px; --cx-stat-h: 30px; --cx-btn: 56px; --cx-tool: 48px; --cx-sbtn: 48px;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="landscape"] {
  --cx-strip-h: 44px; --cx-rail-w: 52px; --cx-stat-h: 0px; --cx-btn: 44px; --cx-tool: 44px; --cx-sbtn: 44px;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] {
  --cx-strip-h: 80px; --cx-read-h: 28px; --cx-rail-w: 0px; --cx-stat-h: 0px; --cx-btn: 44px; --cx-tool: 44px; --cx-sbtn: 44px;
  --cx-bar-h: 58px;
}
@media (max-width: 699px) {
  .ui-console:not(#x#x)[data-form="tablet"] { --cx-strip-h: 92px; }   /* adaptive.css two-row strip (iPad split view) */
}
/* Night (nvg.mjs): follow its red palette; body-level tokens win on inheritance. Selection is a
 * fill in the red ink with black ink on it (hostile red is a symbol colour, never a fill). */
.ui-console:not(#x#x) body.nvg {
  --cx-space: #000;
  --cx-frame: #000;
  --cx-panel: #000;
  --cx-raised: var(--panel-2);
  --cx-hover: #1c0805;
  --cx-line: var(--line-hi);
  --cx-line-hi: #5e1c11;
  --cx-ink: var(--text);
  --cx-dim: var(--dim);
  --cx-mute: var(--dim);
  --cx-select: var(--text);
  --cx-select-ink: #000;
  --cx-focus: var(--hi);
  --cx-ok: var(--ok);
  --cx-warn: var(--warn);
  --cx-bad: var(--bad);
  --cx-solid: var(--cx-panel);
  --cx-glass-hi: var(--cx-hover);
  --cx-edge: var(--cx-line);
  --cx-edge-hi: var(--cx-line-hi);
  --cx-act: var(--cx-focus);
  --cx-act-fill: var(--cx-select);
  --cx-hud-bg: var(--cx-panel);
  --mute: var(--dim);
}
.ui-console:not(#x#x) body.nvg.nvg-dim { --cx-hover: #120402; --cx-line-hi: #3d1209; }

/* ================================================================ base */
.ui-console:not(#x#x) body { font: var(--fw-1) 13px/1.35 var(--font); color: var(--text); background: var(--bg); }
.ui-console:not(#x#x) #stars { background: var(--bg); }
.ui-console:not(#x#x) ::selection { background: var(--cx-select); color: var(--cx-select-ink); }
.ui-console:not(#x#x) { caret-color: var(--cx-focus); accent-color: var(--cx-select); }
/* Focus: 2px ring, 2px clear of the control, so it reads on a selected (blue) fill too. */
.ui-console:not(#x#x) :focus-visible { outline: 2px solid var(--cx-focus); outline-offset: 2px; }
.ui-console:not(#x#x) :focus:not(:focus-visible) { outline: none; }
.ui-console:not(#x#x) :is(#status, #sheet, #draw-tray, .cx-rail, .cx-menu, #session, #msg, .ad-chip, .ewc, .air-ui, .lib, #assist-host) :is(button, span, strong, label, h1, h2, h3, h4, div, a, summary) {
  letter-spacing: normal;
}
.ui-console:not(#x#x) :is(#map, #hud-layer) { top: 0; right: 0; bottom: 0; left: 0; }
/* Boot splash: the product wordmark under the GMW emblem keeps its capitalisation ("Sat Globe",
 * never "SAT GLOBE"; theme.css uppercases the whole veil) and is ink, not the selection blue. */
.ui-console:not(#x#x) #loader .boot-sub {
  font: 600 15px/1 var(--cx-font);
  letter-spacing: .02em;
  text-indent: 0;
  text-transform: none;
  color: var(--cx-ink);
}
.ui-console:not(#x#x) #reticle { left: 50%; top: 50%; }

/* Controls that live elsewhere in this shell: the rail, the menu, the status bar. No
 * floating +/− or tool squares on any form (DESIGN.md: pinch and wheel zoom; zoom lives in
 * the rail on touch tablets). */
.ui-console:not(#x#x) :is(#zoomctl, .ad-fab, .ad-fab-sym, #btn-draw-fab, .maplibregl-ctrl-bottom-left, .op-cursor) { display: none !important; }
.ui-console:not(#x#x) #status :is(#tool-label, #btn-library, #btn-assist, #btn-home, #btn-nvg, #btn-borders, #btn-fmt, #btn-help, #btn-install, #btn-n) { display: none; }
.ui-console:not(#x#x)[data-input="mouse"] #status #btn-search { display: none; }   /* the field is there */
.ui-console:not(#x#x) .cx-phone-only { display: none; }

/* ================================================================ top strip */
.ui-console:not(#x#x) #status {
  top: 0; left: 0; right: 0;
  height: var(--cx-top-edge);
  padding: var(--safe-t, 0px) calc(var(--safe-r, 0px) + 8px) 0 calc(var(--safe-l, 0px) + 12px);
  background: var(--cx-frame);
  border-bottom: 1px solid var(--cx-line);
  box-shadow: none;
  z-index: 23;
}
/* One row, one rhythm: wordmark · search ········ sign in · DTG · presence · split ·
 * Globe|Map · More. All controls are --cx-sbtn tall, 12px between groups. The free space
 * sits after the search, so "Sign in" appearing (left of the DTG) never moves the DTG. */
.ui-console:not(#x#x) #status .status-row { height: var(--cx-strip-h); column-gap: 12px; align-items: center; }
.ui-console:not(#x#x) #status .btns { display: contents; }
.ui-console:not(#x#x) #status .coords { order: 2; height: auto; column-gap: 12px; flex: 0 1 auto; margin-right: auto; min-width: 0; }
.ui-console:not(#x#x) #status #btn-search { order: 1; }
.ui-console:not(#x#x) #status #btn-signin { order: 3; }
.ui-console:not(#x#x) #status .clock { order: 4; }
.ui-console:not(#x#x) #status #btn-session { order: 5; }
.ui-console:not(#x#x) #status .cx-layout { order: 6; }
.ui-console:not(#x#x) #status #proj-seg { order: 7; }
.ui-console:not(#x#x) #status .cx-more { order: 8; }
/* Readouts live in the status bar (desktop, tablet) or the phone's readout row. */
.ui-console:not(#x#x) #status .coords > .read { display: none; }
.ui-console:not(#x#x) #status .val,
.ui-console:not(#x#x) #status .val.hi { font: 400 13px/1 var(--cx-mono); color: var(--cx-ink); }
.ui-console:not(#x#x) #status .lab { font: var(--cx-cap); letter-spacing: var(--cx-cap-track); color: var(--cx-mute); }
/* Wordmark: "Sat Globe", that capitalisation, sentence-case type (DESIGN.md wordmark token). */
.ui-console:not(#x#x) .cx-mark {
  order: 0;
  flex: none;
  font: 600 13px/1 var(--cx-font);
  letter-spacing: .02em;
  text-transform: none;
  color: var(--cx-ink);
  padding-right: 12px;
  border-right: 1px solid var(--cx-line);
  white-space: nowrap;
}
.ui-console:not(#x#x) #status .clock {
  margin-left: 0;
  flex: none;
  font: 400 12px/1 var(--cx-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--cx-ink);
  white-space: nowrap;
}
.ui-console:not(#x#x) #status .clock .dtg-d { color: var(--cx-mute); }
.ui-console:not(#x#x) #status .btns > :is(button, .cx-more):not([hidden]) { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ui-console:not(#x#x) #status :is(button, .cx-more) {
  height: var(--cx-sbtn);
  min-width: var(--cx-sbtn);
  padding: 0 8px;
  font: 500 12px/1 var(--cx-font);
  text-transform: none;
  letter-spacing: 0;
  color: var(--cx-dim);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r);
  box-shadow: none;
}
.ui-console:not(#x#x) #status button[hidden] { display: none; }
.ui-console:not(#x#x) #status button svg { width: 16px; height: 16px; flex: none; }
.ui-console:not(#x#x) #status .cx-more svg { width: 20px; height: 20px; }
.ui-console:not(#x#x) #status button:hover { background: var(--cx-hover); color: var(--cx-ink); }
.ui-console:not(#x#x) #status :is(button.on, button[aria-pressed="true"]) {
  color: var(--cx-select-ink);
  background: var(--cx-select);
  box-shadow: none;
}
.ui-console:not(#x#x) #status button[aria-expanded="true"] { color: var(--cx-ink); background: var(--cx-hover); }
.ui-console:not(#x#x) #status #btn-signin { color: var(--cx-ink); font-weight: 600; }
/* Segmented controls (Globe | Map, split view): quiet cells, no outer frame; the selected
 * cell is the solid selection fill. */
.ui-console:not(#x#x) #status .ad-seg {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.ui-console:not(#x#x) #status .ad-seg[hidden],
.ui-console:not(#x#x) #status .ad-seg .ad-seg-btn[hidden] { display: none; }
.ui-console:not(#x#x) #status .ad-seg .ad-seg-btn {
  height: var(--cx-sbtn);
  min-width: var(--cx-sbtn);
  padding: 0 8px;
  border: 0;
  border-radius: var(--cx-r);
  box-shadow: none;
}
.ui-console:not(#x#x) #status .ad-seg .ad-seg-btn[aria-pressed="true"] { color: var(--cx-select-ink); background: var(--cx-select); box-shadow: none; }
/* Split view only where several panes can work: not on phones or portrait tablets. */
.ui-console:not(#x#x):is([data-form="phone"], [data-orient="portrait"]) #status .cx-layout { display: none; }
/* Search */
.ui-console:not(#x#x) #status #goto { flex: 0 1 300px; }
.ui-console:not(#x#x) #status #goto-q {
  height: var(--cx-sbtn);
  font: 400 13px/1 var(--cx-font);
  color: var(--cx-ink);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-r);
}
.ui-console:not(#x#x) #status #goto-q::placeholder { color: var(--cx-mute); opacity: 1; }
.ui-console:not(#x#x) #status #goto-q:focus { border-color: var(--cx-select); outline: none; }

/* ================================================================ rail */
.ui-console:not(#x#x) .cx-rail {
  position: absolute;
  z-index: 22;
  top: var(--cx-top-edge);
  bottom: var(--cx-bot-edge);
  left: 0;
  width: var(--cx-left-edge);
  padding: 8px 0 8px var(--safe-l, 0px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--cx-frame);
  border-right: 1px solid var(--cx-line);
  overflow-y: auto;
  scrollbar-width: none;
}
.ui-console:not(#x#x) .cx-rail::-webkit-scrollbar { display: none; }
.ui-console:not(#x#x) .cx-rail #dock { display: contents; }
.ui-console:not(#x#x) .cx-rail :where(#dock button, .cx-rail-btn) {
  position: relative;
  flex: none;
  width: var(--cx-btn);
  height: var(--cx-btn);
  min-width: 0;
  min-height: 0;
  max-height: none;
  padding: 0;
  display: grid;
  place-items: center;
  place-content: center;
  color: var(--cx-dim);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r);
  box-shadow: none;
  cursor: pointer;
}
.ui-console:not(#x#x) .cx-rail :where(#dock button, .cx-rail-btn)::before,
.ui-console:not(#x#x) .cx-rail :where(#dock button, .cx-rail-btn)::after { display: none; }
.ui-console:not(#x#x) .cx-rail :where(#dock button, .cx-rail-btn) svg { width: 20px; height: 20px; }
.ui-console:not(#x#x) .cx-rail :where(#dock button, .cx-rail-btn):hover { color: var(--cx-ink); background: var(--cx-hover); }
.ui-console:not(#x#x) .cx-rail :where(#dock button.active, .cx-rail-btn[aria-pressed="true"]),
.ui-console:not(#x#x) .cx-rail :where(#dock button.active, .cx-rail-btn[aria-pressed="true"]):hover { color: var(--cx-select-ink); background: var(--cx-select); }
.ui-console:not(#x#x) .cx-rail :is(.lbl-full, .lbl-short) { display: none; }
/* Seven items (DESIGN.md): MTD (the map itself) and Surveillance are not rail items. */
.ui-console:not(#x#x) .cx-rail :is(.dock-attrib, [data-mode="mtd"], [data-mode="surveillance"], [hidden]) { display: none !important; }
.ui-console:not(#x#x) .cx-rail [data-mode="sdts"] { order: 1; }
.ui-console:not(#x#x) .cx-rail [data-mode="info"] { order: 3; }
.ui-console:not(#x#x) .cx-rail .cx-rail-sep { order: 4; }
.ui-console:not(#x#x) .cx-rail [data-cx="draw"] { order: 5; }
.ui-console:not(#x#x) .cx-rail [data-cx="symbols"] { order: 6; }
.ui-console:not(#x#x) .cx-rail .cx-rail-sep + .cx-rail-sep,
.ui-console:not(#x#x) .cx-rail .cx-rail-sep:nth-of-type(2) { order: 7; }
.ui-console:not(#x#x) .cx-rail [data-cx="library"] { order: 8; }
.ui-console:not(#x#x) .cx-rail [data-cx="assist"] { order: 9; }
.ui-console:not(#x#x) .cx-rail .cx-rail-fill { order: 10; flex: 1 0 8px; }
.ui-console:not(#x#x) .cx-rail [data-mode="settings"] { order: 11; }
.ui-console:not(#x#x) .cx-rail [data-cx="zin"] { order: 12; }
.ui-console:not(#x#x) .cx-rail [data-cx="zout"] { order: 13; }
.ui-console:not(#x#x) .cx-rail .cx-rail-sep { flex: none; width: 20px; height: 1px; margin: 4px 0; background: var(--cx-line-hi); }
.ui-console:not(#x#x)[data-input="mouse"] .cx-rail .cx-zoom { display: none; }
/* Tablet: 72 rail, 56 buttons, a 12px sentence-case caption under each icon (gloves; no
 * tooltips on glass). */
.ui-console:not(#x#x)[data-form="tablet"] .cx-rail { gap: 4px; }
.ui-console:not(#x#x)[data-form="tablet"] .cx-rail :where(#dock button, .cx-rail-btn) {
  width: calc(var(--cx-rail-w) - 8px);
  height: var(--cx-btn);
  grid-template-rows: 22px 14px;
  row-gap: 4px;
}
.ui-console:not(#x#x)[data-form="tablet"] .cx-rail :where(#dock button, .cx-rail-btn) svg { width: 22px; height: 22px; }
.ui-console:not(#x#x)[data-form="tablet"] .cx-rail .lbl-short {
  display: block;
  font: 500 12px/14px var(--cx-font);
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
  white-space: nowrap;
}
.ui-console:not(#x#x)[data-form="tablet"] .cx-rail .cx-zoom { height: 48px; grid-template-rows: none; }
.ui-console:not(#x#x)[data-form="tablet"] .cx-rail .cx-zoom .lbl-short { display: none; }
/* Phone portrait: the rail is the bottom bar (58): Layers, Info, Draw, Symbols, Settings,
 * captioned in plain words. Library and Assistant are in the More menu; zoom is pinch. */
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail {
  z-index: 27;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: calc(var(--cx-bar-h) + var(--safe-b, 0px));
  padding: 0 var(--safe-r, 0px) var(--safe-b, 0px) var(--safe-l, 0px);
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  border-right: 0;
  border-top: 1px solid var(--cx-line);
  overflow: visible;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail :is(.cx-rail-sep, .cx-rail-fill, .cx-zoom, [data-cx="library"], [data-cx="assist"]) { display: none; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail :where(#dock button, .cx-rail-btn) {
  flex: 1 1 0;
  width: auto;
  height: var(--cx-bar-h);
  grid-template-rows: 22px 14px;
  row-gap: 4px;
  border-radius: 0;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail :where(#dock button, .cx-rail-btn) svg { width: 22px; height: 22px; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail .lbl-short {
  display: block;
  font: 500 12px/14px var(--cx-font);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail :focus-visible { outline-offset: -4px; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-rail :is(.active, [aria-pressed="true"]):focus-visible { outline-color: var(--cx-select-ink); }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-phone-only { display: flex; }
/* Phone landscape (~320 px of rail between strip and home indicator): the same five as the
 * portrait bar, so Settings is never scrolled off the bottom; Library and Assistant are in
 * the More menu, zoom is pinch. */
.ui-console:not(#x#x)[data-form="phone"][data-orient="landscape"] .cx-rail :is(.cx-rail-sep:nth-of-type(2), .cx-zoom, [data-cx="library"], [data-cx="assist"]) { display: none; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="landscape"] .cx-phone-only { display: flex; }

/* ================================================================ draw palette (only while drawing) */
.ui-console:not(#x#x) #draw-tray { display: none; }
.ui-console:not(#x#x) body.mode-draw #draw-tray,
.ui-console:not(#x#x) body:has(#draw-tray button[data-tool].active:not([data-tool="pan"])) #draw-tray {
  position: absolute;
  z-index: 24;
  top: var(--cx-top);
  left: var(--cx-left);
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - var(--cx-left) - var(--cx-right));
  max-height: none;
  margin: 0;
  padding: 4px;
  transform: none;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 2px;
  overflow: visible;
  contain: none;              /* adaptive.css paint containment would clip the focus ring */
  pointer-events: auto;
  background: var(--cx-panel);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-r);
  box-shadow: var(--cx-shadow);
}
.ui-console:not(#x#x)[data-form="desktop"]:has(#sheet.open) body.mode-draw #draw-tray,
.ui-console:not(#x#x)[data-form="tablet"][data-orient="landscape"]:has(#sheet.open) body.mode-draw #draw-tray {
  left: calc(var(--cx-left) + var(--ad-sheet-dw) + var(--cx-gap));
}
.ui-console:not(#x#x) #draw-tray > :is(button, select) {
  flex: none;
  width: var(--cx-tool);
  height: var(--cx-tool);
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--cx-dim);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r);
  box-shadow: none;
}
.ui-console:not(#x#x) #draw-tray > button svg { width: 18px; height: 18px; }
.ui-console:not(#x#x)[data-form="tablet"] #draw-tray > button svg { width: 20px; height: 20px; }
.ui-console:not(#x#x) #draw-tray > button:hover { color: var(--cx-ink); background: var(--cx-hover); }
.ui-console:not(#x#x) #draw-tray > button:is(.active, [aria-pressed="true"]),
.ui-console:not(#x#x) #draw-tray > button:is(.active, [aria-pressed="true"]):hover { color: var(--cx-select-ink); background: var(--cx-select); box-shadow: none; }
.ui-console:not(#x#x) #draw-tray > button::after { content: none !important; }  /* hotkeys are in the tooltips */
.ui-console:not(#x#x) #draw-tray :is(#btn-hand, #btn-symbols, select) { display: none; }
/* Groups (console.mjs adds the separators):
 *   select pan | point route area freehand circle ring | measure R&B | undo redo ···
 *   wipe AOI mission | done
 * Wipe sits away from Done; AOI and Mission (both "this area") stay together. */
.ui-console:not(#x#x) #draw-tray [data-tool="select"] { order: 10; }
.ui-console:not(#x#x) #draw-tray [data-tool="pan"] { order: 11; }
.ui-console:not(#x#x) #draw-tray .cx-tray-sep-1 { order: 19; }
.ui-console:not(#x#x) #draw-tray [data-tool="point"] { order: 20; }
.ui-console:not(#x#x) #draw-tray [data-tool="line"] { order: 21; }
.ui-console:not(#x#x) #draw-tray [data-tool="poly"] { order: 22; }
.ui-console:not(#x#x) #draw-tray [data-tool="freehand"] { order: 23; }
.ui-console:not(#x#x) #draw-tray [data-tool="circle"] { order: 24; }
.ui-console:not(#x#x) #draw-tray [data-tool="ring"] { order: 25; }
.ui-console:not(#x#x) #draw-tray .cx-wez-tool { order: 26; }
.ui-console:not(#x#x) #draw-tray > button[hidden] { display: none; }
.ui-console:not(#x#x) #draw-tray .cx-tray-sep-2 { order: 29; }
.ui-console:not(#x#x) #draw-tray [data-tool="measure"] { order: 30; }
.ui-console:not(#x#x) #draw-tray [data-tool="rb"] { order: 31; }
.ui-console:not(#x#x) #draw-tray .cx-tray-sep-3 { order: 39; }
.ui-console:not(#x#x) #draw-tray #btn-undo-tray { order: 40; }
.ui-console:not(#x#x) #draw-tray #btn-redo-tray { order: 41; }
.ui-console:not(#x#x) #draw-tray .cx-tray-sep-4 { order: 49; margin-left: 12px; }
.ui-console:not(#x#x) #draw-tray #btn-wipe { order: 50; margin: 0; }
.ui-console:not(#x#x) #draw-tray [data-tool="aoi"] { order: 51; }
.ui-console:not(#x#x) #draw-tray #btn-mission { order: 52; }
.ui-console:not(#x#x) #draw-tray .cx-tray-sep-5 { order: 59; }
.ui-console:not(#x#x) #draw-tray #btn-draw-done { order: 60; display: grid; }
.ui-console:not(#x#x) #draw-tray > .cx-tray-sep {
  flex: none;
  align-self: center;
  width: 1px;
  min-width: 1px;
  height: calc(var(--cx-tool) * .5);
  margin: 0 4px;
  padding: 0;
  background: var(--cx-line-hi);
}
.ui-console:not(#x#x) #draw-tray :is(#btn-undo-tray, #btn-redo-tray, #btn-mission, #btn-wipe) svg { width: 18px; height: 18px; }
/* The shell marks every draw toggle pressed while drawing; close is an action, not a state. */
.ui-console:not(#x#x) #draw-tray #btn-draw-done[aria-pressed] { color: var(--cx-dim); background: transparent; }
.ui-console:not(#x#x) #draw-tray #btn-draw-done:hover { color: var(--cx-ink); background: var(--cx-hover); }
/* Wipe: danger is a bad-coloured label, armed on the first press (index.html .warn). */
.ui-console:not(#x#x) #draw-tray #btn-wipe.warn { color: var(--cx-bad); background: transparent; box-shadow: inset 0 0 0 1px var(--cx-bad); animation: none; }
/* The armed tool's instruction, one line under the tray (console.mjs places it). */
.ui-console:not(#x#x) .cx-hint {
  position: fixed;
  z-index: 24;
  max-width: calc(100vw - 16px);
  padding: 4px 8px;
  font: 400 12px/1.3 var(--cx-font);
  color: var(--cx-ink);
  background: var(--cx-panel);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-r);
  box-shadow: var(--cx-shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.ui-console:not(#x#x) .cx-hint[hidden] { display: none; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) .cx-hint { font-size: 13px; padding: 6px 10px; }
/* Phone portrait: a scrolling row above the bottom bar. */
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] body.mode-draw #draw-tray {
  top: auto;
  left: var(--cx-pad);
  right: var(--cx-pad);
  bottom: var(--cx-bot);
  max-width: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-hint { white-space: normal; max-width: calc(100vw - 2 * var(--cx-pad)); }

/* ================================================================ panels
 * DESIGN.md "Panels", one primitive for #sheet (Layers, Info, Settings) on every form:
 * header 40 (48 touch) with a 13/600 sentence-case title and an SVG close in a quiet 32/44
 * button, hairline below; the body scrolls; rows 32/44 (--cx-row) with hairline separators;
 * segmented = quiet buttons with one solid select fill; switches on = select fill.
 * Geometry: docked left beside the rail between strip and status bar (desktop, tablet
 * landscape); a bottom sheet standing on the status bar (tablet portrait) or the bottom bar
 * (phone portrait), drawn UNDER the frame so the status bar and the classification bar stay
 * on top at every detent; docked right on a phone in landscape.
 * Icons are SVG masks (24 viewBox, stroke 1.5, round caps) so they take currentColor. */
.ui-console:not(#x#x) :is(#sheet, .sym-host, .sym-scrim, #inspect) {
  --sh-ico-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  --sh-ico-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  --sh-ico-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3.5 2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z'/%3E%3C/svg%3E");
  --sh-ico-star-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='m12 3.5 2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z'/%3E%3C/svg%3E");
}
.ui-console:not(#x#x) #sheet {
  color: var(--cx-ink, #f6f7f9);
  background: var(--cx-panel, #1c2127);
  border: 1px solid var(--cx-line, rgba(255, 255, 255, .10));
  border-radius: var(--cx-r, 2px);
  box-shadow: var(--cx-shadow, 0 6px 20px rgba(0, 0, 0, .45));
  font: 400 13px/1.35 var(--cx-font, "Public Sans", system-ui, sans-serif);
}
.ui-console:not(#x#x) #sheet-head {
  flex: none;
  height: 40px;
  min-height: 40px;
  padding: 0 4px 0 var(--cx-pad-panel, 12px);
  gap: 8px;
  background: transparent;
  border-bottom: 1px solid var(--cx-line, rgba(255, 255, 255, .10));
}
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet-head { height: 48px; min-height: 48px; padding-right: 2px; }
.ui-console:not(#x#x) #sheet-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 600 13px/1.2 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cx-ink, #f6f7f9);
}
.ui-console:not(#x#x) #sheet .sheet-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 0;                         /* the markup's "×" glyph; the icon is the mask below */
  color: var(--cx-dim, #abb3bf);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r, 2px);
  cursor: pointer;
}
.ui-console:not(#x#x) #sheet .sheet-x:not(:has(svg))::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--sh-ico-x) center / 16px 16px no-repeat;
  mask: var(--sh-ico-x) center / 16px 16px no-repeat;
}
.ui-console:not(#x#x) #sheet .sheet-x svg { width: 16px; height: 16px; }
.ui-console:not(#x#x) #sheet .sheet-x:hover { color: var(--cx-ink, #f6f7f9); background: var(--cx-hover, #2f343c); }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .sheet-x { width: 44px; height: 44px; }
.ui-console:not(#x#x) #sheet .sheet-pane {
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--cx-line-hi, rgba(255, 255, 255, .22)) transparent;
}
.ui-console:not(#x#x) #sheet .sheet-pane::-webkit-scrollbar { width: 8px; }
.ui-console:not(#x#x) #sheet .sheet-pane::-webkit-scrollbar-thumb { background: var(--cx-line-hi, rgba(255, 255, 255, .22)); border-radius: var(--cx-r, 2px); }
/* Footer actions, right-aligned; one primary (Draw); Clear is a danger label. */
.ui-console:not(#x#x) #sheet-actions:not([hidden]) {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px var(--cx-pad-panel, 12px);
  background: transparent;
  border-top: 1px solid var(--cx-line, rgba(255, 255, 255, .10));
}
.ui-console:not(#x#x) #sheet-actions button {
  flex: none;
  min-width: 0;
  height: var(--cx-ctl, 28px);
  padding: 0 8px;
  font: 500 13px/1 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cx-dim, #abb3bf);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r, 2px);
}
.ui-console:not(#x#x) #sheet-actions button:hover { color: var(--cx-ink, #f6f7f9); background: var(--cx-hover, #2f343c); }
.ui-console:not(#x#x) #sheet-actions #btn-clear { color: var(--cx-bad, #e76a6e); margin-right: auto; }
.ui-console:not(#x#x) #sheet-actions button.primary { color: var(--cx-select-ink, #fff); background: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x) .sheet-foot { border-top-color: var(--cx-line, rgba(255, 255, 255, .10)); color: var(--cx-mute, #8f99a8); font-size: 11px; }

/* Segmented control (Layers presets, Streets, every Settings choice). */
.ui-console:not(#x#x) #sheet .lyr-seg {
  display: flex;
  gap: 2px;
  padding: 8px var(--cx-pad-panel, 12px);
  background: var(--cx-panel, #1c2127);
  border: 0;
  border-bottom: 1px solid var(--cx-line, rgba(255, 255, 255, .10));
}
.ui-console:not(#x#x) #sheet .lyr-seg-btn {
  flex: 1 1 0;
  min-width: 0;
  height: var(--cx-ctl, 28px);
  min-height: 0;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 500 13px/1 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cx-dim, #abb3bf);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r, 2px);
  cursor: pointer;
}
.ui-console:not(#x#x) #sheet .lyr-seg-btn:hover:not(:disabled) { color: var(--cx-ink, #f6f7f9); background: var(--cx-hover, #2f343c); }
.ui-console:not(#x#x) #sheet .lyr-seg-btn[aria-pressed="true"],
.ui-console:not(#x#x) #sheet .lyr-seg-btn[aria-pressed="true"]:hover { color: var(--cx-select-ink, #fff); background: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x) #sheet .lyr-seg-btn:focus-visible { outline: 2px solid var(--cx-focus, #4c90f0); outline-offset: -2px; }
.ui-console:not(#x#x) #sheet :is(.set-seg, .lyr-seg-inline) { flex: 0 1 auto; padding: 0; background: transparent; border: 0; }
.ui-console:not(#x#x) #sheet :is(.set-seg, .lyr-seg-inline) .lyr-seg-btn { flex: 0 0 auto; min-width: 40px; }
.ui-console:not(#x#x) #sheet .set-row[data-key="cls"] .set-seg .lyr-seg-btn { flex: 1 1 0; min-width: 0; padding: 0; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet :is(.set-seg, .lyr-seg-inline) .lyr-seg-btn { min-width: 44px; }
/* Seven banner levels in a 340 px sheet on touch: 1 px gaps and 4 px into the gutters keep 44. */
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .set-row[data-key="cls"] .set-seg { gap: 1px; width: auto; margin-inline: -4px; flex: 1 1 100%; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .set-row[data-key="cls"] .set-seg .lyr-seg-btn { min-width: 44px; }

/* Switch: track hover-grey, on = select fill with a select-ink knob. */
.ui-console:not(#x#x) #sheet .lyr-sw {
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.ui-console:not(#x#x) #sheet .lyr-sw-track {
  position: relative;
  display: block;
  width: 28px;
  height: 16px;
  box-sizing: border-box;
  background: var(--cx-hover, #2f343c);
  border: 1px solid var(--cx-line-hi, rgba(255, 255, 255, .22));
  border-radius: var(--cx-r, 2px);
}
.ui-console:not(#x#x) #sheet .lyr-sw-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: var(--cx-dim, #abb3bf);
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}
.ui-console:not(#x#x) #sheet .lyr-sw:hover .lyr-sw-track { border-color: var(--cx-dim, #abb3bf); }
.ui-console:not(#x#x) #sheet .lyr-sw[aria-checked="true"] .lyr-sw-track { background: var(--cx-select, #2d72d2); border-color: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x) #sheet .lyr-sw[aria-checked="true"] .lyr-sw-knob { transform: translateX(12px); background: var(--cx-select-ink, #fff); }
.ui-console:not(#x#x) #sheet .lyr-sw:focus-visible { outline: 0; }
.ui-console:not(#x#x) #sheet .lyr-sw:focus-visible .lyr-sw-track { outline: 2px solid var(--cx-focus, #4c90f0); outline-offset: 2px; }
.ui-console:not(#x#x) #sheet .lyr-sw:disabled { cursor: default; opacity: .4; }
.ui-console:not(#x#x) #sheet .set-row .lyr-sw { width: 44px; height: var(--cx-ctl, 28px); min-height: 0; margin-right: -8px; }

/* Range: a 4 px track filled in dim up to the value (--v, set by catalog.mjs), an ink thumb. */
.ui-console:not(#x#x) #sheet .lyr-range { height: 24px; }
.ui-console:not(#x#x) #sheet .lyr-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--cx-r, 2px);
  background: linear-gradient(to right, var(--cx-dim, #abb3bf) 0 var(--v), var(--cx-hover, #2f343c) var(--v) 100%);
}
.ui-console:not(#x#x) #sheet .lyr-range::-webkit-slider-thumb { width: 12px; height: 16px; margin-top: -6px; background: var(--cx-ink, #f6f7f9); border: 0; border-radius: var(--cx-r, 2px); }
.ui-console:not(#x#x) #sheet .lyr-range::-moz-range-track { height: 4px; background: var(--cx-hover, #2f343c); border-radius: var(--cx-r, 2px); }
.ui-console:not(#x#x) #sheet .lyr-range::-moz-range-progress { height: 4px; background: var(--cx-dim, #abb3bf); }
.ui-console:not(#x#x) #sheet .lyr-range::-moz-range-thumb { width: 12px; height: 16px; background: var(--cx-ink, #f6f7f9); border: 0; border-radius: var(--cx-r, 2px); }
.ui-console:not(#x#x) #sheet .lyr-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--cx-panel, #1c2127), 0 0 0 4px var(--cx-focus, #4c90f0); }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .lyr-range { height: 44px; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .lyr-range::-webkit-slider-thumb { width: 16px; height: 24px; margin-top: -10px; }

/* Desktop and tablet landscape: a sidebar beside the rail. */
.ui-console:not(#x#x):is([data-form="desktop"], [data-form="tablet"][data-orient="landscape"]) #sheet {
  top: var(--cx-top);
  bottom: var(--cx-bot);
  left: var(--cx-left);
  right: auto;
  width: var(--ad-sheet-dw, 340px);
  max-width: calc(100vw - var(--cx-left) - var(--cx-right));
  max-height: none;
  padding: 0;
  transform: none;
}
.ui-console:not(#x#x)[data-form="tablet"][data-orient="landscape"] #sheet:not(.open) { display: none; }
.ui-console:not(#x#x)[data-form="tablet"][data-orient="landscape"] #sheet.open { display: flex; }
.ui-console:not(#x#x)[data-form="tablet"][data-orient="landscape"] .sheet-grip { display: none; }
/* Portrait: sheets.mjs drags a bottom sheet between detents (inline transform; the CSS height
 * is the full detent). It stands on the status bar (tablet) or the bottom bar (phone), and sits
 * under the frame (strip and status bar 23, bottom bar 27, classification bars 60): a half or
 * peek detent slides its lower part behind them instead of over them. */
.ui-console:not(#x#x)[data-orient="portrait"]:is([data-form="phone"], [data-form="tablet"]) #sheet {
  z-index: 22;
  top: auto;
  bottom: var(--cx-bot-edge);
  height: calc(100% - var(--cx-top) - var(--cx-bot-edge));
  margin-inline: 0;
  border-bottom: 0;
  border-radius: var(--cx-r, 2px) var(--cx-r, 2px) 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .45);
}
.ui-console:not(#x#x)[data-orient="portrait"][data-form="tablet"] #sheet { left: var(--cx-left); right: var(--cx-right); width: auto; }
.ui-console:not(#x#x)[data-orient="portrait"][data-form="phone"] #sheet { left: var(--cx-pad); right: var(--cx-pad); width: auto; }
.ui-console:not(#x#x)[data-orient="portrait"]:is([data-form="phone"], [data-form="tablet"]) .sheet-grip { height: 16px; }
.ui-console:not(#x#x)[data-orient="portrait"]:is([data-form="phone"], [data-form="tablet"]) .sheet-grip::before { margin-top: 6px; background: var(--cx-line-hi, rgba(255, 255, 255, .22)); }
/* Phone landscape: docked right. */
.ui-console:not(#x#x)[data-form="phone"][data-orient="landscape"] #sheet {
  top: var(--cx-top);
  bottom: var(--cx-bot);
  left: auto;
  right: var(--cx-right);
  width: min(340px, 46vw);
  padding: 0;
}

/* Layer sheet (catalog.mjs builds it; a3 owns the markup). Rows: switch · name · tags ·
 * value · locate · chevron. The name button fills the row height (the 16 px "Frame …"
 * targets failed WCAG 2.5.8). Touch: every target 44, 8 px apart. Row padding puts the
 * switch track on the panel's content edge (12 mouse, 16 touch). */
.ui-console:not(#x#x) #sheet .lyr-seg:not(.set-seg):not(.lyr-seg-inline) { position: sticky; top: 0; z-index: 2; }
.ui-console:not(#x#x) #sheet .lyr-oprow {
  position: sticky;
  top: calc(var(--cx-ctl, 28px) + 17px);
  z-index: 2;
  grid-template-columns: auto minmax(0, 1fr) 4.5ch;
  column-gap: 12px;
  min-height: var(--cx-row, 32px);
  padding: 0 var(--cx-pad-panel, 12px);
  background: var(--cx-panel, #1c2127);
  border-bottom: 1px solid var(--cx-line, rgba(255, 255, 255, .10));
}
.ui-console:not(#x#x) #sheet .lyr-oplabel { font: 400 13px/1.35 var(--cx-font, "Public Sans", system-ui, sans-serif); letter-spacing: 0; text-transform: none; color: var(--cx-dim, #abb3bf); }
/* A pack's own opacity, inside its drawer (caret): same parts as the stack slider, not sticky. */
.ui-console:not(#x#x) #sheet .lyr-op {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 4.5ch;
  align-items: center;
  column-gap: 12px;
  min-height: var(--cx-row, 32px);
  padding-right: 8px;
}
.ui-console:not(#x#x) #sheet .lyr-op :is(.lyr-range, .lyr-val) { grid-area: auto; }
.ui-console:not(#x#x) #sheet .lyr-op .lyr-val { text-align: right; }
.ui-console:not(#x#x) #sheet .lyr-val { font: 400 12px/1 var(--cx-mono, "IBM Plex Mono", ui-monospace, monospace); font-variant-numeric: tabular-nums slashed-zero; color: var(--cx-dim, #abb3bf); }
.ui-console:not(#x#x) #sheet .lyr-sec + .lyr-sec { border-top: 1px solid var(--cx-line, rgba(255, 255, 255, .10)); }
.ui-console:not(#x#x) #sheet .lyr-sec-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px var(--cx-pad-panel, 12px) 8px;
  font: 600 12px/1.2 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cx-dim, #abb3bf);
}
.ui-console:not(#x#x) #sheet :is(.lyr-dev, .lyr-prov) > summary { list-style: none; cursor: pointer; }
.ui-console:not(#x#x) #sheet :is(.lyr-dev, .lyr-prov) > summary::-webkit-details-marker { display: none; }
.ui-console:not(#x#x) #sheet :is(.lyr-dev, .lyr-prov) > summary::before { content: none; }
.ui-console:not(#x#x) #sheet :is(.lyr-dev, .lyr-prov) > summary::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--sh-ico-chev) center / 16px 16px no-repeat;
  mask: var(--sh-ico-chev) center / 16px 16px no-repeat;
  transition: transform 120ms ease-out;
}
.ui-console:not(#x#x) #sheet :is(.lyr-dev, .lyr-prov)[open] > summary::after { transform: rotate(90deg); }
.ui-console:not(#x#x) #sheet :is(.lyr-row, .lyr-src) {
  column-gap: 8px;
  min-height: var(--cx-row, 32px);
  padding: 0 4px 0 6px;
}
.ui-console:not(#x#x) #sheet .lyr-sec > .lyr-row + .lyr-row,
.ui-console:not(#x#x) #sheet .lyr-more > .lyr-src + .lyr-src,
.ui-console:not(#x#x) #sheet .lyr-prov > .lyr-src { border-top: 1px solid var(--cx-line, rgba(255, 255, 255, .10)); }
.ui-console:not(#x#x) #sheet .lyr-row::before { display: none; }
@media (hover: hover) {
  .ui-console:not(#x#x) #sheet :is(.lyr-row, .lyr-src):hover { background: var(--cx-raised, #252a31); }
}
.ui-console:not(#x#x) #sheet .lyr-name {
  display: block;
  align-self: stretch;
  min-width: 0;
  margin: 0;
  padding: 0;
  line-height: var(--cx-row, 32px);
  font-size: 13px;
  font-weight: 400;
  font-family: var(--cx-font, "Public Sans", system-ui, sans-serif);
  color: var(--cx-dim, #abb3bf);
}
.ui-console:not(#x#x) #sheet :is(.lyr-row, .lyr-src)[data-on="true"] .lyr-name,
.ui-console:not(#x#x) #sheet .lyr-auto .lyr-name { color: var(--cx-ink, #f6f7f9); }
.ui-console:not(#x#x) #sheet button.lyr-name:hover { color: var(--cx-ink, #f6f7f9); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--cx-line-hi, rgba(255, 255, 255, .22)); }
.ui-console:not(#x#x) #sheet .lyr-name:focus-visible { outline: 2px solid var(--cx-focus, #4c90f0); outline-offset: -2px; }
.ui-console:not(#x#x) #sheet :is(.lyr-res, .lyr-src-m, .lyr-meta) {
  font: 400 12px/1.3 var(--cx-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--cx-mute, #8f99a8);
}
.ui-console:not(#x#x) #sheet :is(.lyr-row[data-on="true"] .lyr-res, .lyr-auto .lyr-res, .lyr-src[data-on="true"] .lyr-src-m) { color: var(--cx-dim, #abb3bf); }
.ui-console:not(#x#x) #sheet :is(.lyr-src-m, .lyr-res) { min-width: 0; max-width: 24ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ui-console:not(#x#x) #sheet .lyr-badge {
  padding: 2px 4px;
  font: 600 11px/1 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cx-warn, #ec9a3c);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--cx-r, 2px);
}
.ui-console:not(#x#x) #sheet .lyr-badge[data-kind="mute"] { color: var(--cx-dim, #abb3bf); border-color: var(--cx-line-hi, rgba(255, 255, 255, .22)); }
.ui-console:not(#x#x) #sheet button.lyr-badge[aria-pressed="true"] { color: var(--cx-select-ink, #fff); background: var(--cx-select, #2d72d2); border-color: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x) #sheet .lyr-auto .lyr-auto-tag {
  padding: 2px 4px;
  font: 600 11px/1 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: .06em;
  color: var(--cx-dim, #abb3bf);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--cx-line-hi, rgba(255, 255, 255, .22));
  border-radius: var(--cx-r, 2px);
}
.ui-console:not(#x#x) #sheet :is(.lyr-solo, .lyr-caret, .lyr-lbl) {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--cx-dim, #abb3bf);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r, 2px);
}
.ui-console:not(#x#x) #sheet .lyr-lbl { font: 600 12px/1 var(--cx-font, "Public Sans", system-ui, sans-serif); }
.ui-console:not(#x#x) #sheet :is(.lyr-solo, .lyr-caret) svg { width: 16px; height: 16px; }
.ui-console:not(#x#x) #sheet :is(.lyr-solo, .lyr-caret, .lyr-lbl):hover:not(:disabled) { color: var(--cx-ink, #f6f7f9); background: var(--cx-hover, #2f343c); }
.ui-console:not(#x#x) #sheet :is(.lyr-solo, .lyr-lbl)[aria-pressed="true"],
.ui-console:not(#x#x) #sheet :is(.lyr-solo, .lyr-lbl)[aria-pressed="true"]:hover:not(:disabled) { color: var(--cx-select-ink, #fff); background: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x) #sheet .lyr-lbl:disabled { color: var(--cx-mute, #8f99a8); opacity: .5; }
.ui-console:not(#x#x) #sheet .lyr-more { padding: 0 4px 8px 0; }
/* A quiet action inside a layer's details (e.g. "WEZ domes" on a site layer); pressed = select. */
.ui-console:not(#x#x) #sheet .lyr-more .lyr-act {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 4px 0 0 -8px; /* label aligned with the meta line above */
  padding: 0 8px;
  font: 500 13px/1 var(--cx-font, "Public Sans", system-ui, sans-serif);
  color: var(--cx-dim, #abb3bf);
  background: transparent;
  border: 0;
  border-radius: var(--cx-r, 2px);
}
.ui-console:not(#x#x) #sheet .lyr-more .lyr-act:hover:not(:disabled) { color: var(--cx-ink, #f6f7f9); background: var(--cx-hover, #2f343c); }
.ui-console:not(#x#x) #sheet .lyr-more .lyr-act[aria-pressed="true"] { color: var(--cx-select-ink, #fff); background: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .lyr-more .lyr-act { height: 44px; margin-left: -12px; padding: 0 12px; }
.ui-console:not(#x#x) #sheet .lyr-srcs-h {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 4px 48px;
  font: 600 12px/1.2 var(--cx-font, "Public Sans", system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cx-dim, #abb3bf);
}
.ui-console:not(#x#x) #sheet .lyr-more.lyr-srcs > .lyr-src { padding-left: 0; }
.ui-console:not(#x#x) #sheet .lyr-prov > .lyr-src { padding-left: 0; }
/* Drawings (index.html fills #feat-list): rows with hairlines; 2525 letter tags; SVG delete. */
.ui-console:not(#x#x) #sheet #feat-list .row { min-height: var(--cx-row, 32px); padding: 0 4px 0 var(--cx-pad-panel, 12px); border-top: 1px solid var(--cx-line, rgba(255, 255, 255, .10)); }
.ui-console:not(#x#x) #sheet #feat-list .name { font: 400 13px/1.35 var(--cx-font, "Public Sans", system-ui, sans-serif); color: var(--cx-ink, #f6f7f9); }
.ui-console:not(#x#x) #sheet #feat-list .meas { font: 400 12px/1.3 var(--cx-mono, "IBM Plex Mono", ui-monospace, monospace); color: var(--cx-dim, #abb3bf); }
.ui-console:not(#x#x) #sheet #feat-list input[type="checkbox"] { accent-color: var(--cx-select, #2d72d2); }
.ui-console:not(#x#x) #sheet #feat-list .del { display: grid; place-items: center; width: 28px; height: 28px; font-size: 0; color: var(--cx-dim, #abb3bf); border-radius: var(--cx-r, 2px); }
.ui-console:not(#x#x) #sheet #feat-list .del::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--sh-ico-x) center / 16px 16px no-repeat;
  mask: var(--sh-ico-x) center / 16px 16px no-repeat;
}
.ui-console:not(#x#x) #sheet #feat-list .del:hover { color: var(--cx-bad, #e76a6e); background: var(--cx-hover, #2f343c); }
/* Touch (gloves): rows 44 (--cx-row), every control 44, 8 px apart. */
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet :is(.lyr-solo, .lyr-caret, .lyr-lbl, #feat-list .del) { width: 44px; height: 44px; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .lyr-sw { min-width: 44px; min-height: 44px; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) #sheet .lyr-srcs-h { padding-left: 56px; min-height: 44px; }

/* ================================================================ phone portrait: bottom bar
 * The bar itself is the rail (see "rail"). The strip is one 52 px control row (search ···
 * DTG · presence · Globe|Map · More) over a 28 px readout row: the status bar's MGRS,
 * scale and tile cells. No floating +/− or tool squares: zoom is pinch; Draw and Symbols
 * are in the bar. */
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] :is(#zoomctl, #btn-draw-fab, .ad-fab-sym) { display: none !important; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"]:has(#sheet.open) #btn-mission-surv { visibility: hidden; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-mark { display: none; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status .status-row {
  height: calc(var(--cx-strip-h) - var(--cx-read-h));
  flex-wrap: nowrap;
  column-gap: 4px;
  overflow: visible;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status .status-row::before { content: none; display: none; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status .coords { display: flex; flex: 0 1 auto; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status :is(.coords, .clock, #goto, #btn-search, #btn-session, #proj-seg, .cx-more, #btn-signin) { height: auto; align-self: center; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status .clock { margin: 0 4px; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status :is(button, .cx-more, .ad-seg .ad-seg-btn) { padding: 0 10px; }
/* The go-to field, once open, spans the control row (not the readout row). */
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] #status #goto:focus-within {
  top: var(--safe-t, 0px);
  bottom: auto;
  height: calc(var(--cx-strip-h) - var(--cx-read-h));
  background: var(--cx-frame);
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-status {
  position: absolute;
  z-index: 24;
  top: calc(var(--safe-t, 0px) + var(--cx-strip-h) - var(--cx-read-h));
  left: 0;
  right: 0;
  bottom: auto;
  height: var(--cx-read-h);
  padding: 0 calc(var(--safe-r, 0px) + 12px) 0 calc(var(--safe-l, 0px) + 12px);
  display: flex;
  align-items: center;
  gap: 16px;
  font: 400 12px/1 var(--cx-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--cx-ink);
  background: transparent;
  border-top: 1px solid var(--cx-line);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-status :is(.ll, .elev, .hdg, .pitch, .eye, .credit) { display: none; }
/* 390 px: MGRS (the reticle, so no "Center" caption), the scale bar, the tile link. */
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-status { gap: 12px; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-status :is(.pos, .scale) .cx-st-l { display: none; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-status .scale { width: auto; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-status .link { margin-left: auto; }

/* ================================================================ chips, toasts
 * Chip: a floating action on the map (the Surveillance mission entry) = a quiet panel
 * button, square 2px corners, sentence case, never a pill. Toast: panel surface, hairline,
 * one soft shadow, under the strip, never a hit target. Tag: the neutral outlined caption
 * (DESIGN.md Tags), never blue, never filled. */
.ui-console:not(#x#x) .ad-chip {
  height: var(--cx-ctl);
  padding: 0 12px;
  color: var(--cx-ink);
  background: var(--cx-panel);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-r);
  box-shadow: var(--cx-shadow);
  font: 500 13px/1 var(--cx-font);
  text-transform: none;
  letter-spacing: 0;
}
.ui-console:not(#x#x) .ad-chip:hover { background: var(--cx-hover); }
.ui-console:not(#x#x) body[data-mode="surveillance"] #btn-mission-surv {
  top: var(--cx-top);
  left: var(--cx-left);
  right: var(--cx-right);
  height: var(--cx-ctl);
  color: var(--cx-ink);
  border-color: var(--cx-line);
  font: 500 13px/1 var(--cx-font);
  text-transform: none;
  letter-spacing: 0;
}
.ui-console:not(#x#x) #msg {
  top: var(--cx-top);
  bottom: auto;
  padding: 6px 12px;
  color: var(--cx-ink);
  background: var(--cx-panel);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-r);
  font: 400 13px/1.35 var(--cx-font);
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
  box-shadow: var(--cx-shadow);
}
.ui-console:not(#x#x) .cx-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 16px;
  padding: 0 4px;
  font: var(--cx-cap);
  letter-spacing: var(--cx-cap-track);
  text-transform: uppercase;
  color: var(--cx-dim);
  background: transparent;
  border: 1px solid var(--cx-line-hi);
  border-radius: var(--cx-r);
}
.ui-console:not(#x#x) .cx-tag[hidden] { display: none; }
.ui-console:not(#x#x) #assist-host {
  top: var(--cx-top-edge);
  bottom: var(--cx-bot-edge);
  right: 0;
  background: var(--cx-panel);
  border: 0;
  border-left: 1px solid var(--cx-line);
  border-radius: 0;
}

/* ================================================================ overflow menu (console.mjs)
 * View · Display · Tools · Help, separated by hairlines. Label left; value right in ink
 * mono; hotkey right in mute kbd (fine pointers only). Checkbox: a 12px outlined box,
 * checked = selection fill with a white tick. Rows 32 (44 on touch). */
.cx-menu {
  position: fixed;
  z-index: 60;
  min-width: 256px;
  max-width: calc(100vw - 16px);
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--cx-ink, #f6f7f9);
  background: var(--cx-panel, #1c2127);
  border: 1px solid var(--cx-line, rgba(255, 255, 255, .1));
  border-radius: var(--cx-r, 2px);
  box-shadow: var(--cx-shadow, 0 6px 20px rgba(0, 0, 0, .45));
  font: 400 13px/1.2 var(--cx-font);
}
.cx-menu[hidden], .cx-menu-g[hidden], .cx-menu-sep[hidden] { display: none; }
.cx-menu-g { display: flex; flex-direction: column; }
.cx-menu-it {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--cx-row, 32px);
  padding: 0 12px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cx-menu-it[hidden] { display: none; }
.cx-menu-it:hover, .cx-menu-it:focus { background: var(--cx-hover, #2f343c); outline: none; }
.cx-menu-it:focus-visible { outline: 2px solid var(--cx-focus, #4c90f0); outline-offset: -2px; }
.cx-menu-l { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.cx-menu-v { flex: none; font: 400 12px/1 var(--cx-mono); font-variant-numeric: tabular-nums slashed-zero; color: var(--cx-ink, #f6f7f9); }
.cx-menu-v:empty { display: none; }
.cx-menu-k {
  flex: none;
  min-width: 16px;
  font: 400 11px/1 var(--cx-mono);
  color: var(--cx-mute, #8f99a8);
  text-align: right;
  background: none;
  border: 0;
}
:root:is([data-input="touch"], [data-input="pen"]) .cx-menu-k { display: none; }
.cx-menu-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  border: 1px solid var(--cx-dim, #abb3bf);
  border-radius: var(--cx-r, 2px);
}
.cx-menu-box svg { width: 12px; height: 12px; stroke-width: 2.5; visibility: hidden; }
.cx-menu-it[aria-checked="true"] .cx-menu-box { color: var(--cx-select-ink, #fff); background: var(--cx-select, #2d72d2); border-color: var(--cx-select, #2d72d2); }
.cx-menu-it[aria-checked="true"] .cx-menu-box svg { visibility: visible; }
.cx-menu-sep { flex: none; height: 1px; margin: 4px 0; background: var(--cx-line, rgba(255, 255, 255, .1)); }
[data-input="touch"] .cx-menu-it, [data-input="pen"] .cx-menu-it { min-height: 44px; }

/* ================================================================ status bar (console.mjs) */
.cx-status { display: none; }
.ui-console:not(#x#x):is([data-form="desktop"], [data-form="tablet"]) .cx-status {
  position: absolute;
  z-index: 23;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--cx-stat-h) + var(--safe-b, 0px));
  padding: 0 calc(var(--safe-r, 0px) + 12px) var(--safe-b, 0px) calc(var(--safe-l, 0px) + 12px);
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--cx-ink);
  background: var(--cx-frame);
  border-top: 1px solid var(--cx-line);
  font: 400 12px/1 var(--cx-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.ui-console:not(#x#x)[data-form="tablet"] .cx-status { --cx-cap: 600 12px/1.2 var(--cx-font); }
/* Fixed cell widths (mono ch), so nothing shifts when Pointer/Center swaps or values change. */
.cx-st { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.cx-st[hidden] { display: none; }
.cx-st-l { font: var(--cx-cap); letter-spacing: var(--cx-cap-track); text-transform: uppercase; color: var(--cx-mute); }
.cx-st-v { display: inline-block; }
.cx-swap { display: inline-grid; }
.cx-swap > * { grid-area: 1 / 1; text-align: left; }
.cx-swap > :not(.on) { visibility: hidden; }
.cx-st.pos .cx-st-v { min-width: 18ch; }
.cx-st.ll .cx-st-v { min-width: 27ch; }
.cx-st.elev .cx-st-v { min-width: 8ch; }
.cx-st.hdg .cx-st-v { min-width: 4ch; }
.cx-st.pitch .cx-st-v { min-width: 3ch; }
.cx-st.eye .cx-st-v { min-width: 9ch; }
.cx-st.link .cx-st-v { min-width: 2ch; }
.cx-st.link[data-state="warn"] .cx-st-v { color: var(--cx-warn); }
.cx-st.link[data-state="bad"] .cx-st-v { color: var(--cx-bad); }
.cx-st-btn { pointer-events: auto; cursor: pointer; padding: 3px 4px; margin: -3px -4px; border-radius: var(--cx-r); }
.cx-st-btn:hover { background: var(--cx-hover); }
/* Credits (licence obligation: ODbL, CC BY): whole parts only, right-aligned before the tile
 * link; parts that do not fit wrap onto a clipped second line and a "+N" counts them. The
 * full text is the cell's title. */
.cx-st.credit {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  font: 400 11px/14px var(--cx-font);
  color: var(--cx-mute);
  pointer-events: auto;
}
.ui-console:not(#x#x)[data-form="tablet"] .cx-st.credit { font-size: 12px; }
.cx-st.credit .cx-st-v { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cx-credit-parts { display: flex; flex-wrap: nowrap; min-width: 0; height: 14px; overflow: hidden; }
.cx-credit-parts.cx-measure { flex-wrap: wrap; flex-grow: 1; }
.cx-credit-part { flex: none; white-space: nowrap; }
.cx-credit-part[hidden] { display: none; }
.cx-credit-part + .cx-credit-part::before { content: "·"; margin: 0 6px; }
.cx-credit-more { flex: none; font: 400 11px/1 var(--cx-mono); color: var(--cx-dim); }
.cx-credit-more:empty { display: none; }
.cx-st.link { margin-left: auto; }
.cx-st.credit:not([hidden]) + .cx-st.link { margin-left: 0; }
.cx-st.scale { width: calc(5ch + 8px + 132px); }
.cx-st.scale .maplibregl-ctrl-scale {
  position: static;
  display: block !important;
  margin: 0;
  height: 12px;
  padding: 0 4px;
  box-sizing: content-box;
  font: 400 11px/12px var(--cx-mono);
  color: var(--cx-ink);
  background: transparent;
  border: 1px solid var(--cx-dim);
  border-top: 0;
}
@media (max-width: 960px) {
  .cx-st.ll { display: none; }
}
/* iPad split view (tablet under 700 wide): position, scale and the tile link fit; the eye
 * altitude does not (the cells overflowed the bar's right edge). */
@media (max-width: 699px) {
  .ui-console:not(#x#x)[data-form="tablet"] .cx-st.eye { display: none; }
}

/* ================================================================ HUD block (selected track) */
.cx-hud {
  position: absolute;
  z-index: 21;
  top: var(--cx-top);
  right: var(--cx-right);
  width: var(--cx-side-w);
  padding: 8px 12px 10px;
  display: grid;
  gap: 8px;
  color: var(--cx-ink);
  background: var(--cx-panel);      /* opaque: labels must not ghost through */
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-r);
  box-shadow: var(--cx-shadow);
  font: 400 12px/1.4 var(--cx-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  pointer-events: none;
  user-select: none;
}
.cx-hud[hidden] { display: none; }
.cx-hud section { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.cx-hud section[hidden] { display: none; }
.cx-hud h3 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font: var(--cx-cap);
  letter-spacing: var(--cx-cap-track);
  text-transform: uppercase;
  color: var(--cx-mute);
}
.cx-hud h3 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px/1.2 var(--font); letter-spacing: 0; text-transform: none; color: var(--cx-ink); }
.cx-hud h3 i { flex: none; font: 600 11px/1 var(--cx-mono); font-style: normal; letter-spacing: .04em; padding: 2px 4px; border: 1px solid currentColor; border-radius: var(--cx-r); }
.cx-hud h3 i[data-a="hostile"] { color: var(--ho, #ff3031); }
.cx-hud h3 i[data-a="friend"] { color: var(--fr, #80e0ff); }
.cx-hud h3 i[data-a="neutral"] { color: var(--ne, #aaffaa); }
.cx-hud h3 i[data-a="unknown"] { color: var(--uk, #ffff80); }
.cx-hud dt { align-self: center; font: var(--cx-cap); letter-spacing: var(--cx-cap-track); text-transform: uppercase; color: var(--cx-mute); }
.cx-hud dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-hud dd.wide { grid-column: 1 / -1; }
.ui-console:not(#x#x)[data-form="phone"][data-orient="portrait"] .cx-hud { left: var(--cx-pad); right: var(--cx-pad); width: auto; }

/* Track card container (ew.mjs builds it; its inside is ew.css). Selection docks on the right:
 * under the HUD (console.mjs publishes --cx-hud-h), the HUD's width, opaque panel, never past
 * the status bar. Phone portrait: full width between the HUD and the bottom bar; phone
 * landscape: the right column. Steps left of the Symbols palette (rule below). */
.ui-console:not(#x#x) :is(.ewc, .ew-card) {
  top: calc(var(--cx-top) + var(--cx-hud-h, 0px));
  left: auto;
  right: var(--cx-right);
  color: var(--cx-ink, #f6f7f9);
  background: var(--cx-panel, #1c2127);
  border: 1px solid var(--cx-line, rgba(255, 255, 255, .10));
  border-radius: var(--cx-r, 2px);
  box-shadow: var(--cx-shadow, 0 6px 20px rgba(0, 0, 0, .45));
  opacity: 1;
}
.ui-console:not(#x#x) .ewc:is([data-form="desktop"], [data-form="tablet"]) {
  width: var(--cx-side-w, 340px);
  max-width: calc(100vw - var(--cx-left) - var(--cx-right));
  bottom: auto;
  max-height: calc(100% - var(--cx-top) - var(--cx-hud-h, 0px) - var(--cx-bot));
  border-width: 1px;
}
.ui-console:not(#x#x) .ewc[data-form="phone"] {
  top: calc(var(--cx-top) + var(--cx-hud-h, 0px));
  left: var(--cx-pad);
  right: var(--cx-pad);
  bottom: var(--cx-bot);
  width: auto;
  max-height: none;
  padding-bottom: 0;
  border-width: 1px;
}
.ui-console:not(#x#x)[data-orient="landscape"] .ewc[data-form="phone"] { left: auto; width: min(var(--cx-side-w, 340px), 50vw); }

/* ================================================================ symbol palette (symbols.mjs)
 * symbols.css styles the palette from the --cx tokens (panel, header, wells, quiet segments,
 * grid without tile cards); here only its place in the frame and the 2525 underline guard. */
.ui-console:not(#x#x) .sym-pal { letter-spacing: normal; }
/* The affiliation underline keeps its 2525 colour when selected (redundant with the letter). */
.ui-console:not(#x#x) .sym-aff [data-aff="f"][aria-checked="true"]::after { background: var(--fr, #80e0ff); opacity: 1; }
.ui-console:not(#x#x) .sym-aff [data-aff="h"][aria-checked="true"]::after { background: var(--ho, #ff3031); opacity: 1; }
.ui-console:not(#x#x) .sym-aff [data-aff="n"][aria-checked="true"]::after { background: var(--ne, #aaffaa); opacity: 1; }
.ui-console:not(#x#x) .sym-aff [data-aff="u"][aria-checked="true"]::after { background: var(--uk, #ffff80); opacity: 1; }
/* Docked on the right (desktop, tablet landscape); the HUD and cards step left. */
.ui-console:not(#x#x):is([data-form="desktop"], [data-form="tablet"][data-orient="landscape"]) .sym-host {
  top: var(--cx-top);
  bottom: var(--cx-bot);
  left: auto;
  right: var(--cx-right);
  width: var(--cx-side-w);
  height: auto;
  max-width: calc(100vw - 2 * var(--cx-pad));
}
.ui-console:not(#x#x):is([data-form="desktop"], [data-form="tablet"][data-orient="landscape"]):has(.sym-host:not([hidden])) :is(.cx-hud, .ewc, #inspect) {
  right: calc(var(--cx-right) + var(--cx-side-w) + var(--cx-gap));
}
.ui-console:not(#x#x)[data-orient="portrait"]:is([data-form="phone"], [data-form="tablet"]) .sym-host {
  left: var(--cx-left);
  right: var(--cx-right);
  bottom: var(--cx-bot-edge);
}
.ui-console:not(#x#x)[data-orient="portrait"][data-form="phone"] .sym-host { left: 0; right: 0; }

/* ================================================================ EW map labels (ew.mjs)
 * Cartographic text, not chips: white name with a dark halo, data line in mono. The symbol
 * carries the 2525 affiliation colour; ew.mjs declutters by priority. */
.ui-console:not(#x#x) .ew-label {
  padding: 1px 4px;
  color: var(--cx-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 600 12px/1.25 var(--font);
  letter-spacing: 0;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 3px rgba(0, 0, 0, .8);
}
.ui-console:not(#x#x) .ew-label-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--cx-ink); }
.ui-console:not(#x#x) .ew-label-meta { font: 400 11px/1.25 var(--cx-mono); font-variant-numeric: tabular-nums slashed-zero; color: var(--cx-ink); }
/* Simulated items are marked by the SYN- prefix and the white ring; the SIM tag is in the
 * card, not on the map (DESIGN.md Map overlays). */
.ui-console:not(#x#x) .ew-label .ew-sim-tag { display: none; }
.ui-console:not(#x#x):is([data-input="touch"], [data-input="pen"]) .ew-label { padding: 5px 6px; }
.ui-console:not(#x#x) body.nvg .ew-label { color: var(--text); text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ui-console:not(#x#x) body.nvg :is(.ew-label-name, .ew-label-meta) { color: var(--text); }
