/* Argus FOIA: the design system's tokens and base styles, and the workspace shell
 * (design/workspace-prototype.html, approved Nov 21).
 *
 * Every colour is a custom property in the token blocks below: light (`:root`), then dark
 * twice with the same values (once for "follow the device", once for a person who chose
 * Dark); nothing else in any stylesheet writes a colour. crates/web/src/tokens.rs mirrors
 * the light values, checks the two dark blocks agree and tests WCAG contrast for both
 * schemes. No inline styles anywhere (strict CSP: style-src 'self').
 *
 * Square corners everywhere: only avatars, status dots, pills and thin bars are round.
 * Each rail section has a hue (`.h-sage` ...); a page carries its section's class, so
 * `--hue`, `--tint` and the older `--accent` follow it.
 *
 * Old token names (`--border`, `--accent`, `--danger`, `--warn`, `--radius`, ...) stay as
 * aliases so every screen built before the shell keeps working.
 */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/fonts/Jost-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #EDF0EC;
  --surface: #FFFFFF;
  --raised: #F5F7F4;
  --line: #DCE2DC;
  --line-strong: #C3CCC4;
  --line-control: #7A847E;
  --text: #1C2420;
  --text-2: #4B5650;
  --text-3: #636E68;
  --brand: #2B2523;
  --on-hue: #FFFFFF;
  --rail: #FFFFFF;
  --link: #2F6A9A;
  --online: #2FA36B;
  --away: #D9A514;
  --dnd: #D2453B;
  --offline: #9AA39E;
  --badge: #D2453B;
  --on-badge: #FFFFFF;
  --rail-shadow: 1px 0 0 rgba(28, 36, 32, .06), 6px 0 22px -11px rgba(28, 36, 32, .28);
  --fly-shadow: 11px 0 29px -11px rgba(28, 36, 32, .32);
  --bar-shadow: 0 -6px 19px -13px rgba(0, 0, 0, .3);
  --seg-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  --topbar-bg: rgba(237, 240, 236, .88);

  /* Section hues: deep (fills, white text >= 4.5:1) and tint (soft grounds). */
  --sage: #3E7A5E;   --sage-tint: #E2EEE7;
  --lake: #2F6A9A;   --lake-tint: #E1EBF4;
  --plum: #74508A;   --plum-tint: #EEE5F2;
  --ochre: #8A6A12;  --ochre-tint: #F5EDD6;
  --rose: #A34A62;   --rose-tint: #F6E4E9;
  --slate: #4A5866;  --slate-tint: #E5E9ED;
  /* A hue as text, icon or focus ring (>= 4.5:1 on the surface, 3:1 on its tint): the
   * hue itself in light; lighter in dark, where the vivid fills are too deep for text. */
  --sage-ink: var(--sage);   --lake-ink: var(--lake);   --plum-ink: var(--plum);
  --ochre-ink: var(--ochre); --rose-ink: var(--rose);   --slate-ink: var(--slate);

  --late: #A3362A;   --late-tint: #F7E3DF;  --late-fill: #A3362A;  --on-late: #FFFFFF;
  --soon: #8A5A00;   --soon-tint: #F7ECD4;
  --ok: #2E6B4A;     --ok-tint: #E0EEE5;
  --hatch: #D7DDD6;
  --shadow: 0 1px 2px rgba(28, 36, 32, .06), 0 6px 19px -10px rgba(28, 36, 32, .18);

  /* Review highlights: what each redaction comes from (text is --text on each). */
  --mark-decision: #DCE4F7;
  --mark-pattern: #F4DDEB;
  --mark-person: #D9D4C7;
  --mark-edge: #8A5A7A;
  /* What a black-out looks like on a page under review: black in both themes, as the
   * released page will have it. */
  --blackout: #000000;
  /* The video player's stage: dark in both themes (a calm frame for footage), with
   * its own text, lanes and box colours. */
  --stage: #121614;  --stage-2: #1B201E;  --stage-line: #343C38;
  --on-stage: #EEF2EF;  --on-stage-2: #B3BDB8;  --stage-focus: #8DB8FF;
  --tl-hidden: #5AA9FF;  --tl-review: #F5B94A;  --tl-shown: #8C9791;
  --tl-mute: #FF7A7A;  --tl-flag: #C9A2FF;  --tl-draw: #FF6FA0;

  /* Aliases: the names the screens before the shell use. */
  --border: var(--line);
  --border-control: var(--line-control);
  --accent: var(--lake);
  --accent-hover: var(--lake);
  --on-accent: var(--on-hue);
  --focus: var(--lake-ink);
  --danger: var(--late);
  --danger-soft: var(--late-tint);
  --warn: var(--soon);
  --warn-soft: var(--soon-tint);
  --ok-soft: var(--ok-tint);
  --release: var(--ok);
  --check: var(--soon);
  --withhold: var(--text);

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-mark: "Jost", var(--font);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 0px;
  /* Sizes (w8): the app at 100% matches what it was at 80% browser zoom, with body text
   * kept at 14px and every control at least 32px tall. Other lengths in this file were
   * scaled by 0.8 with it; new rules use these tokens and the spacing scale. */
  --rail-w: 90px;
  --tile-h: 74px;
  --tile-icon: 24px;
  --tile-label: 11px;
  --mark-size: 37px;
  --fly-w: 202px;
  --page-x: 26px;
  --control-h: 36px;
  --button-h: 34px;
  --control-h-sm: 32px;
  --fs-h1: 28px;
  --fs-h2: 15px;
  --fs-h3: 14px;
  --fs-body: 14px;
  --fs-small: 13px;
  --fs-meta: 12px;
  --space-1: 3px;
  --space-2: 6px;
  --space-3: 10px;
  --space-4: 13px;
  --space-5: 19px;
  --space-6: 26px;
  --space-7: 38px;
  --nav-width: 90px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A;
    --surface: #121212;
    --raised: #1A1A1A;
    --line: #232323;
    --line-strong: #343434;
    --line-control: #6E6E6E;
    --text: #F5F5F5;
    --text-2: #A3A3A3;
    --text-3: #858585;
    --brand: #F5F5F5;
    --on-hue: #FFFFFF;
    --rail: #111111;
    --link: #A190FF;
    --online: #4CC98A;
    --away: #E8BE4F;
    --dnd: #F07A6E;
    --offline: #6E7872;
    --badge: #D7363C;
    --on-badge: #FFFFFF;
    --rail-shadow: 1px 0 0 rgba(0, 0, 0, .4), 8px 0 24px -11px rgba(0, 0, 0, .7);
    --fly-shadow: 11px 0 29px -11px rgba(0, 0, 0, .7);
    --bar-shadow: 0 -6px 19px -13px rgba(0, 0, 0, .7);
    --seg-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --topbar-bg: rgba(10, 10, 10, .88);
    --sage: #13865A;   --sage-tint: #12251E;
    --lake: #2F6FEB;   --lake-tint: #172135;
    --plum: #6D4BF6;   --plum-tint: #211B36;
    --ochre: #B45309;  --ochre-tint: #2C1C11;
    --rose: #D6336C;   --rose-tint: #311720;
    --slate: #4F6280;  --slate-tint: #1C1F24;
    --sage-ink: #3DBE87;  --lake-ink: #6E9BFF;  --plum-ink: #A592FF;
    --ochre-ink: #EE9A4A; --rose-ink: #F06E9A;  --slate-ink: #9DAEC6;
    --late: #FF7A7A;   --late-tint: #4A1C1E;  --late-fill: #D7363C;  --on-late: #FFFFFF;
    --soon: #F5B94A;   --soon-tint: #33270F;
    --ok: #5BD69A;     --ok-tint: #12291D;
    --hatch: #262626;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -11px rgba(0, 0, 0, .6);
    --mark-decision: #26365C;
    --mark-pattern: #4A2A40;
    --mark-person: #45423B;
    --mark-edge: #D9A3C6;
    --blackout: #000000;
    --stage: #0E0E0E;  --stage-2: #161616;  --stage-line: #2E2E2E;
    --on-stage: #F5F5F5;  --on-stage-2: #B0B0B0;  --stage-focus: #8DB8FF;
    --tl-hidden: #5AA9FF;  --tl-review: #F5B94A;  --tl-shown: #8C8C8C;
    --tl-mute: #FF7A7A;  --tl-flag: #C9A2FF;  --tl-draw: #FF6FA0;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
    --bg: #0A0A0A;
    --surface: #121212;
    --raised: #1A1A1A;
    --line: #232323;
    --line-strong: #343434;
    --line-control: #6E6E6E;
    --text: #F5F5F5;
    --text-2: #A3A3A3;
    --text-3: #858585;
    --brand: #F5F5F5;
    --on-hue: #FFFFFF;
    --rail: #111111;
    --link: #A190FF;
    --online: #4CC98A;
    --away: #E8BE4F;
    --dnd: #F07A6E;
    --offline: #6E7872;
    --badge: #D7363C;
    --on-badge: #FFFFFF;
    --rail-shadow: 1px 0 0 rgba(0, 0, 0, .4), 8px 0 24px -11px rgba(0, 0, 0, .7);
    --fly-shadow: 11px 0 29px -11px rgba(0, 0, 0, .7);
    --bar-shadow: 0 -6px 19px -13px rgba(0, 0, 0, .7);
    --seg-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --topbar-bg: rgba(10, 10, 10, .88);
    --sage: #13865A;   --sage-tint: #12251E;
    --lake: #2F6FEB;   --lake-tint: #172135;
    --plum: #6D4BF6;   --plum-tint: #211B36;
    --ochre: #B45309;  --ochre-tint: #2C1C11;
    --rose: #D6336C;   --rose-tint: #311720;
    --slate: #4F6280;  --slate-tint: #1C1F24;
    --sage-ink: #3DBE87;  --lake-ink: #6E9BFF;  --plum-ink: #A592FF;
    --ochre-ink: #EE9A4A; --rose-ink: #F06E9A;  --slate-ink: #9DAEC6;
    --late: #FF7A7A;   --late-tint: #4A1C1E;  --late-fill: #D7363C;  --on-late: #FFFFFF;
    --soon: #F5B94A;   --soon-tint: #33270F;
    --ok: #5BD69A;     --ok-tint: #12291D;
    --hatch: #262626;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -11px rgba(0, 0, 0, .6);
    --mark-decision: #26365C;
    --mark-pattern: #4A2A40;
    --mark-person: #45423B;
    --mark-edge: #D9A3C6;
    --blackout: #000000;
    --stage: #0E0E0E;  --stage-2: #161616;  --stage-line: #2E2E2E;
    --on-stage: #F5F5F5;  --on-stage-2: #B0B0B0;  --stage-focus: #8DB8FF;
    --tl-hidden: #5AA9FF;  --tl-review: #F5B94A;  --tl-shown: #8C8C8C;
    --tl-mute: #FF7A7A;  --tl-flag: #C9A2FF;  --tl-draw: #FF6FA0;
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Section hues. */
.h-sage  { --hue: var(--sage);  --tint: var(--sage-tint);  --accent: var(--sage);  --accent-hover: var(--sage);  --focus: var(--sage-ink); --ink: var(--sage-ink); }
.h-lake  { --hue: var(--lake);  --tint: var(--lake-tint);  --accent: var(--lake);  --accent-hover: var(--lake);  --focus: var(--lake-ink); --ink: var(--lake-ink); }
.h-plum  { --hue: var(--plum);  --tint: var(--plum-tint);  --accent: var(--plum);  --accent-hover: var(--plum);  --focus: var(--plum-ink); --ink: var(--plum-ink); }
.h-ochre { --hue: var(--ochre); --tint: var(--ochre-tint); --accent: var(--ochre); --accent-hover: var(--ochre); --focus: var(--ochre-ink); --ink: var(--ochre-ink); }
.h-rose  { --hue: var(--rose);  --tint: var(--rose-tint);  --accent: var(--rose);  --accent-hover: var(--rose);  --focus: var(--rose-ink); --ink: var(--rose-ink); }
.h-slate { --hue: var(--slate); --tint: var(--slate-tint); --accent: var(--slate); --accent-hover: var(--slate); --focus: var(--slate-ink); --ink: var(--slate-ink); }

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--ink, var(--focus));
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-3); font-family: var(--font-display); }
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: 650; }
h3 { font-size: var(--fs-h3); font-weight: 650; }
p { margin: 0 0 var(--space-3); }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -80px;
  background: var(--surface);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-control);
  z-index: 50;
}
.skip-link:focus { top: var(--space-3); }

