/* ============================================================
   BLUEQUILL UI — KNOTWORKS SUITE DESIGN SYSTEM
   Surface class: COMMAND (desk / records) with a PRINT deliverable attached.
   Product accent: patrol blue #8ab4ff — the POLICE colour on the suite deck.

   Semantic colours (ok / warn / danger, source green/amber, --st-*, the marker
   shapes) are IDENTICAL in every Knotworks product and every theme. That is the
   whole point of a suite. ONLY --accent and the chrome greys change per product.
   Re-mapping a semantic here would break the cross-agency legend.

   Command-scale ergonomics: 4–12px radii, 32–40px targets. Sentinel's 16/22px
   radii and 56/96px buttons are PANIC-surface numbers and would make a records
   desk read like a toy. Do not import them.
   ============================================================ */

:root {
  /* ---- ground & surfaces (dark -> light stack) ---- */
  --bg:        #0b1020;   /* page ground                                   */
  --nav:       #111931;   /* topbar / tab strip / drawer sheet             */
  --panel:     #131a2e;   /* cards, rails, popups, table hover             */
  --panel-2:   #0f1730;   /* overlay panels floating over the stage        */
  --panel-3:   #1b2544;   /* active nav pill, row hover, inset button      */
  --panel-glass: rgba(15,23,48,.95);

  /* ---- lines ---- */
  --line:      #34406b;   /* primary border — cards, inputs, buttons       */
  --line-2:    #263153;   /* quiet divider — under nav, section rules      */
  --line-3:    #1b2544;   /* table row rule (quietest)                     */

  /* ---- type ---- */
  --text:      #e9edf6;   /* 9.0:1 on bg — body & values                   */
  --muted:     #93a0bc;   /* 7.2:1 on bg — labels, secondary copy          */
  --dim:       #5c6a8c;   /* 3.5:1 on bg — META ONLY. Never load-bearing.  */

  /* ---- product accent (THE ONLY LINE THAT CHANGES PER PRODUCT) ---- */
  --accent:      #8ab4ff;               /* BlueQuill patrol blue — 9.0:1 on bg */
  --accent-ink:  #0a1424;               /* ink ON an accent fill — 8.8:1       */
  --accent-wash: rgba(138,180,255,.10);
  --accent-edge: rgba(138,180,255,.45);

  /* ---- semantics: FIXED SUITE-WIDE, never re-skinned ---- */
  --ok:       #3ddc97;   /* good / available / verified / delivered  */
  --warn:     #ffb23e;   /* aging / caution / live device / QI flag  */
  --danger:   #ff5d5d;   /* feed lost / critical / unverified        */
  --on-alert: #1c060a;   /* ink ON a --danger fill — 6.5:1.
                            NOT #fff: white on #ff5d5d is 3.0:1 and fails AA.
                            (ops/public/style.css L13 still has that bug.)      */
  --on-ok:    #062a1c;
  --on-warn:  #241a05;

  /* ---- responder bus: source colour (suite-wide legend) ---- */
  --syn:  #3ddc97;   /* synthetic / simulated */
  --live: #ffb23e;   /* live device reporting */

  /* ---- unit status (suite-wide; NEVER re-mapped per product) ---- */
  --st-available:    #3ddc97;
  --st-responding:   #ffb23e;
  --st-onscene:      #ff5d5d;
  --st-transporting: #5ca8ff;  /* THE OTHER BLUE. Status only — 1.19:1 against
                                  --accent, so it never appears as chrome, never
                                  in a swatch row with --accent, and is ALWAYS
                                  accompanied by the word "transporting". */
  --st-other:        #93a0bc;

  /* ---- chips over imagery ---- */
  --chipbg:   rgba(11,16,32,.92);
  --chiptext: #e9edf6;

  /* ---- radius (COMMAND scale) ---- */
  --r-xs:   4px;
  --r-sm:   6px;
  --r:      8px;
  --r-md:   9px;
  --r-lg:  12px;
  --r-xl:  14px;
  --r-pill: 999px;

  /* ---- spacing (2px grid; these six carry ~90% of the suite) ---- */
  --s-1:  4px;  --s-2:  6px;  --s-3:  8px;
  --s-4: 10px;  --s-5: 12px;  --s-6: 14px;
  --s-7: 18px;  --s-8: 22px;  --s-9: 26px;

  /* ---- PRINT / letterhead only. NEVER on a live command surface: brass sits
     perceptually next to --warn/--live amber, which means "aging feed" and
     "live device" across the whole suite. ---- */
  --paper-navy:   #16324f;
  --paper-brass:  #c9a227;
  --paper-accent: #1d4ed8;   /* patrol blue's paper twin */

  /* ---- safe areas: the installed iPhone/iPad app (Michael's rule, 2026-10-07) ----
     index.html asks for viewport-fit=cover, so the page is drawn under the island,
     notch, status bar, home indicator and landscape sides, and env() reports their
     sizes. Nothing but a background may sit there. 0px in a desktop browser, so every
     calc(<old> + var(--safe-*)) is the old value there. Defined ONCE, here; everything
     else reads var(--safe-*). app/test/safe-areas.test.mjs holds the rule; the inset
     layout itself is at the end of workspace.css. ---- */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
}

/* ============================================================
   COMMAND-SURFACE LAW: NO ANIMATION, ANYWHERE, including vendor CSS.
   A command screen must read correctly after ten minutes of neglect.
   If something you add appears not to animate, THIS is why — do not remove it.
   The only sanctioned motion is button:active translateY(1px), below.
   ============================================================ */
*, *::before, *::after { animation: none !important; transition: none !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
/* No webfont anywhere in the suite. System stack only — these surfaces load on
   station Wi-Fi and in dead zones. */

a { color: var(--accent); }
::selection { background: var(--accent-edge); color: var(--text); }

/* ============================================================
   1. TOPBAR / NAV
   ============================================================ */
#topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 900; letter-spacing: .06em; font-size: 15px; white-space: nowrap; }
.brand .sub {
  color: var(--muted); font-weight: 600; font-size: 12px;
  margin-left: 8px; letter-spacing: .02em;
}

/* The prototype chip. On EVERY surface, every route, never dismissible. */
.proto {
  border: 1.5px solid var(--danger); color: var(--danger);
  font-weight: 800; font-size: 11px; padding: 2px 8px;
  border-radius: var(--r-xs); letter-spacing: .04em; white-space: nowrap;
}

.mainnav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mainnav a {
  color: var(--accent); background: transparent; font: inherit;
  font-weight: 700; font-size: 12.5px; text-decoration: none;
  border: 1px solid var(--line); padding: 5px 10px;
  border-radius: var(--r-xs); letter-spacing: .05em; text-transform: uppercase;
  min-height: 32px; display: inline-flex; align-items: center;
}
.mainnav a:hover { border-color: var(--accent); background: var(--panel-3); }
/* Active state = outline + colour, never a solid fill. Solid accent is reserved
   for the ONE primary action on a screen. */
.mainnav a.on { color: var(--text); border-color: var(--accent); background: var(--panel-3); }

.spacer { margin-left: auto; }

.whoami {
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.whoami b { color: var(--text); font-weight: 700; }
.whoami .role {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-edge);
  border-radius: var(--r-pill); padding: 1px 8px;
}

/* The lowercase, wide-tracked, dim disclosure string. Part of the identity. */
.subbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 4px 14px; background: var(--nav);
  border-bottom: 1px solid var(--line-2);
}
.tag {
  color: var(--dim); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
}

