/* UNSAFE portal — the portal look (KEV-31; draft-portal-look §2, approved 4 Nov 2026).
   A police system's interface is dark, plain and procedural, and its documents are
   paper: the shell is the dark ground, every document is one white sheet (`.sheet`,
   the same paper for both packs, style guide §2.1 as decided 3 Nov), and the banner is
   what tells the two packs apart. Nothing on the shell or a sheet tells the player
   anything by colour or shape alone: no status colours, no red, no green. The one
   named exception is the Messages unread dot (D3), built in part 2.
   Documents are real text, never images. Keep this file self-contained. */

/* ---- fonts: IBM Plex, served from the portal's own static assets (src/client/fonts) */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/IBMPlexSans-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* ---- tokens (draft §2.1, §2.2, §2.3). Contrast ratios are asserted by test/portal-look.test.ts. */
:root {
  /* shell */
  --shell: #11161C;
  --recessed: #0E1319;
  --raised: #19212A;
  --rule: #2B3744;
  --field-edge: #627280;
  --ink: #E8ECEF;
  --ink-2: #8A97A4;
  --ink-3: #808E99;
  --accent: #5E96B8;
  --accent-bright: #8FBDD8;
  --on-accent: #0C1116;
  /* the sheet: one paper for both packs */
  --paper: #FDFDFC;
  --paper-ink: #15181B;
  --paper-rule: #D5D8DA;
  --paper-quiet: #5C6468;
  --paper-field: #FFFFFF;
  --paper-field-edge: #8A9196;
  /* banners (style guide §2) */
  --band-dark: #1F2A33;
  --band-dark-ink: #FDFDFC;
  --band-light: #E6EAEE;
  --band-light-top: #15181B;
  --band-light-bottom: #9AA0A6;
  /* development builds only */
  --tbd-bg: #ffe66d;
  --tbd-line: #c99700;
  --dev: #b000b0;
  /* type */
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* spacing scale and furniture */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --radius: 2px;
  --measure: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--shell); }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--shell); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s2); }
a { color: var(--accent-bright); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.sheet :focus-visible { outline-color: var(--paper-ink); }

#app { min-height: 100vh; display: flex; flex-direction: column; }
.page { width: 100%; max-width: calc(var(--measure) + 2 * var(--s4)); margin: 0 auto; padding: var(--s4); flex: 1; }

/* ---- type roles (draft §2.2) */
.micro { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.meta { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-2); }
.note, .muted { color: var(--ink-3); font-size: 13px; line-height: 19px; }

/* ---- controls: 44×44 targets, 48px fields, 16px inputs (iOS zoom), radius 2px */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 18px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; line-height: 1.3; border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--field-edge); font-weight: 500; }
.btn.small { padding: 0 var(--s3); font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
/* KEV-56: a tap on a button is a tap, never the start of a double-tap zoom. No visual change. */
button, .btn { touch-action: manipulation; }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
label { display: block; font-size: 13px; line-height: 18px; color: var(--ink-2); margin: var(--s4) 0 6px; }
input[type=text], input[type=search], textarea { display: block; width: 100%; min-height: 48px; padding: var(--s3); border: 1px solid var(--field-edge); border-radius: var(--radius); background: var(--raised); color: var(--ink); font-size: 16px; line-height: 22px; }
textarea { min-height: 6rem; resize: vertical; }
/* An error is primary ink: the sentence already says what went wrong. */
.error { color: var(--ink); margin: var(--s2) 0 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.btn.block { display: flex; width: 100%; }
.hair { display: block; height: 1px; background: var(--rule); border: 0; margin: 0; }
/* Visually hidden, still read: the join code letter by letter. */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* No cards on the shell (draft §4 item 4): a group of controls is spacing, not a panel. */
.group { margin-bottom: var(--s5); }
.page > h1 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0 0 var(--s4); }

/* ---- bars (draft §2.3). Bars run full width; their content stops at the measure. */
.topbar { height: 48px; flex: none; display: flex; align-items: center; padding: 0 var(--s4); background: var(--shell); border-bottom: 1px solid var(--rule); }
.topbar .inner { width: 100%; max-width: var(--measure); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-width: 0; }
.topbar .inner > .micro { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .jc { display: flex; align-items: baseline; gap: var(--s2); flex: none; }
.topbar .code { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ink); }
/* The tab bar sits at the foot and stays there while the screen scrolls. The active tab
   is told by a 2px rule along its top and 600 weight, not by colour alone. */
.tabs { position: sticky; bottom: 0; z-index: 5; flex: none; background: var(--recessed); border-top: 1px solid var(--rule); padding: 0 var(--s1) env(safe-area-inset-bottom); }
.tabs .inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 64px; max-width: var(--measure); margin: 0 auto; }
.tab { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: var(--s2) var(--s1); border-top: 2px solid transparent; color: var(--ink-2); text-decoration: none; font-size: 12px; line-height: 15px; font-weight: 400; overflow-wrap: anywhere; }
.tab[aria-current="page"] { border-top-color: var(--accent); color: var(--accent-bright); font-weight: 600; }
/* D3: the Messages dot, while anything in the feed is unopened. The one place colour
   and shape carry meaning; its words are the visually hidden "New message" beside it. */