.muted { color: var(--text-2); }
.small { font-size: var(--fs-small); }
.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* A table ignores `height`: hide it inside a clipped block (`div.sr-only > table`), never
 * with the class on the table itself, or its rows still stretch the page. */
table.sr-only, table.visually-hidden { display: block; }

/* ---------------------------------------------------------------- wordmark */

.wordmark {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-family: var(--font-display);
}
.wordmark span { color: var(--text-2); font-weight: 500; }

/* ---------------------------------------------------------------- forms */

.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-4); }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { color: var(--text-2); font-size: 13px; }
.field .error { color: var(--danger); font-size: 13px; font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
input[type="time"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: 0;
  padding: 8px var(--space-3);
  min-height: var(--control-h);
  width: 100%;
}
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="date"]::-webkit-datetime-edit { color: var(--text); }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }

.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font: inherit;
  font-weight: 600;
  min-height: var(--button-h);
  padding: 0 14px;
  border-radius: 0;
  border: 1px solid var(--sel, var(--accent));
  background: var(--sel, var(--accent));
  color: var(--on-sel, var(--on-accent));
  cursor: pointer;
  text-decoration: none;
}
.button:hover, .btn:hover { filter: brightness(0.94); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-control); filter: none; }
.button.secondary:hover { background: var(--raised); }
.button.block { width: 100%; }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }
.link-button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}

.flash {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-left-width: 3px;
  background: var(--surface);
}
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.flash.notice { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.flash a { color: inherit; font-weight: 600; }

/* Live cards that update themselves (the building card on the Response page). */
.packet-building progress { width: 100%; max-width: 32rem; height: 12px; margin: var(--space-2) 0; }

fieldset { border: 0; padding: 0; margin: 0 0 var(--space-2); }
legend { font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin-bottom: var(--space-3); }

/* ---------------------------------------------------------------- auth pages */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: var(--space-7) var(--space-4);
}
.auth-card {
  width: 100%;
  max-width: 336px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-6);
}
.auth-card h1 { font-size: 22px; }
.auth-card .wordmark { display: inline-block; margin-bottom: var(--space-5); }
.auth-card .switch { margin: var(--space-4) 0 0; color: var(--text-2); font-size: 14px; }
.auth-card .auth-terms { margin: var(--space-2) 0 0; text-align: center; color: var(--text-2); }

/* ================================================================ the workspace shell */

body.app { min-height: 100vh; }
/* Focus Not Obscured (WCAG 2.4.11): when Tab or a link scrolls something into view, it
 * stops below the sticky top bar (and, on a phone, above the bottom tabs). */
:root:has(body.app) { scroll-padding-top: 64px; }
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
  padding-left: env(safe-area-inset-left, 0px);
}

/* The rail: the mark, six section tiles, the person. */
nav.nav {
  position: sticky; top: 0; z-index: 31;
  height: 100vh; height: 100dvh;
  width: var(--rail-w);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0 0 13px;
  background: var(--rail); box-shadow: var(--rail-shadow);
  overflow-y: auto;
}
.rail-mark {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 16px 0 14px; color: var(--brand); text-decoration: none;
}
.rail-mark svg { width: var(--mark-size); height: var(--mark-size); }
.rail-word { font: 500 14px/1 var(--font-mark); letter-spacing: .2em; margin-right: -.2em; }
.rail-tile {
  width: 100%; height: var(--tile-h); flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: transparent; cursor: pointer; text-decoration: none;
  color: var(--text-2); font-size: var(--tile-label); font-weight: 500; letter-spacing: .01em;
  transition: background-color .2s ease, color .2s ease;
}
.rail-tile svg { width: var(--tile-icon); height: var(--tile-icon); }
.rail-tile:hover, .rail-tile[aria-expanded="true"]:not([aria-current]) { background: var(--tint); color: var(--text); }
.rail-tile[aria-current="true"] { background: var(--sel, var(--hue)); color: var(--on-sel, var(--on-hue)); }
.rail-tile:focus-visible { outline-offset: -3px; outline-color: var(--text); }
.rail-foot { margin-top: auto; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 10px; }