/* ============================================================
   2. THE AS-OF STAMP — three states, and it never lies.
   Ticks on its OWN 1s timer, independent of any fetch, so a dead fetch loop
   still ages the display. Initial class is `lost`, not blank and not green.
   Green is only ever earned by a fetch that actually returned.
   ============================================================ */
.asof {
  font-weight: 800; font-size: 12.5px; color: var(--ok);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: var(--r-xs);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.asof.aging { color: var(--warn); border-color: var(--warn); }
.asof.lost  { color: var(--on-alert); background: var(--danger); border-color: var(--danger); }

/* ============================================================
   3. BANNERS
   .bigbanner  — LOUD. A feed/fetch died. Full width, pushes the page down so it
                 cannot be scrolled past. Never a toast, never auto-dismissing.
   .notebanner — CALM. A persistent, non-alarming statement of a known limit
                 (e.g. the AI engine is not logged in). Amber edge, panel ground,
                 normal ink. It is information, not an emergency.
   ============================================================ */
.bigbanner {
  background: var(--danger); color: var(--on-alert); font-weight: 900;
  text-align: center; padding: 10px 14px; font-size: 15px; letter-spacing: .03em;
}
.bigbanner .why { display: block; font-weight: 700; font-size: 12.5px; letter-spacing: 0; margin-top: 3px; }

.notebanner {
  background: var(--panel); color: var(--text);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  padding: 10px 14px; font-size: 13px; line-height: 1.5;
}
.notebanner.checking { border-left-color: var(--muted); color: var(--muted); }
.notebanner .bt {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--warn); margin-bottom: 4px;
}
.notebanner.checking .bt { color: var(--muted); }
.notebanner .detail {
  display: block; margin: 6px 0; color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 10px;
}
.notebanner .unlock { display: block; margin-top: 6px; }
.notebanner code {
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #9fd0ff; background: #0a0f16; border-radius: var(--r-xs); padding: 1px 5px;
}

/* ============================================================
   4. PAGE / STAGE
   ============================================================ */
#stage { flex: 1; min-height: 0; overflow-y: auto; }
.page { padding: 22px 26px 40px; max-width: 1180px; }
.page.prose { max-width: 820px; }
h1.page-h1 { font-size: 21px; font-weight: 700; letter-spacing: .02em; margin: 0 0 4px; }
.page-lede { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }

/* The uppercase micro-label. Section head, table header, tile caption, field
   label. It is one of the two typographic tells of a Knotworks screen. */