.tab .dot { flex: none; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--accent); }
.conn { font-size: 13px; line-height: 18px; color: var(--ink); background: var(--raised); border-bottom: 1px solid var(--rule); text-align: center; padding: var(--s2) var(--s4); }

/* ---- front door and join-code screen: no cards, the forms sit on the ground */
.page.front { max-width: calc(420px + 2 * var(--s6)); padding: 40px var(--s6) var(--s6); display: flex; flex-direction: column; gap: var(--s5); }
.wordmark-block { display: flex; flex-direction: column; gap: var(--s1); margin: 0; padding-bottom: var(--s4); border-bottom: 1px solid var(--rule); }
.wordmark { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.lead { margin: 0; color: var(--ink-2); }
.door label:first-child { margin-top: 0; }
.door .actions { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s4); }
input.code { font-family: var(--mono); letter-spacing: .2em; }
.or { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s3); align-items: center; margin: 0; }
.resume { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.rows a { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); min-height: 48px; padding: var(--s3) 0; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 21px; }
.rows .ref { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.privacy { margin: 0; }
.leave { margin: 0; text-align: center; font-size: 14px; }
.leave a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- join code and the device list */
.lobby-code, .lobby-devices { display: flex; flex-direction: column; gap: var(--s2); }
.lobby-code h2, .lobby-devices h2 { margin: 0; }
.joincode { font-family: var(--mono); font-size: 40px; line-height: 48px; font-weight: 500; letter-spacing: .28em; text-indent: .28em; text-align: center; padding: 18px 0 16px; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); overflow-wrap: anywhere; }
.devices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.devices li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 21px; }

/* ---- feed (build spec §2.2.1, §2.4, §10; draft §3)
   Two shapes and no colour. An opened entry, whoever is speaking, is the time in the
   micro label on the shell and then one `.sheet` under the Kingsley letterhead: a
   message, an opened nudge, a warrant result, all the same sheet with nothing to style
   differently. An unopened entry is `.line`: one line on the shell between two
   hairlines, with no sheet, no panel and no stripe, so it is not shaped like a document
   and cannot be mistaken for a reward. No gold offer, no red refusal, no green
   approval: a distinction a table can see is per-field feedback by the back door. Do
   not add a modifier class to either. */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.stamp { margin: 0 0 6px; padding: 0 var(--s1); }