/* The person: initials in a circle, the status dot on their own avatar only. */
.avatar {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  font: 600 12px/1 var(--font); color: var(--text-2); padding: 0;
}
button.avatar { cursor: pointer; }
button.avatar:hover { border-color: var(--line-strong); color: var(--text); }
.avatar[aria-expanded="true"] { border-color: var(--text-3); }
.avatar .presence {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--online); box-shadow: 0 0 0 2.5px var(--rail);
}
.presence[data-status="away"] { background: var(--away); }
.presence[data-status="dnd"] { background: var(--dnd); }
.presence[data-status="offline"] { background: var(--rail); box-shadow: 0 0 0 2.5px var(--rail), inset 0 0 0 2.5px var(--offline); }
.topbar .me-top { display: none; }

/* The flyout: the section's pages, floating over the work (nothing moves under it). */
.flyout {
  position: fixed; z-index: 30; top: 0; bottom: 0; left: calc(var(--rail-w) + env(safe-area-inset-left, 0px));
  width: var(--fly-w); background: var(--surface); border-right: 1px solid var(--line);
  box-shadow: var(--fly-shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .18s ease, visibility 0s linear 0s;
}
.flyout.closed {
  transform: translateX(-13px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .18s ease, opacity .14s ease, visibility 0s linear .18s;
}
/* Closed from the keyboard (focus moved on): hidden at once, so the next Tab can't land
 * on a link that is still fading out. */
.flyout.closed.at-once { transition: none; }
.fly-inner { width: var(--fly-w); padding: 21px 0 0; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; height: 100%; }
.fly-inner[hidden] { display: none; }
.fly-head { display: flex; align-items: center; gap: 10px; padding: 0 19px; }
.fly-head h2 { margin: 0; font: 650 18.5px/1.1 var(--font-display); letter-spacing: -.01em; }
.fly-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.fly-links { display: flex; flex-direction: column; }
.fly-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
/* Settings' small group headings ("Agency", "Mail", ...): its links sit a little closer. */
.fly-group { margin: 11px 19px 3px; font: 650 11px/1.2 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.fly-group:first-child { margin-top: 0; }
.fly-group + .fly-list a { padding-top: 7px; padding-bottom: 7px; }
.fly-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 19px; text-decoration: none; color: var(--text-2); font-weight: 500;
  transition: background-color .25s ease, color .25s ease;
}
.fly-list a:hover { background: var(--raised); color: var(--text); }
.fly-list a[aria-current="page"] { background: var(--sel-tint, var(--tint)); color: var(--text); font-weight: 600; }
.fly-list a:focus-visible { outline-offset: -3px; }
.fly-list a[data-count]::after {
  content: attr(data-count) / "";
  min-width: 21px; padding: 1px 6px; border-radius: 99px; text-align: center;
  font-size: 12px; font-weight: 600; background: var(--raised); color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.fly-list a[aria-current="page"][data-count]::after { background: var(--sel, var(--hue)); color: var(--on-sel, var(--on-hue)); }
.fly-note {
  margin-top: auto; padding: 14px 19px 18px; background: var(--raised); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-2); overflow-wrap: anywhere;
}
.fly-note strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* The work: the top bar, then the page. */
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 13px;
  padding: calc(11px + env(safe-area-inset-top, 0px)) max(13px, env(safe-area-inset-right, 0px), var(--page-x)) 11px var(--page-x);
  background: var(--topbar-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.agency { display: flex; flex-direction: column; min-width: 0; }
.agency b { font-weight: 650; font-family: var(--font-display); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agency span { font-size: 12px; color: var(--text-2); }
.top-search {
  margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; width: min(304px, 100%);
  padding: 0 11px; background: var(--surface); border: 1px solid var(--line); color: var(--text-3);
}
.top-search:focus-within { border-color: var(--line-control); outline: 2px solid var(--ink, var(--focus)); outline-offset: 2px; }
.top-search label { display: grid; place-items: center; cursor: text; }
.top-search input, .top-search input[type="search"] {
  border: 0; outline: 0; background: transparent; font: inherit; color: var(--text);
  width: 100%; min-width: 0; min-height: 32px; padding: 0;
}
.top-search svg { width: 14px; height: 14px; flex: none; }
.kbd { font-size: 11.5px; padding: 1px 5px; border: 1px solid var(--line); color: var(--text-3); white-space: nowrap; }

.bell {
  position: relative; flex: none; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--text-2); cursor: pointer;
}
.bell:hover, .bell[aria-expanded="true"] { color: var(--text); }
.bell svg { width: 19px; height: 19px; }
.bell .ball {
  position: absolute; top: 2px; right: -3px; min-width: 14px; height: 14px; padding: 0 4px; border-radius: 99px;
  display: grid; place-items: center; background: var(--badge); color: var(--on-badge);
  font: 700 10.5px/1 var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2.5px var(--bg);
}

.main.page {
  min-width: 0; flex: 1;
  padding: 6px max(13px, env(safe-area-inset-right, 0px), var(--page-x)) 38px var(--page-x);
}
.main.page:focus { outline: none; }
/* Pages built for the shell stack their parts with one gap. */
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack > * { margin: 0; }

/* Popovers: the notifications, the account menu, a day of the week. */
.notes, .me-menu, .daypop {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: opacity .14s ease, transform .16s ease;
}
.notes {
  position: fixed; z-index: 40; top: calc(53px + env(safe-area-inset-top, 0px)); right: max(13px, env(safe-area-inset-right, 0px), 19px);
  width: 304px; max-width: calc(100vw - 19px); max-height: calc(100vh - 72px); display: flex; flex-direction: column;
  transform-origin: top right;
}
.notes[hidden], .me-menu[hidden], .daypop[hidden] { display: none; }
.js .notes[hidden], .js .daypop[hidden] { display: flex !important; opacity: 0; transform: translateY(-5px) scale(.98); pointer-events: none; visibility: hidden; }
.js .me-menu[hidden] { display: block !important; opacity: 0; transform: translateY(5px) scale(.98); pointer-events: none; visibility: hidden; }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); }
.notes-head h2 { margin: 0; font: 650 14.5px/1.2 var(--font-display); }
.notes-head form { margin: 0; }
.link-btn { border: 0; background: transparent; padding: 3px 0; font-size: 12.5px; font-weight: 500; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn[disabled] { color: var(--text-3); cursor: default; text-decoration: none; }
.notes-list { list-style: none; margin: 0; padding: 5px 0; overflow-y: auto; }
.notes-list form { margin: 0; }
.notes-empty { margin: 0; padding: 18px 14px; color: var(--text-2); font-size: 13px; }
.note {
  display: grid; grid-template-columns: 29px minmax(0, 1fr) 8px; gap: 10px; align-items: start;
  width: 100%; padding: 10px 14px; border: 0; background: transparent; text-align: left; cursor: pointer;
  text-decoration: none; color: var(--text);
}
.note:hover { background: var(--raised); }
.note:focus-visible { outline-offset: -2px; }
.note .n-icon { width: 32px; height: 32px; display: grid; place-items: center; background: var(--tint); color: var(--ink); }
.note .n-icon svg { width: 15px; height: 15px; }
.note .n-body { display: flex; flex-direction: column; min-width: 0; }
.note .n-t { font-size: 13px; line-height: 1.4; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.note .n-when { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.note .n-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; background: var(--badge); }
.note.read .n-dot { visibility: hidden; }
.note.read .n-t { color: var(--text-2); font-weight: 400; }
.notes-foot { border-top: 1px solid var(--line); padding: 10px 14px; }
.notes-foot a { font-size: 12.5px; font-weight: 500; color: var(--text-2); text-decoration: none; }
.notes-foot a:hover { color: var(--text); text-decoration: underline; }

.me-menu {
  position: fixed; z-index: 40; left: calc(var(--rail-w) + 10px + env(safe-area-inset-left, 0px)); bottom: 11px;
  width: 240px; max-width: calc(100vw - 19px); max-height: calc(100vh - 22px); overflow-y: auto;
  transform-origin: bottom left;
}
.me-head { display: flex; gap: 10px; align-items: center; padding: 14px 14px 11px; }
.me-head .avatar { width: 38px; height: 38px; font-size: 14px; }
.me-head .presence { width: 11px; height: 11px; box-shadow: 0 0 0 3px var(--surface); }
.me-head .presence[data-status="offline"] { background: var(--surface); box-shadow: 0 0 0 3px var(--surface), inset 0 0 0 2.5px var(--offline); }
.me-name { font-weight: 650; font-family: var(--font-display); font-size: 14.5px; line-height: 1.2; }
.me-role { font-size: 12px; color: var(--text-3); }
.me-sec { border-top: 1px solid var(--line); padding: 6px 0; margin: 0; }
.me-label { padding: 5px 14px 3px; font-size: 12px; color: var(--text-3); font-weight: 500; }
.me-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 14px; border: 0; background: transparent;
  text-align: left; text-decoration: none; color: var(--text); font-size: 13.5px; cursor: pointer;
}
.me-item:hover { background: var(--raised); }
.me-item:focus-visible { outline-offset: -2px; }
.me-item .sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--online); }
.me-item .sdot[data-status="away"] { background: var(--away); }
.me-item .sdot[data-status="dnd"] { background: var(--dnd); }
.me-item .sdot[data-status="offline"] { background: transparent; box-shadow: inset 0 0 0 2px var(--offline); }
.me-item .hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.me-item[aria-checked="true"] { font-weight: 600; }
.me-item[aria-checked="true"]::after { content: ""; margin-left: auto; width: 5px; height: 9px; border: solid var(--text); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); }
.me-item[aria-checked="true"] .hint { display: none; }
.me-item svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 3px 14px 6px; padding: 3px; background: var(--raised); }
.theme-seg button { border: 0; background: transparent; padding: 6px 0; font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--seg-shadow); }