.section-h {
  font-size: 11.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin: 22px 0 8px;
  display: flex; align-items: baseline; gap: 10px;
}
.section-h .count { color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.section-h.loud-red   { color: var(--danger); }
.section-h.loud-amber { color: var(--warn); }
.section-note { color: var(--muted); font-size: 12.5px; margin: -2px 0 10px; }

.loading { color: var(--muted); font-size: 13px; padding: 26px 0; }
/* No spinner. No skeleton shimmer. A loading state is the word "loading…". */

/* ============================================================
   5. CARDS & PANELS — border + radius + flat fill. NEVER a shadow.
   Severity is carried by the BORDER.
   ============================================================ */
.card {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); padding: 12px; margin-bottom: 10px;
  display: block; width: 100%; text-align: left; color: inherit;
  font: inherit; text-decoration: none;
}
a.card, button.card { cursor: pointer; }
a.card:hover, button.card:hover { border-color: var(--accent); background: var(--panel-3); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card .row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .name { font-weight: 700; }
.card .n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.card .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.card .meta b { color: var(--text); font-weight: 700; }

.card.crit  { border: 2px solid var(--danger); background: var(--bg); }
.card.warn  { border-color: var(--warn); background: #241a05; }
.card.wedge { border-left: 3px solid var(--accent); }

.panel {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px;
}
.panel h2 {
  font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.panel .x {
  margin-left: auto; background: none; border: none; color: var(--muted);
  font-size: 17px; cursor: pointer; min-width: 40px; min-height: 36px;
}

/* The HERO panel: the one action this screen exists to start. */
.hero {
  border: 1px solid var(--accent-edge); border-left: 3px solid var(--accent);
  border-radius: var(--r-lg); background: var(--accent-wash);
  padding: 20px 22px; margin-bottom: 16px;
}
.hero h2 {
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px;
}
.hero p { color: var(--muted); font-size: 13px; margin: 10px 0 0; max-width: 62ch; line-height: 1.5; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.rowline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- stat tiles: every headline number is a button that opens its rows ---- */
.stats { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; background: var(--panel); text-align: left; cursor: pointer;
  font: inherit; color: inherit;
}
.stat:hover { border-color: var(--accent); background: var(--panel-3); }
.stat b { display: block; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat b i { font-size: 12px; font-style: normal; color: var(--muted); }
.stat span { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.stat em { display: block; font-style: normal; font-size: 10.5px; color: var(--dim); margin-top: 3px; }

/* ============================================================
   6. BUTTONS & INPUTS
   ============================================================ */
button { font: inherit; cursor: pointer; }

.btn {
  min-height: 40px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-weight: 700; font-size: 13px; letter-spacing: .03em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }   /* the ONLY movement allowed */
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn:disabled:hover { background: var(--panel); }

/* toggled ON — outline + colour, never a fill */
.btn.on { border-color: var(--accent); color: var(--accent); }

/* primary — filled accent, dark ink. AT MOST ONE per screen. */
.btn.primary {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); min-height: 48px; font-weight: 800;
}
.btn.primary:hover { background: var(--accent); }

/* hero — the single unmistakable action a landing screen leads with.
   56px, still on the COMMAND radius scale. */
.btn.hero-btn {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  min-height: 56px; padding: 0 28px; font-size: 15px; font-weight: 800;
  letter-spacing: .04em; border-radius: var(--r-md);
}
.btn.hero-btn:hover { background: var(--accent); }

.btn.armed  { background: var(--danger); border-color: var(--danger); color: var(--on-alert); }
.btn.danger { color: var(--danger); border-color: #7a2530; background: transparent; }
.btn.ghost  { background: transparent; }
.btn.sm     { min-height: 32px; padding: 0 10px; font-size: 12px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 0 12px; min-height: 40px;
}
textarea { padding: 10px 12px; min-height: 96px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;   /* outlines, never shadows */
}

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.field .hint { color: var(--muted); font-size: 11.5px; }
.searchrow { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.searchrow input { flex: 1; min-width: 220px; }

/* ============================================================
   7. CHIPS & PILLS — three families, do not blur them.
   ============================================================ */
/* (a) state chip — tinted block, square-ish, tiny caps */
.chip {
  display: inline-block; border-radius: var(--r-sm); padding: 2px 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  margin-right: 6px; text-transform: uppercase;
}
.chip.ok    { background: #0e3b35; color: var(--ok); }
.chip.stale { background: #4a3500; color: var(--warn); }
.chip.bad   { background: #4a1219; color: var(--danger); }
.chip.info  { background: #123c77; color: #7db4ff; }
.chip.hard  { background: var(--danger); color: var(--on-alert); }   /* filled = worst state */
.chip.quiet { background: var(--panel-3); color: var(--muted); }

/* (b) status pill — border-only, fully round, a row's state */
.st {
  display: inline-block; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  border: 1px solid; text-transform: uppercase;
}
.st-active   { color: #5ca8ff; border-color: rgba(92,168,255,.5); }
.st-complete { color: var(--ok); border-color: rgba(61,220,151,.45); }
.st-neutral  { color: var(--muted); border-color: var(--line); }
.st-hot      { color: var(--warn); border-color: rgba(255,178,62,.5); }
.st-bad      { color: var(--danger); border-color: rgba(255,93,93,.5); }

/* (c) filter chip — and it DECLARES ITS OWN SUPPRESSION.
   A hidden layer is never allowed to look like an empty world. */
.fchip {
  background: transparent; border: 2px solid var(--accent); color: var(--text);
  font: inherit; font-weight: 800; font-size: 12px; letter-spacing: .05em;
  padding: 6px 12px; border-radius: var(--r-sm); cursor: pointer; min-height: 34px;
}
.fchip.off { border-style: dashed; border-color: var(--line); color: var(--muted); }
.fchip.off::after { content: " — hidden"; font-weight: 600; font-size: 10px; letter-spacing: 0; }

/* (d) duty/person chip */
.dutychip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--ok); color: var(--ok); background: rgba(61,220,151,.08);
  border-radius: var(--r-pill); padding: 4px 11px; font-size: 12px; font-weight: 700;
}
.dutychip.bad  { border-color: var(--danger); color: var(--danger); background: rgba(255,93,93,.08); }
.dutychip.warn { border-color: var(--warn); color: var(--warn); background: rgba(255,178,62,.08); }
.dutychip i  { font-style: normal; font-size: 10px; opacity: .8; letter-spacing: .05em; }
.dutychip em { font-style: normal; font-size: 10.5px; color: var(--muted); }

/* ============================================================
   8. TABLES — the page body NEVER scrolls sideways.
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 10px;
  white-space: nowrap;
}
td { padding: 12px 10px; border-bottom: 1px solid var(--line-3); vertical-align: top; }
tbody tr.crow { cursor: pointer; }
tbody tr.crow:hover td { background: var(--panel); }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.n { text-align: center; font-variant-numeric: tabular-nums; }
/* Tabular numerals on EVERY number that changes. Jitter in a count on a command
   wall is a defect. */
.num { font-variant-numeric: tabular-nums; }

/* ============================================================
   9. STATUS DOTS & THE SUITE MARKER ALPHABET
   Two orthogonal encodings that never overlap:
     SHAPE  = service (circle EMS / square FIRE / diamond POLICE / triangle ALERT)
     COLOUR = source  (green synthetic / amber live device / red alert)
   A new entity type gets a NEW SHAPE, never a new hue.
   ============================================================ */
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
/* A dot ALWAYS sits beside the status word — never alone. */
.dotrow { display: inline-flex; align-items: center; gap: 6px; }

.svcmk {
  width: 13px; height: 13px; flex: none; display: inline-block;
  border: 2.5px solid var(--syn); background: var(--chipbg);
}
.svcmk.e { border-radius: 50%; }
.svcmk.f { border-radius: 2px; }
.svcmk.p { border-radius: 2px; transform: rotate(45deg); }
.svcmk.a {
  width: 0; height: 0; border: none; background: none;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 14px solid var(--danger);
}
.svcmk.live { border-color: var(--live); }

.unitlbl {
  background: var(--chipbg); border: 1.5px solid var(--syn); color: var(--syn);
  border-radius: var(--r-sm); padding: 1px 6px; font-size: 10.5px;
  font-weight: 800; letter-spacing: .05em; white-space: nowrap;
}
.unitlbl.live  { border-color: var(--live); color: var(--live); }
.unitlbl.alert { border-color: var(--danger); color: var(--danger); }

/* ============================================================
   10. THE HONEST-STATE IDIOMS
   ============================================================ */
/* Absence-law empty state: dashed border, wording that refuses to reassure.
   "No X received" is a statement about what reached this server — never a
   finding about the world. Deliberately NOT green: a reassurance colour would
   assert exactly what the words carefully do not. */
.gempty {
  border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px;
  color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.5;
}
.gempty b { color: var(--text); font-weight: 700; }
.gfiltered { color: var(--muted); font-size: 12px; font-style: italic; padding: 2px 0; }
.empty { text-align: center; color: var(--dim); padding: 40px 20px; }

/* A record that cannot be rendered in the primary view is LISTED with a
   plain-language reason. Filtering something out is an event that gets announced. */
.nopos { width: 100%; font-size: 11px; font-weight: 700; color: var(--warn); margin-top: 4px; }

/* Loud in-page failure: the fetch died. Say so; never render stale data as current. */
.failcard {
  border: 2px solid var(--danger); border-radius: var(--r-md); background: var(--bg);
  padding: 14px 16px; margin-bottom: 12px;
}
.failcard .ft {
  color: var(--danger); font-weight: 900; font-size: 11.5px;
  letter-spacing: .08em; text-transform: uppercase;
}
.failcard .fm { margin-top: 6px; font-size: 13px; line-height: 1.5; }
.failcard .fw { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.failcard .actions { margin-top: 12px; }

/* imported != verified. Auto-extracted renders as a visual QUESTION, not a fact:
   dashed, muted-blue, and it never sorts into the confirmed list. */
.unverified {
  border-style: dashed !important; border-color: #6f86c2 !important;
  background: rgba(61,126,255,.06);
}
.unverified::after {
  content: " auto-extracted — not officer-confirmed";
  font-size: 10.5px; font-weight: 700; color: #9db4e8; letter-spacing: .04em;
}
/* A gap that is neither safe nor alarming. Deliberately NOT red: absence is not
   evidence of harm any more than it is evidence of safety. */
.unreported {
  background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255,255,255,.035) 6px 12px);
  border: 1px dashed var(--dim); border-radius: var(--r-sm);
  color: var(--muted); padding: 6px 10px; font-size: 12.5px;
}

/* Status is MEASURED, never assumed. Never render a dead thing as if it were up. */
.card.down   { opacity: .62; border-style: dashed; }
.card.absent { opacity: .55; border-style: dashed; }
.card.down .card-s   { color: var(--danger); }
.card.absent .card-s { color: var(--muted); }
.card.live .card-s   { color: var(--ok); }

/* The wall note: say what is NOT on this wire. */
.wallnote {
  margin-top: 26px; border-top: 1px solid var(--line); padding-top: 10px;
  color: var(--muted); font-size: 11px; line-height: 1.6; max-width: 82ch;
}

/* Meta line. --dim is legal HERE and nowhere that changes a decision. */
.meta-dim { color: var(--dim); font-size: 11px; letter-spacing: .02em; }

/* ============================================================
   11. RECEIPTS DRAWER — every headline number opens the rows behind it.
   Escape closes it, tap-out closes it, and the tile's number and the drawer's
   rows come from ONE function so they can never disagree.
   ============================================================ */
/* The dimming backdrop runs to every screen edge; its padding keeps the sheet it
   holds inside the safe area (0 in a desktop browser). */
.drawer {
  position: fixed; inset: 0; z-index: 60; background: rgba(5,8,18,.72);
  display: flex; align-items: flex-end; justify-content: center;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.dsheet {
  background: var(--nav); border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: 940px;
  max-height: calc(86vh - var(--safe-top) - var(--safe-bottom)); display: flex; flex-direction: column; padding: 16px 18px 20px;
  overflow-y: auto;
}
.dhead { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.dhead b { font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.dmethod { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 10px 0 12px; }
.drow {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: baseline;
  padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--text); font-size: 13px;
}
.drow:hover { background: var(--panel-3); }
.dsub { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 12px 0 4px; }
.dexcl .v { color: var(--dim); font-weight: 600; font-size: 12px; }

/* ============================================================
   12. LOGIN
   ============================================================ */
.login-wrap { display: flex; justify-content: center; padding: 48px 22px 60px; }
.login-card {
  width: 100%; max-width: 560px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); padding: 24px 26px 26px;
}
.login-card h1 { font-size: 21px; font-weight: 700; letter-spacing: .02em; margin: 0 0 4px; }
.login-card .lede { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; line-height: 1.5; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.demo-btn {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2);
  color: var(--text); font: inherit; text-align: left; padding: 10px 12px; cursor: pointer;
  min-height: 62px;
}
.demo-btn:hover { border-color: var(--accent); background: var(--panel-3); }
.demo-btn b { display: block; font-weight: 700; font-size: 13.5px; }
.demo-btn span {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-top: 3px;
}
.demo-btn em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.login-sep {
  display: flex; align-items: center; gap: 10px; margin: 20px 0 14px;
  color: var(--muted); font-size: 10.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.login-err {
  border: 2px solid var(--danger); border-radius: var(--r); background: var(--bg);
  color: var(--text); padding: 10px 12px; margin-bottom: 14px; font-size: 13px; line-height: 1.5;
}
.login-err b { color: var(--danger); }
.login-note {
  margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 10px;
  color: var(--muted); font-size: 11.5px; line-height: 1.6;
}

/* ============================================================
   13. PRINT / PAPER — written light-first from scratch. The screen is night,
   the paper is white, and they are two different designs.
   Every screen accent has a hand-picked paper twin or it is invisible on white.
   BlueQuill's paper identity is Chris's navy + brass — the ONE place brass is
   legal, because amber semantics do not exist on paper.
   ============================================================ */
@media print { :root { color-scheme: light; } }

body.paper {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #16202e; background: #fff; max-width: 820px; margin: 0 auto;
  padding: calc(26px + var(--safe-top)) calc(26px + var(--safe-right)) calc(26px + var(--safe-bottom)) calc(26px + var(--safe-left));
  display: block;
}
.paper .sub { color: #55637c; font-size: 13px; }
.paper h1 { font-size: 22px; color: var(--paper-navy); }
.paper h2 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #55637c;
  margin: 20px 0 8px; border-bottom: 1px solid #d9dee8; padding-bottom: 4px;
}
.paper .seal { border-top: 2px solid var(--paper-brass); }
.paper .tile { flex: 1; border: 1.2px solid #b9c3d6; border-radius: 9px; padding: 12px; text-align: center; }
.paper .tile b { display: block; font-size: 22px; color: var(--paper-accent); }
.paper td { padding: 6px 8px; border-bottom: 1px solid #eef0f4; }
.paper .foot { margin-top: 22px; border-top: 1px solid #d9dee8; padding-top: 8px; font-size: 10px; color: #8792a8; }
/* The prototype label PRINTS. It is not chrome; it is a disclosure. */
.paper .proto {
  display: inline-block; font-size: 9px; letter-spacing: .12em;
  border: 1px solid #c33; color: #c33; padding: 2px 8px; border-radius: 3px; font-weight: 700;
}
/* Blank fields print as a RULE, not as an em-dash and never as a guess. */
.paper .blankrule { display: inline-block; min-width: 220px; border-bottom: 1px solid #16202e; }

.noprint {
  margin: 0 0 8px; padding: 7px 10px; background: #111931; color: #fff;
  font-size: 11px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center;
  /* The strip carries a sentence AND a button group. Without wrap the group is
     squeezed until its buttons collide with the sentence on a narrow window. */
  flex-wrap: wrap; gap: 10px;
}
.noprint > span:first-child { flex: 1 1 320px; min-width: 240px; }
.noprint .npbtns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 0 0 auto; }
.noprint button {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px;
  padding: 7px 16px; font-weight: 800; font-size: 12px; cursor: pointer;
}
/* A ghost button on this strip would otherwise inherit --accent-ink (near-black)
   from the rule above and vanish into the navy. Secondary actions here are
   outlined in white, which also keeps ONE filled accent per screen. */
.noprint .btn.ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45);
}
.noprint .btn.ghost:hover { background: rgba(255,255,255,.10); }

@media print {
  .noprint, #topbar, .subbar, .mainnav, #banners, .tabs { display: none !important; }
  body { padding: 0; }
  .panel, .card, section { break-inside: avoid; }
  /* NO box-shadow on any print surface — it renders as a grey block bleed in PDF. */
  * { box-shadow: none !important; }
}
/* NEVER write a global `@media print { body * { visibility:hidden } }`. Sentinel
   shipped that for badge printing and it blanked every OTHER print surface.
   Any scoped hide must be gated behind a body class the printing component sets:
   @media print { body.badge-printing * { visibility:hidden } … } */

/* ============================================================
   14. THE REPORT FLOW + COMMAND OVERVIEW
   Added for public/wizard.js and public/command.js. Same laws as everything
   above: severity by BORDER, no shadows, no animation, absence stated in words
   and never in a colour alone, at most ONE filled accent per screen.
   ============================================================ */

/* ---- step indicator. The state of each step is a WORD, not just a colour. ---- */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.step {
  flex: 1; min-width: 148px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); padding: 8px 10px;
}
.step .sn {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); font-variant-numeric: tabular-nums;
}
.step .sl { display: block; font-weight: 700; font-size: 13.5px; margin-top: 1px; }
.step .ss {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-top: 5px;
}
.step.done { border-color: rgba(61,220,151,.45); }
.step.done .ss { color: var(--ok); }
.step.now  { border-color: var(--accent); background: var(--accent-wash); }
.step.now .sl, .step.now .ss { color: var(--accent); }
.step.todo { border-style: dashed; }
.step.todo .sl { color: var(--muted); }

/* ---- a generated document. Markdown is shown as PLAIN TEXT, escaped, never
   rendered as HTML: it is evidence, not page content. ---- */
.doc {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg);
  padding: 14px 16px; margin: 0; white-space: pre-wrap; word-break: break-word;
  overflow-x: auto; overflow-y: auto; max-height: 620px;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}
/* the literal [GAP - ask officer] marker the drafter leaves inline */
.doc .gap {
  background: #4a3500; color: var(--warn); font-weight: 800;
  padding: 0 4px; border-radius: var(--r-xs);
}

/* ---- clarify: one question, one box ---- */
.q { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel);
     padding: 12px; margin-bottom: 10px; }
.q.willgap  { border-left: 3px solid var(--warn); }
.q.exempted { border-color: var(--warn); }
.q.answered { border-left: 3px solid var(--ok); }
.q .qn { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted);
         font-size: 11px; letter-spacing: .06em; }
.q .qt { font-weight: 700; font-size: 13.5px; margin-top: 2px; }
.q .qp { color: var(--muted); font-size: 12px; margin: 5px 0 8px; }
.q .qwarn { color: var(--warn); font-size: 11.5px; font-weight: 700; line-height: 1.5; margin-top: 8px; }
.q textarea { width: 100%; min-height: 74px; }
.q .exline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.q .exline label { font-size: 12px; font-weight: 700; color: var(--muted); display: flex;
                   gap: 6px; align-items: center; cursor: pointer; }
.q .exline input[type="text"] { flex: 1; min-width: 200px; }
input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent); }

/* ---- key/value ledger (completeness audit, form fill, receipts) ---- */
.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 14px;
      font-size: 12.5px; align-items: baseline; }
.kv .k { color: var(--muted); font-weight: 800; font-size: 10.5px;
         letter-spacing: .07em; text-transform: uppercase; }
.kv .v { color: var(--text); }

/* ---- an anchor that has to look like a button (download links) ---- */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---- honest long-stage progress: a number that ticks, never a spinner ---- */
.runline {
  color: var(--warn); font-weight: 700; font-size: 12.5px; line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

/* ---- distribution rows. The bar is a second encoding of the number that is
   already printed beside it — never the only one. ---- */
.frow { display: grid; grid-template-columns: minmax(140px, 210px) 52px 1fr; gap: 10px;
        align-items: center; padding: 4px 0; font-size: 12.5px; }
.frow .fl { color: var(--muted); font-weight: 700; }
.frow .fn { font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.frow .fb { height: 8px; border-radius: var(--r-xs); background: var(--panel-3); }
.frow .fb i { display: block; height: 100%; border-radius: var(--r-xs); background: var(--accent); }
.frow.zero .fn { color: var(--dim); }

/* ---- receipts drawer close row ---- */
.dclose { margin-left: auto; }

/* ============================================================
   15. THE OFFICER HOME + THE THREE SITUATIONAL SURFACES
   Added for public/officer.js. Same laws as everything above: severity by
   BORDER, no shadow anywhere, no animation anywhere, absence stated in words
   and never in a colour alone, at most ONE filled accent per screen (it is
   already spent on "Start a report", so nothing below is ever filled accent).
   ============================================================ */

/* A map wants the window. A records page does not. */
.page.wide { max-width: 1560px; }

/* ---- per-feed as-of stamp -------------------------------------------------
   The topbar .asof describes the SCREEN. This describes ONE FEED, so a live
   radio read can never make a dead unit feed look current. Same three states,
   same colours, same rule: green is only ever earned by a fetch that returned. */
.feedstamp {
  font-weight: 800; font-size: 11px; color: var(--ok);
  border: 1px solid var(--line); padding: 2px 8px; border-radius: var(--r-xs);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  display: inline-block; white-space: nowrap;
}
.feedstamp.aging { color: var(--warn); border-color: var(--warn); white-space: normal; }
.feedstamp.lost  { color: var(--on-alert); background: var(--danger); border-color: var(--danger);
                   white-space: normal; }

/* ---- a loud in-page strip. Louder than .gempty, quieter than .bigbanner.
   Used where a section itself is the alarm (returned work, a live school
   alert, a last-known list under a dead feed). ---- */
.loudstrip {
  border: 1px solid var(--warn); border-left: 3px solid var(--warn);
  border-radius: var(--r); background: #241a05; color: var(--text);
  padding: 9px 12px; margin-bottom: 10px; font-size: 12.5px; font-weight: 700; line-height: 1.5;
}
.loudstrip.red { border-color: var(--danger); border-left-color: var(--danger); background: #2a0d10; }

/* ---- a compact failure, sized for a tile. Same voice as .failcard. ---- */
.tfail {
  border: 2px solid var(--danger); border-radius: var(--r); background: var(--bg);
  padding: 10px 12px; margin-bottom: 10px;
}
.tfail b {
  display: block; color: var(--danger); font-weight: 900; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
}
.tfail span { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.5; }
.tfail i { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; font-style: normal; }

/* ---- RESUME: the second half of the dominant action. Lives INSIDE .hero, so
   it must not compete with the one filled accent button above it. ---- */
.resumewrap { margin-top: 16px; border-top: 1px solid var(--accent-edge); padding-top: 12px; }
.resume-h {
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px;
}
.resume-h .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.resume {
  display: grid; grid-template-columns: auto 1fr auto; gap: 3px 10px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); background: var(--panel);
  padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: inherit;
}
.resume:hover { border-color: var(--accent); background: var(--panel-3); }
.resume:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.resume.hot { border-left-color: var(--warn); }
.resume .rstep {
  grid-column: 1; font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--accent); font-variant-numeric: tabular-nums;
  white-space: nowrap; align-self: center;
}
.resume .rname { grid-column: 2; font-weight: 700; font-size: 14px; }
.resume .rid {
  grid-column: 3; color: var(--muted); font-weight: 700; font-size: 12px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.resume .rwhat { grid-column: 2 / -1; font-size: 12.5px; color: var(--text); }
.resume .rmeta { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); }

/* ---- SITUATIONAL TILES (map / persons / radio / water map) ---- */
.tile {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel-2); padding: 14px 16px 16px; margin-bottom: 12px;
}
.tile-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tile-h h2 {
  font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text); margin: 0;
}
.tile-n {
  font-size: 10.5px; font-weight: 800; color: var(--accent-ink); background: var(--accent);
  border-radius: var(--r-xs); padding: 1px 6px; font-variant-numeric: tabular-nums;
}
.tile-h .feedstamp { margin-left: auto; }
.tile-note { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }
.tile-b { margin-bottom: 12px; }
.tile-f { display: flex; gap: 10px; flex-wrap: wrap; }
.tile-sub { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.tile-sub code {
  font: 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #9fd0ff; background: #0a0f16; border-radius: var(--r-xs); padding: 1px 5px;
}

/* a row of counted things. The shape beside each number is the suite marker
   alphabet, so the count and the map agree without a second legend. */
.countrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.cnt {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.cnt b { font-size: 19px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums;
         letter-spacing: 0; }

/* measured up/down, never assumed */
.upline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.upline b { color: var(--ok); }
.upline.down b { color: var(--danger); }

/* ---- a released police channel, rendered identically everywhere ---- */
.grantline {
  border: 1px solid var(--warn); border-left: 3px solid var(--warn);
  border-radius: var(--r); background: #241a05;
  padding: 9px 12px; margin-top: 10px;
}
.grantline b { margin-right: 8px; }
.grantline .gmeta { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ============================================================
   15a. THE COUNTY MAP
   ============================================================ */
.maplayout { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.mapcol { flex: 1 1 560px; min-width: 320px; display: flex; flex-direction: column; }
.maptop {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 0 8px;
}
.mapbox {
  height: 62vh; min-height: 380px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg); overflow: hidden;
}
.mapbox.nomap { display: flex; align-items: center; justify-content: center; padding: 20px; }
.mapbox.nomap .failcard { margin: 0; max-width: 560px; }

.maprail {
  flex: 0 1 360px; min-width: 300px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel-2);
  padding: 12px 14px 16px; max-height: 78vh; overflow-y: auto;
}
.maprail .section-h { margin-top: 14px; }
.maprail .section-h:first-of-type { margin-top: 4px; }
.maprail .section-h .feedstamp { margin-left: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }

.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.legend .lg {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}

.svcgroup { margin-bottom: 12px; }
.svcgroup h3 {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 5px; font-variant-numeric: tabular-nums;
}
.u {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 5px 0; border-bottom: 1px solid var(--line-3); font-size: 12.5px;
}
.u b { font-weight: 700; }
.u .ust { color: var(--muted); }
.u .usince { margin-left: auto; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* the marker itself (a Leaflet divIcon) */
.mkrow { display: flex; align-items: center; gap: 5px; white-space: nowrap; }

/* Leaflet's popup is white by default. Themed here so a popup does not flash a
   sheet of white over a night surface. */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  box-shadow: none;
}
.leaflet-popup-content { margin: 10px 12px; font: 12.5px/1.5 inherit; }
.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: var(--chipbg) !important; color: var(--dim); }
.leaflet-control-attribution a { color: var(--muted); }
.pop b { letter-spacing: .03em; }
.pop .popsrc, .pop .popwall { color: var(--muted); font-size: 11px; font-weight: 700; }

/* school alert card — the loudest thing on the rail, by border and by words */
.alertcard {
  border: 2px solid var(--danger); border-radius: var(--r-md); background: var(--bg);
  padding: 10px 12px; margin-bottom: 10px;
}
.alertcard.compact { padding: 8px 10px; }
.ac-head {
  color: var(--danger); font-weight: 900; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
}
.ac-site { font-weight: 700; font-size: 13.5px; margin-top: 3px; }
.ac-sev { color: var(--warn); font-size: 12px; font-weight: 700; margin-top: 2px; }
.ac-narr { font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.ac-meta { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.ac-act { margin-top: 8px; }

/* ============================================================
   15b. RADIO
   A lane's state is a WORD plus a chip, never a colour alone.
   ============================================================ */
.pcopy { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 0 0 8px; max-width: 78ch; }
.pcopy:last-child { margin-bottom: 0; }
.pcopy b { color: var(--text); }

.lane {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel);
  padding: 11px 13px; margin-bottom: 9px;
}
.lane.granted  { border-color: var(--warn); border-left: 3px solid var(--warn); }
.lane.pending  { border-style: dashed; }
.lane.unknown  { border-color: var(--danger); }
.lane-h { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.lane-h b { font-size: 13.5px; }
.lane-svc {
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.lane-say { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.lane .kv { margin-top: 9px; }
.lane .snap { display: block; color: var(--dim); font-size: 11px; font-style: normal; margin-top: 2px; }

.incrow { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.inclbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}

.tx {
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel);
  padding: 9px 11px; margin-bottom: 7px;
}
.tx-h { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; font-size: 12px; }
.tx-band {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 6px;
}
.tx-at, .tx-dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.tx-inc { margin-left: auto; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tx-inc.none { color: var(--dim); }
.tx-t {
  margin-top: 6px; font-size: 13px; line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tx-c { margin-top: 5px; color: var(--dim); font-size: 11px; }

/* ============================================================
   15c. THE EMBEDDED WATER MAP
   ============================================================ */
.framebar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--panel);
  padding: 8px 12px; color: var(--muted); font-size: 12px;
}
.framebar span { flex: 1; min-width: 200px; }
.fireframe {
  display: block; width: 100%; height: 72vh; min-height: 420px;
  border: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--bg);
}

/* The PRINT surface (§13) has its own `.tile`, and specificity already hands
   `.paper .tile` its border, radius, padding and centring. But it never declares
   a background or a bottom margin, so it would quietly inherit the command
   tile's dark fill above and print as a grey block. Say white explicitly. */
.paper .tile { background: #fff; margin-bottom: 0; }

/* ============================================================
   16. THE DEEP COMMAND SURFACES  (public/supervisor.js)
   Officer roster + one officer's picture, the pending-case queue, the township
   print pack, and the channel-release control. Same laws as everything above:
   severity by BORDER, no shadow, no animation, absence stated in words.
   ============================================================ */

/* ---- 16a. every number names its source, right under it ---- */
.srcline {
  margin: 6px 0 4px; color: var(--dim); font-size: 10.5px;
  letter-spacing: .05em; text-transform: uppercase;
}

/* ---- 16b. the command-surface cards on the command home ---- */
.surfcard { display: block; }
.surfbig {
  font-size: 26px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.surfcap {
  font-size: 10.5px; color: var(--muted); letter-spacing: .06em;
  text-transform: uppercase; margin: 2px 0 8px;
}

/* ---- 16c. the roster row + the monogram ----
   There is NO photograph of any officer in this system. The monogram is
   initials drawn from a name, and the screen says so in words beside it. It is
   deliberately typographic — a circle with a face-like fill would read as an
   avatar someone forgot to load, which is the wrong claim. */
.mono {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--panel-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; letter-spacing: .04em; color: var(--accent);
}
.mono.big { width: 76px; height: 76px; font-size: 26px; border-radius: var(--r-lg); }

.offrow { display: flex; align-items: center; gap: 14px; }
.offmain { flex: 1 1 auto; min-width: 0; }
.offmain b { display: block; font-size: 14px; }
.offmain .sub { display: block; margin-top: 3px; }
.offnum { flex: 0 0 auto; text-align: right; }
.offnum b {
  display: block; font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums;
}
.offnum i {
  display: block; font-style: normal; font-size: 10px; color: var(--dim);
  letter-spacing: .05em; text-transform: uppercase; max-width: 170px;
}

.offhead { display: flex; gap: 16px; align-items: flex-start; margin: 14px 0 4px; }
.offid { flex: 1 1 auto; min-width: 0; }
.offid .page-lede { margin-bottom: 8px; }

/* ---- 16d. THE UNMEASURED TILE ----
   Same footprint as a real stat tile, so the space a chief expects a number in
   is OCCUPIED by the reason there is not one. It must never be mistaken for a
   tile that failed to load, so it carries no accent and no red: it is not a
   fault, it is a limit. */
.unmeas {
  border: 1px dashed var(--line); border-radius: var(--r-md);
  background: transparent; padding: 12px 14px;
}
.um-h {
  font-size: 11.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.um-v {
  font-size: 18px; font-weight: 800; letter-spacing: .04em;
  color: var(--dim); margin: 4px 0 6px;
}
.um-w { font-size: 12.5px; color: var(--text); line-height: 1.55; }
.um-f { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

/* ---- 16e. the one-unit mini map on an officer's page ---- */
.mapbox.short { height: 320px; min-height: 260px; }
.revreason {
  flex: 1 1 260px; min-width: 200px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text); padding: 7px 10px; font: inherit; font-size: 13px;
}

/* ---- 16f. THE PAPER DOCUMENT, INSIDE THE DARK APP ----
   §13 styles `body.paper` for a page that IS a document. The township pack is a
   document rendered inside the router's dark stage, so the same design is
   applied to a BLOCK instead: `.paper.paperdoc` picks up every `.paper x`
   descendant rule already written up there (h1, h2, sub, tile, td, foot, proto,
   blankrule, seal) and adds the container itself.
   NEVER convert this to `body.paper` — body is also the topbar's parent, and a
   820px max-width on it squeezes the whole application chrome. */
.paperdoc {
  background: #fff; color: #16202e; max-width: 820px;
  border: 1px solid #b9c3d6; border-radius: var(--r-lg);
  padding: 26px 28px 30px; margin: 4px 0 20px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.paperdoc h1 { margin: 0 0 2px; }
.paperdoc code {
  font: 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #eef1f6; border-radius: 3px; padding: 1px 4px; color: #16202e;
}
.paperdoc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.paperdoc th {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #55637c;
  border-bottom: 1px solid #d9dee8; padding: 6px 8px;
}
.paperdoc td { color: #16202e; vertical-align: top; }
.paperdoc td .sub, .paperdoc .sub { color: #55637c; }
.paperdoc .n { text-align: right; font-variant-numeric: tabular-nums; }
.paperdoc .tiles { display: flex; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; }
.paperdoc .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.paperdoc b { color: #16202e; }

@media print {
  /* The document is the page. The app's chrome is already hidden by §13's rule;
     this drops the stage's own padding and the document's own frame so the pack
     starts at the paper margin instead of 26px inside a rounded box. */
  .page { padding: 0 !important; max-width: none !important; }
  .paperdoc {
    max-width: none; border: none; border-radius: 0; padding: 0; margin: 0;
  }
  .paperdoc h2, .paperdoc table, .paperdoc .tiles { break-inside: avoid; }
  .paperdoc tr { break-inside: avoid; }
  /* The stage scrolls on screen; a scroll container prints ONE screenful and
     silently drops the rest of the pack. The app shell is a full-height flex
     column, which pins that container to the viewport — undo both, or the
     township report prints page 1 and silently loses every page after it. */
  #stage { overflow: visible !important; flex: none !important; min-height: 0 !important; }
  html, body {
    height: auto !important; overflow: visible !important;
    background: #fff; display: block !important;
  }
}

@media (max-width: 900px) {
  .paperdoc .cols { grid-template-columns: 1fr; }
  .offhead { flex-direction: column; }
}

/* ============================================================
   17. THE OFFICER EDIT LAYER  (public/edits.js)
   The editing surface, the AI-vs-officer redline and the export block.

   Same laws as everything above: severity and state by BORDER and by WORDS,
   never by colour alone; no box-shadow anywhere (it prints as a grey block);
   no animation on a command surface. The redline lives on the LIGHT paper
   surface because it is a document that gets printed and handed over, so its
   colours are hand-picked for white — the dark app's palette is unreadable
   there and is never reused.
   ============================================================ */

/* ---- 17a. WHICH VERSION AM I LOOKING AT — stated in words, every time ---- */
.verbar {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-md);
  background: var(--panel);
}
.verbar .vchip {
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-xs); border: 1px solid var(--line); white-space: nowrap;
}
/* AI = dashed, because nothing human has confirmed it. Officer = solid accent edge. */
.verbar .vchip.ai      { border-style: dashed; color: var(--muted); }
.verbar .vchip.officer { border-color: var(--accent-edge); color: var(--accent); }
.verbar .vwhy { color: var(--muted); font-size: 12.5px; }

/* ---- 17b. THE EDITING SURFACE ---- */
.edbox {
  width: 100%; resize: vertical; min-height: 320px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.edbox:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* The save state. It says the WORD, and the border carries the same meaning —
   a colour-blind officer must never have to guess whether their work is saved. */
.edstate {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  padding: 7px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  background: var(--bg); color: var(--muted);
}
.edstate.dirty { border-left-color: var(--warn);  color: var(--warn); }
.edstate.ok    { border-left-color: var(--ok);    color: var(--ok); }
.edstate.busy  { border-left-color: var(--muted); color: var(--muted); }

/* ---- 17c. THE EXPORT BLOCK — every version that exists, each named ---- */
.dlset { display: flex; flex-direction: column; gap: 8px; }
.dlrow {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); padding: 10px 12px;
}
.dlrow.primary-row { border-left: 3px solid var(--accent); }
.dlrow .dlwhat { flex: 1 1 320px; min-width: 240px; }
.dlrow .dlwhat b { display: block; font-weight: 700; font-size: 13.5px; }
.dlrow .dlwhat span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.5; }
.dlrow .dlgo { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 17d. THE REDLINE, ON PAPER ----
   Inside .paperdoc, so it inherits the light document design. Every mark is
   redundant: added text is a tint AND an underline, removed text is a tint AND
   a strike-through. Neither is ever carried by colour alone. */
.paperdoc .dsum { font-size: 13px; line-height: 1.55; color: #16202e; margin: 6px 0 0; }
.paperdoc .dleg { font-size: 11.5px; line-height: 1.5; color: #55637c; margin: 4px 0 10px; }
.paperdoc .dwarn {
  font-size: 12.5px; line-height: 1.5; color: #16202e; margin: 8px 0 0;
  border-left: 3px solid #c0392b; background: #fdecec; padding: 8px 10px; border-radius: 4px;
}

/* Every redline class is scoped under `table.dl`, and the text cell is `.dltx`
   rather than the obvious `.tx` — §16 already owns `.tx` for a radio
   transmission card (dark panel background), and an unscoped collision painted
   the unchanged half of this white document navy. */
table.dl { table-layout: fixed; width: 100%; border-collapse: collapse; margin-top: 4px; }
table.dl th {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #55637c;
  border-bottom: 1px solid #d9dee8; padding: 5px 6px; text-align: left;
}
table.dl td {
  vertical-align: top; padding: 3px 6px; border-bottom: 1px solid #eef0f4;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-word; color: #16202e;
}
table.dl td.ln { color: #8792a8; text-align: right; font-size: 10px; }
table.dl tr.r-eq td.dltx { color: #55637c; }        /* unchanged reads quieter than changed */
table.dl tr.r-ch td.side-a { background: #fdf2f2; }
table.dl tr.r-ch td.side-b { background: #eef8f1; }
table.dl del.wr {
  background: #fbd9d9; color: #7a1d1d; text-decoration: line-through; text-decoration-thickness: 1px;
}
table.dl ins.wa {
  background: #cdecd8; color: #14532d; text-decoration: underline; text-decoration-thickness: 1px;
}
table.dl .dnone { color: #8792a8; font-style: italic; }
/* the drafter's literal [GAP …] token, on paper */
.paperdoc .gap { background: #fff3d0; color: #7a5200; font-weight: 700; padding: 0 3px; border-radius: 2px; }

/* Long unchanged runs are FOLDED ON SCREEN ONLY. The print rule below unfolds
   them: a discovery artifact that quietly omits the unchanged body of a report
   is not a discovery artifact. The text is never removed from the DOM. */
table.dl .folded    { display: none; }
table.dl .foldnote  { color: #8792a8; font-style: italic; }
table.dl.showall .folded   { display: inline; }
table.dl.showall .foldnote { display: none; }

@media print {
  /* Letter, with a margin a court clerk can hole-punch. */
  @page { size: letter; margin: 0.6in; }
  /* Unfold everything. Both rules are !important because they must beat the
     on-screen fold no matter what the reader last clicked. */
  table.dl .folded   { display: inline !important; }
  table.dl .foldnote { display: none !important; }
  /* Tints must survive the browser's "background graphics off" default as best
     they can; the strike-through and the underline carry the meaning if they do
     not, which is exactly why both marks are doubled. */
  table.dl { font-size: 9.5px; }
  table.dl tr { break-inside: avoid; }
  .paperdoc .dwarn { break-inside: avoid; }
}

/* ---------------------------------------------------------------------------
   THE FRONT DOOR (hub.js, view `home`). Cards are generated from the view
   registry, so this styles a variable number of them and must not assume a
   count. Everything here is outline-and-ground — the ONE filled accent on the
   screen is the hero's Start a report button, per the .btn.primary rule.
   ------------------------------------------------------------------------- */
.hubhero .btn { margin-top: 14px; }
.hubhero .btn + .btn { margin-left: 8px; }

.hubtiles { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 22px; }
.hubloading { color: var(--muted); font-size: 12.5px; }
.hubtile {
  flex: 1 1 180px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); padding: 14px 16px;
}
.hubtile:hover { border-color: var(--accent); }
.hubtile b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.hubtile b.unknown { color: var(--muted); }
.hubtile span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.hubh2 {
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.hubgrid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.hubcard {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); padding: 14px 16px;
}
.hubcard:hover { border-color: var(--accent); }
.hubcard b { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.hubcard span {
  display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px;
  line-height: 1.45;
}
.hubfoot { color: var(--muted); font-size: 12px; margin-top: 22px; }