.line { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px var(--s1); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.line .stamp { margin: 0; padding: 0; }
.line .new { font-size: 15px; line-height: 21px; color: var(--ink); }
.line .btn { min-width: 72px; }
.sheet .actions { margin-top: var(--s4); }
.sheet .muted { color: var(--paper-quiet); }

/* ---- the warrant sheet (build spec §2.5.1; draft §2.1, §3). The form is a sheet under
   the Kingsley letterhead; its fields are fields on a form, not app controls: the white
   field ground on the sheet's off-white, a 1px grey edge, the sheet's body size, and
   16px in the inputs. The submit control is a square ink rectangle, right-aligned at the
   foot. Nothing on this sheet is coloured: no accent, nothing red, amber or green. */
.sheet .intro { font-size: 14px; line-height: 21px; color: var(--paper-quiet); margin: 0 0 var(--s5); }
.sheet .field + .field { margin-top: 20px; }
.sheet label { display: block; margin: 0 0 6px; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-ink); }
.sheet textarea { display: block; width: 100%; min-height: 0; font-size: 16px; line-height: 24px; color: var(--paper-ink); background: var(--paper-field); border: 1px solid var(--paper-field-edge); border-radius: var(--radius); padding: 10px 12px; resize: vertical; }
.sheet textarea:disabled { background: var(--paper); color: var(--paper-ink); opacity: 1; -webkit-text-fill-color: var(--paper-ink); }
.sheet .note { font-size: 13px; line-height: 19px; color: var(--paper-quiet); margin: 6px 0 0; }
.sheet .foot { display: flex; justify-content: flex-end; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--paper-rule); }
.sheet .submit { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; background: var(--paper-ink); color: var(--paper); border: 1px solid var(--paper-ink); border-radius: 0; font-size: 15px; font-weight: 600; cursor: pointer; }
.sheet .submit:disabled { opacity: .5; cursor: default; }
/* The determination: the sheet's ink between two 2px rules in that same ink, its one
   sentence beneath, then, only if something was recognised, the caption and one tick
   row per phrase. The tick is ink. The same block sits on a feed sheet. */
.det { border-top: 2px solid var(--paper-ink); border-bottom: 2px solid var(--paper-ink); padding: var(--s3) 0; margin: 0 0 18px; color: var(--paper-ink); }
.det h2 { margin: 0 0 var(--s1); font-size: 15px; line-height: 22px; font-weight: 700; letter-spacing: .06em; }
.det p { margin: 0; font-size: 15px; line-height: 22px; }
.rec { margin-top: var(--s3); }
.det .recognised-caption { margin: 0; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-quiet); }
.recognised { list-style: none; margin: 6px 0 0; padding: 0; }
.recognised li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s2); align-items: center; padding: 7px 0; border-top: 1px solid var(--paper-rule); font-size: 14px; line-height: 20px; }
.tick { display: inline-flex; width: 16px; height: 16px; color: var(--paper-ink); }
/* The cooldown line, where the submit control was: a thin rule above, a clock glyph, the
   sentence and the mm:ss countdown, all in the sheet's quiet ink. */