/* ================================================================ shell pages */

.hello h1 { margin: 0; font: 700 var(--fs-h1)/1.1 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.hello p { margin: 6px 0 0; color: var(--text-2); max-width: 62ch; }
.hello p b { color: var(--text); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 18px 0; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font: 650 15px/1.2 var(--font-display); }
.panel-head p { margin: 0; color: var(--text-3); font-size: 12.5px; }

/* The next two weeks: business days from the pack, closures as one hatched block. */
.week-scroll { overflow-x: auto; padding: 13px 11px 14px; }
.week { display: flex; gap: 6px; min-width: 752px; }
/* Every column has the same two header rows: the month row (the month's name once, on
 * its first column, and a rule across the month's columns), then the day header (weekday
 * and date number; the past column its label and count). Both rows have a fixed height
 * and never wrap, so every header shares one baseline and one rule line. A column is
 * never narrower than its header. */
.day { display: flex; flex-direction: column; gap: 6px; min-width: min-content; flex: 1 1 0; }
.mrow {
  height: 21px; flex: none; display: flex; align-items: flex-end; padding: 0 6px 3px;
  margin-bottom: -6px; white-space: nowrap;
}
.mrow.in { box-shadow: inset 0 2px 0 var(--line-strong); }
.mrow.in:not(.end) { margin-right: -6px; }
.mname { font: 650 12px/1 var(--font); letter-spacing: .02em; color: var(--text-2); }
.day.past { flex-grow: 1.15; }
.day.off { flex-grow: .42; }
/* One closed weekday alone: wide enough for a holiday's name. */
.day.off.span1 { flex-grow: .62; }
.day.off.span2 { flex-grow: .84; }
.day.off.span3 { flex-grow: 1.26; }
.day.off.span4 { flex-grow: 1.68; }
.day.off.span5 { flex-grow: 2.1; }
.day-head {
  display: flex; align-items: baseline; gap: 5px; height: 32px; padding: 8px 6px 0;
  border-bottom: 1px solid var(--line); white-space: nowrap; flex: none;
}
.day-head .dn { font-weight: 600; font-size: 12px; color: var(--text-2); }
.day-head .dd { font: 650 17px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.day.today .day-head { border-bottom: 2px solid var(--sage); }
.day.today .dn { color: var(--sage-ink); }
.today-tag { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--sage-tint); color: var(--text); }
.day.past .day-head { border-bottom: 2px solid var(--late); }
.day.past .dn, .day.past .dd { color: var(--late); }
.day.off { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 7px); }
.day.off .day-head { border-bottom-color: transparent; }
.off-note { font-size: 12px; color: var(--text-2); padding: 0 6px; line-height: 1.4; overflow-wrap: break-word; hyphens: auto; }
.chip {
  display: flex; flex-direction: column; gap: 5px; padding: 8px 9px;
  background: var(--raised); border: 1px solid var(--line); text-decoration: none; color: var(--text);
  transition: border-color .15s ease, background-color .15s ease;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface); }
.chip .t { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text); overflow-wrap: break-word; }
.chip .m { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); }
.who-dot {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 700 10px/1 var(--font); color: var(--on-hue); background: var(--hue);
}
.chip .who-dot { margin-left: auto; }
.tdot { width: 6px; height: 6px; border-radius: 50%; background: var(--hue); flex: none; display: inline-block; }
/* A request type is told by the dot's shape as well as its hue (WCAG 1.4.1): records a
 * circle, video a square, data about the requester a diamond. */
.tdot.t-video { border-radius: 0; }
.tdot.t-about { border-radius: 0; transform: rotate(45deg) scale(.9); }
.day.past .chip { background: var(--late-tint); border-color: transparent; }
/* --text-3 is under 4.5:1 on the late tint (4.29 light, 3.85 dark): the meta line darkens. */
.day.past .chip .m { color: var(--text-2); }
.more {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%;
  padding: 7px 9px; border: 1px dashed var(--line-strong); background: transparent;
  font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: left; text-decoration: none;
}
.more:hover, .more[aria-expanded="true"] { border-style: solid; background: var(--surface); color: var(--text); }
.more .faces { display: flex; }
.more .faces i {
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; margin-left: 3px;
  font: 700 9.5px/1 var(--font); font-style: normal; color: var(--on-hue); background: var(--hue); box-shadow: 0 0 0 2px var(--raised);
}
.day.past .more { border-color: var(--late); color: var(--late); }
.daypop {
  position: fixed; z-index: 40; width: 272px; max-width: calc(100vw - 19px); max-height: min(368px, calc(100vh - 19px));
  display: flex; flex-direction: column; left: 10px; top: 10px;
}
.daypop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); }
.daypop-head h2, .daypop-head h3 { margin: 0; font: 650 14.5px/1.2 var(--font-display); }
.daypop-head span { font-size: 12px; color: var(--text-3); }
.daypop ul { list-style: none; margin: 0; padding: 5px 0; overflow-y: auto; }
.dp-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) 21px; gap: 10px; align-items: center; padding: 8px 14px; text-decoration: none; color: var(--text); }
.dp-item:hover { background: var(--raised); }
.dp-item:focus-visible { outline-offset: -2px; }
.dp-item .t { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.dp-item .m { display: block; font-size: 12px; color: var(--text-3); }
.dp-item .who-dot { width: 19px; height: 19px; }
.daypop-foot { border-top: 1px solid var(--line); padding: 10px 14px; }
.daypop-foot a { font-size: 12.5px; font-weight: 600; color: var(--link); text-decoration: none; }
.daypop-foot a:hover { text-decoration: underline; }
.day-none { display: none; }
.week-key { display: flex; flex-wrap: wrap; gap: 13px; padding: 0 18px 14px; font-size: 12px; color: var(--text-2); }
.week-key span { display: inline-flex; align-items: center; gap: 5px; }

/* The lower row: equal-height panels. */
.two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.two > .panel { display: flex; flex-direction: column; }
.two > .panel > .wait-list, .two > .panel > .month, .two > .panel > .panel-empty { flex: 1; }
.wait-list { list-style: none; margin: 0; padding: 8px 8px 10px; }
/* Today's to-do list (w18): the step and the request on the left, who has it (or "Take
 * it") and the due pill on the right. The form sits outside the link. */
.wait-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px; align-items: center; }
.wait-list li + li { border-top: 1px solid var(--line); }
.wait-list li:hover { background: var(--raised); }
.wait-list .w-main {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 11px; align-items: center;
  padding: 10px; text-decoration: none; color: var(--text);
}
.w-side { display: grid; grid-template-columns: 5.6rem 5.2rem 7.4rem; justify-items: end; align-items: center; gap: 10px; padding-right: 10px; }
.w-also { display: block; font-size: 12px; color: var(--text-2); }
.w-side .unassigned { font-size: 12px; color: var(--text-2); }
.w-side .take { margin: 0; }
.take-btn { min-height: var(--control-h); padding: 0 12px; font-size: 13px; }
.w-side .who-dot { width: 22px; height: 22px; font-size: 10.5px; }
.panel-head h2 .count { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.w-icon { width: 32px; height: 32px; display: grid; place-items: center; background: var(--tint); color: var(--ink); }
.w-icon svg { width: 17px; height: 17px; }
.w-t { font-weight: 600; display: block; }
.w-s { font-size: 12px; color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-empty { padding: 18px; color: var(--text-2); margin: 0; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.pill.late { background: var(--late-tint); color: var(--late); }
.pill.soon { background: var(--soon-tint); color: var(--soon); }
.pill.ok { background: var(--ok-tint); color: var(--ok); }
.pill.calm { background: var(--raised); color: var(--text-2); }

.month { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.month-line { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.month-line b { font: 650 18.5px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
/* The daily chart: one column per day; hover or the arrow keys read each day. */
.daychart { position: relative; flex: 1; min-height: 176px; display: flex; flex-direction: column; gap: 8px; outline: none; }
.daychart:focus-visible { outline: 2px solid var(--sage-ink); outline-offset: 3px; }
.dc-plot {
  position: relative; flex: 1; min-height: 152px;
  display: grid; grid-template-columns: 21px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 18px;
}
.dc-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dc-y { grid-row: 1; grid-column: 1; }
.dc-bars { grid-row: 1; grid-column: 2; }
.dc-x { grid-row: 2; grid-column: 2; }
.dc-grid { stroke: var(--line); stroke-width: 1; }
.dc-base { stroke: var(--line-strong); stroke-width: 1; }
.dc-ylab, .dc-xlab { fill: var(--text-3); font: 500 10.5px var(--font); font-variant-numeric: tabular-nums; }
.dc-in { fill: var(--sage); }
.dc-out { fill: var(--sage-tint); stroke: var(--sage); stroke-width: 1.25; }
.dc-closed { fill: var(--hatch); opacity: .55; }
.dc-hot { fill: var(--raised); }
.dc-hit { fill: transparent; }
.dc-key { display: flex; flex-wrap: wrap; gap: 13px; font-size: 12px; color: var(--text-2); }
.dc-key span { display: inline-flex; align-items: center; gap: 5px; }
.dc-key .k-in { width: 8px; height: 8px; background: var(--sage); }
.dc-key .k-out { width: 8px; height: 8px; background: var(--sage-tint); box-shadow: inset 0 0 0 1.25px var(--sage); }
.dc-tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 120px; padding: 7px 10px;
  background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.45;
  transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap; box-shadow: var(--shadow);
  left: 50%; top: 0;
}
.dc-tip[hidden] { display: none; }
.dc-tip b { display: block; font-weight: 650; font-size: 12px; }
.ontime { display: flex; flex-direction: column; gap: 6px; }
.ot-bar { display: block; width: 100%; height: 8px; border-radius: 99px; overflow: hidden; background: var(--raised); }
.ot-bar .a, .ot-legend .a { fill: var(--sage); background: var(--sage); }
.ot-bar .b, .ot-legend .b { fill: var(--soon); background: var(--soon); }
.ot-bar .c, .ot-legend .c { fill: var(--late); background: var(--late); }
.ot-legend { display: flex; flex-wrap: wrap; gap: 11px; font-size: 12px; color: var(--text-2); }
.ot-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ot-legend i { width: 8px; height: 8px; display: inline-block; }

/* The Inbox: square count tiles are the main filter; people, type and sort narrow them. */
.lanes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.lane {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 13px 14px 12px;
  background: var(--surface); text-align: left; color: var(--text); text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}
.lane .n { font: 750 var(--fs-h1)/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lane .l { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.lane .x { font-size: 12px; font-weight: 600; color: var(--late); min-height: 1.2em; }
.lane:hover { background: var(--tint); }
.lane[aria-current="true"] { background: var(--sel, var(--hue)); color: var(--on-sel, var(--on-hue)); }
.lane[aria-current="true"] .l, .lane[aria-current="true"] .x { color: var(--on-sel, var(--on-hue)); }
.lane.alarm { --hue: var(--late); --tint: var(--late-tint); --sel: var(--late-fill); --on-sel: var(--on-late); }
.lane.alarm:not([aria-current="true"]) .n { color: var(--late); }
.lane:focus-visible { outline-offset: -3px; }

.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 21px; }
.fgroup { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.fgroup-l { font-size: 12px; font-weight: 500; color: var(--text-2); margin-right: 3px; }
.pf {
  position: relative; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--hue); color: var(--on-hue); text-decoration: none;
  font: 700 11.5px/1 var(--font); transition: opacity .15s ease, box-shadow .15s ease;
}
/* People not in the filter go grey, not faint: their initials keep 4.5:1 (WCAG 1.4.3;
 * at 32% opacity they were under 2:1). */
.people-f.filtering .pf:not([aria-current="true"]) { filter: saturate(0); }
.pf[aria-current="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink, var(--hue)); }
.tf {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--text-2); text-decoration: none;
}
.tf:hover { border-color: var(--line-strong); color: var(--text); }
.tf[aria-current="true"] { border-color: var(--hue); background: var(--sel-tint, var(--tint)); color: var(--text); font-weight: 600; }
.sortf { margin-left: auto; }
.sortf select { font-size: 12.5px; padding: 6px 10px; min-height: var(--control-h-sm); width: auto; cursor: pointer; }
.sortf .button { min-height: var(--control-h-sm); padding: 0 10px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 3px 3px 3px 9px; background: var(--raised); border: 1px solid var(--line); font-size: 12px; color: var(--text); }
.tag a { width: 18px; height: 18px; display: grid; place-items: center; color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1; }
.tag a:hover { color: var(--text); }
.clear { padding: 3px 5px; font-size: 12px; font-weight: 600; color: var(--link); text-decoration: none; }
.clear:hover { text-decoration: underline; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 18px 0; flex-wrap: wrap; }
.list-head h2 { margin: 0; font: 650 15px/1.2 var(--font-display); }
.list-head p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.cols-head, .irow { display: grid; grid-template-columns: 35px minmax(0, 1fr) 236px 32px 96px; gap: 13px; align-items: center; }
.cols-head { padding: 11px 18px 0; font-size: 12px; color: var(--text-3); font-weight: 500; }
.rows { list-style: none; margin: 0; padding: 6px; }
.irow { padding: 11px; position: relative; }
.irow + .irow { border-top: 1px solid var(--line); }
.irow:hover { background: var(--raised); }
.irow .req { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--text); font-weight: 700; font-size: 12px; }
.irow .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.irow a.t::after { content: ""; position: absolute; inset: 0; }
.irow a.t:focus-visible { outline: none; }
.irow:focus-within { outline: 2px solid var(--ink, var(--focus)); outline-offset: -2px; }
.irow .s { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow .s .tdot { margin-right: 6px; vertical-align: 1px; }
.who-dot.nobody { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.irow-more { display: none; }
.stage { display: flex; gap: 3px; align-items: center; }
.stage i { width: 14px; height: 5px; border-radius: 99px; background: var(--line); display: block; }
.stage i.on { background: var(--lake); }
.stage-l { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.irow .who-dot { width: 22px; height: 22px; font-size: 10.5px; }
.list-empty { padding: 35px 18px 38px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--text-2); }
.list-empty p { margin: 0; }

/* Stub pages inside the shell (your profile, sign-in). */
.stub { padding: 32px 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.stub h2 { margin: 0; font: 650 17px/1.2 var(--font-display); }
.stub p { margin: 0; color: var(--text-2); max-width: 56ch; }

/* ================================================================ screens (before the shell) */

.empty {
  border: 1px dashed var(--border-control);
  padding: var(--space-6);
  background: var(--surface);
}

.list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.list a {
  display: block;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.list a:hover { background: var(--raised); }

.label { font-weight: 650; font-size: 12px; padding: 2px var(--space-2); border: 1px solid currentColor; }
.label.release { color: var(--release); }
.label.check { color: var(--check); }
.label.withhold { color: var(--withhold); }

.htmx-indicator { opacity: 0; transition: opacity 150ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

code { font-family: var(--font-mono); font-size: 0.875em; }
kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--border-control);
  padding: 0 4px;
  background: var(--surface);
}
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.page-head h1 { margin-bottom: var(--space-1); }
.page-head .subtitle { margin: 5px 0 0; max-width: 70ch; }
.page-head .actions { display: flex; gap: var(--space-2); flex-wrap: wrap; flex-shrink: 0; }
.page-head .actions .button { white-space: nowrap; }
.crumb { margin-bottom: var(--space-2); font-size: 14px; }
.crumb a { text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); }
.request-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-5); }
.request-grid .card { margin-bottom: 0; }
.request-grid + * { margin-top: var(--space-5); }
/* The request page: public/css/request.css (pages::request). */
.request-text { white-space: pre-wrap; max-height: 22.4rem; overflow: auto; border-top: 1px solid var(--border); padding-top: var(--space-3); }
.letter { white-space: pre-wrap; }
textarea { min-height: 6.4rem; line-height: 1.5; }
.field.narrow { max-width: 11.2rem; }
/* A tick box or radio is clicked through its label, so the label row is the target:
 * at least 24px tall (WCAG 2.5.8). */
.check-row { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); min-height: 24px; }
.check-row > label { min-height: 24px; display: inline-flex; align-items: center; }
fieldset.inline { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
fieldset.inline > label { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 24px; }
fieldset.inline legend { width: 100%; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3); }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); }
/* Scrolling boxes are positioned, so the clipped screen-reader text inside them (a
 * header cell's hidden "Action" at the far right of a wide table) is held by the box and
 * can't widen or lengthen the page. */
.table-wrap, .chart-scroll, .week-scroll, .request-text, .maildrop-unread { position: relative; }
.card .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; color: var(--text-2); font-weight: 600; }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--raised); }
/* A table that becomes label / value rows on a phone (cells carry data-label). */
@media (max-width: 600px) {
  .table.stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr { display: block; width: 100%; }
  .table.stack-sm tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
  .table.stack-sm tbody tr:last-child { border-bottom: 0; }
  .table.stack-sm td { display: block; position: relative; padding: 3px 0 3px 5.2rem; border: 0; overflow-wrap: anywhere; }
  .table.stack-sm td::before { content: attr(data-label); position: absolute; left: 0; top: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
  .table.stack-sm .inline-form { flex-wrap: wrap; }
}
.row-link { font-weight: 600; text-decoration: none; color: var(--text); }
.row-link:hover { text-decoration: underline; }

/* The statutory clock */
.clock { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; font-weight: 550; }
.clock .dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }
.clock.ok { color: var(--ok); }
.clock.ok .dot { background: var(--ok); }
.clock.soon { color: var(--warn); }
.clock.soon .dot { background: var(--warn); }
.clock.late { color: var(--danger); }
.clock.late .dot { background: var(--danger); }
.clock.none { color: var(--text-2); }
/* Reflow (WCAG 1.4.10): at 320px a long clock ("No fixed deadline · aim for Nov 24,
 * 2026") wraps instead of widening the page. */