.cooldown { display: flex; gap: 10px; align-items: flex-start; margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--paper-rule); font-size: 14px; line-height: 20px; color: var(--paper-quiet); }
.cooldown .clock { display: inline-flex; flex: none; margin-top: 1px; }
.cooldown .t { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- case file index (build spec §2.8.1; draft §3). One screen title, set from the
   tab's own string; each section's header on the shell in the micro label; under it
   one sheet run per section with a 6px band in that pack's banner treatment, rows,
   and exhibit references in mono down a ragged right edge. Nothing else. */
.screen-title { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0 0 var(--s2); padding: var(--s1) var(--s1) 0; color: var(--ink); }
.section { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s4) 0 0; }
.section > h2 { margin: 0; padding: 0 var(--s1); }
.run { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); overflow: hidden; }
.run .band { height: 6px; }
.run-dark .band { background: var(--band-dark); }
.run-light .band { background: var(--band-light); border-top: 3px solid var(--band-light-top); }
.run ul { list-style: none; margin: 0; padding: 0; }
.run li + li { border-top: 1px solid var(--paper-rule); }
.run a { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); min-height: 48px; padding: 13px 14px; color: var(--paper-ink); text-decoration: none; font-size: 15px; line-height: 21px; }
.run .ref { font-family: var(--mono); font-size: 12px; color: var(--paper-quiet); white-space: nowrap; }
.print-pack { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s5) 0 0; padding: 0 var(--s1); }
.print-pack h2 { margin: 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--rule); }
/* The epilogue's item list keeps the one paper so it reads on the dark shell. */
.items { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.items li + li { border-top: 1px solid var(--paper-rule); }
.items a { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; min-height: 48px; padding: 13px 14px; text-decoration: none; color: var(--paper-ink); font-size: 15px; line-height: 21px; }
.items .ref { font-family: var(--mono); font-size: 12px; color: var(--paper-quiet); white-space: nowrap; }

/* ---- the item viewer (build spec §2.8.2). The header replaces the top bar and stays
   while the sheet scrolls under it; there is no tab bar inside an item. */
.item-head { position: sticky; top: 0; z-index: 5; height: 52px; flex: none; background: var(--shell); border-bottom: 1px solid var(--rule); padding: 0 var(--s1); }
.item-head .toolbar { height: 100%; max-width: var(--measure); margin: 0 auto; display: flex; align-items: center; gap: var(--s1); }
.ibtn { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; height: 44px; padding: 0 var(--s2); background: transparent; border: 0; border-radius: var(--radius); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.item-head .crumb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibtn.textsize { font-weight: 600; letter-spacing: .02em; }
.ibtn.textsize .a1 { font-size: 13px; }
.ibtn.textsize .a2 { font-size: 18px; }
.page.sheeted { padding: var(--s3) var(--s3) var(--s6); }
.reader { display: flex; flex-direction: column; min-height: 100vh; }

/* ---- the sheet: one paper for both packs. No shadow, no gradient, no ageing.
   The text-size control steps the whole sheet together (style guide §7.2): every size
   inside is in em, so body, form block and meta keep their proportions. Step 0, the
   smallest, is body 15px. */
.sheet { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: 22px; font-size: 15px; line-height: 1.6; }
.sheet[data-size="1"] { font-size: 17px; }
.sheet[data-size="2"] { font-size: 19px; }
.sheet p { margin: 0 0 .9em; overflow-wrap: anywhere; }
.sheet hr { border: 0; border-top: 1px solid var(--paper-rule); margin: 1.2em 0; }
/* form blocks: 12px mono at 1.65 (at step 0), between a rule above and below, with no
   tinted ground. On screen they never wrap: a long line scrolls sideways inside the
   block, so a form's columns stay aligned at 390px and the page itself never scrolls
   sideways (ruled 4 Nov, reversing part 1's wrap). In print they still wrap (print.css). */
.sheet .form { font-family: var(--mono); font-size: .8em; line-height: 1.65; white-space: pre; overflow-x: auto; overflow-wrap: normal; -webkit-overflow-scrolling: touch; max-width: 100%; margin: 0 0 1.1em; padding: var(--s2) 0; border-top: 1px solid var(--paper-rule); border-bottom: 1px solid var(--paper-rule); background: none; tab-size: 4; }
/* numbered paragraphs hang: the number in its own column, the paragraph beside it */
.sheet .np { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); gap: 0 6px; }
.sheet .np .n { font-variant-numeric: tabular-nums; }

/* ---- banners (style guide §2; draft §2.1). The light banner heads every feed sheet and
   the warrant sheet as the Kingsley letterhead. On an item sheet, a paragraph reading
   exactly a Whitmoor banner line renders with these same rules (KEV-54, style guide
   §7.2): dark for Ashgrove, light for Kingsley, inside the sheet's padding. */
.banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px var(--s4); padding: var(--s3) 14px; }
.banner .op { font-size: 20px; line-height: 24px; font-weight: 700; letter-spacing: .16em; }
.banner .force { font-size: 11.5px; line-height: 16px; letter-spacing: .1em; }
.banner-dark { background: var(--band-dark); color: var(--band-dark-ink); }
.banner-light { background: var(--band-light); color: var(--paper-ink); border-top: 3px solid var(--band-light-top); border-bottom: 1px solid var(--band-light-bottom); }
/* Inside a sheet the banner steps with the text-size control (KEV-63, style guide §7.2):
   each size is in em of the sheet's font size, written as calc(px / 15) so that at step 0
   (15px) it is exactly the px value above. The feed's and the warrant's sheets stay at
   step 0, so they render as before. Screen only: in print the sheet is 12pt and the
   banner keeps the px values above (print.css, style guide §7.1).
   KEV-63 (session 44): on an item sheet (the reader's, the one with a text-size step) the
   operation name never breaks within itself. It is one line (nowrap), and its size is
   capped by the banner's own width: OPERATION ASHGROVE, the longer name, is 14.19em wide
   in Plex Sans Bold at .16em tracking, so the cap is 100cqi / 14.5 (cqi: 1% of the
   banner's content width; 14.5 leaves a 2% margin). Where the name already fits, the cap
   is above calc(20em / 15) and today's size stands. The operation and the force may still
   wrap onto separate rows. The feed's and the warrant's sheets carry no data-size, so
   they are unchanged. */