@media (max-width: 600px) { .clock { white-space: normal; } }

.counts { display: inline-flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: 13px; }
.count.release { color: var(--release); }
.count.check { color: var(--check); font-weight: 650; }
.count.withhold { color: var(--withhold); }

/* New request */
details.new-request > summary { list-style: none; display: inline-flex; }
details.new-request > summary::-webkit-details-marker { display: none; }
details.new-request[open] > summary { margin-bottom: var(--space-4); }
details.new-request .card { margin-bottom: 0; }

/* Drop it */
.dropzone {
  border: 2px dashed var(--border-control);
  padding: var(--space-5);
  display: grid;
  gap: var(--space-3);
  background: var(--bg);
  margin-bottom: var(--space-4);
}
.dropzone.dragging { border-color: var(--accent); background: var(--raised); }
.dropzone label { display: grid; gap: var(--space-1); }
.upload-progress { display: grid; gap: var(--space-2); }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.4rem; gap: var(--space-1) var(--space-3); align-items: center; font-size: 13px; }
.upload-row .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upload-row progress { width: 100%; accent-color: var(--accent); }
.upload-row > span:last-child { grid-column: 1 / -1; }
.upload-row.failed > span:last-child { color: var(--danger); font-weight: 600; }
.upload-row.ok > span:last-child { color: var(--ok); }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.file-list .file { border: 1px solid var(--border); padding: var(--space-3); display: grid; gap: var(--space-1); }
.file-main { display: grid; min-width: 0; }
.file-name { overflow-wrap: anywhere; }
.file-state { display: flex; gap: var(--space-3); align-items: baseline; }
/* 24px tall to click, laid out as before (WCAG 2.5.8). */
.file-state a, input[type="file"] { padding-block: 2px; margin-block: -2px; }
.state { font-size: 12px; font-weight: 650; }
.state.processing { color: var(--warn); }
.state.done { color: var(--ok); }
.state.failed { color: var(--danger); }
.error-text { color: var(--danger); margin: 0; }

/* Review */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); align-items: center; }
/* The key hint stays on one line where it fits, and wraps on a phone (WCAG 1.4.10). */
.keys { white-space: nowrap; }
@media (max-width: 600px) { .keys { white-space: normal; } }
.items { display: grid; gap: var(--space-4); }
.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
}
.review-item.needs-check { border-left: 3px solid var(--check); }
.review-item.current { outline: 2px solid var(--focus); outline-offset: 2px; }
.item-head { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
/* The passage's heading (for screen-reader navigation) keeps the line's look. */
.item-head .item-title { font: inherit; margin: 0; }
.item-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4); }
.passage-text { white-space: pre-wrap; font-size: 14px; line-height: 1.7; }
mark { color: var(--text); padding: 0 1px; }
mark.redact.decision { background: var(--mark-decision); }
mark.redact.pattern { background: var(--mark-pattern); border-bottom: 2px dashed var(--mark-edge); }
mark.redact.person { background: var(--mark-person); border-bottom: 2px solid var(--text); }
mark.released { background: transparent; color: var(--ok); text-decoration: underline wavy; }
.hit { font-weight: 600; }
.hit.released { text-decoration: line-through; color: var(--text-2); }
.page-thumb { display: block; width: 7.2rem; border: 1px solid var(--border); overflow: hidden; align-self: start; }
.page-thumb img { display: block; width: 100%; height: auto; }
.item-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.item-actions details { flex: 1 1 17.6rem; }
.item-actions summary { cursor: pointer; font-weight: 600; color: var(--link); min-height: var(--control-h); display: flex; align-items: center; }
.item-actions details[open] { border: 1px solid var(--border); padding: 0 var(--space-4) var(--space-4); }
.comment-form { display: flex; gap: var(--space-2); flex: 1 1 14.4rem; }
.history { margin: var(--space-3) 0 0; padding-left: var(--space-5); color: var(--text-2); }

/* Packet */
.blockers { margin: 0 0 var(--space-4); padding-left: var(--space-5); }

/* Settings */
.subnav { display: flex; gap: var(--space-1); flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); flex-wrap: wrap; }
.subnav a { display: block; padding: var(--space-2) var(--space-3); text-decoration: none; color: var(--text-2); font-weight: 550; border-bottom: 3px solid transparent; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--hue, var(--accent)); }
.inline-form { display: inline-flex; gap: var(--space-2); align-items: center; }
.inline-form select { width: auto; }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.meter { display: grid; gap: var(--space-1); border: 1px solid var(--border); padding: var(--space-4); }
.big { font: 700 20px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.plans { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.plan-option { display: flex; gap: var(--space-3); align-items: baseline; border: 1px solid var(--border); padding: var(--space-3) var(--space-4); cursor: pointer; }
.plan-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.plan-chosen { background: var(--raised); padding: var(--space-3); font-size: 14px; }

/* Public pages (not in the shell). */
.public { max-width: 880px; margin: 0 auto; padding: 0 var(--space-5) var(--space-7); }
.public.download { max-width: 608px; }
.public-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); max-width: 880px; margin: 0 auto; padding: var(--space-5); }
.public-top nav { display: flex; gap: var(--space-4); align-items: center; }
.public-foot { border-top: 1px solid var(--border); max-width: 880px; margin: var(--space-6) auto 0; padding: var(--space-4) var(--space-5); }
.hero { padding: var(--space-6) 0 var(--space-5); max-width: 35.2rem; }
.hero h1 { font-size: 30px; letter-spacing: -0.02em; }
.lede { font-size: 15px; color: var(--text-2); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); font-weight: 650; margin-bottom: var(--space-1); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.4rem, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.price-card { background: var(--surface); border: 1px solid var(--border); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.price-card.featured { border: 2px solid var(--accent); }
.price-card.enterprise { background: var(--raised); }
.price-card h2 { margin: 0; }
.price-card ul { margin: 0; padding-left: var(--space-5); flex: 1; }
.price { margin: 0; }
.amount { font-size: 23.5px; font-weight: 700; letter-spacing: -0.02em; }
.per { color: var(--text-2); }
.fine-print { max-width: 35.2rem; color: var(--text-2); }
.downloads a { font-weight: 600; }

/* w5 overview: the overview, the reports and the annual report. */
.tiles > li, .questions > *, .split > * { min-width: 0; }
.tiles { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { display: grid; gap: 2px; align-content: start; padding: 13px 14px 12px; background: var(--surface); color: var(--text); text-decoration: none; height: 100%; }
a.tile:hover { background: var(--tint, var(--raised)); }
.tile.late .tile-n { color: var(--late); }
.tile.soon .tile-n { color: var(--soon); }
.tile-n { font: 750 25px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.tile-note { color: var(--text-2); font-size: 12px; }


.report-range { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); align-items: flex-end; margin-bottom: var(--space-2); }
.report-range .field { margin-bottom: var(--space-3); min-width: 8rem; }
.report-range .button { margin-bottom: var(--space-3); }
.report-range select { width: auto; min-width: 6.4rem; }

.chart h2 { font-size: 14px; }
.chart-scroll { overflow-x: auto; }
.chart-svg { display: block; width: 100%; min-width: 24rem; height: auto; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart-svg .axis text { fill: var(--text-3); font-size: 11.5px; font-family: var(--font); }
.chart-svg .mark { fill: var(--accent); }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart-svg .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-svg .hit { fill: var(--text); fill-opacity: 0; }
.chart-svg .bar:hover .hit { fill-opacity: 0.06; }
.chart-svg .bar:hover .mark, .chart-svg .bar:hover .dot { opacity: .85; }

.table.compact caption { text-align: left; color: var(--text-2); font-size: 13px; padding-bottom: var(--space-2); }
.table.compact th, .table.compact td { padding: var(--space-2) var(--space-3); }
.report-table th[scope="row"] { font-size: 14px; color: var(--text); font-weight: 600; white-space: nowrap; }
.report-table tfoot th, .report-table tfoot td { border-top: 2px solid var(--border-control); font-weight: 700; color: var(--text); }
.report-table td { white-space: nowrap; }
.table-wrap + .card { margin-top: var(--space-5); }
.definitions summary { cursor: pointer; font-weight: 600; color: var(--link); min-height: var(--control-h); display: flex; align-items: center; }
.definitions[open] summary { margin-bottom: var(--space-3); }

/* Reports and the annual report (w18): one column of questions, each with its number
 * first, how it is counted beside it, then one chart. */
.range-chips { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); margin-bottom: var(--space-4); }
.chip-link {
  display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 var(--space-3);
  border: 1px solid var(--border-control); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer; list-style: none;
}
.chip-link::-webkit-details-marker { display: none; }
.chip-link:hover { background: var(--raised); }
.chip-link[aria-current="true"] { background: var(--sel, var(--hue)); color: var(--on-sel, var(--on-hue)); border-color: transparent; font-weight: 650; }
.custom-range[open] { flex-basis: 100%; }
.custom-range[open] > summary { margin-bottom: var(--space-3); display: inline-flex; }
.menu-dl { position: relative; }
.menu-dl > summary { list-style: none; }
.menu-dl > summary::-webkit-details-marker { display: none; }
.menu-dl ul {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 15rem; margin: 0; padding: 6px 0;
  list-style: none; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.menu-dl li a { display: flex; align-items: center; min-height: var(--control-h); padding: 0 var(--space-4); color: var(--text); text-decoration: none; font-size: 14px; }
.menu-dl li a:hover { background: var(--raised); }
.page-head .actions:has(details.menu-dl[open]) { flex-basis: auto; }
.page-head .actions details.menu-dl[open] { width: auto; }
.questions { display: grid; gap: var(--space-5); max-width: 60rem; }
.questions > .card { margin: 0; }
.question h2 { margin-bottom: var(--space-3); }
.headline { margin-bottom: var(--space-4); }
.hl-main { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
.hl-n { font: 750 var(--fs-h1)/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hl-t { font-size: 16px; color: var(--text); }
.hl-more { margin: var(--space-2) 0 0; color: var(--text-2); font-size: 14px; }
.how { margin-top: var(--space-2); font-size: 13.5px; }
.how > summary { cursor: pointer; color: var(--link); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.how dl { margin: var(--space-2) 0 0; display: grid; gap: var(--space-1) var(--space-3); grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); }
.how dt { font-weight: 600; }
.how dd { margin: 0; color: var(--text-2); }
.now-line { margin: 0 0 var(--space-4); font-size: 14px; }
.now-line a.late { color: var(--late); font-weight: 650; }
.chart-h { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin: var(--space-4) 0 var(--space-2); }
.question .chart-scroll { max-width: 40rem; }
.chart-svg .mark-b { fill: var(--tint); stroke: var(--accent); stroke-width: 1.25; }
.chart-svg .bar:hover .mark-b { opacity: .85; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin: var(--space-2) 0 0; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; display: inline-block; }
.chart-legend .k-a { background: var(--accent); }
.chart-legend .k-b { background: var(--tint); box-shadow: inset 0 0 0 1.25px var(--accent); }
.bar-list { width: 100%; }
.bar-list caption { text-align: left; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bar-list th { font-weight: 500; text-align: left; width: 45%; font-size: 14px; }
.bar-list .bar-cell { width: 45%; }
.hbar { display: block; width: 100%; height: 10px; }
.hbar rect { fill: var(--accent); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-5); }
.more-table > summary, .month-table > summary { cursor: pointer; color: var(--link); font-weight: 600; min-height: var(--control-h); display: flex; align-items: center; gap: var(--space-2); }
.month-table > summary h2 { margin: 0; font-size: inherit; color: var(--text); }
.month-table[open] > summary, .more-table[open] > summary { margin-bottom: var(--space-3); }
.annual-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2) var(--space-4); }
.annual-facts dd { text-align: right; font-variant-numeric: tabular-nums; }

/* w5 share */
.asks .ask-list { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.ask { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3); border: 1px solid var(--border); border-left-width: 3px; background: var(--surface); }
.ask.waiting { border-left-color: var(--warn); }
.ask.done { border-left-color: var(--ok); }
.ask.changes { border-left-color: var(--danger); }
.ask.closed { border-left-color: var(--border-control); color: var(--text-2); }
.ask-main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1 1 14.4rem; overflow-wrap: anywhere; }
.ask-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: start; }
.ask-note { margin: var(--space-1) 0 0; padding-left: var(--space-3); border-left: 2px solid var(--border); color: var(--text-2); white-space: pre-wrap; }
.ask-new summary { cursor: pointer; font-weight: 600; color: var(--link); padding-block: 2px; margin-block: -2px; }
.ask-new form { margin-top: var(--space-4); }
.ask-new fieldset { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.ask-new legend { font-weight: 600; margin-bottom: var(--space-2); }
.public.share { max-width: 38.4rem; margin: 0 auto; }
.share .card { margin-bottom: var(--space-5); }
.share .letter { white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.check-items { display: grid; gap: var(--space-4); padding-left: var(--space-5); }
.check-items .passage-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--raised); padding: var(--space-3); }
.closed-link { margin-top: var(--space-6); }
.room-search { display: flex; gap: var(--space-2); margin: var(--space-5) 0; }
.room-search input { flex: 1; min-width: 0; }
.room-list, .hits { display: grid; gap: var(--space-4); padding: 0; }
.room-list h3, .hits h3 { margin: 0 0 var(--space-1); font-size: 15px; overflow-wrap: anywhere; }
.snippet { margin: var(--space-2) 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.snippet mark { background: var(--mark-decision); color: var(--text); padding: 0 2px; }
.pager { display: flex; justify-content: space-between; gap: var(--space-4); margin: var(--space-5) 0; }
.pager a[rel="next"] { margin-left: auto; }
.downloads li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.publish form { margin-top: var(--space-3); }

/* w5 maildrop */
.maildrop { margin-top: var(--space-5); }
.maildrop h3 { font-size: 14px; margin: var(--space-4) 0 var(--space-2); }
.maildrop-summary { font-size: 14.5px; margin: 0 0 var(--space-3); }
.maildrop-unread { max-height: 19.2rem; overflow-y: auto; }
.maildrop-unread li, .maildrop li { overflow-wrap: anywhere; }
.maildrop-trace { gap: var(--space-4); }
.maildrop-trace .card { margin: 0; }
.maildrop-trace h2 { font-size: 14.5px; }
.maildrop-trace h3 { font-size: 14px; margin: var(--space-3) 0 var(--space-1); }
.maildrop-trace ul { margin: 0; padding-left: var(--space-5); overflow-wrap: anywhere; }
.maildrop-trace .facts dd { overflow-wrap: anywhere; }

/* w5 repeat */
.repeat .matches { gap: var(--space-4); }
.match-row { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.match-row:first-child { border-top: 0; padding-top: 0; }
.match-head { font-weight: 600; }
.strength { font-size: 12px; font-weight: 650; padding: 2px var(--space-2); border: 1px solid currentColor; }
.strength.strong { color: var(--ok); }
.strength.possible { color: var(--check); }
.reasons { margin: var(--space-2) 0 var(--space-3); padding-left: var(--space-5); }
.flag-list { border-left: 3px solid var(--warn); padding-left: var(--space-3); margin: var(--space-3) 0; }
.flag-list ul { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
li.flag.block { color: var(--danger); font-weight: 600; }
.repeat-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-top: var(--space-3); }
.repeat-actions form { margin: 0; }
.standing-new { margin-bottom: var(--space-5); }
.standing-new > summary { display: inline-block; list-style: none; cursor: pointer; margin-bottom: var(--space-3); }
.standing-new > summary::-webkit-details-marker { display: none; }
.standing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--space-4); }
.confirm-files li { border-bottom: 1px solid var(--border); padding-bottom: var(--space-2); }

/* ================================================================ narrow screens */
/* The rail becomes a bottom bar; the flyout a sheet above it. */

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .workspace { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  :root:has(body.app) { scroll-padding-top: 60px; scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  nav.nav {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; width: 100%;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    border-top: 1px solid var(--line); overflow: visible; box-shadow: var(--bar-shadow);
  }
  .rail-mark, .rail-foot { display: none; }
  .rail-tile { width: auto; flex: 1; height: 64px; gap: 4px; font-size: 11px; }
  .rail-tile svg { width: 24px; height: 24px; }
  .flyout {
    top: auto; left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: auto; max-height: 60vh; border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .flyout.closed { transform: translateY(6px); }
  .fly-inner { width: 100%; padding-bottom: 6px; }
  .fly-note { display: none; }
  .topbar { padding-left: max(13px, env(safe-area-inset-left, 0px)); padding-right: max(13px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .main.page { padding-left: max(13px, env(safe-area-inset-left, 0px)); padding-right: max(13px, env(safe-area-inset-right, 0px)); }
  .agency span, .kbd { display: none; }
  .agency b { font-size: 14px; }
  .top-search { width: auto; flex: 1; }
  .topbar .me-top { display: grid; flex: none; }
  .me-menu { left: auto; right: max(10px, env(safe-area-inset-right, 0px)); bottom: auto; top: calc(51px + env(safe-area-inset-top, 0px)); transform-origin: top right; max-height: calc(100vh - 120px); }
  .hello h1, h1 { font-size: 22.5px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .wait-list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .w-side { display: flex; justify-content: flex-start; flex-wrap: wrap; padding: 0 10px 10px 53px; }
  .w-side > :empty { display: none; }
  .cols-head { display: none; }
  .irow { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .irow .stagecol, .irow .asgcol, .cols-head .asgcol { display: none; }
  .irow .irow-more { display: inline; }
  .irow .s { white-space: normal; }
  .lanes { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lane { padding: 10px 10px 9px; }
  .lane .n { font-size: 22px; }
  .sortf { margin-left: 0; }
  .request-grid, .grid-2, .meters, .item-body { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .public { padding: 0 var(--space-4) var(--space-6); }
  .hero h1 { font-size: 23.5px; }
  .auth-card { padding: var(--space-5); }
  .standing-grid, .split { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: var(--space-3); }
  .tile-n { font-size: 18.5px; }
  .annual-facts { grid-template-columns: 1fr; }
  .annual-facts dd { text-align: left; margin-bottom: var(--space-2); }
  .room-search { flex-direction: column; }
  .ask-actions { width: 100%; }
}
@media (max-width: 520px) {
  .top-search .kbd { display: none; }
  .lanes { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* A phone: the two weeks read down as a list, one row a day (the day on the left, what
 * is due on the right); closures stay one hatched row, "+N more" stays. */
@media (max-width: 600px) {
  .week-scroll { overflow: visible; padding: 10px 0 11px; }
  .week { flex-direction: column; min-width: 0; gap: 0; }
  .day, .day.past, .day.off {
    display: grid; grid-template-columns: 59px minmax(0, 1fr); column-gap: 11px; row-gap: 6px;
    padding: 10px 13px 10px 14px; border-top: 1px solid var(--line); flex: none;
  }
  .day:first-child { border-top: 0; }
  .day > * { grid-column: 2; }
  /* The month row becomes a divider above the month's first day; the rest go. */
  .day > .mrow { display: none; }
  .day > .mrow.start {
    display: flex; grid-column: 1 / -1; grid-row: 1; height: auto; margin: -10px -13px 0 -14px;
    padding: 8px 13px 6px 14px; background: var(--raised); border-bottom: 1px solid var(--line); box-shadow: none;
  }
  .day:has(> .mrow.start) > .day-head { grid-row: 2 / span 3; }
  .day > .day-head {
    grid-column: 1; grid-row: 1 / span 3; align-self: start; height: auto;
    flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; border: 0;
  }
  .day { min-width: 0; }
  .day.today .day-head, .day.past .day-head { border: 0; }
  .day.past .day-head { white-space: normal; }
  .day.past { box-shadow: inset 3px 0 0 var(--late); }
  .day.today { box-shadow: inset 3px 0 0 var(--sage); }
  .day-head .dd { font-size: 15px; }
  .today-tag { margin-left: 0; }
  .off-note { padding: 0; align-self: center; }
  .day-none { display: block; align-self: center; font-size: 12px; color: var(--text-3); }
  .chip { flex-direction: row; align-items: center; gap: 8px; }
  .chip .t { flex: 1; min-width: 0; overflow-wrap: break-word; }
  .chip .m { flex: none; }
  .week-key { padding-top: 3px; }
}

@media print {
  nav.nav, .flyout, .topbar, .me-menu, .notes, .daypop, .skip-link, .no-print, .page-head .actions { display: none !important; }
  .shell { display: block; }
  .main.page { padding: 0; }
  .card, .table-wrap, .panel { border-color: var(--border-control); break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* The Inbox's "New request" opens across the page head. */
.page-head { flex-wrap: wrap; }
.page-head .actions:has(details[open]) { flex-basis: 100%; }
.page-head .actions details[open] { width: 100%; }
.panel .table-wrap.flush { border: 0; border-top: 1px solid var(--line); margin-top: 11px; }
.notes-page .notes-list { padding: 5px 0; }
.room-search .button { min-height: var(--control-h); }
/* An icon inside a button sits beside its label at text size. */
.button > svg { width: 13px; height: 13px; flex: none; margin-right: 6px; vertical-align: -3px; fill: none; stroke: currentColor; }
/* Exemption usage (reports, annual report): the department split under the totals. */
.exemption-usage h3, .table-wrap:has(.exemption-table) + h3 { margin-top: var(--space-5); }
.exemption-table tr.group th { padding-top: var(--space-4); font-weight: 600; text-align: left; }