@media screen {
  .sheet .banner { padding: calc(12em / 15) calc(14em / 15); gap: calc(2em / 15) calc(16em / 15); }
  .sheet .banner .op { font-size: calc(20em / 15); line-height: calc(24em / 20); }
  .sheet[data-size] .banner { container-type: inline-size; }
  .sheet[data-size] .banner .op { font-size: min(calc(20em / 15), calc(100cqi / 14.5)); white-space: nowrap; }
  .sheet .banner .force { font-size: calc(11.5em / 15); line-height: calc(16em / 11.5); }
}
/* On an item sheet the header line under a banner keeps the feed's 14px gap (.lh). */
.sheet .banner + p { margin-top: 14px; }
/* The Kingsley letterhead under the banner (draft §2.2): the review-team line, the
   reference in the quiet ink, and the document's own heading when it has one. */
.lh { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 16px; font-size: 11.5px; line-height: 17px; letter-spacing: .07em; }
.lh .team { font-weight: 600; }
.lh .ref { font-size: 11px; letter-spacing: .04em; color: var(--paper-quiet); }
.lh .doc { font-weight: 400; }
/* Inside a sheet the letterhead lines step with the text-size control too (KEV-63, style
   guide §7.2): at step 0 they are the px values above, and on an item sheet they are the
   header lines under a banner (render-blocks.ts). The .lh's sizes are calc(px / 15) of
   the sheet; the reference's is calc(px / 11.5) of the .lh. Screen only, as the banner's. */
@media screen {
  .sheet .lh { font-size: calc(11.5em / 15); line-height: calc(17em / 11.5); margin: calc(14em / 11.5) 0 calc(16em / 11.5); }
  .sheet .lh .ref { font-size: calc(11em / 11.5); }
}

/* ---- appendix (e.g. the clue index): the same one paper */
.checklist-item { display: flex; align-items: flex-start; gap: .5em; }
.checklist-item .checkbox { flex: 0 0 auto; width: .8em; height: .8em; margin-top: .25em; border: 1.5px solid currentColor; border-radius: 2px; }

/* ---- TBD markers and development copy */
mark.tbd { background: var(--tbd-bg); outline: 2px solid var(--tbd-line); color: #3a2d00; padding: 0 .15em; border-radius: 2px; white-space: pre-wrap; }
.dev-copy { outline: 1px dashed var(--dev); outline-offset: 2px; }

/* ---- the shared-moment strip (build spec §2.7): one line on the raised ground above
   the 999 call and above a warrant result, a small link glyph and the words. */
.shared { display: flex; gap: var(--s2); align-items: center; padding: 10px var(--s3); background: var(--raised); color: var(--ink); font-size: 13px; line-height: 18px; border-radius: var(--radius); }
.shared svg { flex: none; color: var(--ink-2); }
.feed .shared { margin: 0 0 var(--s3); }
.page.sheeted > div > .shared { margin: 0 0 var(--s3); }
.opening .shared { margin: 0 0 var(--s3); }

/* ---- opening overlay (the 999 call): the shell's ground, the item on the one paper */
.opening { position: fixed; inset: 0; background: var(--shell); color: var(--ink); overflow-y: auto; z-index: 20; }
.opening .page { padding-bottom: 5rem; }
.opening audio { width: 100%; margin: .75rem 0; }
.opening .continue { position: fixed; bottom: 0; left: 0; right: 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--recessed); border-top: 1px solid var(--rule); display: flex; justify-content: center; }

/* ---- dev panel (development builds only) */
.devtoggle { position: fixed; right: .6rem; bottom: calc(64px + .6rem + env(safe-area-inset-bottom)); z-index: 30; background: var(--dev); color: #fff; border: 0; border-radius: 999px; padding: .4rem .8rem; font-size: .8rem; cursor: pointer; }
.devpanel { position: fixed; right: .6rem; bottom: calc(64px + 3rem + env(safe-area-inset-bottom)); z-index: 30; width: min(360px, calc(100vw - 1.2rem)); background: #fff; color: #111; border: 2px solid var(--dev); border-radius: 8px; padding: .75rem; font-size: .85rem; }
.devpanel h3 { color: var(--dev); margin: 0 0 .5rem; font-size: .85rem; }
.devpanel .row { margin-bottom: .4rem; }
.devpanel .btn { background: var(--dev); border-color: var(--dev); color: #fff; }
.devpanel pre { font-size: .7rem; max-height: 10rem; overflow: auto; background: #f6f6f6; padding: .4rem; }

/* ---- search (draft §3). Results are text on the shell, never sheets: a title is an
   underlined link, so a link is not told by colour alone, with its snippet beneath. The
   count line and the no-results line take the same position; the no-results line takes
   the same rules as a result list, a hairline above and below. */
.count { margin: 0 0 var(--s2); font-size: 14px; line-height: 20px; color: var(--ink-2); }
.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: var(--s3) 0; border-top: 1px solid var(--rule); }
.results li:last-child { border-bottom: 1px solid var(--rule); }
.results a { color: var(--accent-bright); font-size: 15px; line-height: 21px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.results .snippet { display: block; color: var(--ink-2); font-size: 14px; line-height: 20px; margin-top: 2px; }
.none { margin: 0; padding: var(--s3) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 20px; color: var(--ink-2); }
/* The Tools rule is shell furniture, not a sheet (spec §10.2), and it is the last
   thing on this screen in all three of its states — before a search, under results,
   under a nothing. The space above it is what makes it read as the foot of the
   screen rather than as one more result. Roles are spec §10.1: micro label over a
   hairline in the rule colour, the anchor as a tool row on the raised ground at the
   row size, the note in body at the quiet ink. */
.tools { margin-top: 2.25rem; }
.tools h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 0; padding-bottom: .4rem; border-bottom: 1px solid var(--rule); }
.tools .anchor { margin: 0; }
.tools .anchor a { display: block; padding: .8rem 1rem; background: var(--raised); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); text-decoration: none; color: var(--ink); font-size: 15px; line-height: 1.4; min-height: 44px; }
.tools .tools-note { margin: .6rem 0 0; font-size: 13px; line-height: 19px; color: var(--ink-3); }
