/* Rotunda's one stylesheet.
 *
 * Extracted (2026-09) from app.py, where it lived as an ~865-line
 * Python string constant named STYLE. Comments elsewhere in app.py
 * that say "see STYLE" mean this file; app.py still reads it into a
 * constant of that name at import, and serves it at /static/style.css.
 *
 * PHN2ZyB2aWV3Qm94PSI0MTUgMzk5IDc3MCA3NzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTc2NCw0NDVhMzYsMzYgMCAwIDEgNzIsMFoiLz4KICA8cGF0aCBkPSJNNTA5LDczNUw1MDksNzAwQzUwOSw1NjAgNjQwLDQ2MiA4MDAsNDYyQzk2MCw0NjIgMTA5MSw1NjAgMTA5MSw3MDBMMTA5MSw3MzVMODAwLDY2OVoiLz4KICA8cGF0aCBkPSJNNDE1LDc5OUw4MDAsNzExTDExODUsNzk5TDExODUsODYyTDgwMCw3NzRMNDE1LDg2MloiLz4KICA8cGF0aCBkPSJNNTA5LDg4M0w1NzEsODY5TDU3MSwxMDY1TDUwOSwxMDY1WiIvPgogIDxwYXRoIGQ9Ik02ODAsODQ0TDc0Myw4MzBMNzQzLDEwNjVMNjgwLDEwNjVaIi8+CiAgPHBhdGggZD0iTTg1Nyw4MzBMOTE5LDg0NEw5MTksMTA2NUw4NTcsMTA2NVoiLz4KICA8cGF0aCBkPSJNMTAyOSw4NjlMMTA5MSw4ODNMMTA5MSwxMDY1TDEwMjksMTA2NVoiLz4KICA8cmVjdCB4PSI1MDkiIHk9IjExMDciIHdpZHRoPSI1ODIiIGhlaWdodD0iNjIiLz4KPC9zdmc+ below is not a CSS feature and not a typo:
 * app.py substitutes the base64-encoded brand mark into it at import
 * time (see BRAND_MARK_SVG there), so opening this file directly shows
 * the placeholder rather than the icon.
 */
  :root {
    /* Rotunda visual redesign (2026-08) — replaces the monochrome
       palette that itself replaced an earlier indigo/Linear one (see
       git history: #27 tried reintroducing color on secondary buttons,
       #30 reverted it). This is a deliberate, larger reversal of that
       revert, built from a Claude Design mockup the team approved —
       not a regression back to #27's version. Same token *names* as
       before on purpose, so the hundreds of existing rules below that
       reference --ink/--paper/--slate/etc. by name pick up the new
       values for free; only the values themselves, plus a handful of
       new tokens (--bg, --gold, --warn, --info, --radius-lg), change
       here. --content-bg is the sidebar-shell (app_shell()) page
       background — in this design it's intentionally the SAME value as
       --paper (the chrome bg), since the mockup has no separate "bar"
       color at all: sidebar/topbar/content all sit on one flat --bg,
       divided only by 1px hairlines (--rule). --surface is the one
       token that still reads as a distinct "raised" tone (cards/panels/
       dropdowns/modals) — the mockup's own cards are actually
       transparent+border, but keeping --surface non-transparent for
       now avoids relitigating every .card/.panel rule in this pass;
       see the redesign follow-up for per-page component work. */
    /* v5 (Rotunda Dashboard v5 mockup): a warm grey canvas (--bg) under a
       lighter sheet (--paper, the chrome), a sidebar a step darker than
       the sheet, white cards edged in --rule-card. */
    --bg: #ffffff; --ink: #14181f; --paper: #ffffff; --content-bg: #ffffff; --surface: #ffffff;
    --sidebar: #f4f5f6; --ink-2: #5b6270; --muted: #5c6370; --link: #2563eb;
    /* The signed-in shell's own greys, from the Wispr Flow-style sidebar
       the founder approved (Oct 29 2026): the page ground behind every
       app_shell() page, the sidebar's hairlines and quiet labels, and its
       setup card. Highlights (active row, badge, fills, ticks) stay the
       app's own tokens. --content-bg is left alone: it is also the soft
       hover tint inside cards, which a Flow page ground would erase. */
    --shell-main: #ffffff; --shell-rule: #e4e6e9; --shell-muted: #5f6672;
    --shell-card: #ffffff; --shell-card-rule: #e4e6e9;
    /* Flow-style redesign (founder, Oct 29 2026; docs/mockups/
       flow-style-mockup.html): the canvas the sidebar and topbar sit on,
       around the page's rounded window, and the one accent its setup
       bar and summary panel use. */
    --flow-canvas: #f4f5f6; --flow-accent: #111315; --flow-panel: #f9fafb; --flow-chip: #f1f2f4;
    --gold: #8A6A18;
    --slate: color-mix(in srgb, var(--ink) 65%, transparent);
    --rule: color-mix(in srgb, var(--ink) 9%, transparent); /* ≈ #e7e5de on the sheet */
    --rule-soft: color-mix(in srgb, var(--rule) 50%, transparent); /* table row dividers: half a hairline */
    /* --rule at 14% measures 1.35:1 against either ground. Fine for a
       divider — WCAG 1.4.11 doesn't govern decoration — and not fine for
       the visual boundary of a control, which is what tells a
       low-vision reader an input is there at all and needs 3:1. So the
       hairline that separates rows and the outline that IS the control
       are now two tokens.

       48% is where light mode clears the bar: #111 at that alpha on the
       cream ground measures 3.29:1, and the same alpha of white on black
       measures 4.92:1. Light is the binding case by a wide margin, which
       is why the number looks heavier than a dark-mode-only reading
       would suggest. Measured, not guessed, and re-measured on every
       test run — see tests/test_contrast.py. */
    --rule-strong: color-mix(in srgb, var(--ink) 48%, transparent);
    /* And a third weight, between the two, for the border that is the
       whole outline of a card rather than a divider inside one. A card
       is not a control, so 1.4.11's 3:1 doesn't govern it and
       --rule-strong reads far too heavy at card size — but --rule's
       1.35:1 is close to invisible in bright outdoor light, which is
       the reading condition for someone checking a hearing between
       committee rooms. 30% measures ~2:1 on the cream ground and
       ~2.5:1 on black: clearly above the hairline it replaces, clearly
       below the outline that means "this takes input". Measured on
       every test run — see tests/test_contrast.py.

       The exception is the mobile bill card, which uses --rule-strong:
       there the border isn't decoration around content that has other
       boundaries, it is the ONLY thing separating one bill from the
       next. */
    --rule-card: color-mix(in srgb, var(--ink) 30%, transparent);
    /* The ONE card edge (calm-down D2): every card, panel and status strip
       inside the page frame is edged in this, never in --rule-card (which
       is a control's edge and is far brighter). */
    --card-edge: var(--shell-card-rule);
    --accent: var(--link);
    /* --accent-solid/--accent-solid-text are the button-fill pair — in
       dark mode the fill inverts (light pill, dark text) while --accent
       above stays a light-on-dark *text* color, so one variable can't
       do both. --accent-solid-hover is the mockup's own style-hover
       swap (a solid near-black/near-white pill goes fully black/white
       on hover) — real buttons below now use this instead of a generic
       opacity fade. */
    --accent-solid: #14181f; --accent-solid-text: #ffffff; --accent-solid-hover: #2a303b;
    --accent-soft: color-mix(in srgb, var(--ink) 8%, transparent);
    /* Status/position color system: one hue per meaning (early=blue,
       active/watch=amber, passed/support=green, failed/oppose=red),
       fixed lightness+chroma per theme so only the hue varies — ported
       directly from the mockup's own hue()/statusColor()/rag() JS
       (same H values: 245/85/145/25). --good/--error keep their
       existing names (passed/failed) since dozens of rules already
       reference them; --warn/--info are new (active-or-watch /
       introduced-or-in-committee). *-soft variants are translucent
       tints of the hue itself now, not independent flat colors, so a
       badge's soft background always stays in the same family as its
       own text/dot color. */
    --good: oklch(0.44 0.13 145); --good-soft: color-mix(in srgb, var(--good) 16%, transparent);
    --error: oklch(0.44 0.13 25); --error-soft: color-mix(in srgb, var(--error) 16%, transparent);
    --warn: oklch(0.44 0.13 85); --warn-soft: color-mix(in srgb, var(--warn) 16%, transparent);
    --info: oklch(0.44 0.13 245); --info-soft: color-mix(in srgb, var(--info) 16%, transparent);
    --shadow-rest: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.10);
    /* The rest of the shadow and scrim vocabulary (whole-app audit Y31),
       so a hand-typed shadow can't drift in one rule at a time — there
       were thirteen, one copied into four menus. --shadow-pop is every
       anchored menu/dropdown; --shadow-float the dark toast and tooltip
       chips; --shadow-drawer the off-canvas sidebar; --shadow-up a bar
       or sheet pinned to the bottom (it casts upward); --ring-focus the
       soft halo on a focused field. --scrim is the one page-dimming
       overlay behind a modal, sheet, palette or drawer (it was 0.40 in
       three places and 0.45 in one). Pure black at an alpha reads the
       same on either ground, so none of these is redeclared per theme;
       in dark mode a menu's edge comes from its --rule-card border, not
       its shadow. tests/test_tokens_a11y_markup.py holds the file to
       these. */
    --shadow-pop: 0 4px 14px rgba(0,0,0,0.16);
    --shadow-float: 0 10px 30px -12px rgba(0,0,0,0.5);
    --shadow-drawer: 0 0 40px rgba(0,0,0,0.25);
    --shadow-up: 0 -4px 16px -8px rgba(0,0,0,0.4);
    --ring-focus: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
    --scrim: rgba(0,0,0,0.4);
    /* The handful of border-radius values actually used below (4-8px)
       collapse into these two tokens; 999px pills get their own, and
       --radius-lg is the mockup's card/panel/search-bar radius, now
       consumed by every card in the app: .card, .panel, .stat-card,
       .modal-panel, .current-status-card and the mobile bill card all
       used to hardcode their own radius, and all but the bill card
       hardcoded 18px, so a bill card and the panel holding it didn't
       match. One value, in one place — if 12px is the wrong call, this
       line is the whole change. Left
       alone on purpose: 50% and the two circular dots (.step-dot,
       .status-badge::before) that use a fixed pixel radius instead of
       50% only because their box is sized in rem, not px — those are
       circles, not rounded rectangles, so they're not part of this
       scale. */
    /* --radius-xs is the corner on a tiny colour swatch (a party dot, a
       vote-legend key) — 6px would turn a 7px square into a circle. */
    --radius-xs: 2px; --radius-sm: 10px; --radius-md: 12px; --radius-lg: 18px; --radius-pill: 999px;
    /* A button's corner (design system Button: 6px). Its own token, not
       a scale step, so a button and the 10px field beside it can differ
       on purpose. The whole rule, by what a thing is: anything pressed
       to act or go (buttons, links styled as buttons, back links, Undo,
       the flag toggle) takes --radius-button; anything typed into or
       picked from (fields, filter dropdowns and tabs) takes --radius-sm,
       the design system's 10px; a label or chip naming a state or topic
       (status, position, counts, chips) is a --radius-pill. */
    --radius-button: 6px;
    --icon-pencil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
    /* The app window's own corner (design system --radius-window): one
       box in the whole app takes it, .app-shell above 900px. */
    --radius-window: 20px;
    /* The frame (design system tokens/spacing.css): how far the window
       sits inside the canvas, the sidebar's width, a nav row's height,
       and the two shadows the frame casts — the window on the canvas and
       the raised pill under the current nav item. The design system's
       own names, kept as they are so its component specs read straight
       across. */
    --window-inset: 14px; --sidebar-width: 248px; --nav-item: 34px;
    /* v5 dashboard names (docs/design-system tokens/colors.css), fed
       from the app's own tokens so both themes follow without a dark
       copy: the segmented track, the tint behind an Urgent triage row,
       and the tile tones (IconTile / LetterTile / DateTile). */
    --paper-50: color-mix(in srgb, var(--ink) 3%, var(--surface));
    --paper-250: color-mix(in srgb, var(--ink) 5%, var(--surface));
    --paper-350: color-mix(in srgb, var(--ink) 6%, var(--paper));
    --urgent-row: color-mix(in srgb, var(--error) 4%, var(--surface));
    --shadow-window: 0 0 0 1px rgba(20,24,31,0.06), 0 20px 50px -24px rgba(20,24,31,0.25);
    /* The current item in any nav (sidebar, Settings rail, Compliance rail,
       onboarding stepper): a soft fill, no edge and no shadow (UI
       calm-down, Oct 22 2026). A mix of --ink, so one definition follows
       both themes; deeper than the 5% hover tint so "you are here" is
       never mistaken for "the pointer is here". */
    --nav-active: color-mix(in srgb, var(--ink) 9%, transparent);
    --nav-hover: color-mix(in srgb, var(--ink) 5%, transparent);
    /* The spacing scale (UX audit F). Every margin, padding and gap in
       the app is one of these — before this there were ~40 distinct
       literal values (0.35rem, 0.4rem, 1.15rem, ...) beside a six-step
       scale most rules ignored, so neighbouring panels never quite
       lined up. space-0 is the 2px hairline step (nav item stacking,
       badge nudges); 7/8 are page-level section spacing. Not redeclared
       in the dark :root — spacing doesn't change between themes.
       tests/test_design_tokens.py holds the file to this list; 0, auto,
       1px/-1px (border compensation) and clamp() are the exceptions. */
    --space-0: 2px; --space-1: 4px; --space-2: 8px; --space-3: 12px;
    --space-4: 16px; --space-5: 24px; --space-6: 32px;
    --space-7: 48px; --space-8: 64px;
    /* Motion: three speeds and two curves, so every fade, slide and hover
       moves at the same calm pace. fast = hover and press feedback; base =
       a menu, popup or row appearing; slow = a panel or drawer sliding in.
       Spinners, loading pulses and the reduce-motion reset keep their own. */
    --dur-fast: .12s; --dur: .2s; --dur-slow: .3s;
    --ease: ease; --ease-out: cubic-bezier(.2, .8, .2, 1);
    /* The type scale (UX audit F15/S7). Every font-size in the app is
       one of these — the Flagged page alone had fifteen distinct sizes,
       down to 9.9px, which erased the hierarchy they were meant to
       draw. 2xs is the floor (uppercase micro-labels, column heads,
       badges); nothing renders smaller. body stays 16px (= base), since
       inputs inherit it and anything under 16px makes iOS zoom on focus.
       tests/test_type_scale.py holds the file to this list. */
    --text-2xs: 0.75rem;   /* 12px — the floor; labels, eyebrows, meta */
    --text-xs: 0.8rem;     /* 12.8px — meta, captions, secondary lines */
    --text-sm: 0.875rem;   /* 14px   — table cells, nav, dense body */
    --text-base: 1rem;     /* 16px   — body, panel titles */
    --text-md: 1.15rem;    /* 18.4px — bill/modal titles */
    --text-lg: 1.4rem;     /* 22.4px — page h1 */
    --text-xl: 1.7rem;     /* 27.2px — stat numbers */
    --text-display: 2.2rem; /* 35.2px — dashboard highlights, sign-in h1 */
    /* Body copy is Geist (see FONT_LINKS), the mockup's declared body/UI
       face, rather than the system stack. The mockup's own body stack is
       "Geist, system-ui, sans-serif"; the fallback to system-ui keeps
       text painting if Geist hasn't loaded, and Geist self-hosts so
       nothing is fetched from a third party. --font-serif is the
       mockup's one deliberate exception — an editorial-style headline
       in Instrument Serif — and still isn't consumed by anything, so
       the webfont it named is no longer downloaded on every page load
       for nobody (see FONT_LINKS). The token stays, pointed at a
       serif every machine already has; the day a headline actually
       wants Instrument Serif it comes back as one family in FONT_LINKS
       and one word here. --mono has one job: bill numbers ("AB 1024"),
       where a fixed-width face lets a column of them line up and keeps
       "SB 1" from reading as "SB l". Nothing else is set in it — not
       counts (tabular-nums does that), not key hints, not the prose
       around a bill number, not a letter (whole-app audit Y23). */
    --font-sans: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Libre Caslon Text is the display face (founder, Nov 25 2026) — the
       headline on the landing/auth heroes, the page-head titles and the
       wordmark (see DISPLAY_FACES in app.py: its 400 file answers the
       500 weight asked for here, its 700 the 600). It's headings only;
       body copy and small labels stay --font-sans. The stack falls
       through to a system serif so a heading keeps its shape if it
       hasn't loaded. */
    --font-display: 'Libre Caslon Text', Georgia, "Times New Roman", serif;
    --font-serif: Georgia, "Times New Roman", serif;
    --mono: 'Geist Mono', ui-monospace, monospace;
    /* Drawn icons for the places that used to print a typed glyph (arrows, ticks,
       crosses, pencils). Same stroke style as the sidebar's (round caps, no fill);
       painted as a mask in currentColor, so they follow each chip's own colour in
       both themes. See .icn and the mask group beside .status-badge. */
    --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
    --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
    --icon-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3C/svg%3E");
    --icon-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E");
    --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
    --icon-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
    --icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
    --icon-equals: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9h14M5 15h14'/%3E%3C/svg%3E");
    --icon-pencil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
    --icon-scale: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M7 21h10M5 7h14'/%3E%3Cpath d='m5 7-3 7a3 3 0 0 0 6 0Zm14 0-3 7a3 3 0 0 0 6 0Z'/%3E%3C/svg%3E");
    --icon-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
    --icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
    --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
    --icon-votes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v9M8 8.5h8M8 19h8'/%3E%3C/svg%3E");
    /* One definition covers both themes — .brand-mark masks this
       shape and fills it with --ink, which already flips per theme on
       its own, so this doesn't need the redefine-in-three-places
       pattern every actual *color* above uses. */
    --brand-mark: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSI0MTUgMzk5IDc3MCA3NzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTc2NCw0NDVhMzYsMzYgMCAwIDEgNzIsMFoiLz4KICA8cGF0aCBkPSJNNTA5LDczNUw1MDksNzAwQzUwOSw1NjAgNjQwLDQ2MiA4MDAsNDYyQzk2MCw0NjIgMTA5MSw1NjAgMTA5MSw3MDBMMTA5MSw3MzVMODAwLDY2OVoiLz4KICA8cGF0aCBkPSJNNDE1LDc5OUw4MDAsNzExTDExODUsNzk5TDExODUsODYyTDgwMCw3NzRMNDE1LDg2MloiLz4KICA8cGF0aCBkPSJNNTA5LDg4M0w1NzEsODY5TDU3MSwxMDY1TDUwOSwxMDY1WiIvPgogIDxwYXRoIGQ9Ik02ODAsODQ0TDc0Myw4MzBMNzQzLDEwNjVMNjgwLDEwNjVaIi8+CiAgPHBhdGggZD0iTTg1Nyw4MzBMOTE5LDg0NEw5MTksMTA2NUw4NTcsMTA2NVoiLz4KICA8cGF0aCBkPSJNMTAyOSw4NjlMMTA5MSw4ODNMMTA5MSwxMDY1TDEwMjksMTA2NVoiLz4KICA8cmVjdCB4PSI1MDkiIHk9IjExMDciIHdpZHRoPSI1ODIiIGhlaWdodD0iNjIiLz4KPC9zdmc+");
    /* The page-with-a-folded-corner tile at the head of each bill row
       (Flow-style rows), masked and filled like --brand-mark. */
    --bill-row-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M4 2h6l3 3v9H4z'/%3E%3Cpath d='M10 2v3h3'/%3E%3C/svg%3E");
  }
  /* :not([data-theme="light"]) so an explicit light choice (the
     manual toggle below, see account_widget()) beats the OS
     preference — without that guard, someone on a dark-mode OS who
     explicitly picks "light" here would still get this block's
     values, since a media query alone can't know about the toggle. */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      /* Near-black rather than pure #000, matching the approved mockup
         (--bg #08090A, panel/card --surface #0F1011, off-white ink
         #F7F8F8). tests/test_contrast.py measures the dark ramp on
         exactly these values, read out of this file — it used to use a
         pure white-on-black stand-in, which flattered the greys (Y32). */
      --bg: #141414; --ink: #F7F8F8; --paper: #1b1b1b; --content-bg: #1b1b1b; --surface: #212121;
    --sidebar: #141414; --ink-2: #A9AFBA; --muted: #969CA8; --link: #9DB6DC;
    --shell-main: #1b1b1b; --shell-rule: #2a2a2a; --shell-muted: #a3a29d;
    --shell-card: #1b1b1b; --shell-card-rule: #2f2f2f;
    --flow-canvas: #141414; --flow-accent: #7fd1b5; --flow-panel: #181818; --flow-chip: #262626;
    /* Native scrollbars and form chrome follow the theme too, or they
       stay bright white on the charcoal canvas. */
    color-scheme: dark;
      --gold: #C9B27A;
      --accent-solid: #F2F3F5; --accent-solid-text: #14181f; --accent-solid-hover: #D9DCE1;
      --good: oklch(0.76 0.12 145); --error: oklch(0.76 0.12 25);
      --warn: oklch(0.76 0.12 85); --info: oklch(0.76 0.12 245);
      --shadow-rest: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
      --shadow-hover: 0 18px 40px rgba(0,0,0,0.35);
      --shadow-window: 0 0 0 1px rgba(255,255,255,0.05), 0 20px 50px -24px rgba(0,0,0,0.7);
    }
  }
  /* The other half of the manual override: an explicit dark choice
     wins regardless of OS preference. Same values as the media-query
     block above, kept as its own always-applies rule (not folded into
     it) since [data-theme="dark"] needs to win even on a light-mode
     OS, where that media query never matches at all. */
  :root[data-theme="dark"] {
    --bg: #141414; --ink: #F7F8F8; --paper: #1b1b1b; --content-bg: #1b1b1b; --surface: #212121;
    --sidebar: #141414; --ink-2: #A9AFBA; --muted: #969CA8; --link: #9DB6DC;
    --shell-main: #1b1b1b; --shell-rule: #2a2a2a; --shell-muted: #a3a29d;
    --shell-card: #1b1b1b; --shell-card-rule: #2f2f2f;
    --flow-canvas: #141414; --flow-accent: #7fd1b5; --flow-panel: #181818; --flow-chip: #262626;
    /* Native scrollbars and form chrome follow the theme too, or they
       stay bright white on the charcoal canvas. */
    color-scheme: dark;
    --gold: #C9B27A;
    --accent-solid: #F2F3F5; --accent-solid-text: #14181f; --accent-solid-hover: #D9DCE1;
    --good: oklch(0.76 0.12 145); --error: oklch(0.76 0.12 25);
    --warn: oklch(0.76 0.12 85); --info: oklch(0.76 0.12 245);
    --shadow-rest: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-hover: 0 18px 40px rgba(0,0,0,0.35);
    --shadow-window: 0 0 0 1px rgba(255,255,255,0.05), 0 20px 50px -24px rgba(0,0,0,0.7);
  }
  * { box-sizing: border-box; }

  /* One blanket honouring of the OS "reduce motion" setting, for the
     whole stylesheet. Before this, exactly two things respected it
     (#page-progress's transition and the toast entrance) while the
     spinner's infinite spin, .skeleton-bar's infinite opacity pulse on
     every list page, the nav caret rotation and every transition ran
     regardless — and an infinite opacity loop is the specific pattern
     that triggers vestibular discomfort.

     0.01ms rather than `none`: an animation that still runs, just
     instantly, so anything that keys off animationend (or a
     transitionend) still fires and no state machine hangs waiting.
     iteration-count:1 is what actually stops the two infinite ones.
     !important because these have to beat rules anywhere below,
     including the media-query blocks. The JS half of this lives at
     each smooth-scroll call site — see calendar_body.html,
     directory_body.html and disclosure_review_body.html. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
  body {
    margin: 0; background: var(--content-bg); color: var(--ink);
    font: 16px/1.5 var(--font-sans);
    -webkit-font-smoothing: antialiased;
  }
  /* A handful of plain, unclassed <a> tags (e.g. a client's name in the
     flagged-bills list) had no color rule anywhere, so they fell back to
     the browser's own default link blue instead of the app's palette —
     this is the one place that acts as a fallback for those. Anywhere
     that already sets its own color (.secondary, .primary, .panel-link,
     etc.) keeps doing so — a class selector beats this bare-tag one. */
  /* THE link (UI calm-down, Oct 22 2026): navy (--link), no underline,
     going to ink on hover (no hover underline, Oct 25 2026) — the design system's link
     button, now the only look a text link has. There used to be three:
     underlined blue, plain blue, and gold-on-hover (a:hover warmed every
     link to --gold). Links inside a running sentence also keep a soft
     underline at rest, so colour is never the only cue (WCAG 1.4.1). A
     link a page rule gives its own colour (.secondary, .primary, a row
     title) keeps that; new text links take this one and add nothing. */
  a { color: var(--link); text-decoration: none; }
  @media (hover: hover) { a:hover { color: var(--ink); } }
  :is(p, .sub, .empty, .field-hint) a:not(.primary, .secondary, .danger, .tag, .edit-btn),
  :is(p, .sub, .empty, .field-hint) .linklike {
    text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.2em;
  }
  /* No border-radius here. This rule outranks the base .primary/
     .secondary/.filter-tab/button rules (a :focus-visible pseudo-class
     beats a bare class), so setting a radius on the *element* snapped
     every 999px pill into a 6px rectangle the instant it took keyboard
     focus — the one state only keyboard users ever see, and the one
     that looked broken. Browsers already clip `outline` to the
     element's own radius, so the declaration bought nothing. */
  a:focus-visible, button:focus-visible, input:focus-visible,
  select:focus-visible, summary:focus-visible, textarea:focus-visible,
  details:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--ink); outline-offset: 2px;
  }
  /* A field clicked or tapped into shows only its darkened edge; the
     ring is for people moving with Tab, who need to see where they
     landed (founder, Oct 30 2026: the gold looked dated, the ring
     unneeded for a mouse). Browsers count a text field as
     :focus-visible however it was reached, so focus.js records how
     focus last moved on <html>, starting at pointer; no attribute
     (script not run) keeps every ring. The search boxes carry the ring on their
     wrapper, so they are listed too. */
  :root[data-focus-by="pointer"] :is(input, select, textarea):focus-visible,
  :root[data-focus-by="pointer"] :is(.search-bar-field, .search-box, .dir-search-box, .palette-search):focus-within {
    outline: none;
  }
  /* Focus the app moves itself (onto the page after a click, tabindex
     -1) draws no ring — it outlined the whole page in gold on page
     change (founder, Oct 29 2026). Tab-reachable controls keep it. */
  [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
  ::selection { background: var(--accent-solid); color: var(--accent-solid-text); }
  .wrap { max-width: 46rem; margin: 0 auto; padding: var(--space-6) var(--space-5) var(--space-8); }
  /* Auth pages (/login, /signup, /forgot, /reset, /join) — v5
     (docs/design-system: Card, forms, actions). The dome mark, a serif
     display-face title and a one-line muted subtitle stacked above
     the form, which sits in a white Card: 18px corners on a hairline,
     no shadow. Plain paper behind it — the design system has no
     gradients and no imagery in the app, so the old gold glow and ring
     outlines are gone. Buttons and fields keep the app's own shape
     (button shape changes app-wide in one pass); field labels are the
     app's own (ink, so a label never reads as help text); links are navy and
     go to ink on hover; the checkbox is navy when ticked. */
  .auth-wrap { max-width: 26rem; padding-top: var(--space-7); text-align: center; }
  .auth-mark { margin: 0 auto var(--space-4); }
  .auth-wrap h1 {
    font-size: var(--text-display); font-weight: 500; line-height: 1.05; letter-spacing: -0.015em;
    margin: 0 0 var(--space-3); text-wrap: balance;
  }
  .auth-sub { color: var(--ink-2); font-size: var(--text-base); margin: 0 auto var(--space-6); max-width: 22rem; text-wrap: pretty; }
  /* /accessibility: a page of reading on the auth pages' plain shell. */
  .statement-wrap { max-width: 44rem; padding-top: var(--space-7); padding-bottom: var(--space-8); }
  .statement-wrap h1 { font-size: var(--text-display); font-weight: 500; line-height: 1.05; margin: 0 0 var(--space-4); }
  .statement-wrap h2 { font-size: var(--text-md); margin: var(--space-6) 0 var(--space-2); }
  .statement-wrap li { margin-bottom: var(--space-2); }
  /* .card.auth-card, not .auth-card: .card is defined further down the
     file, so it needs the extra class to win. */
  .card.auth-card {
    background: var(--surface); border-color: var(--rule); box-shadow: none;
    padding: var(--space-5); margin-bottom: 0; text-align: left;
  }
  .auth-card .req-legend { color: var(--ink-2); }
  /* Sign In's two forms (password, then two-step's code): `form`'s display:flex would show a hidden one. */
  .auth-card form[hidden] { display: none; }
  .auth-submit { width: 100%; justify-content: center; margin-top: var(--space-2); }
  .auth-alt { color: var(--ink-2); font-size: var(--text-sm); margin: var(--space-5) 0 0; }
  .auth-alt a { color: var(--link); font-weight: 500; }
  @media (hover: hover) { .auth-alt a:hover, .auth-forgot:hover { color: var(--ink); } }
  .auth-wrap #loading, .auth-wrap #error { justify-content: center; margin-top: var(--space-4); }
  /* Sign In's password label with "Forgot password?" at the far end, beside the field it's about. */
  .auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
  .auth-forgot { display: inline-flex; align-items: center; min-height: 1.5rem; font-size: var(--text-xs); font-weight: 500; color: var(--link); }
  /* /forgot's "Check your email", in place of the form it replaces —
     the same white Card the form sat in. */
  .auth-sent {
    text-align: left; margin-top: var(--space-2); padding: var(--space-5);
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  }
  .auth-sent p { margin: 0; font-size: var(--text-sm); }
  .auth-sent p + p { margin-top: var(--space-2); }
  /* /oauth/authorize, the Allow page for a connected app (oauth.py):
     reading, not a form, so its paragraphs sit apart; the two choices
     stack full width like the sign-in button. */
  .connect-card p { font-size: var(--text-sm); margin: 0 0 var(--space-3); }
  .connect-list { font-size: var(--text-sm); margin: 0 0 var(--space-3); padding-left: var(--space-5); }
  .connect-list li { margin-bottom: var(--space-1); }
  .connect-app-note { color: var(--ink-2); }
  .connect-warn { color: var(--warn); font-weight: 500; }
  .connect-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
  .connect-actions .auth-submit { margin-top: 0; }
  .auth-wrap .step-indicator { justify-content: center; flex-wrap: wrap; margin: 0 auto var(--space-5); }

  /* Sign-in page chrome (.auth-page): a column at least a screen tall,
     so the footer sits at the bottom of the page on a short form rather
     than just under it; the "Keep me signed in" row; the footer. */
  .auth-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .auth-page main { position: relative; z-index: 1; flex: 1 0 auto; }

  .auth-remember { flex: 1 1 100%; display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-0); cursor: pointer; user-select: none; font-size: var(--text-sm); color: var(--ink-2); min-height: 1.5rem; }
  .auth-remember input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }

  .auth-footer {
    position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: var(--space-4);
    padding: var(--space-4) var(--space-5) var(--space-5);
  }
  .auth-footer-brand { font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm); color: var(--ink-2); }
  @media (max-width: 640px) {
    .auth-wrap { padding-top: var(--space-6); }
    .auth-wrap h1 { font-size: var(--text-xl); }
    .card.auth-card, .auth-sent { padding: var(--space-4); }
  }

  /* Onboarding wizard (/onboarding) — a left vertical stepper beside the
     current step. Two columns on desktop, stacked on narrow. v5
     (docs/design-system): serif display-face titles; the current
     step a raised white pill like the sidebar's active nav item;
     field labels stay the app's own (ink, unlike help text);
     the progress label in sentence case; ticked boxes navy. */
  .onboarding {
    max-width: 58rem; margin: 0 auto; padding: var(--space-6) var(--space-5) var(--space-8);
    display: grid; grid-template-columns: 17rem 1fr; gap: var(--space-6); align-items: start;
  }
  .onboarding-mark { display: block; margin-bottom: var(--space-4); }
  .onboarding-title { font-size: var(--text-lg); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--space-2); }
  .onboarding-steps .sub { margin: 0 0 var(--space-5); color: var(--ink-2); }
  .ob-stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
  .ob-step { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm); }
  .ob-step.active { background: var(--nav-active); }
  .ob-num {
    flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--text-xs); font-weight: 600; border: 1px solid var(--rule-strong); color: var(--ink-2);
  }
  .ob-step.active .ob-num { background: var(--accent-solid); color: var(--accent-solid-text); border-color: var(--accent-solid); }
  .ob-step.done .ob-num { background: var(--good-soft); color: var(--good); border-color: var(--good); }
  .ob-step.done .ob-num::after { content: ""; --ic: var(--icon-check); }
  .ob-step.done .ob-num { font-size: 0; }
  .ob-step.done .ob-num::after { font-size: var(--text-sm); }
  .ob-label { display: flex; flex-direction: column; line-height: 1.3; }
  .ob-label strong { font-size: var(--text-sm); font-weight: 500; }
  .ob-step:not(.active) .ob-label strong { color: var(--ink-2); }
  .ob-sub { font-size: var(--text-xs); color: var(--muted); }
  .onboarding-main { min-width: 0; }
  .onboarding-step-title { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--space-2); }
  .onboarding-step .sub { margin-top: 0; color: var(--ink-2); text-wrap: pretty; }
  .onboarding input[type="checkbox"] { accent-color: var(--accent); }
  .ob-field { display: block; margin-top: var(--space-4); flex: 1 1 100%; }
  .ob-field[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .onboarding-nav { display: flex; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
  .onboarding-nav #ob-next { margin-left: auto; }
  .ob-bill-form { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }
  /* Step 3's title-search results: light rows from /api/search, each
     with its own Flag button. */
  .ob-results { margin-top: var(--space-4); }
  .ob-results-count { margin: 0 0 var(--space-2); }
  .ob-result-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
  .ob-result {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-2) 0; border-bottom: 1px solid var(--rule);
  }
  .ob-result-text { min-width: 0; font-size: var(--text-sm); line-height: 1.4; }
  .ob-result-text strong { font-weight: 500; font-variant-numeric: tabular-nums; margin-right: var(--space-1); }
  .ob-result-title { color: var(--ink-2); }
  .ob-result .ob-result-flag, .ob-result .ob-bill-chip-flagged { flex: none; }
  /* Step 3's clients from the firm's CAL-ACCESS filings (Oct 7 audit T3):
     a ticked client row, its filing's bills indented under it. */
  .ob-result .ob-finder-use { flex: none; white-space: nowrap; }
  .ob-filings { margin-top: var(--space-4); }
  .ob-filings-title { font-weight: 500; font-size: var(--text-md); letter-spacing: -0.01em; margin: 0 0 var(--space-1); }
  .ob-filing-client { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
  .ob-filing-bills { list-style: none; margin: var(--space-1) 0 0; padding: 0 0 0 var(--space-5); }
  .ob-check { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); line-height: 1.4; }
  .ob-check strong { font-weight: 500; font-variant-numeric: tabular-nums; }
  .ob-filings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
  /* Step 1's "Start from your paperwork" drop box (setup_files.py): a
     dashed target the whole width of the step, a line per file read. */
  .ob-drop-zone { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); margin-top: var(--space-2); padding: var(--space-4) var(--space-3); border: 1px dashed var(--rule-strong); border-radius: var(--radius-md); text-align: center; font-size: var(--text-sm); cursor: pointer; }
  .ob-drop-zone.is-over { border-color: var(--accent); background: var(--accent-soft); }
  @media (hover: hover) { .ob-drop-zone:hover { border-color: var(--accent); } }
  .ob-drop-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .ob-drop-browse { color: var(--accent); text-decoration: underline; }
  .ob-drop-hint { color: var(--ink-2); font-size: var(--text-xs); }
  .ob-drop-results { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
  .ob-drop-result { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); line-height: 1.4; }
  .ob-drop-result strong { font-weight: 500; margin-right: var(--space-1); }
  .ob-drop-said { display: block; color: var(--ink-2); }
  .ob-drop-result.is-error .ob-drop-said { color: var(--error); }
  .ob-signed-in { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--rule); font-size: var(--text-xs); color: var(--ink-2); }

  /* ── Onboarding / Create Account (2026 mockup parity) ──────────────
     The Create Account form and the three-step wizard adopt the
     mockup's visual language through the existing tokens: selectable
     radio "cards" for step 1's one question, a top progress bar on
     the wizard, and bill chips on step 3. Only the roles the app serves
     are selectable — see accounts.ONBOARDING_ROLES — so the form never
     promises a feature that isn't built. */
  .auth-wrap.auth-wide { max-width: 34rem; }

  /* Selectable radio cards — onboarding step 1's "Which describes you?"
     (role and registrant type in one answer): a real focusable
     <button> per option, a ring "dot" that fills when chosen, and the
     app's "on = accent" surface cue. */
  .role-cards { display: flex; flex-direction: column; gap: var(--space-2); }
  .role-card {
    display: grid; grid-template-columns: 1rem minmax(0, 1fr); align-items: start;
    gap: var(--space-3); width: 100%; text-align: left; cursor: pointer; font: inherit;
    padding: var(--space-3) var(--space-4); border: 1px solid var(--rule-card);
    border-radius: var(--radius-lg); background: var(--surface); color: var(--ink);
    transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  }
  /* Its own hover background: .role-card sits above the global
     :where(button):hover rule, which ties it on specificity and so won on
     source order — a black (light) / white (dark) fill under the card's
     ink text, the unchosen cards blanking out on hover and press. */
  @media (hover: hover) { .role-card:hover { border-color: var(--rule-strong); background: var(--surface); } }
  .role-card.selected { border-color: var(--accent-solid); background: var(--accent-soft); }
  .role-card:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 2px; }
  .role-dot {
    margin-top: var(--space-0); width: 1rem; height: 1rem; border-radius: 50%;
    border: 2px solid var(--rule-strong); flex: none; box-sizing: border-box;
  }
  .role-card.selected .role-dot {
    border-color: var(--accent-solid);
    box-shadow: inset 0 0 0 0.18rem var(--surface), inset 0 0 0 1rem var(--accent-solid);
  }
  .role-body { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
  .role-title { font-size: var(--text-sm); font-weight: 500; }
  .role-desc { font-size: var(--text-xs); line-height: 1.4; color: var(--ink-2); }
  /* On a phone the three described cards pushed the account fields
     ~1,000px down. Only the chosen card keeps its description; the rest
     are one line each, and a tap shows theirs. */
  @media (max-width: 640px) {
    .role-card:not(.selected) .role-desc { display: none; }
  }
  /* The shield "what you'll get" note, right under onboarding's choice
     it describes. flex: 1 1 100% for the same reason as .form-grid
     below: inside a flex-wrap form it needs a full-row basis. */
  .role-note {
    display: flex; gap: var(--space-2); align-items: flex-start; margin-top: var(--space-4); flex: 1 1 100%;
    padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-lg);
    color: var(--ink-2); font-size: var(--text-xs); line-height: 1.5;
  }
  .role-note[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .onboarding .form-grid[hidden] { display: none; }   /* a campaign has no lobbying registration */
  .role-note svg { flex: none; margin-top: var(--space-0); color: var(--ink-2); }

  /* Two-up field grids (name + org; filer ID + effective date). */
  .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-4); margin-top: var(--space-4); flex: 1 1 100%; }

  /* Wizard top progress bar. */
  .ob-progress { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
  .ob-progress-label {
    font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 500;
    color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  .ob-progress-track { flex: 1; height: 3px; border-radius: var(--radius-pill); background: var(--accent-soft); overflow: hidden; }
  .ob-progress-fill { display: block; height: 100%; width: 33.333%; background: var(--accent-solid); border-radius: var(--radius-pill); transition: width var(--dur) var(--ease); }

  /* Step 3 bill chips (replacing the row list). */
  .ob-bill-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
  /* Chips: full pills, a borderless tinted fill (design system data chips). */
  .ob-bill-chip {
    display: inline-flex; align-items: center; gap: var(--space-2); height: 2rem; padding: 0 var(--space-3);
    border-radius: var(--radius-pill); border: 1px solid transparent; background: var(--paper-250);
    font-size: var(--text-xs); font-weight: 500;
  }
  .ob-bill-chip-num { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--slate); font-variant-numeric: tabular-nums; }
  .ob-bill-chip-flagged { font-size: var(--text-2xs); font-weight: 600; color: var(--good); }

  @media (max-width: 720px) {
    .onboarding { grid-template-columns: 1fr; gap: var(--space-5); }
    .ob-stepper { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: var(--space-2); }
    .ob-step .ob-label { display: none; }
    .ob-step.active .ob-label { display: flex; }
    .ob-signed-in { display: none; }
  }
  /* A full-width bar, same grammar as the signed-in shell's .app-topbar
     (fixed height, border-bottom, solid --paper against the page's
     --content-bg) — public pages don't get the sidebar, but the top
     chrome should still read as "this app's header," not a different
     product's thin link row. The inner div re-centers content at the
     same width as .wrap so the bar's contents still line up with the
     page below it. */
  .top-nav {
    height: 4rem; display: flex; align-items: center; background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .top-nav-inner {
    width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 var(--space-5);
    display: flex; gap: var(--space-4); align-items: center; position: relative;
  }
  /* Wraps nav_links()/left_extra + the account widget (see top_nav()).
     display:contents at desktop widths means this introduces no box of
     its own — its children lay out directly in .top-nav-inner's flex
     row, identical to before this element existed. Only the ≤640px
     media query below turns it into an actual box (a dropdown panel). */
  .top-nav-links { display: contents; }
  /* Brand left, everything else right: the first of the page's links
     (or the account widget, on a page with none) takes the auto margin,
     so the group stays together at the far end. Desktop only — in the
     stacked mobile panel below, an auto margin would push it sideways. */
  @media (min-width: 641px) {
    .top-nav-links > :first-child { margin-left: auto; }
  }
  /* Hidden until the ≤640px media query below shows it — nothing for
     it to open above that width, since .top-nav-links is still just
     the plain inline row. Two classes (.icon-btn.top-nav-menu-btn), not
     one — .icon-btn's own `display: flex` (defined later in this file)
     would otherwise win the display property on source order alone,
     since a single-class selector here ties with it on specificity. */
  .icon-btn.top-nav-menu-btn { display: none; flex: none; margin-left: auto; }
  @media (max-width: 640px) {
    .icon-btn.top-nav-menu-btn { display: flex; }
    .top-nav-links {
      display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
      align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--rule);
      padding: var(--space-4) var(--space-5); gap: var(--space-3); box-shadow: var(--shadow-pop); z-index: 30;
    }
    .top-nav-links.show { display: flex; }
    /* The account widget's own wrapper (see top_nav()'s `account`
       variable) carries margin-left:auto and a max-width inline —
       exactly what's needed to push it to the far right of a
       horizontal row, but meaningless (and, for max-width, actively
       cramping) once .top-nav-links switches to a stacked column
       above. !important earns its keep here overriding an inline
       style for a genuinely different layout context, not routine
       specificity-fighting. */
    .top-nav-links.show > div { margin-left: 0 !important; max-width: none !important; }
    /* The panel stretches its items full-width; keep the pill's label centered in it. */
    .top-nav-links.show a.secondary { justify-content: center; }
    /* /login and /signup: two links, no menu (see top_nav()). */
    .top-nav.inline-links .icon-btn.top-nav-menu-btn { display: none; }
    .top-nav.inline-links .top-nav-links {
      display: flex; position: static; flex-direction: row; align-items: center;
      margin-left: auto; padding: 0; border: 0; box-shadow: none; background: none;
    }
  }
  .top-nav a { color: var(--accent); font-size: var(--text-sm); text-decoration: none; white-space: nowrap; }
  /* The one outlined button in the bar (/login's "Create account",
     /signup's "Sign in"). a.secondary's own `font: inherit` would otherwise size it
     at body text, a step up from the links beside it. */
  .top-nav a.secondary {
    font-size: var(--text-sm); padding: var(--space-1) var(--space-4); color: var(--ink);
  }
  @media (hover: hover) { .top-nav a.secondary:hover { text-decoration: none; } }
  /* .top-brand is a real <a> now (links home) — .top-nav a above would
     otherwise win on color/font-size since element+class ties with
     class-only on specificity's middle term; .top-nav .top-brand (two
     classes) reliably beats it instead of relying on source order. */
  .top-nav .top-brand {
    font-family: var(--font-display); font-weight: 600; font-size: var(--text-base);
    color: var(--ink); margin-right: var(--space-2);
  }
  @media (hover: hover) { .top-nav .top-brand:hover { text-decoration: none; } }
  /* Shared by every usage of the real Rotunda logo (TOP_BRAND, the
     sidebar's .app-brand, the landing page's .lp-brand and hero)
     — a sized, empty element masked to --brand-mark's shape and
     filled with --ink, which already recolors per theme on its own
     (see --brand-mark's single definition in :root). A mask, not
     background-image, so one SVG asset can serve both themes instead
     of needing separate light/dark exports. Each usage sets its own
     width/height inline, since the three contexts need different
     sizes — except inside a .brand-lockup, below. */
  .brand-mark {
    display: inline-block; flex: none; background-color: var(--ink);
    -webkit-mask-image: var(--brand-mark); mask-image: var(--brand-mark);
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
  }
  /* The mark + "Rotunda" wordmark pair (top nav, sidebar, landing nav
     and footer, auth footer). Everything is in em, so each usage sets
     only its font-size and the proportions hold at every size.
     Baseline-aligned, not centered: an empty inline-block's baseline is
     its bottom edge, so the mark's base bar sits on the text baseline
     and the dome rises past the capitals the way a round letter
     overshoots. Centering a mark taller than the caps (~0.7em in
     Newsreader, the face this was tuned on; it holds in Libre Caslon Text) left the bar hanging below a wordmark with no
     descenders. 0.77em puts the dome's top (the artwork's 6% inset
     counted) level with the ascenders of "t" and "d", so mark and word
     read as one block; at 0.9em the dome rose past them and its middle
     sat visibly high against a mostly-lowercase word (founder, Nov 1
     2026, "option D"). Retuned for Libre Caslon Text's heavier, larger
     letters (founder, Nov 25 2026, "Option 2"): at 0.77em the mark read
     small and crowded beside the bold word, so it is 0.9em, with a
     0.3em gap, and dropped 0.06em below the baseline so the bigger
     dome's middle stays level with the word rather than riding high.
     Baseline alignment packs the pair to the top of a taller box, so a
     fixed-height container (.app-brand) centers a nested lockup rather
     than being one. currentColor so the mark takes the wordmark's colour
     (the auth footer's is --slate, not --ink). The artwork is square
     (viewBox 0 0 100 100), hence aspect-ratio. The gap is named rather
     than a --space-* step because it's a ratio of the wordmark, not
     fixed px (an unregistered custom property's em resolves where it's
     used, i.e. at the wordmark). */
  .brand-lockup {
    --lockup-gap: 0.3em;
    display: inline-flex; align-items: baseline; gap: var(--lockup-gap);
  }
  .brand-lockup .brand-mark {
    height: 0.9em; width: auto; aspect-ratio: 1 / 1;
    transform: translateY(0.06em);
    background-color: currentColor;
  }
  h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.005em; font-size: var(--text-lg); margin: 0 0 var(--space-1); }
  .sub { color: var(--slate); margin: 0 0 var(--space-6); font-size: var(--text-sm); }
  /* Every form label in the app used to be a .sub — the same treatment
     as page subtitles, help text and metadata — so on the client and
     profile forms the label and its own help text rendered identically
     and the eye couldn't separate "what this field is" from "what to
     type in it". --ink at 600 gives the label the weight; .sub stays
     what it always was, for the sentence underneath. Modelled on the
     .pref-check-text / .pref-check-sub pair further down. */
  .field-label {
    display: block;   /* also a real <label for> where a control sits beside its input */
    color: var(--ink); font-weight: 600; font-size: var(--text-xs);
    margin: 0 0 var(--space-1); letter-spacing: -0.005em;
  }
  /* Signup's own 2-step progress — two dots rather than a full wizard
     bar, since it's only ever these two steps (account, then profile
     details). Sits inline with the existing "Step 1 of 2" copy rather
     than replacing it. */
  .step-indicator { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0 0 var(--space-6); }
  .step-indicator .sub { margin: var(--space-0) 0 0; }
  .step-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--rule); flex: none; margin-top: var(--space-1); }
  .step-dot.filled { background: var(--ink); }
  form {
    display: flex; gap: var(--space-2); margin-bottom: var(--space-6); flex-wrap: wrap;
  }
  /* type="search" for the Search key on a phone keyboard, without what
     it brings along: WebKit's rounded look and a native clear × beside
     the one .search-field-clear already draws. */
  input[type="search"] { -webkit-appearance: none; appearance: none; }
  input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
  /* Fields, selects and textareas share the design system's 10px
     field corner (forms: TextInput, Select, TextArea), replacing the old
     G3 full pills (a native checkbox/radio ignores the radius). */
  input, select, textarea {
    font: inherit; padding: var(--space-2) var(--space-3); border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  }
  /* Every field's edge darkens to ink on focus, however it was reached
     — the whole cue for a mouse, with the keyboard ring above added for
     Tab. */
  input:focus, select:focus, textarea:focus {
    border-color: var(--ink);
  }
  select { cursor: pointer; }
  /* The app's own select, date and tick box — the browser's versions
     (OS chevron, "mm/dd/yyyy" widget, system checkbox) looked like a
     different product beside the custom pill dropdowns. One drawn
     chevron (the stroke colour can't read a CSS variable inside an
     image, so each theme names its own), the same edge/radius/focus as
     a text field, and a clear ticked state (solid ink). Components still set
     their own size and font. */
  :root { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235b6270' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.4 6.3 5 8.8l4.6-5.2' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23A9AFBA' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.4 6.3 5 8.8l4.6-5.2' fill='none' stroke='%2314181f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  }
  :root[data-theme="dark"] { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23A9AFBA' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.4 6.3 5 8.8l4.6-5.2' fill='none' stroke='%2314181f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  select:not([multiple]):not([size]) {
    -webkit-appearance: none; appearance: none;
    background-image: var(--select-chevron); background-repeat: no-repeat;
    background-position: right 0.6rem center; background-size: 0.75rem 0.75rem;
    text-overflow: ellipsis;
  }
  /* !important: a dozen components set a `padding:` shorthand for their
     own density, which would otherwise slide the text under the chevron. */
  select:not([multiple]):not([size]) { padding-right: var(--space-6) !important; }
  select:disabled, input:disabled { opacity: 0.55; cursor: not-allowed; }
  input[type="date"] { min-width: 9.5rem; font-variant-numeric: tabular-nums; }
  input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; border-radius: var(--radius-xs); }
  input[type="checkbox"]:not(.switch), input[type="radio"] {
    -webkit-appearance: none; appearance: none; flex: none;
    width: 1.1rem; height: 1.1rem; padding: 0; vertical-align: -0.2em; cursor: pointer;
    /* A drawn box has no size of its own: a later `width: auto` on an input
       for a row's text field collapsed it to a 2px sliver (the Form 601
       first-registration / renewal choice, critique Nov 21 2026). The
       floor holds whatever width a page's rule gives it. */
    min-width: 1.1rem; min-height: 1.1rem;
    border: 1px solid var(--rule-strong); background: var(--surface) center / 0.8rem 0.8rem no-repeat;
  }
  input[type="checkbox"]:not(.switch) { border-radius: var(--radius-xs); }
  input[type="radio"] { border-radius: 50%; }
  input[type="checkbox"]:not(.switch):checked, input[type="radio"]:checked {
    background-color: var(--ink); border-color: var(--ink);
  }
  input[type="checkbox"]:not(.switch):checked { background-image: var(--check-mark); }
  input[type="radio"]:checked { background-image: radial-gradient(circle, var(--surface) 0 32%, transparent 36%); background-size: 100% 100%; }
  input[type="checkbox"]:not(.switch):indeterminate { background-color: var(--ink); border-color: var(--ink); background-image: linear-gradient(var(--surface), var(--surface)); background-size: 0.55rem 2px; }
  input#bill { flex: 1; min-width: 8rem; }
  /* A leading magnifier inside a text input (the mockup's search bars all
     carry one). The wrapper is relative, the icon absolutely placed, and
     the input pads left to clear it — so the field keeps its own
     focus rules from above while looking like a search bar. Radius
     overridden to match .search-bar-field's rounded-rectangle shape
     (the .search-bar-field rule further down takes it to 0 instead, on
     its own higher-specificity selector, once the input sits inside
     that bigger wrapped bar rather than standing on its own). */
  .search-field { position: relative; display: flex; align-items: center; }
  .search-field-icon {
    position: absolute; left: 0.85rem; width: 0.85rem; height: 0.85rem;
    color: var(--slate); flex: none; pointer-events: none;
  }
  .search-field input { width: 100%; padding-left: var(--space-6); border-radius: var(--radius-sm); }
  /* /lookup's bill-number suggestions, hung under the whole query row
     (box and Search button) so a phone's narrow box doesn't squeeze the
     titles out. Each option is a finger-sized row: number, title (one
     line), status; on a phone the title takes a line of its own. */
  .lookup-query-form { position: relative; }
  .bill-suggest {
    position: absolute; top: calc(100% + var(--space-1)); left: 0; right: 0; z-index: 20;
    list-style: none; margin: 0; padding: var(--space-1) 0; max-height: 22rem; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--rule-card); border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
  }
  .bill-suggest[hidden] { display: none; }
  .bill-suggest-item {
    display: flex; align-items: center; gap: var(--space-2); min-height: 2.75rem;
    padding: var(--space-1) var(--space-3); cursor: pointer; font-size: var(--text-sm);
  }
  /* The keyboard's pick is stronger than the pointer's hover, so the two
     can be told apart when both are on screen. */
  .bill-suggest-item.is-active { background: var(--rule); box-shadow: inset 2px 0 0 var(--ink); }   /* see .palette-option */
  .bill-suggest-item.is-active .bill-suggest-title { color: var(--ink); }
  @media (hover: hover) { .bill-suggest-item:hover { background: var(--accent-soft); } }
  .bill-suggest-number { font-variant-numeric: tabular-nums; font-weight: 500; flex: none; }
  .bill-suggest-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--slate); }
  .bill-suggest-session { flex: none; font-size: var(--text-xs); color: var(--slate); }
  @media (max-width: 767px) {
    .bill-suggest-item { flex-wrap: wrap; row-gap: 0; padding-top: var(--space-2); padding-bottom: var(--space-2); }
    .bill-suggest-item .status-badge { margin-left: auto; }
    .bill-suggest-title { order: 1; flex-basis: 100%; white-space: normal;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  }
  /* A trailing clear (×) control, the mirror of the leading magnifier:
     absolutely placed on the right, shown by the page only once there is
     text to clear (hidden attribute toggled in LOOKUP_BODY). The input
     pads right to make room, but only in a field that actually carries
     one — every other .search-field keeps its own spacing. */
  .search-field-clear {
    position: absolute; right: 0.5rem; display: inline-flex;
    align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem;
    padding: 0; background: transparent; border: none; border-radius: var(--radius-pill);
    color: var(--slate); font-size: var(--text-md); line-height: 1; cursor: pointer;
  }
  /* display above would otherwise beat the hidden attribute, and the ×
     showed on an empty box (search/dashboard audit S10). */
  .search-field-clear[hidden] { display: none; }
  @media (hover: hover) { .search-field-clear:hover { background: var(--accent-soft); color: var(--ink); } }
  .search-field:has(.search-field-clear:not([hidden])) input { padding-right: var(--space-6); }
  /* The design system's Button: 32px tall (a 24px line plus 4px above
     and below), 6px corners, Geist 500, the ink fill with a real hover
     colour swap (--accent-solid-hover). Height comes from line-height +
     padding rather than a height/min-height, so a class that zeroes the
     padding (.linklike, .icon-btn, tabs) doesn't inherit a 32px box; a
     touch screen still gets the 44px floor (the coarse-pointer block by
     .row-menu-btn). */
  button {
    font: inherit; font-size: var(--text-sm); font-weight: 500; line-height: 1.5rem; padding: var(--space-1) var(--space-4); border: none;
    border-radius: var(--radius-button); background: var(--accent-solid); color: var(--accent-solid-text); cursor: pointer;
    transition: background var(--dur-fast) var(--ease);
  }
  /* :where() zeroes this selector's specificity to (0,1,0) so a
     class-level background (a .filter-tab/.switch-btn/.linklike/… that
     opts out of the solid pill) wins on hover instead of losing to it —
     but only when that class rule comes LATER in this file: a tie goes
     to source order. A class defined above this point needs its own
     :hover background (see .role-card).
     Without that, this rule's (0,1,1) beat those (0,1,0) base rules and
     repainted transparent link/tab buttons with the solid fill while
     their text colour stayed — the invisible-on-hover text. Solid
     buttons (bare <button>, .auth-submit) set no class background, so
     they still darken. Supersedes the per-button `background:none on
     hover` band-aids noted at .settings-tab/.icon-btn. */
  @media (hover: hover) { :where(button):hover { background: var(--accent-solid-hover); } }
  button:disabled { opacity: 0.5; cursor: default; }
  /* A button that is unavailable reads as unavailable, not as a faded
     working one (founder, Nov 21 2026): the ordinary button shapes —
     plain, .primary, .secondary, .small — lose their fill and take a
     dashed edge and muted text. The 1px edge is taken off the line
     height, so the button keeps its size and nothing shifts when it
     comes back on. Link-, icon- and tab-shaped buttons keep the fade. */
  button:is(:not([class]), .primary, .secondary, .small):not(.linklike, .icon-btn, .row-menu-btn, .filter-tab, .edit-btn):disabled {
    opacity: 1; background: transparent; color: var(--slate);
    border: 1px dashed var(--rule-strong); line-height: calc(1.5rem - 2px);
  }
  @media (hover: hover) { button:is(:not([class]), .primary, .secondary, .small):not(.linklike, .icon-btn, .row-menu-btn, .filter-tab, .edit-btn):disabled:hover { background: transparent; } }
  /* Secondary/danger actions are quiet buttons (UI calm-down, Oct 22
     2026; polish D3): a secondary now carries a hairline outline so it
     still reads as a button and not plain text; danger stays outline-free.
     Three looks in all — primary (filled), secondary (outlined), and the
     text link (.linklike / a) for tertiary actions. One font size per
     step: 14px default, 12.8px for .small.
     The 1px border stays, transparent, so a ghost is the same 32px as a
     solid one and nothing shifts when the soft fill arrives on hover
     (gated by (hover: hover), below). Keyboard focus still gets the
     gold ring from the shared :focus-visible rule. */
  button.secondary, button.danger {
    background: transparent; border: 1px solid var(--rule-card); color: var(--ink);
  }
  button.danger { border-color: transparent; }
  /* Two pixels off the line for the border, so an outlined button is the
     same 32px as a solid one. :where() keeps this at one element's
     specificity: any class rule that sets its own line-height still wins. */
  button:where(.secondary, .danger) { line-height: calc(1.5rem - 2px); }
  button.danger { color: var(--error); }
  @media (hover: hover) { button.secondary:hover { background: var(--accent-soft); } }
  @media (hover: hover) { button.danger:hover { background: var(--error-soft); } }
  /* Same button look for plain <a> links used as actions (e.g. "View"
     on LegiScan, "Report" to the action-report page) — button's base
     rule only targets <button>, so links need their own copy of the
     same properties plus the anchor-specific reset. */
  a.secondary, a.danger {
    display: inline-flex; align-items: center; gap: var(--space-2); font: inherit; font-size: var(--text-sm); font-weight: 500; line-height: calc(1.5rem - 2px);
    padding: var(--space-1) var(--space-4); border-radius: var(--radius-button); text-decoration: none;
    background: transparent; border: 1px solid var(--rule-card); color: var(--ink); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }
  a.danger { color: var(--error); border-color: transparent; }
  a.secondary svg, a.danger svg { width: 0.85rem; height: 0.85rem; flex: none; }
  /* Solid-fill counterpart to a.secondary/a.danger above, same reasoning
     — an <a> styled to look like the app's solid dark <button>. */
  a.primary {
    display: inline-flex; align-items: center; gap: var(--space-2); font: inherit; font-size: var(--text-sm); font-weight: 500; line-height: 1.5rem;
    padding: var(--space-1) var(--space-4); border-radius: var(--radius-button); text-decoration: none;
    background: var(--accent-solid); color: var(--accent-solid-text); transition: background var(--dur-fast) var(--ease);
  }
  @media (hover: hover) { a.primary:hover { background: var(--accent-solid-hover); } }
  a.primary svg { width: 0.85rem; height: 0.85rem; }
  @media (hover: hover) { a.secondary:hover { background: var(--accent-soft); color: var(--ink); } }
  @media (hover: hover) { a.danger:hover { background: var(--error-soft); } }
  #result { display: none; }
  #result.show { display: block; }
  /* Cards, panels and stat cards carry no outline (UI calm-down, Oct 22
     2026): the sheet behind them is a different ground and the space
     round them does the separating. In dark the lift is the ground
     shift alone; in light a faint --shadow-rest keeps white from
     melting into cream. A hairline survives only where it divides
     things inside a card (a table row, a panel head), never around it. */
  .card {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);
    border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-5);
  }
  .bill-id { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--ink); margin-bottom: var(--space-2); }
  .bill-title { font-size: var(--text-md); font-weight: 700; margin: 0 0 var(--space-1); }
  /* The report heading's number ("SB318 · Title") never breaks mid-number. */
  .bill-title-number { white-space: nowrap; }
  .bill-desc { color: var(--slate); font-size: var(--text-sm); }
  .bill-link { display: inline-block; margin-top: var(--space-2); font-size: var(--text-sm); }
  /* The one pill (UX audit F). Every static label pill — status,
     position, verdict, tag, chips, counts — shares this shape, size and
     weight; each class below only picks its colours. Before this there
     were two sizes, three paddings and three border treatments, so two
     pills side by side on one row rarely matched. The transparent 1px
     border is what keeps a bordered pill and a tinted one the same
     height; a variant that wants an outline sets border-color only.
     .tag alone stays uppercase: its text is raw CAL-ACCESS values
     ("firm", "employer") that read as labels only that way. Interactive
     chips (.filter-tab, .filter-chip, ...) are buttons, not this. */
  .status-badge, .sponsor, .tag, .position-badge, .verdict-chip, .soon-badge, .soon-tag,
  .next-chip, .due-chip, .dash-count, .party-pill, .vote-outcome, .dir-stale-badge, .dir-edit-badge, .disc-pill,
  .letter-pill {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
    padding: var(--space-0) var(--space-2); border: 1px solid transparent; border-radius: var(--radius-pill);
    font-size: var(--text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; vertical-align: middle;
  }
  /* Just a neutral dot, not color-varied by status text — LegiScan's
     status_label is a freeform string (dozens of possible values across
     bills), and guessing which ones are "good" vs "bad" well enough to
     color them confidently isn't a call this restyle should make. */
  .status-badge { background: var(--accent-soft); color: var(--accent); margin-bottom: var(--space-2); }
  .status-badge::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: var(--radius-pill); background: currentColor; flex: none; }
  /* Unlike the base rule above (deliberately neutral because LegiScan's
     own status_label is a freeform string not worth guessing at — see
     that rule's comment), a caller that owns its own small, known status
     enum (e.g. disclosure filings' draft/ready_to_file) can opt into a
     real color here instead of reaching for .position-badge, a
     different component meant for a client's stance on a bill. */
  .status-badge.good { background: var(--good-soft); color: var(--good); }
  /* /admin/system's job states (system_health.py): failed, and gone quiet. */
  .status-badge.bad { background: var(--error-soft); color: var(--error); }
  .status-badge.warn { background: var(--warn-soft); color: var(--warn); }
  .card-actions { margin-top: var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  /* The bill's flagged/archived state on /report — plain muted text, not
     a .status-badge pill: in a row of pill buttons, a pill reads as one
     more thing to press. Same look as search results' .flagged-mark. */
  .card-actions .flagged-mark { font-size: var(--text-xs); color: var(--slate); margin-right: var(--space-1); }
  h2.section { font-size: var(--text-base); margin: var(--space-5) 0 var(--space-2); }
  table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  td, th { padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--rule-soft); vertical-align: top; text-align: left; }
  /* Half-strength dividers, none under the last row: the card's own edge ends the table. */
  tbody tr:last-child > :is(td, th) { border-bottom: 0; }
  /* Tabular figures, not a typewriter face: the digits still line up
     down the column, and the date reads in the same type as the rest of
     the row. */
  td.date { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--slate); }
  /* Milestone left-edge on a history row (see milestoneClass() in
     LOOKUP_BODY / REPORT_BODY) — an inset box-shadow rather than a
     border, since a real border on a <td> inside a border-collapse
     table shifts column width by its own thickness; inset paints
     without taking any layout space. */
  tr.milestone-intro td:first-child { box-shadow: inset 3px 0 0 0 var(--slate); }
  tr.milestone-passed td:first-child { box-shadow: inset 3px 0 0 0 var(--good); }
  tr.milestone-amended td:first-child { box-shadow: inset 3px 0 0 0 var(--ink); }
  /* /report's "Current Status" callout (see REPORT_BODY) — the single
     most recent bill_status_history row, called out above the full
     history table below it rather than making someone read down to
     the last row to find "where things stand right now." Weight comes
     from the left-edge accent and the bold action text alone — an
     ordinary 1px card border on the plain surface. It used to be a 2px
     ink border on a tinted fill, which is how a focused or selected
     control looks, and it outweighed everything else on the page. No
     colored fill either (same restraint .status-badge's own comment
     explains: LegiScan's action text is freeform, so this isn't the
     place to guess "good" vs "bad" news).
     The left-edge accent reuses milestoneClass()'s own three
     categories (same function that colors history rows below it) so
     this card's accent means the same thing the table already
     established, not a new color vocabulary. */
  .current-status-card {
    border: 1px solid var(--card-edge);   /* no milestone stripe (D2): one card edge; the words say the milestone */
    border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
    margin-top: var(--space-4); background: var(--surface);
  }
  .current-status-card .current-status-label {
    font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--slate); margin-bottom: var(--space-2);
  }
  .current-status-card .current-status-action { font-size: var(--text-base); font-weight: 700; }
  .current-status-card .current-status-meta { font-size: var(--text-xs); color: var(--slate); margin-top: var(--space-1); }
  /* "When does this need to be amended by?" — manually entered (see
     bill_amend_by_dates in schema.sql; LegiScan has no such field),
     so it lives as a small editable row inside the same callout rather
     than its own panel — one more fact about where things stand right
     now, not a separate concept. */
  /* Stacked, not a one-line flex row: this field used to be a bare
     "Amend by" label beside a date input, which is a date field on a
     compliance screen with no stated meaning — the kind users either
     avoid or fill in believing it does something. It now carries a help
     line saying what it is and where it shows up, and a save
     confirmation under the input, and those need their own lines. */
  .current-status-card .current-status-amend-by {
    margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--rule);
  }
  .current-status-card .current-status-amend-by label {
    display: block; font-size: var(--text-xs); font-weight: 600; color: var(--slate);
  }
  .current-status-card .current-status-amend-by .sub {
    font-size: var(--text-2xs); color: var(--slate); margin: var(--space-0) 0 var(--space-2);
  }
  .current-status-card .current-status-amend-by input[type="date"] {
    font-size: var(--text-xs); padding: var(--space-1) var(--space-2); width: auto;
  }
  .current-status-card .current-status-amend-by #amend-by-status {
    margin: var(--space-1) 0 0; min-height: 1em;
  }

  /* The status pill's own line on a bill report: the pill says which
     stage the bill is at, the date beside it says when that stage was
     reached. They used to run together as "Enrolled — as of 2026-08-20"
     directly above a Latest action block dated Aug 28, which read as the
     page contradicting itself rather than as two different facts. */
  .status-line { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
  .status-since { font-size: var(--text-xs); color: var(--slate); margin-bottom: var(--space-2); }
  /* The page's one "Last checked …" line (dates.js lastCheckedHtml): quiet
     under the title, amber words (not just colour) when failed or behind. */
  .last-checked { font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--space-3); }
  .last-checked.is-stale { color: var(--warn); font-weight: 600; }
  /* A two-year bill's note beside its status word (Oct 7 audit N7). */
  .status-note { display: block; font-size: var(--text-xs); color: var(--slate); }

  /* A status the app worked out from the bill's last-action text rather
     than read from a status field — search results, where LegiScan's
     result rows carry no status code (see bill_status.js). Marked so an
     inference never sits in the same visual register as a recorded fact;
     the tooltip on the pill says so in words, since a dotted underline
     on its own is decoration to anyone who doesn't already know. */
  /* Was a dashed border; now the inference is said in the tooltip, and
     the pill itself is a solid tint plus an icon per kind of stage (the
     tones are set by STATUS_TONES in bill_status.js), so what a badge
     means never rests on its colour or its outline. */
  .status-badge.tone-early { background: var(--content-bg); color: var(--slate); border-color: var(--rule-strong); }
  .status-badge.tone-moving { background: var(--accent-soft); color: var(--accent); }
  .status-badge.tone-passed { background: var(--good-soft); color: var(--good); }
  .status-badge.tone-ended { background: var(--error-soft); color: var(--error); }
  .status-badge.tone-early::before { content: ""; --ic: var(--icon-circle); }
  .status-badge.tone-moving::before { content: ""; --ic: var(--icon-arrow); }
  .status-badge.tone-passed::before { content: ""; --ic: var(--icon-check); }
  .status-badge.tone-ended::before { content: ""; --ic: var(--icon-x); }
  /* The drawn-icon group: every pseudo-element below paints its --ic as a
     currentColor mask (the glyph it replaced was typed text). Each rule
     that wants one sets content: "" and --ic; nothing else shows. */
  .status-badge[class*="tone-"]::before,
  .position-badge::before,
  .digest-icon::before,
  .agenda-icon::before,
  .filter-tab.active::before,
  .save-status[data-state="saved"]::before,
  .view-menu-dropdown button[aria-pressed="true"]::before,
  .filter-group-toggle::after,
  .section-nav-item.done .section-nav-count::before,
  .jump-item.done .jump-item-count::before,
  .mike-steps li:not(:last-child)::before,
  .ob-step.done .ob-num::after,
  .icn {
    display: inline-block; width: 1em; height: 1em; flex: none; border-radius: 0;
    background: currentColor; vertical-align: -0.125em;
    -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  }
  .status-badge[class*="tone-"]::before { width: 1.15em; height: 1.15em; font-size: var(--text-xs); }
  .icn-arrow { --ic: var(--icon-arrow); }
  .icn-check { --ic: var(--icon-check); }
  .icn-x { --ic: var(--icon-x); }
  .icn-circle { --ic: var(--icon-circle); }
  .icn-dot { --ic: var(--icon-dot); }

  /* One tooltip for every .has-tip: status badges and the Status filter
     tabs. Shown on hover AND keyboard focus (a title attribute only ever
     did the first). Positioned under its owner, above everything. */
  .has-tip { position: relative; }
  .has-tip > .tip {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
    width: max-content; max-width: 16rem; white-space: normal; text-align: left;
    font-size: var(--text-xs); font-weight: 400; line-height: 1.4; letter-spacing: 0; text-transform: none;
    background: var(--ink); color: var(--surface); border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-2); box-shadow: var(--shadow-rest); pointer-events: none;
  }
  .result-card-flags .has-tip > .tip { left: auto; right: 0; }
  /* Tap opens it too (.tip-open, tooltip.js), so hover is gated like
     every other :hover — a tap would otherwise leave it stuck open. */
  .has-tip:focus-visible > .tip, .has-tip.tip-open > .tip { display: block; }
  @media (hover: hover) { .has-tip:hover > .tip { display: block; } }
  .has-tip.tip-end > .tip { left: auto; right: 0; }
  /* An open tip takes the tap that closes it, rather than letting it
     fall through to whatever is underneath (a bill card opens its report). */
  .has-tip.tip-open > .tip { pointer-events: auto; }
  /* An open tip hangs below its badge into the rest of a phone bill
     card, whose lifted cells (z-index 1) would otherwise paint over it.
     The extra `tr` outranks those rules, which come later in the file. */
  .bill-cards tr td:has(.tip-open) { z-index: 3; }

  td.chamber {
    white-space: nowrap; font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase;
    color: var(--accent);
  }
  .sponsor-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .sponsor { background: var(--accent-soft); color: var(--accent); }
  #error {
    display: none; background: var(--error-soft); color: var(--error);
    padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); margin-bottom: var(--space-5);
  }
  #error.show { display: block; }
  /* A link in an error is the way out of it (e.g. "Add registration
     details" on Disclosures), so it reads as one: the error's own colour,
     underlined, rather than the plain-link slate that looked like text. */
  #error a { color: inherit; font-weight: 600; text-decoration: underline; }
  /* The same for a button that is the way out (the dashboard's "Try
     again"): .linklike's accent blue would sit off-colour on the banner. */
  #error .linklike { color: inherit; font-weight: 600; }
  /* An error about one field, under that field (e.g. "No California bill
     called AB 99999" under Add a bill) — #error's colour, no banner. */
  .field-error { color: var(--error); font-size: var(--text-sm); margin: var(--space-2) 0 0; }
  .field-error:empty { display: none; }
  /* The box that message is about (aria-invalid, set with the message —
     see static/js/field_errors.js). Red even while focused — focus goes
     straight to it — with the gold focus glow still around it. */
  input[aria-invalid="true"], input[aria-invalid="true"]:focus { border-color: var(--error); }
  /* Two or more problems at once: the banner lists them, left-aligned
     so a list reads as one even on the centred sign-up page. */
  #error p { margin: 0; text-align: left; }
  #error ul { margin: var(--space-1) 0 0; padding-left: var(--space-5); text-align: left; }
  /* #client-form-saving is the client modal's own "Saving…" — it can't be
     #loading because the client detail page, which shares that modal,
     already has a #loading skeleton of its own. */
  #loading, #client-form-saving { display: none; align-items: center; gap: var(--space-2); color: var(--slate); font-size: var(--text-sm); }
  #loading.show, #client-form-saving.show { display: flex; }
  #loading.skeleton.show { display: block; }
  /* Skeleton containers that can't share the #loading id — the Alerts
     page has two (digest-loading / rules-loading) — still need the same
     show/hide convention. Without these, clearing the class only strips
     `show` while the div stays a visible block full of placeholder bars,
     leaving skeletons stranded above the loaded content. */
  .skeleton { display: none; }
  .skeleton.show { display: block; }
  .spinner {
    display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 50%; flex: none;
    border: 2px solid var(--rule); border-top-color: var(--slate); animation: spin 0.6s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  /* busy.js's "working on it": inside a button the spinner takes the
     button's own text colour, so it reads on a dark primary button as
     well as a light secondary one. Content being replaced (a new
     quarter) isn't faded — opacity is how text slips under AA (see
     test_contrast) — it stops taking clicks and a line sweeps along its
     top edge until the new content is drawn. */
  .is-busy .spinner { border-color: currentColor; border-top-color: transparent; vertical-align: -0.12em; }
  .is-busy { cursor: progress; }
  .is-updating { position: relative; pointer-events: none; cursor: progress; }
  .is-updating::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 1;
    background: linear-gradient(90deg, transparent, var(--slate), transparent) no-repeat;
    background-size: 40% 100%; animation: updating-sweep 1s linear infinite;
  }
  @keyframes updating-sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }
  @media (prefers-reduced-motion: reduce) { .is-updating::before { animation: none; background: var(--slate); } }
  /* Organization Search's own loading state — 3 rows shaped like the
     real results table (see LOBBYING_BODY) instead of plain "Searching…"
     text, so the layout doesn't jump when real rows replace it. */
  .skeleton-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule); }
  .skeleton-row:last-child { border-bottom: none; }
  .skeleton-bar { height: 0.8rem; border-radius: var(--radius-sm); background: var(--accent-soft); animation: skeleton-pulse 1.2s ease-in-out infinite; }
  @keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
  /* P2-32's other half: this is a plain multi-page app (see app.py's own
     module docstring — no client-side router), so every navigation is a
     real browser page load and nothing can paint DURING the network
     round trip itself. What this bar does instead: confirms the click
     landed, immediately, and keeps confirming across the gap via
     page_progress.js's sessionStorage flag, so a slow cold start (the
     3-5s the audit measured) reads as "loading" instead of "did that
     work?" — same job a native app's own progress indicator does. */
  #page-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0%; opacity: 0;
    background: var(--accent-solid); z-index: 200; pointer-events: none;
    display: none; /* off (founder, Oct 29 2026): pages change without a loading line */
  }
  @media (prefers-reduced-motion: reduce) { #page-progress { transition: none !important; } }
  /* Turbo Drive's own bar would draw a second line over this one. */
  .turbo-progress-bar { display: none; }
  .empty { color: var(--slate); font-size: var(--text-sm); }
  /* Two rules for "nothing here": a whole list or page that's empty gets
     emptyStateBox() below; a small part of a section keeps this quiet
     line. .inset gives it a card's own padding when it sits straight in
     a padless card (a list's Loading…/None); .inset-y is the space for
     a line under a sub-heading. Classes, not a style="" per page, so
     every quiet line sits the same distance from its edge. */
  .empty.inset { padding: var(--space-3) var(--space-4); }
  .empty.inset-y { padding: var(--space-2) 0; }
  /* The zero-state: a centered muted icon over the message, not the bare
     grey line .empty gives (see emptyStateBox() in empty_state.js, which
     builds this markup). It had a dashed outline and its own fill — a
     box inside the card that already holds it — and lost both (UI
     calm-down, Oct 22 2026): the card is the box, so this is only room
     and words. The icon takes --slate via currentColor. */
  .empty-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--space-3); text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--slate);
  }
  .empty-box svg { width: 32px; height: 32px; opacity: 0.7; flex: none; }
  .empty-box p { margin: 0; max-width: 34rem; font-size: var(--text-sm); line-height: 1.5; }
  /* The calm "AI is off" state (aiOffBox in empty_state.js): the same
     box, with a heading line over the one sentence of why. */
  .empty-box .empty-title {
    display: block; margin-bottom: var(--space-1);
    font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--ink);
  }
  .empty-box.ai-off { flex: 1; }
  /* The one-click next step under a zero-result message ("Search all
     sessions", "Include ended bills", "Clear all") — its own row, below
     the sentence that explains why it is offered. */
  .empty-box .empty-actions {
    display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-3);
  }
  /* The dashboard's first-bill box: a new firm flags its first bill in
     the empty worklist card itself. */
  .dash-first-bill { display: flex; gap: var(--space-2); width: 100%; max-width: 26rem; }
  .dash-first-bill input { flex: 1; min-width: 0; }
  .dash-first .field-error:empty { display: none; }
  /* Small centered dialog, used by the flag-confirmation modal (see
     openFlagModal() in REPORT_BODY) and the "+ Add new client"
     quick-add panel shared between it and clientCell() (see
     CLIENT_QUICKADD_JS) — the app's only two true modals, everything
     else (row menus, the account menu) is an anchored dropdown instead.
     z-index comfortably clears .row-menu-dropdown/.app-account-menu's
     own z-index: 20 above, since a modal has to sit above any dropdown
     left open behind it. */
  .modal-backdrop {
    position: fixed; inset: 0; background: var(--scrim); z-index: 100;
    display: none; align-items: center; justify-content: center; padding: var(--space-4);
  }
  .modal-backdrop.show { display: flex; }
  .modal-panel {
    background: var(--surface); border: 1px solid var(--rule-card); box-shadow: var(--shadow-hover);
    border-radius: var(--radius-lg); padding: var(--space-5); width: 100%; max-width: 26rem; max-height: 90vh; overflow-y: auto;
  }
  .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
  .modal-head .title { font-size: var(--text-base); font-weight: 700; margin: 0; }
  .modal-head .sub { font-size: var(--text-xs); color: var(--slate); margin-top: var(--space-1); }
  .modal-panel form { margin: 0; flex-direction: column; gap: var(--space-3); }
  .modal-panel label { display: block; }
  .modal-panel label[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .modal-panel input, .modal-panel select, .modal-panel textarea { width: 100%; }
  /* Cancel, then the action, at the right edge — the order every other
     app's dialogs use, so a user's hand already knows where "OK" is. */
  .modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
  /* The bill report's "which client is this letter for?" (D1): one row
     per assigned client — name, position, and whether a click opens
     their letter or drafts one. */
  .letter-picker-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
  .letter-picker-option {
    display: flex; align-items: center; gap: var(--space-2); width: 100%; text-align: left;
  }
  .letter-picker-name { flex: 1; font-weight: 600; }
  .letter-picker-action { font-size: var(--text-xs); color: var(--slate); }
  /* "Request a meeting" on the bill report (meeting_request.py): offices
     as checkboxes in groups, then one draft card per office. Wider than
     the other dialogs, since a draft's body is read in it. */
  .mreq-panel { max-width: 34rem; }
  .mreq-intro { margin: 0 0 var(--space-3); }
  .mreq-group { border: 0; margin: 0 0 var(--space-3); padding: 0; }
  .mreq-group legend { font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--space-1); }
  .modal-panel label.mreq-option, .mreq-option {
    display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-1) 0; cursor: pointer;
  }
  .modal-panel .mreq-option input { width: 1.1rem; margin-top: var(--space-0); }
  .mreq-option-off { cursor: default; padding-left: var(--space-5); }
  .mreq-name { display: block; font-weight: 600; }
  .mreq-who { display: block; font-size: var(--text-xs); color: var(--slate); }
  .mreq-flag { color: var(--slate); font-style: italic; }
  .mreq-add { margin: var(--space-1) var(--space-1) 0 0; }
  #mreq-search-results:not(:empty) { margin-top: var(--space-1); }
  .modal-panel label.mreq-mention { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
  .modal-panel .mreq-mention input { width: 1.1rem; }
  .mreq-client { margin-top: var(--space-2); }
  .mreq-drafts { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
  .mreq-draft { border: 1px solid var(--rule-card); border-radius: var(--radius-md); padding: var(--space-3); }
  .mreq-draft p { margin: 0 0 var(--space-2); }
  .mreq-head { font-size: var(--text-sm); }
  .mreq-head span { color: var(--slate); }
  .mreq-body { white-space: pre-line; font-size: var(--text-sm); max-height: 12rem; overflow-y: auto; }
  .mreq-draft-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  /* The letter's position, asked before a Watch/Neutral letter is made
     (static/js/letter_start.js). */
  .letter-position-choices { border: 0; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
  .letter-position-choice { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; cursor: pointer; }
  /* ── The ⌘K palette (static/js/command_palette.js) — a modal over any
     page: one field, then results grouped Bills / Clients / Letters /
     People, the full bill search last. Top-anchored rather than centred
     so the field doesn't jump as results arrive. */
  .palette-backdrop {
    position: fixed; inset: 0; background: var(--scrim); z-index: 110;
    display: flex; justify-content: center; align-items: flex-start; padding: var(--space-8) var(--space-4) var(--space-4);
  }
  .palette-backdrop[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  body.palette-open { overflow: hidden; }
  .palette {
    width: 100%; max-width: 38rem; max-height: 70vh; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--rule-card); box-shadow: var(--shadow-hover);
    border-radius: var(--radius-lg); overflow: hidden;
  }
  .palette-field {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule);
  }
  /* The field itself is the same rounded box as every other search in
     the app (/lookup's .search-bar-field, the .search-box filters):
     magnifier inside it, and the focus ring on the whole box. The bare
     input used to carry the global ring itself, so opening the palette
     drew a gold outline around the text alone, with the magnifier left
     outside it — unlike any other search box. */
  .palette-search {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2);
    min-height: 2.75rem; padding: 0 var(--space-3);
    border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface);
  }
  .palette-search:focus-within { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }
  .palette-search svg { width: 0.9rem; height: 0.9rem; flex: none; color: var(--slate); }
  .palette-search input {
    flex: 1; min-width: 0; border: 0; background: none; box-shadow: none;
    padding: var(--space-1) 0; font-size: var(--text-base); color: var(--ink);
  }
  /* The box carries the ring (WCAG 2.4.7; whole-app audit Y26); the
     input must not draw a second one inside it. */
  .palette-search input:focus, .palette-search input:focus-visible { outline: none; box-shadow: none; }
  .palette-search input::placeholder { color: var(--slate); }
  .palette-field kbd {
    font: inherit; font-size: var(--text-2xs); color: var(--slate);
    border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 0 var(--space-1);
  }
  .palette-list { overflow-y: auto; padding: var(--space-2) 0; }
  .palette-group + .palette-group { border-top: 1px solid var(--rule); margin-top: var(--space-1); padding-top: var(--space-1); }
  .palette-group-head {
    padding: var(--space-2) var(--space-4) var(--space-1);
    font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate);
  }
  .palette-option {
    display: flex; align-items: baseline; gap: var(--space-2); min-height: 2.25rem;
    padding: var(--space-2) var(--space-4); color: var(--ink); text-decoration: none; font-size: var(--text-sm);
  }
  /* The keyboard-selected option gets a gold left bar as well as the
     tint: the tint alone (1.18:1) was the same as mouse hover (Y26). */
  .palette-option[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--ink); }
  @media (hover: hover) { .palette-option:hover { background: var(--accent-soft); } }
  .palette-main { font-weight: 600; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .palette-sub { flex: 1; min-width: 0; color: var(--slate); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .palette-tag { flex: none; color: var(--slate); font-size: var(--text-2xs); }
  .palette-all .palette-main { max-width: none; font-weight: 500; }
  .palette-hint { margin: 0; padding: var(--space-3) var(--space-4); color: var(--slate); font-size: var(--text-sm); }
  @media (max-width: 640px) {
    .palette-backdrop { padding: var(--space-3); }
    .palette { max-height: 85vh; }
  }
  /* ── Clients page: modal add/edit + the mockup's four-column browse ──
       (see CLIENTS_BODY / clients_body.html). Two things the generic
       modal rules above don't cover:
       1. The add/edit-client form is a 14-field CAL-ACCESS record, so it
          opens in the wide panel and keeps its own multi-column row
          layout rather than .modal-panel form's single stacked column.
       2. "+ Add client" is now a modal (not the old inline expand-card),
          so the browse below it is the mockup's four data columns —
          Name / Business address / Industry — with no
          actions column. The row's Edit/Remove fold into one kebab
          in the last cell (the same move the
          directory table made with its stale toggle), and Edit gets a
          neutral hover so it doesn't borrow the destructive-red the rest
          of a .row-menu-dropdown carries. */
  #client-modal-backdrop form { flex-direction: row; flex-wrap: wrap; }
  /* On a phone the multi-column groups (city/state/zip, amount/per) get
     too tight to read, so the form falls back to .modal-panel form's
     single stacked column below the drawer breakpoint. */
  @media (max-width: 640px) {
    #client-modal-backdrop form { flex-direction: column; }
  }
  /* Fourteen fields put "Add client" 1,700px down a 730px-tall panel on
     a phone — found only by scrolling to the end. The actions stay
     pinned to the panel's bottom edge while the fields scroll under
     them; the negative bottom offsets the panel's own padding so the
     bar sits on the edge rather than floating above a strip of fields. */
  #client-modal-backdrop .modal-actions {
    position: sticky; bottom: calc(-1 * var(--space-5)); z-index: 1;
    margin-bottom: calc(-1 * var(--space-5)); padding: var(--space-3) 0 var(--space-5);
    background: var(--surface); border-top: 1px solid var(--rule);
  }
  .clients-filer-cell { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
  .clients-filer-cell .row-menu { margin-left: auto; }
  /* The row's identifier outweighs what's beside it (audit F19): the
     name link was inheriting link slate while the address sat in full
     ink, so the eye landed on addresses first. */
  a.clients-name { color: var(--ink); font-weight: 600; text-decoration: none; }
  /* The list is a portfolio (audit S9): each cell is what needs the
     reader's attention, in the Next action cell's own type — a date line,
     a grey line under it. Counts centre under their headers. */
  .clients-hearing, .clients-governor { color: var(--slate); }
  .clients-hearing-date { color: var(--ink); font-weight: 600; }
  .clients-hearing .next-when.now .clients-hearing-date { color: var(--error); }
  .clients-hearing .next-when.soon .clients-hearing-date { color: var(--warn); }
  .clients-governor .next-when { color: var(--ink); }
  .clients-governor .next-when.now { color: var(--error); }
  .clients-governor .next-when.soon { color: var(--warn); }
  .clients-count { font-variant-numeric: tabular-nums; text-align: center; }
  th.clients-count { white-space: normal; }
  /* After the session (U11): Won and Lost are the answer to "how did this
     client do?", so they carry the weight; how the bills ended is the
     quieter line of facts behind them. The words carry it, not colour. */
  td.clients-won, td.clients-lost { font-weight: 600; color: var(--ink); }
  .clients-ended { color: var(--slate); font-size: var(--text-xs); }
  .clients-interests { font-size: var(--text-xs); color: var(--slate); font-weight: 400; margin-top: var(--space-0); }
  .clients-table-wrap { overflow-x: auto; }
  /* A phone got the wide table in a sideways scroller: names wrapped to
     three lines and Edit/Remove sat in the last column, past the right
     edge. One card per client instead — name with the row menu beside
     it, then only the things that client has going on (an empty cell
     drops out, so a quiet client is a short card). The whole row already
     opens the record (link-row, row_nav.js), so nothing here needs a
     link. */
  @media (max-width: 640px) {
    .clients-table-wrap { overflow: visible; }
    .clients-table, .clients-table tbody, .clients-table td { display: block; }
    .clients-table thead { display: none; }
    .clients-table tr {
      display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3);
      padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule-strong);
    }
    .clients-table tr:last-child { border-bottom: 0; }
    .panel .clients-table td { border: 0; padding: var(--space-0) 0; grid-column: 1; text-align: left; }
    .panel .clients-table td.clients-filer-td { grid-column: 2; grid-row: 1 / span 6; align-self: start; }
    .clients-table td.clients-hearing:empty, .clients-table td.clients-governor:empty,
    .clients-table td.clients-unseen:empty, .clients-table td.clients-open:empty { display: none; }
    .clients-table td.clients-hearing::before, .clients-table td.clients-governor::before,
    .clients-table td.clients-unseen::before, .clients-table td.clients-open::before,
    .clients-table td.clients-live::before {
      margin-right: var(--space-1); font-size: var(--text-2xs); font-weight: 600;
      letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate);
    }
    .clients-table td.clients-hearing::before { content: "Next hearing"; display: block; }
    .clients-table td.clients-governor::before { content: "Governor's desk"; display: block; }
    .clients-table td.clients-unseen::before { content: "New changes"; }
    .clients-table td.clients-open::before { content: "No position yet"; }
    .clients-table td.clients-live::before { content: "Live bills"; }
    /* The after-the-session table's cells need their labels on a phone
       too, or a card is a name over bare numbers; a client with nothing
       won or lost, or no bill ended, has blank cells, so those lines drop
       rather than being labelled with nothing. */
    .clients-table td.clients-won::before { content: "Won"; }
    .clients-table td.clients-lost::before { content: "Lost"; }
    .clients-table td.clients-ended::before { content: "How bills ended"; }
    .clients-table td.clients-report::before { content: "Report"; }
    .clients-table td.clients-ended:empty { display: none; }
    .clients-table td.clients-won::before, .clients-table td.clients-lost::before,
    .clients-table td.clients-ended::before, .clients-table td.clients-report::before {
      margin-right: var(--space-1); font-size: var(--text-2xs); font-weight: 600;
      letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate);
    }
    .clients-table td.clients-count:has(> span:empty) { display: none; }
    .clients-table td.clients-count, .clients-table td.clients-hearing,
    .clients-table td.clients-governor { font-size: var(--text-xs); }
  }
  .row-menu-dropdown button.row-menu-edit { color: var(--ink); }
  @media (hover: hover) { .row-menu-dropdown button.row-menu-edit:hover { background: var(--accent-soft); } }

  /* ── Client form v5 (docs/design-system: forms) ──
     The add/edit-client modal (client_form.html), shared by the Clients
     list and the client page, scoped to #client-modal-backdrop. The
     title and the two section heads in the card serif; labels medium,
     not bold; "(optional …)" asides muted. Fields and buttons keep the
     app's own shape (they change app-wide in one pass). */
  #client-modal-backdrop .modal-panel { border-color: var(--rule); }
  #client-modal-backdrop .modal-head .title {
    font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em;
  }
  #client-modal-backdrop .modal-head .sub { color: var(--ink-2); }
  #client-modal-backdrop .field-label { font-weight: 500; }
  #client-modal-backdrop .client-form-section {
    margin: var(--space-4) 0 0; font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em; text-transform: none;
  }
  #client-modal-backdrop .client-form-section .field-optional {
    font-family: var(--font-sans); font-size: var(--text-xs); letter-spacing: 0; color: var(--muted);
  }
  #client-modal-backdrop .field-optional { color: var(--muted); }
  /* Checkbox: the box beside its label, the hint under the label. */
  #client-modal-backdrop .client-form-check { flex: 1 1 100%; display: flex; align-items: flex-start; gap: var(--space-2); }
  #client-modal-backdrop .client-form-check input { width: 1.1rem; height: 1.1rem; margin-top: var(--space-1); }
  /* Retainer / Hourly (beta review Nov 6 #5) — the contract a new client is added with. */
  .client-comp-kind { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
  .client-comp-kind legend { flex: 1 1 100%; padding: 0; }
  .client-form-radio { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: normal; }
  .modal-panel .client-form-radio input[type="radio"] { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; }
  #quick-add-client-backdrop .client-form-check { display: flex; align-items: center; gap: var(--space-2); }
  #quick-add-client-backdrop .client-form-check input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; }
  /* A quiet line under the client's name, not a pill on every row: an
     amber dot, small grey words that darken when pointed at. */
  .contract-missing {
    display: inline-flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-1); padding: 0; line-height: 1.4;
    border: 0; background: none; cursor: pointer; font: inherit; font-size: var(--text-xs); font-weight: 400; color: var(--ink-2); text-align: left;
  }
  .contract-missing::before { content: ""; flex: none; width: 0.375rem; height: 0.375rem; margin-top: var(--space-1); border-radius: var(--radius-pill); background: var(--warn); }
  @media (hover: hover) { .contract-missing:hover { background: none; color: var(--ink); } }
  .contract-missing-note { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--slate); }
  /* Whose client it is (beta review Nov 6 #6): the client page's lobbyists, and the line under a bill's client chips. */
  .client-lobbyists { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--text-sm); }
  .client-lobbyists .field-label { margin: 0; }
  .client-lobbyists select { width: auto; }
  .client-lobbyist { display: inline-flex; align-items: center; gap: var(--space-1); }
  .client-lobbyists-line { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--slate); }
  #client-modal-backdrop .client-form-check .field-label { margin: 0; }
  #client-modal-backdrop .client-form-check .sub { display: block; margin: 0; color: var(--ink-2); }
  #client-modal-backdrop .client-form-note { flex: 1 1 100%; margin: var(--space-1) 0 0; color: var(--ink-2); text-wrap: pretty; }
  /* The form's row layout: a field the full width, a wide one (City),
     or one of a pair (State, ZIP; Effective date, Period). A label that
     opens a new group sits a step lower. */
  #client-modal-backdrop .cf-full { flex: 1 1 100%; }
  #client-modal-backdrop .cf-wide { flex: 2; }
  #client-modal-backdrop .cf-half { flex: 1; }
  #client-modal-backdrop .field-label.cf-gap { margin-top: var(--space-4); }
  /* Shared with the quick-add modal (client_quickadd.js): the name's
     CAL-ACCESS suggestions hang under the name box at its full width;
     "Prefilled from CAL-ACCESS" sits close under it; a state is capitals. */
  :is(#client-modal-backdrop, #quick-add-client-backdrop) .autofill-anchor { position: relative; }
  :is(#client-modal-backdrop, #quick-add-client-backdrop) .autofill-anchor > .autofill-dropdown { top: 100%; left: 0; right: 0; width: auto; }
  :is(#client-modal-backdrop, #quick-add-client-backdrop) .autofill-dropdown .sub { margin: 0; }
  :is(#client-modal-backdrop, #quick-add-client-backdrop) .cf-autofill-note { margin: var(--space-1) 0 0; }
  :is(#client-modal-backdrop, #quick-add-client-backdrop) .cf-state { text-transform: uppercase; }
  #quick-add-client-backdrop .qac-address { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  #quick-add-client-backdrop .qac-address .cf-full { flex: 1 1 100%; }
  #quick-add-client-backdrop .qac-address .cf-wide { flex: 2; }
  #quick-add-client-backdrop .qac-comp { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  #quick-add-client-backdrop .qac-comp > label { flex: 1 1 10rem; }
  #quick-add-client-backdrop .qac-address .cf-half { flex: 1; }

  /* ── Clients list v5 (docs/design-system: Card, data, forms, actions) ──
     Laid over the rules above for the list page only (CLIENTS_BODY; the
     client record and the shared add/edit modal keep theirs). The
     two stat cards are StatTiles — a ringed icon tile beside the number,
     a hairline edge, no lift; .clients-card is a flush Card whose table
     has a tinted, rounded head band in sentence case and rows that tint
     on hover. Each client leads with its LetterTile; bill numbers are
     mono navy; the unseen count is an accent CountPill; a conflict is a
     KindPill. Buttons (Add client, the row menu) keep the app's own
     shape for now: button shape is to change app-wide in one pass. The
     --gold focus ring and the 44px touch floor stay. */

  /* One quiet line in place of the old stat tiles. */
  .clients-gap p { margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--ink-2); text-wrap: pretty; }
  .clients-gap strong { font-weight: 600; color: var(--ink); }

  /* The Client cell: a LetterTile, then the name over its interests. */
  .clients-ident { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; }
  .clients-ident .letter-tile { margin-top: calc(-1 * var(--space-0)); }
  .clients-ident-text { min-width: 0; overflow-wrap: break-word; }
  .clients-card a.clients-name { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .clients-card .clients-interests { color: var(--ink-2); }
  .clients-card .clients-hearing, .clients-card .clients-governor { color: var(--ink-2); font-size: var(--text-xs); }
  .clients-card .clients-hearing-date, .clients-card .clients-governor .next-when { font-weight: 500; }
  .clients-card .next-where { color: var(--muted); }
  .clients-bill-number { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); white-space: nowrap; }
  .clients-card td.clients-count { color: var(--ink); }
  /* CountPill, accent tone: the unseen count on the navy tint. */
  .clients-card .unread-dot {
    height: auto; min-width: 1.5rem; margin-right: 0; padding: 0 var(--space-2);
    background: var(--info-soft); color: var(--link); font-weight: 500; line-height: 1.4;
  }
  /* KindPill "conflict": a borderless red tint with a small dot. */
  .clients-card .due-chip.clients-conflict {
    min-height: 1.375rem; border-color: transparent; background: var(--error-soft); color: var(--error);
  }
  .clients-card .clients-conflict::before {
    content: ""; width: 0.3125rem; height: 0.3125rem; border-radius: var(--radius-pill); background: currentColor; flex: none;
  }
  .clients-card .clients-report a { font-weight: 500; }
  @media (min-width: 641px) {
    .clients-card .clients-table-wrap { padding: 0 var(--space-2) var(--space-2); }
    .clients-card .clients-table { border-collapse: separate; border-spacing: 0; }
    .clients-card .clients-table th {
      border-top: 0; border-bottom: 0; background: var(--paper-50); padding-top: var(--space-2); padding-bottom: var(--space-2);
      font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .clients-card .clients-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .clients-card .clients-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .clients-card .clients-table th:first-child, .clients-card .clients-table td:first-child { padding-left: var(--space-3); }
    .clients-card .clients-table th:last-child, .clients-card .clients-table td:last-child { padding-right: var(--space-2); }
    .clients-card .clients-table tbody tr:last-child td { border-bottom: 0; }
    @media (hover: hover) {
      .clients-card .clients-table tbody tr:hover { background: none; }
      .clients-card .clients-table tbody tr:hover td { background: var(--paper-50); }
    }
  }
  /* The phone card: hairline between clients, labels in sentence case.
     The row menu sits in the card's top-right corner and the filer ID
     drops to its own line under the rest, so the name keeps the width
     the letter tile takes from it rather than sharing it with a column. */
  @media (max-width: 640px) {
    .clients-card .clients-table tr { position: relative; border-bottom-color: var(--rule); }
    .panel.clients-card .clients-table td.clients-name-td { padding-right: var(--space-6); }
    .panel.clients-card .clients-table td.clients-filer-td { grid-column: 1; grid-row: auto; }
    .clients-card .clients-filer-cell .row-menu { position: absolute; top: var(--space-2); right: var(--space-3); }
    .clients-card .clients-table td::before {
      font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .clients-card .clients-table td.clients-hearing, .clients-card .clients-table td.clients-governor,
    .clients-card .clients-table td.clients-count, .clients-card .clients-table td.clients-report,
    .clients-card .clients-table td.clients-ended { margin-left: var(--space-4); padding-left: var(--space-5); }
  }
  /* ── The flagged list's client cell (see billClientSummaryHtml in
       bill_clients.js and the popover wiring in FLAGGED_BODY). The list
       used to draw the full assignment editor in every row — dozens of
       controls at a handful of bills; the cell is now a read-only
       summary that opens that editor in a popover. */
  .clients-summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2);
    width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
    background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
  }
  @media (hover: hover) { .clients-summary:hover { background: var(--accent-soft); border-color: var(--rule); } }
  .clients-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .clients-summary[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--rule-strong); }
  .clients-summary-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); flex: 1 1 auto; }
  .client-position { display: inline-flex; align-items: center; gap: var(--space-1); }
  .client-position-name { font-size: var(--text-xs); font-weight: 600; color: var(--ink); }
  .client-position-empty { font-size: var(--text-xs); color: var(--slate); }
  /* Anchored, fixed-position editor — below .modal-backdrop's z-index so
     the "+ Add new client" quick-add modal it can open sits above it,
     and above the row menus/account menu (z-index 20) it can sit over. */
  .clients-popover {
    position: fixed; z-index: 90; width: min(26rem, calc(100vw - 1rem));
    background: var(--surface); border: 1px solid var(--rule-card);
    box-shadow: var(--shadow-hover); border-radius: var(--radius-lg);
  }
  .clients-popover[hidden] { display: none; }
  .clients-popover-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border-bottom: 1px solid var(--rule);
  }
  .clients-popover-title { font-size: var(--text-sm); font-weight: 700; }
  .clients-popover-body { padding: var(--space-3) var(--space-3); max-height: min(24rem, 70vh); overflow-y: auto; }
  tr.row-link { cursor: pointer; }
  @media (hover: hover) { tr.row-link:hover { background: var(--accent-soft); } }
  .tag { text-transform: uppercase; color: var(--slate); background: var(--accent-soft); text-decoration: none; }
  /* .tag doubles as a link when it's a bill-number pill inside free
     text (see billPills() in LOBBYING_DETAIL_BODY) — everywhere else
     it's a plain, non-interactive span, so this hover rule only ever
     shows up where it's actually clickable. */
  @media (hover: hover) { a.tag:hover { background: var(--accent-solid); color: var(--accent-solid-text); } }
  /* ── A client's stance on a bill: the word and a small dot ──
     The quiet "Dot" badge the founder chose (Nov 14 2026): a white pill
     on a hairline, the position in plain ink, and a small coloured dot
     before it — blue Watch, green Support, grey Neutral, red Oppose. The
     two qualified stances are the same colour as their side but a RING,
     not a filled dot, so "Support if amended" reads apart from "Support"
     by shape as well as by its words.

     The words are always there, so colour is never the only cue on these
     badges. The one place a position shows without its words — a client's
     short code on the followed-bills table (.client-code, below) — keeps
     its side's + / − / = glyph and tint, because there the mark has to
     carry the meaning on its own. */
  .position-badge { background: var(--surface); color: var(--ink); border-color: var(--rule-card); --dot: var(--slate); }
  .position-badge::before {
    content: ""; width: 0.5rem; height: 0.5rem; flex: none; box-sizing: border-box;
    border-radius: var(--radius-pill); background: var(--dot); -webkit-mask: none; mask: none;
  }
  .position-badge.watch { --dot: var(--info); }
  .position-badge.support { --dot: var(--good); }
  .position-badge.sponsor { --dot: var(--good); }   /* Sponsor is a support (positions.SIDES) */
  .position-badge.support_if_amended { --dot: var(--good); }
  .position-badge.neutral { --dot: var(--slate); }
  .position-badge.oppose_unless_amended { --dot: var(--error); }
  .position-badge.oppose { --dot: var(--error); }
  .position-badge.support_if_amended::before,
  .position-badge.oppose_unless_amended::before { background: transparent; border: 2px solid var(--dot); }
  /* A stance that no longer applies: the one it was changed away from,
     and the "removed from the bill" terminus. Both are history, so the
     word goes muted and the dot grey — an Oppose that ended in June
     shouldn't be as loud on the page as the Oppose in force today. */
  .position-badge.was, .position-badge.removed { color: var(--slate); --dot: var(--rule-strong); }
  /* A client's short code (.client-code, bill_clients.js) has no words
     beside it on a wide screen, so it keeps a glyph and a tint: + for
     support, − for oppose, = neutral, a small ring for Watch. Red and
     green is the pair a deuteranopic reader can't separate, so the glyph
     is what carries the position here (P2-31). */
  .client-code.position-badge { border-color: currentColor; }
  .client-code.position-badge::before {
    width: 0.9em; height: 0.9em; border: 0; border-radius: 0; background: currentColor;
    -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  }
  /* The link blue a shade toward ink: plain --accent on the tinted chip
     read 4.4:1, short of AA's 4.5 at this small size (axe, Nov 18 2026). */
  .client-code.position-badge.watch { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 80%, var(--ink)); --ic: var(--icon-dot); }
  .client-code.position-badge.support,
  .client-code.position-badge.sponsor,
  .client-code.position-badge.support_if_amended { background: var(--good-soft); color: var(--good); --ic: var(--icon-plus); }
  .client-code.position-badge.neutral { background: var(--info-soft); color: var(--info); --ic: var(--icon-equals); }
  .client-code.position-badge.oppose_unless_amended,
  .client-code.position-badge.oppose { background: var(--error-soft); color: var(--error); --ic: var(--icon-minus); }
  /* The selects carry their glyph in the option text itself (see
     client_quickadd.js) — ::before doesn't render inside a native
     <select>, and this is the one cue that has to show both in the
     closed control and in the open dropdown. The colour here is the
     redundant half, not the meaning. */
  select.position-select.support { border-color: var(--good); color: var(--good); }
  select.position-select.oppose { border-color: var(--error); color: var(--error); }
  select.position-select.watch { border-color: var(--accent); color: var(--accent); }
  select.position-select.support_if_amended { border-color: var(--good); color: var(--good); }
  select.position-select.oppose_unless_amended { border-color: var(--error); color: var(--error); }
  select.position-select.neutral { border-color: var(--info); color: var(--info); }
  select.position-select.sponsor { border-color: var(--good); color: var(--good); }
  /* Sponsors & votes' scorecard (P2-25): whether a BILL's own outcome —
     not any legislator's personal vote, which this app has never had —
     landed with or against one of the firm's positions on it. Always
     paired with the position-badge it's next to and spelled in words,
     same non-colour-alone rule .position-badge follows above. */
  .verdict-chip { border-color: currentColor; }
  .verdict-chip.with_us { background: var(--good-soft); color: var(--good); }
  .verdict-chip.against_us { background: var(--error-soft); color: var(--error); }
  .verdict-chip.pending { background: transparent; color: var(--slate); border-color: var(--rule-strong); }
  /* ── The client record's own facts (P2-26) ──
     Compensation, effective date, period of contract and agencies
     lobbied. The Form 601 review asked each client for these and the
     record didn't hold them, so the one workflow this app automates
     ended in hand-typing, per client, per filing.

     A definition list in all but name: label above value, wrapping into
     as many columns as fit, and a fact with no value is omitted rather
     than rendered blank — an empty value under a label reads as a
     broken field rather than as an unanswered question. */
  .client-facts {
    display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5);
    margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--rule);
  }
  .client-facts:empty { display: none; }
  /* The header's address, interests and facts fold behind "Details" on a
     phone (audit Y10) so the bills start on the first screen; the name and
     the action buttons stay outside it. From 641px up the summary is hidden
     and the page script opens the disclosure, so the card reads as before. */
  .client-details > summary {
    width: fit-content; padding: var(--space-2) 0; margin-top: var(--space-1);
    cursor: pointer; font-size: var(--text-sm); color: var(--slate);
  }
  .client-details[open] > summary { padding-bottom: 0; }
  @media (min-width: 641px) {
    .client-details > summary { display: none; }
  }
  /* Client detail as a workspace (audit S4): the header card, then a
     tablist (.settings-tabs) whose panels are each one card. The tab
     names the panel, so a panel opens on its one-line description rather
     than a heading. The bill number is the link to its report and keeps
     the chamber cell's accent rather than turning ink. */
  .client-tabs { margin: var(--space-4) 0 var(--space-4); }
  .client-owed { margin: var(--space-4) 0 0; font-size: var(--text-sm); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
  .client-owed-head { font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--space-2); }
  .client-owed ul { margin: 0; padding-left: var(--space-5); }
  .client-owed .owed-report { color: var(--muted); }
  /* Underlined: in dark mode the link blue sits too close to the text
     around it to tell apart by colour alone (axe, Nov 18 2026). */
  .client-owed li > a { text-decoration: underline; text-underline-offset: 2px; }
  .client-panel-lead { margin: 0; padding: var(--space-3) var(--space-4) 0; }

  /* Sponsored measures (Oct 7 audit N5): each measure is a .saved-row
     whose five stages read as one line of small steps — a done one
     ticked, the current one in the accent — the setup strip's pattern
     (.setup-step) at row size. The forms inside a row drop the page
     form's bottom margin; they sit inside a card, not under a heading. */
  .measure-title { margin: 0; font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
  .measure-bill > form, .measure-bill > div { flex: 1 1 100%; }
  .measure-steps { list-style: none; margin: var(--space-1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: var(--text-2xs); color: var(--slate); }
  .measure-step.done { color: var(--ink); }
  .measure-step.current { color: var(--accent); font-weight: 700; }
  .measure-countdowns { margin: var(--space-2) 0 0; padding-left: var(--space-4); font-size: var(--text-xs); }
  .measure-bill { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
  .measure-number { font-variant-numeric: tabular-nums; font-weight: 500; }
  .measure-bill form, .measure-edit form { margin: var(--space-2) 0 0; }
  .measure-attach input { flex: 1; min-width: 10rem; }
  .measure-suggestions { margin: var(--space-2) 0 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); }
  .measure-edit { margin-top: var(--space-2); font-size: var(--text-xs); }
  .measure-sheet:not(:empty) { margin-top: var(--space-2); display: grid; gap: var(--space-2); justify-items: start; }
  .measure-actions { display: flex; align-items: flex-start; gap: var(--space-2); flex: none; }
  /* On a phone the row's text takes the full width and the two buttons
     drop below it, rather than squeezing it into a narrow column. */
  @media (max-width: 640px) {
    .saved-row.measure { flex-wrap: wrap; }
    .measure > .saved-main { flex-basis: 100%; }
  }

  /* ── Client page v5 (docs/design-system: Card, data, forms, actions) ──
     Laid over the client-record rules above (and the "Our take" / setup
     strip ones below) for /clients/detail only, scoped to this page's own
     containers — .client-back, #client (the header card) and
     .client-workspace (the tabs and their panels) — so no other page
     moves. White cards on a hairline with no shadow; the client's name
     as a serif page title; labels and table heads in sentence case; bill
     numbers in mono navy ahead of their titles; in-row actions the
     dashboard's 30px .small. Left as they are on purpose, as on the bill
     page: the button and field shapes, the label pills' one
     base shape (test_design_tokens), and what shared scripts draw — the
     position control, conflict banners, agenda rows, the meeting log and
     position history. */
  .page-head a.client-back {
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.875rem;
    padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-button);
    background: none; color: var(--ink-2); font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
  }
  #client-name { margin-top: var(--space-2); }
  @media (hover: hover) { .page-head a.client-back:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; } }

  /* The header card: the name, the address and interests as meta lines,
     the facts with sentence-case labels, the actions under a hairline. */
  #client > .card {
    display: flex; flex-direction: column; gap: var(--space-3);
    padding: var(--space-5);
  }
  #client > .card > * { margin: 0; }
  #client .client-address { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--ink-2); }
  #client .client-interests {
    margin-top: var(--space-1); max-width: 54rem;
    font-size: var(--text-sm); line-height: 1.55; color: var(--ink-2); text-wrap: pretty;
  }
  #client .client-facts { margin-top: var(--space-3); padding-top: 0; border-top: 0; }
  #client .client-fact-label {
    font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  #client .client-fact-value { color: var(--ink); }
  #client .client-fact:first-child .client-fact-value { font-weight: 600; }
  #client .card-actions { padding-top: var(--space-3); border-top: 1px solid var(--rule); }
  #client .client-header-menu { margin-left: auto; }

  /* Tabs: the design system's underline strip — muted words, the
     current one in ink. */
  .client-workspace .client-tabs { gap: var(--space-5); }
  @media (hover: hover) { .client-tabs .settings-tab:hover { color: var(--ink); } }
  .client-tabs .tab-count { font-weight: 400; color: var(--muted); }

  /* Each panel is a card: hairline edge, no shadow. Its lead line, a
     body, and the add form as a footer under a hairline. */
  .client-workspace .client-panel-lead { padding: var(--space-4) var(--space-4) var(--space-1); color: var(--ink-2); }
  .client-panel-body { padding: var(--space-2) var(--space-4) var(--space-4); }
  .client-panel-foot { padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--rule); }
  /* People & meetings: one card, two labelled sections — the client's
     own people, then the meeting log — split by a hairline. */
  .client-section-head { margin: 0; padding: var(--space-4) var(--space-4) 0; font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
  .client-section-head .tab-count { font-weight: 400; color: var(--muted); }
  .client-people-section + .client-people-section { border-top: 1px solid var(--rule); }
  .client-people-section { scroll-margin-top: var(--space-6); }
  /* The add forms in a panel's foot (and a measure's "Edit details"):
     labelled fields that share a row and wrap, the button level with the
     boxes. .wide takes twice the room; .full a row of its own. */
  .client-workspace .client-field { flex: 1; min-width: 8rem; }
  .client-workspace .client-field.wide { flex: 2; min-width: 12rem; }
  .client-workspace .client-field.full { flex: 1 1 100%; }
  .client-workspace .client-field :is(input, select, textarea) { width: 100%; }
  .client-workspace form > button[type="submit"] { align-self: flex-end; }
  .client-workspace .measure-sheet textarea, #client-notes { width: 100%; }
  #client-name { overflow-wrap: anywhere; text-wrap: balance; }
  #notes-status { margin-top: var(--space-1); }
  #add-bill-loading { margin-top: var(--space-2); }
  #client-search-links { margin: var(--space-2) 0 0; }
  .client-payments-summary { padding-bottom: 0; font-size: var(--text-sm); }
  .client-payments-summary p { margin: 0 0 var(--space-1); }
  .client-workspace .saved-name { font-weight: 500; }

  /* The Bills table: a tinted head row in sentence case; the bill number
     in mono navy, then an ink title; a bill and its "Our take" line tint
     together on hover. */
  .client-bills th {
    background: var(--paper-50); font-size: var(--text-2xs); font-weight: 500;
    letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .client-workspace td.col-bill.chamber {
    font-variant-numeric: tabular-nums; font-size: var(--text-sm); font-weight: 500;
    text-transform: none; color: var(--link);
  }
  .client-bills td.col-title { font-weight: 500; color: var(--ink); }
  .client-bills td.col-author { font-size: var(--text-xs); color: var(--ink-2); }
  @media (hover: hover) {
    .client-bills tbody tr:not(.take-row):hover,
    .client-bills tbody tr:not(.take-row):hover + tr.take-row,
    .client-bills tbody tr:has(+ tr.take-row:hover),
    .client-bills tbody tr.take-row:hover { background: var(--paper-50); }
  }
  /* StatusDot: a white pill on a hairline, the word in --ink-2, the
     stage glyph alone carrying the stage's colour (as on Flagged). */
  .client-bills .status-badge[class*="tone-"] { background: var(--surface); border-color: var(--rule); color: var(--ink-2); }
  .client-bills .status-badge.tone-early::before { color: var(--muted); }
  .client-bills .status-badge.tone-moving::before { color: var(--link); }
  .client-bills .status-badge.tone-passed::before { color: var(--good); }
  .client-bills .status-badge.tone-ended::before { color: var(--error); }
  .client-bills .take-meta { color: var(--muted); }
  /* On a phone each bill is a card; its cell labels in sentence case.
     Two classes, to outrank the shared .bill-cards labels further down. */
  @media (max-width: 900px) {
    .bill-cards.client-bills td.col-next::before, .bill-cards.client-bills td.col-status::before,
    .bill-cards.client-bills td.col-position::before, .bill-cards.client-bills td.col-author::before {
      font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
  }

  /* Contacts: the name in ink, "Primary" a sentence-case tag beside it. */
  .client-contact-name { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .client-contact-name .tag { margin-left: var(--space-2); text-transform: none; letter-spacing: 0; }
  /* Letters: rows inset in a tint, as on the bill page. */
  #letters .saved-row {
    padding: var(--space-2) var(--space-3); margin-bottom: var(--space-1);
    border-bottom: 0; border-radius: var(--radius-md); background: var(--paper-50);
  }
  /* Sponsored measures: the title as a row title, numbers in mono navy. */
  .client-workspace .measure-title { font-weight: 500; }
  .client-workspace .measure-number { font-weight: 500; color: var(--link); }
  .client-workspace .measure-step.current { font-weight: 600; }
  /* Saved searches: bill numbers in mono navy; "New" an accent CountPill. */
  #client-searches .digest-bill { font-weight: 500; color: var(--link); }
  #client-searches .unread-dot {
    height: auto; padding: 0 var(--space-2); background: var(--info-soft); color: var(--link);
    font-family: var(--font-sans); font-weight: 500; line-height: 1.4;
  }
  /* The setup strip: a serif card title, chips as borderless tinted
     pills, suggested bills led by their mono navy number. */
  #client-setup .setup-title {
    font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em;
  }
  #client-setup .setup-step-head h3, #client-setup .setup-num { font-weight: 600; }
  #client-setup .setup-topic { font-weight: 500; background: var(--paper-250); color: var(--ink-2); }
  #client-setup .setup-links a { font-weight: 500; }
  #client-setup .setup-bill .saved-name { font-variant-numeric: tabular-nums; color: var(--ink); }

  @media (max-width: 640px) {
    #client > .card { padding: var(--space-4); }
    #client .bill-title { font-size: var(--text-lg); }
  }

  /* ── Client report (client_report.py) ──
     A memo, not a dashboard: one column at reading width, serif-free so
     it matches the app on screen, and on paper only the memo prints —
     the period switch, buttons and hint are app furniture, the same
     rule the position letter's print view follows. */
  .report-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  #period-switch { margin: 0; }
  .report-since { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--slate); }
  .report-actions { margin: 0 0 0 auto; }
  /* Which bills go in (Nov 2026): the choice, and for a hand-picked
     report a tick list of the client's bills. App furniture — never printed. */
  .report-include { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--slate); }
  .report-include select { font-size: var(--text-sm); }
  .report-pick { max-width: 46rem; margin-top: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-md); font-size: var(--text-sm); }
  .report-pick summary { cursor: pointer; font-weight: 600; }
  .report-pick-actions { display: flex; gap: var(--space-3); margin: var(--space-2) 0; }
  .report-pick-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; max-height: 18rem; overflow-y: auto; }
  .report-pick-list li { padding: var(--space-1) 0; }
  .report-pick-list label { display: flex; gap: var(--space-2); align-items: baseline; }
  .report-pick-list .memo-bill-num { font-weight: 600; white-space: nowrap; }
  /* "Mark sent" (Oct 7 audit C3): the lobbyist's record that it went out.
     App furniture like the period switch — never printed. */
  .report-sent { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--slate); }
  .report-sent label { display: inline-flex; align-items: center; gap: var(--space-2); }
  .report-hint { margin: var(--space-2) 0 var(--space-4); }
  .client-memo { max-width: 46rem; padding: var(--space-6); line-height: 1.6; outline: none; }
  .client-memo:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
  .client-memo h2 { font-size: var(--text-md); margin: var(--space-6) 0 var(--space-2); }
  .client-memo .memo-head h2 { margin-top: 0; font-size: var(--text-lg); }
  .client-memo h3 { font-size: var(--text-base); margin: 0 0 var(--space-1); }
  .client-memo p { margin: 0 0 var(--space-1); }
  .memo-meta { display: grid; gap: var(--space-0); margin: var(--space-2) 0 var(--space-4); }
  .memo-meta div { display: flex; gap: var(--space-2); }
  .memo-meta dt { min-width: 3.5rem; font-weight: 600; }
  .memo-meta dd { margin: 0; }
  .memo-summary { padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule-card); }
  .memo-group { padding-bottom: var(--space-1); border-bottom: 1px solid var(--rule-card); }
  .memo-bill { margin: var(--space-4) 0; break-inside: avoid; }
  .memo-activity { margin: var(--space-1) 0 var(--space-2); padding-left: var(--space-5); }
  .memo-date { font-weight: 600; white-space: nowrap; }
  .memo-quiet { color: var(--slate); font-style: italic; }
  .memo-result { margin-left: var(--space-2); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
  .memo-result.won { color: var(--ink); }
  .memo-result.lost { color: var(--slate); }
  /* The reference card (Nov 2026): the sponsored / priority tags beside a
     bill's title, its plain-English summary, and the dated facts — current
     text, latest action, latest analysis — in one quiet block. */
  .memo-tag { margin-left: var(--space-2); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; color: var(--ink-2); }
  .memo-plain { margin: var(--space-1) 0 var(--space-2); }
  .memo-plain ul { margin: var(--space-1) 0 0; padding-left: var(--space-5); }
  .memo-plain-note { font-size: var(--text-xs); font-weight: 400; color: var(--slate); }
  .memo-facts { display: grid; gap: var(--space-0); margin: var(--space-1) 0 var(--space-2); font-size: var(--text-sm); }
  .memo-facts div { display: flex; gap: var(--space-2); }
  .memo-facts dt { min-width: 7.5rem; font-weight: 600; }
  .memo-facts dd { margin: 0; }
  #arrange-switch { margin: 0; }
  /* Sort, layout and what shows (Nov 2026): app furniture, never printed
     (.report-controls). The calendar layout is a plain table per month,
     the firm's logo a small mark above the letterhead — both print. */
  #layout-switch { margin: 0; }
  .report-show { position: relative; font-size: var(--text-xs); color: var(--slate); }
  .report-show summary { cursor: pointer; font-weight: 600; }
  .report-show-list { position: absolute; z-index: 5; display: grid; gap: var(--space-1); min-width: 15rem; margin-top: var(--space-1);
    padding: var(--space-3); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--ink); }
  .report-show-list label { display: flex; gap: var(--space-2); align-items: center; }
  .report-logo-preview img { display: block; max-width: 14rem; max-height: 4.5rem; margin-bottom: var(--space-2); object-fit: contain; }
  .memo-logo { display: block; width: auto; max-width: 14rem; height: auto; max-height: 4.5rem; margin: 0 0 var(--space-3); object-fit: contain; }
  .memo-subject { color: var(--slate); }
  .memo-calendar { width: 100%; border-collapse: collapse; margin: var(--space-1) 0 var(--space-3); font-size: var(--text-sm); }
  .memo-calendar th, .memo-calendar td { padding: var(--space-2) var(--space-2) var(--space-2) 0; border-bottom: 1px solid var(--rule-card); text-align: left; vertical-align: top; }
  .memo-calendar th { width: 9.5rem; font-weight: 600; white-space: nowrap; }
  .memo-calendar tr { break-inside: avoid; }
  .memo-calendar ul { margin: 0; padding-left: var(--space-4); }
  .memo-cal-day { display: block; font-weight: 400; color: var(--slate); }
  /* Each bill's path (client_report.progress): a bar per step, done steps
     dark, the current one darkest with a bold label, a stopped bill's
     ending in red. Its summary line is for screen readers and the
     plain-text copy only. */
  .memo-progress { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: var(--space-0) 0;
    margin: var(--space-1) 0 var(--space-2); font-size: var(--text-2xs); line-height: 1.25;
    color: var(--slate); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .memo-progress td { padding: 0; vertical-align: top; overflow-wrap: break-word; hyphens: auto; }
  .memo-progress-bar { display: block; height: var(--space-1); border-radius: var(--radius-xs); margin-bottom: var(--space-1); background: var(--rule-card); }
  .memo-progress .done .memo-progress-bar { background: var(--ink-2); }
  .memo-progress .current { color: var(--ink); font-weight: 600; }
  .memo-progress .current .memo-progress-bar { background: var(--ink); }
  .memo-progress .ended { color: var(--error); font-weight: 600; }
  .memo-progress .ended .memo-progress-bar { background: var(--error); }
  .memo-progress-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .client-memo.copying .memo-progress { display: none; }
  .client-memo.copying .memo-progress-text { position: static; width: auto; height: auto; margin: 0 0 var(--space-1); overflow: visible; clip: auto; white-space: normal; }
  /* The saved parts (Oct 7 audit C2): the cover note and each bill's
     "Our take". Their indicator and an empty one's placeholder are app
     furniture — hidden on paper and when copying (.copying). */
  .memo-cover { margin: 0 0 var(--space-4); }
  .memo-take { margin-top: var(--space-2); }
  .memo-editable { white-space: pre-wrap; outline: none; border-radius: var(--radius-sm); min-height: 1.6em; }
  .memo-editable:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
  .memo-editable:empty::before { content: attr(data-placeholder); color: var(--slate); font-style: italic; }
  .memo-take-date { color: var(--slate); font-weight: 400; }
  .memo-take-stale { color: var(--warn); font-weight: 600; font-size: var(--text-xs); }
  .memo-ui { display: block; font-size: var(--text-xs); color: var(--slate); }
  .client-memo.copying .memo-ui, .client-memo.copying .is-empty, .client-memo.copying .memo-screen-only { display: none; }
  @media (max-width: 767px) {
    .client-memo { padding: var(--space-4); }
    /* The reference card's labels sit above their values on a phone. */
    .memo-facts div { flex-direction: column; gap: 0; }
    /* Eight labels don't fit a phone: the bars alone, and the summary
       line under them in words. */
    .memo-progress td { font-size: 0; }
    .memo-progress { margin-bottom: var(--space-0); }
    .memo-progress-text { position: static; width: auto; height: auto; margin: 0 0 var(--space-1);
      overflow: visible; clip: auto; white-space: normal; font-size: var(--text-2xs); color: var(--slate); }
    .report-actions { margin-left: 0; }
  }
  @media print {
    .app-sidebar, .app-topbar, .page-head, .report-controls, .report-hint, .report-sent, .report-pick, #error,
    .skip-link, #page-progress, .client-memo .memo-ui, .client-memo .is-empty { display: none !important; }
    .client-memo .memo-screen-only { display: none !important; }
    .app-main { padding: 0 !important; }
    .client-memo { border: 0; box-shadow: none; padding: 0; max-width: none; color: #000; background: #fff; }
    .client-memo a { color: inherit; text-decoration: none; }
  }

  /* ── Client report v5 (docs/design-system: Card, data, forms) ──
     Laid over the rules above for /clients/report, scoped to
     .client-report-page, and screen-only: on paper the memo prints
     exactly as it did, and "Copy for email" takes markup, not these
     styles. A serif page title; the period switch a SegmentedControl
     (a paper track, the current period a white thumb); the "sent" state
     a borderless tinted chip that wraps rather than clips on a phone;
     the memo a white card on a hairline with no shadow, its bill
     numbers in mono navy and each outcome a VerdictChip. Buttons and
     fields keep the app's own shape. */
  @media screen {
    .client-report-page .page-head #back-link { margin-bottom: var(--space-2); }
    /* "← <client>" with a long name ends in an ellipsis rather than
       running past the edge on a phone. */
    .client-report-page .page-head > div { min-width: 0; max-width: 100%; }
    .client-report-page .page-head #back-link {
      display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5rem;
    }
    .client-report-page #period-switch { flex-wrap: wrap; border: 0; background: var(--paper-350); }
    .client-report-page #period-switch [data-period] { color: var(--ink-2); }
    .client-report-page #period-switch [data-period][aria-current="page"] {
      background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-rest);
    }
    @media (hover: hover) {
      .client-report-page #period-switch [data-period]:not([aria-current]):hover { background: none; color: var(--ink); }
    }
    .client-report-page .report-since, .client-report-page .report-sent { font-weight: 500; color: var(--ink-2); }
    .client-report-page .report-sent .letter-pill { border-color: transparent; max-width: 100%; white-space: normal; text-align: left; }
    .client-report-page .report-sent .letter-pill:not(.submitted) { background: var(--paper-250); color: var(--ink-2); }
    /* A long contact name shrinks its select instead of running past the edge on a phone. */
    .client-report-page .report-sent label { max-width: 100%; min-width: 0; }
    .client-report-page .report-sent select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
    .client-report-page .report-hint { color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
    .client-report-page .report-hint > .sub { margin: 0; }
    /* The toolbar as three labelled rows (Nov 13 2026 declutter) — what's
       in the report, print or share, the sent record — on one hairline
       card, each row's label in a fixed column so the controls line up.
       Screen-only like the rest; print leaves the whole toolbar out. */
    .client-report-page .report-controls {
      display: block; padding: 0 var(--space-4);
      border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--surface);
    }
    .client-report-page .report-group { display: flex; align-items: center; gap: var(--space-2) var(--space-4); margin: 0; padding: var(--space-3) 0; }
    .client-report-page .report-group + .report-group { border-top: 1px solid var(--rule-card); }
    .client-report-page .report-group[hidden] { display: none; }
    /* "Since last sent" waits for a recorded send (audit C3, markPeriod);
       .scope-option's display was beating its [hidden]. */
    .client-report-page #period-switch [hidden] { display: none; }
    .client-report-page .report-group-label { flex: 0 0 8.5rem; font-size: var(--text-xs); font-weight: 500; color: var(--muted); }
    .client-report-page .report-group-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); flex: 1 1 auto; min-width: 0; margin: 0; }
    @media (max-width: 767px) {
      .client-report-page .report-controls { padding: 0 var(--space-3); }
      .client-report-page .report-group { flex-direction: column; align-items: stretch; gap: var(--space-2); }
      .client-report-page .report-group-label { flex: none; }
    }
    .client-report-page .client-memo { border-color: var(--rule); box-shadow: none; }
    .client-report-page .client-memo .memo-meta dt { font-weight: 500; color: var(--muted); }
    /* BillNumber: every bill the memo links to, ahead of its title. */
    .client-report-page .client-memo a[href^="/report?bill_id"] {
      font-variant-numeric: tabular-nums; font-size: var(--text-sm); font-weight: 500; color: var(--link); white-space: nowrap;
    }
    @media (hover: hover) { .client-report-page .client-memo a[href^="/report?bill_id"]:hover { color: var(--ink); } }
    /* VerdictChip: the outcome against the position, a tinted pill. */
    .client-report-page .memo-result {
      display: inline-flex; align-items: center; padding: 0 var(--space-2); border-radius: var(--radius-pill);
      font-weight: 500; line-height: 1.6; vertical-align: 0.1em;
    }
    .client-report-page .memo-result.won { background: var(--good-soft); color: var(--good); }
    .client-report-page .memo-result.lost { background: var(--error-soft); color: var(--error); }
    .client-report-page .memo-quiet, .client-report-page .memo-take-date,
    .client-report-page .memo-ui, .client-report-page .memo-editable:empty::before { color: var(--muted); }
    /* Shareable link (founder, Nov 15 2026): the firm's panel of links,
       never printed, and the page an outside reader opens (shared_report.py). */
    .client-report-page .report-links { margin: 0 0 var(--space-4); }
    .client-report-page .report-links-list { list-style: none; padding: 0; margin: var(--space-2) 0; }
    .client-report-page .report-links-list li { padding: var(--space-2) 0; border-top: 1px solid var(--rule); }
    .client-report-page .report-link-new { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
    .client-report-page .report-link-new input[type="text"] { flex: 1 1 20rem; min-width: 0; }
    .shared-report-page { max-width: 48rem; margin: 0 auto; padding: var(--space-6) var(--space-4); }
    .shared-report-page .client-memo { max-width: none; }
    .shared-report-page .memo-head h1 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
    .shared-report-page .memo-where { color: var(--muted); }
    .shared-report-page .shared-report-note { color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-4); }
  }
  @media print {
    .client-report-page .report-links, .shared-report-page .shared-report-note { display: none !important; }
  }

  /* ── Client reports list v5 (docs/design-system: Card, data) ──
     Documents > Client reports, scoped to .client-reports-page (the
     .disc-table rules are the Prepared forms list's too). A serif page
     title; the list a flush Card whose table head is a tinted, rounded
     band in sentence case and whose rows tint on hover; "Open report →"
     a link. On a phone each client is a card with its facts labelled,
     not a five-column table pushing the page sideways. */
  .client-reports-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .client-reports-scroll { overflow-x: auto; padding: var(--space-2); }
  .client-reports-page .client-reports-table td.cr-client { font-weight: 500; color: var(--ink); }
  .client-reports-page .client-reports-table td.date { color: var(--ink-2); }
  .client-reports-page .client-reports-table td.cr-sent { white-space: normal; }
  .client-reports-page .client-reports-table .due-none { color: var(--muted); }
  .client-reports-page .client-reports-table a.disc-review-link { font-size: var(--text-sm); font-weight: 500; color: var(--link); }
  @media (hover: hover) { .client-reports-page .client-reports-table a.disc-review-link:hover { color: var(--ink); } }
  @media (min-width: 641px) {
    .client-reports-page .client-reports-table { border-collapse: separate; border-spacing: 0; }
    .client-reports-page .client-reports-table thead th {
      border-top: 0; border-bottom: 0; background: var(--paper-50);
      font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .client-reports-page .client-reports-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .client-reports-page .client-reports-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .client-reports-page .client-reports-table th:first-child, .client-reports-page .client-reports-table td:first-child { padding-left: var(--space-3); }
    .client-reports-page .client-reports-table th:last-child, .client-reports-page .client-reports-table td:last-child { padding-right: var(--space-3); }
    .client-reports-page .client-reports-table tbody tr:last-child td { border-bottom: 0; }
    @media (hover: hover) { .client-reports-page .client-reports-table tbody tr:hover td { background: var(--paper-50); } }
  }
  @media (max-width: 640px) {
    .client-reports-scroll { overflow: visible; padding: 0; }
    .client-reports-page .client-reports-table, .client-reports-page .client-reports-table tbody, .client-reports-page .client-reports-table td { display: block; }
    .client-reports-page .client-reports-table thead { display: none; }
    .client-reports-page .client-reports-table tr { display: block; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule); }
    .client-reports-page .client-reports-table tr:last-child { border-bottom: 0; }
    .client-reports-page .client-reports-table td, .client-reports-page .client-reports-table td:first-child, .client-reports-page .client-reports-table td:last-child {
      padding: var(--space-0) 0; border: 0; text-align: left; white-space: normal;
    }
    .client-reports-page .client-reports-table td:empty { display: none; }
    .client-reports-page .client-reports-table td.cr-client { font-size: var(--text-base); }
    .client-reports-page .client-reports-table td.cr-open { padding-top: var(--space-1); }
    .client-reports-page .client-reports-table :is(td.cr-prepared, td.cr-period, td.cr-sent)::before {
      margin-right: var(--space-1); font-size: var(--text-xs); font-weight: 500; color: var(--muted);
    }
    .client-reports-page .client-reports-table td.cr-prepared::before { content: "Last prepared"; }
    .client-reports-page .client-reports-table td.cr-period::before { content: "Period"; }
    .client-reports-page .client-reports-table td.cr-sent::before { content: "Last sent"; }
  }
  /* "Our take" (Oct 7 audit C2): this client's commentary, a full-width
     line under each of their bills, joined to the bill's row above. */
  .client-bills tr:has(+ tr.take-row) > td { border-bottom: 0; }
  .client-bills tr.take-row > td { padding-top: 0; }
  .take-input, .reasons-input { display: block; width: 100%; resize: vertical; min-height: 2.75rem; margin-top: var(--space-1); }
  .take-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 1.2em; font-size: var(--text-xs); color: var(--slate); }
  .take-when.is-stale { color: var(--warn); font-weight: 600; }
  .col-take .field-label .sub { font-weight: 400; }
  /* Folded until clicked (Nov 13 declutter): an empty box is a "+ …"
     button on one line; a box with text shows open as before. */
  .take-adds { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--text-xs); }
  .take-adds .take-add[hidden], .take-adds:not(:has(.take-add:not([hidden]))) { display: none; }
  .take-field + .take-field, .take-field + .take-adds { margin-top: var(--space-2); }
  .take-field[hidden] + .take-field, .take-field[hidden] + .take-adds { margin-top: 0; }
  .client-workspace td.chamber a { color: inherit; text-decoration: none; }
  .client-fact { display: flex; flex-direction: column; gap: var(--space-0); min-width: 8rem; }
  .client-fact-label {
    font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--slate);
  }
  /* Compensation is the one of the four a reader scans for — it's the
     number a quarterly filing reports — so it gets weight without
     getting its own colour. */
  .client-fact-value { font-size: var(--text-sm); }
  .client-fact:first-child .client-fact-value { font-weight: 700; }

  /* A new client's setup strip (workflow audit B1): three numbered steps
     in one card at the head of the Bills tab, until the client has three
     bills. A finished step keeps its content (the topics stay editable,
     the searches stay listed) and swaps its number for a tick. */
  .setup-strip { padding: var(--space-4); border-bottom: 1px solid var(--rule); }
  .setup-title { margin: 0; font-size: var(--text-base); font-weight: 700; }
  .setup-strip > .sub { margin: var(--space-1) 0 0; }
  .setup-steps { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-4); }
  .setup-step-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
  .setup-step-head h3 { margin: 0; font-size: var(--text-sm); font-weight: 700; }
  .setup-num {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: var(--space-5); height: var(--space-5); border-radius: var(--radius-pill);
    font-size: var(--text-xs); font-weight: 700; color: var(--accent); background: var(--accent-soft);
  }
  .setup-step.done .setup-num { color: var(--accent-solid-text); background: var(--accent-solid); }
  .setup-step > :not(.setup-step-head) { margin-left: var(--space-6); }   /* the number badge plus the gap */
  .setup-hint { margin-top: var(--space-1); margin-bottom: 0; }
  .setup-topic-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .setup-topic {
    font-size: var(--text-xs); font-weight: 600; color: var(--ink);
    background: var(--content-bg); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-3);
  }
  .setup-topics-form { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .setup-topics-form input { flex: 1; min-width: 12rem; }
  .setup-bills { list-style: none; margin: 0; padding: 0; }
  .setup-bill {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
    padding: var(--space-2) 0; border-bottom: 1px solid var(--rule);
  }
  .setup-bill:last-child { border-bottom: 0; }
  .setup-bill .saved-main { flex: 1 1 14rem; }
  .setup-bill-title { font-size: var(--text-sm); margin-left: var(--space-2); }
  .setup-position { font-size: var(--text-xs); }
  /* Each topic a chip, not a word in a " · " run: as inline links they
     were 16px-tall targets packed a separator apart. */
  .setup-links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: var(--text-sm); }
  .setup-links a {
    display: inline-flex; align-items: center; min-height: 1.5rem;
    padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none;
  }
  @media (hover: hover) { .setup-links a:hover { background: var(--accent-solid); color: var(--accent-solid-text); } }

  /* ── Client intake v5 (docs/design-system: Card, forms, data) ──
     /clients/intake, scoped to .client-intake-page (the setup-strip
     rules above are the client page's too). A serif page title; the
     three steps one white card on a hairline, each step's title in the
     card serif; the recorded facts as muted label + ink value; bill
     numbers in mono navy. */
  .client-intake-page .page-head a.client-back { margin-bottom: var(--space-2); }
  .client-intake-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .client-intake-page .intake-steps {
    margin: 0 0 var(--space-4); padding: var(--space-5); gap: var(--space-5);
  }
  .client-intake-page .setup-step-head { gap: var(--space-3); }
  .client-intake-page .setup-title {
    font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  }
  .client-intake-page .setup-num { font-weight: 600; }
  .client-intake-page .setup-step > :not(.setup-step-head) { margin-left: var(--space-6); }
  .client-intake-page .setup-step .sub { margin-top: var(--space-2); margin-bottom: 0; color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
  .client-intake-page .setup-step .sub:first-child { margin-top: 0; }
  .client-intake-page .setup-step .intake-fact { margin-top: var(--space-1); color: var(--ink); }
  .client-intake-page .intake-fact-label, .client-intake-page .intake-fact-missing { color: var(--muted); }
  .client-intake-page .intake-note strong { font-weight: 500; color: var(--ink); }
  .client-intake-page .intake-note a, .client-intake-page .setup-step .sub a { font-weight: 500; }
  .client-intake-page .intake-list { margin: var(--space-1) 0 0; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--ink-2); }
  .client-intake-page .intake-list li { margin-top: var(--space-1); }
  .client-intake-page .intake-bill-number { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); white-space: nowrap; }
  /* Checkbox: navy when ticked, the box beside its label. */
  .client-intake-page .intake-check { display: flex; align-items: flex-start; gap: var(--space-2); }
  .client-intake-page .intake-check input { width: auto; margin-top: var(--space-1); accent-color: var(--link); }
  .client-intake-page .intake-check .field-label { margin: 0; font-weight: 500; }
  @media (max-width: 640px) {
    .client-intake-page .intake-steps { padding: var(--space-4); }
    .client-intake-page .setup-step > :not(.setup-step-head) { margin-left: 0; }
  }

  /* One assigned client on a bill (billClientCellHtml): a small card —
     the client's name with a Remove word on the top line, and under it
     the shared position control (.position-control below), the same
     control the client record's bill table draws. It used to be a pill
     holding the dropdown with the date hanging loose underneath, which
     is why the three places a position is edited looked like three
     different things (audit S7). */
  .client-assignment {
    padding: var(--space-2) 0; margin-bottom: var(--space-1);   /* no inner box (D2) */
    border-bottom: 1px solid var(--rule);
  }
  .client-assignment:last-child { border-bottom: 0; }
  .client-chip { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
  .client-chip > a { font-size: var(--text-sm); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
  /* The ONE position control (position_control.js): position, the date
     it has been in force since, and whether it saved — drawn the same on
     Flagged's pop-up, the bill page and the client record's bill table.
     Wraps onto a second line in a narrow column rather than squeezing. */
  .position-control { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
  .position-control select.position-select { font-size: var(--text-xs); font-weight: 600; padding: var(--space-1) var(--space-2); }
  .pc-since { display: inline-flex; align-items: center; gap: var(--space-1); }
  .pc-since label { font-size: var(--text-xs); color: var(--slate); white-space: nowrap; }
  .pc-since input[type="date"] { font-size: var(--text-xs); padding: var(--space-0) var(--space-1); width: auto; }
  .pc-status { font-size: var(--text-xs); }
  /* The "Authorization" disclosure reads at the control's own size, not body size. */
  .pc-details summary { font-size: var(--text-xs); }
  /* A finished bill's position, read-only (position_control.js endedPositionHtml, audit Y4). */
  .position-ended { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-xs); }
  .position-ended .pe-since { color: var(--slate); }
  .position-ended .pe-actions { display: inline-flex; gap: var(--space-3); }
  .position-ended-unset .pe-hint { margin: 0 0 var(--space-1); font-size: var(--text-xs); color: var(--slate); }
  /* Amended since this position took effect (position_control.js's
     rereviewHtml): the note, and the one-click "Still Oppose as amended".
     Its own line under the control, so it never squeezes the select. */
  .pc-rereview { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
  .pc-rereview .pc-reconfirm { font-size: var(--text-xs); padding: var(--space-1) var(--space-3); }
  .rereview-note { font-size: var(--text-2xs); font-weight: 600; color: var(--warn); }
  /* On Flagged's read-only cell it sits under that client's name and
     badge, so it can't push the badge into a column of its own. */
  .client-position:has(.rereview-note) { flex-wrap: wrap; }
  .client-position .rereview-note { flex-basis: 100%; }
  /* The firm on both sides of one bill (conflict_check.js, Oct 7 audit
     C1): the inline panel a save pauses on, and the banner on the bill
     page, the letter editor and the client page. Warn-toned while open;
     a recorded consent drops to a quiet note. */
  .conflict-panel, .conflict-banner {
    flex-basis: 100%; background: var(--warn-soft); border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4); margin: var(--space-2) 0;
  }
  .conflict-banner[data-status="waived"] { background: var(--content-bg); }
  .conflict-q { margin: 0 0 var(--space-1); font-size: var(--text-sm); font-weight: 600; }
  .conflict-sides, .conflict-banner p { margin: 0 0 var(--space-1); font-size: var(--text-xs); }
  .conflict-list { margin: 0 0 var(--space-1); padding-left: var(--space-5); font-size: var(--text-xs); }
  .conflict-choices { border: 0; padding: 0; margin: var(--space-2) 0; display: grid; gap: var(--space-2); }
  .conflict-choice { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
  .conflict-consent { display: grid; gap: var(--space-2); padding-left: var(--space-5); }
  .conflict-consent[hidden] { display: none; }
  .conflict-date { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
  .conflict-date label, .conflict-consent > label { font-size: var(--text-xs); }
  .conflict-date input[type="date"] { width: auto; }
  .conflict-error { margin: 0; font-size: var(--text-xs); color: var(--error); }
  .conflict-error:empty { display: none; }
  .conflict-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
  .clients-conflict { margin-top: var(--space-1); }
  /* A colleague saved this after it was opened here (Oct 7 audit T5):
     the letter editor's "See theirs / Keep yours". The conflict banner's
     warn tone — both are a pause before something is lost. */
  .stale-save { background: var(--warn-soft); border-radius: var(--radius-md);
                padding: var(--space-3) var(--space-4); margin: var(--space-2) 0; }
  .stale-save[hidden] { display: none; }
  .stale-save p { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
  .stale-save-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  /* Removing a client is a word, in the error colour — not a × that sat
     30px from the pop-up's own close × and looked identical to it
     (whole-app audit Y8). × now only ever means close. */
  .client-chip .chip-remove {
    background: none; border: 0; padding: var(--space-0) var(--space-2); min-height: 1.5rem;
    font: inherit; font-size: var(--text-xs); font-weight: 600; color: var(--error); cursor: pointer;
  }
  /* The "add a new client to this bill" control below the chips above —
     deliberately NOT styled like a position-select (those change an
     *existing* assignment; this one adds a new one), so a dashed
     outline + plain "+ Add client" wording reads as its own distinct
     affordance rather than a second, competing way to do what the chips
     above already do. */
  .add-client-select {
    font-size: var(--text-xs); font-weight: 600; color: var(--slate); background-color: transparent;
    border: 1px dashed var(--rule-strong); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-2);
  }
  @media (hover: hover) { .add-client-select:hover { border-color: var(--accent); color: var(--accent); } }
  /* Filter tabs above a flagged/client-position list — same All/Support/
     Oppose/Watch vocabulary as the position badges above, just as a
     filter instead of a per-row value. */
  /* Wraps: on /alerts these rows sit inside a .panel (overflow: hidden),
     so a nowrap row didn't scroll, it was cut — at 375px "Votes" was
     wholly past the card edge and "Paused" half of it, leaving a phone
     unable to pause the digest. */
  .filter-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
  .filter-tab {
    font: inherit; font-size: var(--text-xs); font-weight: 600; color: var(--slate);
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-3); cursor: pointer;
  }
  @media (hover: hover) { .filter-tab:hover { border-color: var(--ink); } }
  /* Selected is a tint, not the solid fill. The solid cream pill
     (--accent-solid) means "this does something" — Search, Flag, Save —
     and when every chosen session, filter, preset and view wore it too,
     /lookup showed ~10 identical cream shapes and the one real action
     stopped standing out. Selected state now reads from a soft tint,
     an --ink edge (vs --rule-strong at rest) and --ink text (vs
     --slate), plus the check below — so it never rests on colour
     alone. Measured on the dark page: --ink on the tint over --surface
     ≈ 16:1. The :not()s keep a zero-count / unavailable tab that
     happens to be current exactly as the disabled rules draw it. */
  .filter-tab.active {
    background: var(--accent-soft); color: var(--ink); border-color: var(--ink);
  }
  /* Hover on a selected tab can't be "border goes --ink" (it already
     is), so the tint deepens to --rule's 14% instead. */
  @media (hover: hover) {
    .filter-tab.active:not([disabled]):not([aria-disabled="true"]):hover { background: var(--rule); }
  }
  /* The count takes the tab's own colour — --slate at rest, --ink
     when pressed. It used to sit at opacity 0.7 on top of that,
     which took --slate to 3.09:1 (light) / 4.39:1 (dark) — below AA
     for a number the user is meant to read. Mono + size set it apart. */
  /* Pressed state isn't colour alone: a check leads every active tab. */
  .filter-tab.active::before { content: ""; --ic: var(--icon-check); margin-right: var(--space-1); }
  .filter-tab .n { font-variant-numeric: tabular-nums; font-size: var(--text-xs); margin-left: var(--space-1); }

  /* Calendar-scoped underline tabs (Upcoming/Past). The shared .filter-tab
     above is a pill; the hearing calendar renders the same toggle as
     underline tabs per the mockup, so it uses these instead of .filter-tab.
     Kept separate so the pill styling elsewhere (lookup/alerts/flagged) is
     untouched. */
  .cal-tabs { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--rule); margin-bottom: var(--space-4); }
  .cal-tab {
    font: inherit; font-size: var(--text-sm); font-weight: 400; color: var(--slate);
    background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
    padding: var(--space-2) var(--space-0); margin-bottom: -1px; cursor: pointer; white-space: nowrap;
  }
  @media (hover: hover) { .cal-tab:hover { color: var(--ink); } }
  .cal-tab.active { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
  .cal-tab .n { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--slate); margin-left: var(--space-1); }
  /* Relative marker on a hearing group's date (Today/Tomorrow/In N days).
     Plain gold text, no pill — see the mockup; deliberately not .tag, which
     is reused for bill-number pills elsewhere. */
  .cal-when { font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate); }
  .page-head-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
  /* The work-calendar link panel (calendar_feed.py): numbered setup
     steps, then the private link in a read-only field beside Copy. */
  /* .panel carries no padding of its own (its rows bring theirs); this
     card's contents are loose paragraphs and switches, so it pads itself. */
  .panel.feed-card { padding: var(--space-4); }
  .feed-steps { margin: var(--space-3) 0 var(--space-2); padding-left: var(--space-5); font-size: var(--text-sm); }
  .feed-steps li { margin: var(--space-1) 0; }
  .feed-link { display: flex; gap: var(--space-2); align-items: center; }
  .feed-link input { flex: 1 1 auto; min-width: 0; font-size: var(--text-xs); }

  /* ── Sidebar app shell (app_shell()) ──────────────────────────────
     Only for signed-in pages, rolled out one page at a time — see
     app_shell()'s own docstring. Public pages keep the plain .wrap
     single-column layout above and just inherit the new tokens. */
  .app-shell { display: flex; min-height: 100vh; }
  /* Flat, Wispr Flow-style (founder, Oct 29 2026): icon + label rows on
     the shell's own grey. The whole column fits a laptop screen; on a
     shorter window it scrolls as one, the main page untouched. */
  .app-sidebar {
    /* Inside the sidebar the hairline and card edge are Flow's greys. */
    --rule: var(--shell-rule); --rule-soft: color-mix(in srgb, var(--shell-rule) 50%, transparent); --rule-card: var(--shell-card-rule);
    width: var(--sidebar-width); flex: none; background: var(--sidebar); border-right: 1px solid var(--rule);
    display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0;
    /* No bottom padding: the foot carries it, so nothing shows under the
       foot when it is held at the bottom of a scrolled sidebar. */
    padding: var(--space-3) var(--space-2) 0; overflow-y: auto; overscroll-behavior: contain;
  }
  /* Above the drawer width the app fills the browser edge to edge (no
     rounded window frame — the founder asked for it gone, Oct 16 2026): the sidebar is fixed in that window and .app-main is what
     scrolls. Below 900px the page goes back to scrolling as a whole —
     the drawer, the phone's collapsing address bar and the full width
     all want that, and a 14px frame round a phone screen is lost room. */
  @media (min-width: 901px) {
    body:has(.app-shell) { background: var(--shell-main); }
    .app-shell {
      position: fixed; inset: 0; min-height: 0;
      overflow: hidden; background: var(--shell-main);
    }
    .app-sidebar { height: auto; position: relative; }
    .app-body { min-height: 0; }
    /* Its scrollbar comes and goes with page height, and where scrollbars
       take up room (a mouse plugged in, or macOS set to always show them)
       every click between a short page and a tall one slid the content
       ~15px sideways. Keep that room reserved so every page is one width. */
    .app-main { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
    /* /mike's chat fills what the heading leaves rather than guessing it
       (100dvh - 12rem came out a few px over the framed window, so the
       whole page grew a scrollbar with nothing to scroll). */
    .app-main:has(> #mike-page) { display: flex; flex-direction: column; }
    .app-main > #mike-page { flex: 1 1 0; height: auto; }
  }
  /* On paper the window is no frame and nothing scrolls: the page runs on. */
  @media print {
    .app-shell { position: static; overflow: visible; box-shadow: none; border-radius: 0; }
    .app-main { overflow: visible; }
  }
  /* Hidden on desktop — the hamburger next to it exists only for the
     ≤900px drawer version of the sidebar below (see that media query),
     so there's nothing for it to open until then. Two classes
     (.icon-btn.app-topbar-menu-btn), not one — .icon-btn's own
     `display: flex` (defined later in this file) would otherwise win
     the display property on source order alone, since a single-class
     selector here ties with it on specificity. */
  .icon-btn.app-topbar-menu-btn { display: none; flex: none; }
  /* The logo-goes-home link every app keeps in its top bar. Desktop has
     it in the sidebar; with the sidebar a closed drawer, it lives here. */
  .app-topbar-home { display: none; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--ink); }
  .app-topbar-home .brand-mark { width: 22px; height: 22px; }
  /* Full-screen scrim behind the mobile sidebar drawer, closing it on
     click same as .row-menu-dropdown/.autofill-dropdown close on
     click-outside elsewhere in this file. Hidden/display:none outside
     the ≤900px drawer state so it never intercepts clicks on desktop,
     where the sidebar is always visible and never "open" in this sense. */
  .app-sidebar-backdrop { display: none; position: fixed; inset: 0; background: var(--scrim); z-index: 39; }
  .app-sidebar-backdrop.show { display: block; }
  /* Logo and the fold button on one row at the top of the sidebar. */
  .app-sidebar-head { display: flex; align-items: center; gap: var(--space-2); flex: none; padding: 0 0 var(--space-2) var(--space-3); }
  .app-brand {
    display: flex; align-items: center; flex: 1; min-width: 0; min-height: 2rem;
    font-family: var(--font-display); font-weight: 600;
    /* A step up from body size (Nov 16 2026): at --text-base the mark
       came out 12px, smaller than every icon in the column under it. */
    font-size: var(--text-md); letter-spacing: -0.005em;
    color: var(--ink); text-decoration: none;
  }
  /* No square badge — just the mark itself, colored like the rest of
     the app's text (--ink), sitting directly on --paper. Light mode:
     dark mark on white. Dark mode: white mark on black. */
  /* The nav takes the spare height, which puts the setup card and the
     foot at the bottom; a short window scrolls the whole sidebar. */
  nav.app-nav { flex: 1 0 auto; }
  .app-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-0); }
  /* "Today" / "Work" / "Firm": Flow's small spaced capitals. */
  .side-nav-group {
    margin: 0; padding: var(--space-3) var(--space-3) var(--space-1);
    font-size: var(--text-2xs); font-weight: 500; color: var(--shell-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
  }
  /* flex: none — Ask Mike's link is a row of the sidebar's own column,
     not of a list, and was squeezed to 21px whenever the column ran out
     of height. Every row is 36px, the foot's Settings included. */
  .side-nav-item {
    flex: none; height: 36px; display: flex; align-items: center; gap: var(--space-3); border-radius: var(--radius-sm); padding: 0 var(--space-3);
    font-size: var(--text-sm); font-weight: 400; color: var(--ink-2); text-decoration: none;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }
  .side-nav-item svg { width: 20px; height: 20px; flex: none; }
  /* Hover tints only once the pointer has really moved on this page
     (app_shell's script drops .nav-pointer-idle on the first
     pointermove). A freshly loaded page otherwise inherits whatever
     item sits under a resting cursor (after Back, a keyboard or palette
     jump, a scripted browser) and paints it grey beside the real
     current item. The current item never takes the hover tint. */
  @media (hover: hover) { .app-shell:not(.nav-pointer-idle) .side-nav-item:not(.active):hover { background: var(--nav-hover); color: var(--ink); } }
  /* "You are here" is more than the hover tint — a deeper soft fill, ink
     text and bold — so hovering another item never makes two look
     current (WCAG 1.4.1; whole-app audit Y27). No edge, no shadow. */
  .side-nav-item[hidden] { display: none; }
  .side-nav-item.active { background: var(--nav-active); color: var(--ink); font-weight: 600; }
  /* Alerts' unseen-change count (app_shell's script): an ink pill, a
     number, with "new" said to a screen reader, so the colour carries
     nothing alone. */
  .side-nav-badge {
    display: inline-block; margin-left: auto; min-width: 1.25rem; padding: 0 var(--space-1);
    border-radius: var(--radius-pill); background: var(--accent-solid); color: var(--accent-solid-text);
    font-size: var(--text-2xs); font-weight: 600; line-height: 1.25rem; text-align: center;
  }
  .side-nav-badge[hidden] { display: none; }
  /* The fold button under the nav (app_shell()'s script). Styled as one
     more sidebar row, quieter than the destinations above it. Desktop
     only: below 900px the sidebar is a drawer and has nothing to fold. */
  /* An icon button beside the logo; its words are for screen readers
     and its tooltip. */
  .sidebar-collapse-btn {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 32px; height: 32px; padding: 0;
    border: none; border-radius: var(--radius-sm); background: none; cursor: pointer;
    font: inherit; color: var(--shell-muted);
  }
  .sidebar-collapse-btn .side-nav-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .sidebar-collapse-btn svg { width: 20px; height: 20px; flex: none; }
  @media (hover: hover) { .sidebar-collapse-btn:hover { background: var(--nav-hover); color: var(--ink); } }
  @media (max-width: 900px) { .sidebar-collapse-btn { display: none; } }
  /* The drawer's close button, in the fold button's place: phone and
     tablet only, and a full-size touch target. */
  .sidebar-close-btn {
    display: none; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; padding: 0;
    border: none; border-radius: var(--radius-sm); background: none; cursor: pointer;
    color: var(--ink-2);
  }
  .sidebar-close-btn svg { width: 20px; height: 20px; flex: none; }
  @media (hover: hover) { .sidebar-close-btn:hover { background: var(--nav-hover); color: var(--ink); } }
  @media (max-width: 900px) { .sidebar-close-btn { display: flex; } }
  /* Folded: a 3.5rem rail of icons. The names stay in the links, only
     visually hidden (the .sr-only recipe), so each link keeps its
     accessible name; the tooltip shows it on hover and focus. */
  @media (min-width: 901px) {
    .app-sidebar { transition: width var(--dur-fast) var(--ease); }
    .sidebar-collapsed .app-sidebar { width: 68px; }
    .sidebar-collapsed .side-nav-text, .sidebar-collapsed .brand-name,
    .sidebar-collapsed .app-account-text, .sidebar-collapsed .app-account > svg,
    .sidebar-collapsed .topbar-search kbd {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    /* Folded, the head stacks: the mark, then the unfold button. */
    .sidebar-collapsed .app-sidebar-head { flex-direction: column; padding: 0 0 var(--space-2); }
    .sidebar-collapsed .app-brand { justify-content: center; flex: none; }
    /* Alone on the rail, the mark is the size of the icons under it. */
    .sidebar-collapsed .brand-lockup .brand-mark { height: 22px; transform: none; }
    /* The group labels become thin dividers (none above the first); the
       words stay in the page, so each list keeps its name. */
    .sidebar-collapsed .side-nav-group {
      height: 1px; margin: var(--space-2); padding: 0; overflow: hidden;
      background: var(--rule); color: transparent;
    }
    .sidebar-collapsed .side-nav-group:first-child { height: 0; margin: 0; }
    .sidebar-collapsed .side-nav-item, .sidebar-collapsed .topbar-search { justify-content: center; padding: 0; gap: 0; }
    .sidebar-collapsed .setup-card { display: none; }
    /* Folded to icons, the badge sits on the icon's corner. */
    .sidebar-collapsed .side-nav-item { position: relative; }
    .sidebar-collapsed .side-nav-badge { position: absolute; top: 2px; right: 2px; min-width: 1rem; line-height: 1rem; }
    .sidebar-collapsed .app-account { justify-content: center; padding: var(--space-2) 0; }
    .sidebar-collapsed .sync-status { left: 30px; }
    /* The menu is wider than the rail, so it opens out over the page. */
    .sidebar-collapsed .app-account-menu { right: auto; left: var(--space-2); min-width: 12rem; }
  }
  /* Set up Rotunda (app_shell; db.sidebar_setup): a card folded to its
     title, count and progress bar, opening to the four steps. */
  .setup-card {
    flex: none; margin: var(--space-2) var(--space-0); padding: var(--space-3);
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); background: var(--shell-card);
  }
  .setup-card[hidden] { display: none; }
  .setup-card summary { list-style: none; cursor: pointer; border-radius: var(--radius-button); }
  .setup-card summary::-webkit-details-marker { display: none; }
  .setup-card-head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-2); }
  .setup-card-title { flex: 1; font-size: var(--text-sm); font-weight: 600; }
  .setup-card-count { font-size: var(--text-2xs); color: var(--shell-muted); font-variant-numeric: tabular-nums; }
  .setup-card-head::after {
    content: ""; align-self: center; width: 6px; height: 6px; margin: 0 var(--space-0) var(--space-0);
    color: var(--shell-muted); border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease);
  }
  .setup-card[open] .setup-card-head::after { transform: rotate(45deg); }
  .setup-card-bar { display: block; height: 4px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
  /* Filled by scaling, not by width: a width animation re-lays the
     sidebar out every frame for 1.2s (search critique, Nov 10 2026). The
     bar's own overflow and radius round the end. */
  .setup-card-bar > span { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: var(--flow-accent); transition: transform 1.2s var(--ease-out); }
  .setup-card-steps { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
  .setup-card-step {
    display: flex; align-items: center; gap: var(--space-3); min-height: 32px; padding: var(--space-0) var(--space-2);
    border-radius: var(--radius-sm); color: var(--ink); font-size: var(--text-sm); text-decoration: none;
  }
  @media (hover: hover) { .setup-card-step:hover { background: var(--nav-hover); } }
  .setup-card-check {
    flex: 0 0 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--rule-strong);
  }
  .setup-card-step.done .setup-card-check { background: var(--good-soft); border-color: var(--good); color: var(--good); }
  .setup-card-check svg { width: 13px; height: 13px; }
  /* The quiet links, then the account card, under a hairline at the
     bottom of the sidebar. */
  /* Held at the bottom of the sidebar when it scrolls (a short phone,
     the setup card open), so Settings is always in view; the rows above
     pass under it. Its ground is the sidebar's own. */
  .app-sidebar-foot {
    padding: var(--space-2) 0; margin-top: var(--space-1); border-top: 1px solid var(--rule);
    flex: none; position: sticky; bottom: 0; z-index: 1; background: inherit;
    display: flex; flex-direction: column; gap: var(--space-0);
  }
  .app-sidebar-foot .app-account-guest, .app-sidebar-foot .app-account { margin-top: var(--space-1); }
  .app-sidebar-foot .app-account-guest { padding-top: var(--space-2); }
  /* "Synced 11:01 PM" and its dot (app_shell's script fills and unhides
     it; db.data_freshness is what it says). Quiet on purpose: small
     muted text a person can find when they wonder how fresh the data is,
     with the per-source detail in a tooltip on hover and keyboard focus
     (tooltip.js, data-tooltip-wrap). The dot is --good, or --warn once
     the data is older than the daily refresh should leave it. */
  /* A dot on the avatar's corner (founder, Oct 29 2026 — it was a line
     of its own): its words are the tooltip and, visually hidden, what a
     screen reader reads. Hidden with the signed-in card. */
  .sync-status {
    position: absolute; left: 28px; bottom: 6px; z-index: 1;
    display: flex; align-items: center; justify-content: center; width: 12px; height: 12px;
    border-radius: var(--radius-pill); color: var(--muted);
  }
  .sync-status[hidden], .app-account[data-account="guest"] ~ .sync-status { display: none; }
  .sync-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--good); flex: none; box-shadow: 0 0 0 2px var(--sidebar); }
  .sync-status.stale .sync-dot { background: var(--warn); }
  .sync-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .app-account {
    display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--dur-fast) var(--ease); background: none; border: none; width: 100%;
    text-align: left; color: var(--ink); /* button's own base rule sets color: var(--accent-solid-text) —
    white-on-white in light mode, dark-on-dark in dark — this overrides it back to the real text color. */
  }
  @media (hover: hover) { .app-account:hover { background: var(--accent-soft); } }
  .app-avatar {
    height: 1.75rem; width: 1.75rem; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper);
    font-size: var(--text-2xs); font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none;
  }
  .app-account-email {
    font-size: var(--text-xs); font-weight: 500; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; flex: 1; min-width: 0;
  }
  /* The sidebar card's two lines: the person, then the firm. */
  .app-account-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
  .app-account-text .app-account-email { flex: none; }
  .app-account-org {
    font-size: var(--text-2xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .app-account-org:empty { display: none; }
  .app-account-chevron { color: var(--muted); flex: none; }
  /* The account menu (founder, Nov 16 2026): a plain list — email and
     firm in grey at the top, quiet rows that go light grey under the
     pointer, Appearance as a side panel, Sign out alone in red. */
  .app-account-menu {
    position: absolute; left: 0; right: 0; bottom: 3.75rem; background: var(--surface);
    border: 1px solid var(--rule-card); border-radius: var(--radius-sm); padding: var(--space-1); box-shadow: var(--shadow-pop);
    display: none; flex-direction: column; gap: 0; z-index: 20;
  }
  /* account_widget()'s dropdown on a public page (top_nav()'s call
     passes this) sits in a top bar, not a bottom-anchored sidebar
     footer — opens downward from the account button instead of
     upward, and isn't stretched to a sidebar-footer's own width. */
  .app-account-menu.top-anchored { left: auto; right: 0; bottom: auto; top: 100%; margin-top: var(--space-1); width: 15rem; }
  .app-account-menu.show { display: flex; }
  .app-account-menu button, .app-account-menu a {
    display: block; background: none; border: none; color: var(--ink); font: inherit; font-weight: 400; font-size: var(--text-sm);
    text-align: left; padding: var(--space-2) var(--space-3); border-radius: var(--radius-button); cursor: pointer; text-decoration: none;
  }
  @media (hover: hover) { .app-account-menu button:hover, .app-account-menu a:hover { background: var(--nav-hover); } }
  .app-account-menu :is(button, a):focus-visible { outline: none; box-shadow: var(--ring-focus); }
  .account-menu-who { display: flex; flex-direction: column; gap: var(--space-0); padding: var(--space-2) var(--space-3); min-width: 0; }
  .account-menu-email, .account-menu-firm { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .account-menu-email { font-size: var(--text-xs); }
  .account-menu-firm { font-size: var(--text-2xs); }
  .account-menu-who > :empty { display: none; }
  .account-menu-sep { height: 1px; background: var(--rule); margin: var(--space-1) calc(-1 * var(--space-1)); }
  .app-account-menu .account-menu-signout { color: var(--error); }
  /* A phone can't install the desktop app. */
  @media (max-width: 640px) { .app-account-menu .account-menu-desktop { display: none; } }
  /* Appearance: its row carries an arrow; its panel pops out to the left
     of the menu (the menu sits at the window's right edge), level with
     the row. Open while hovered, clicked, or reached by the right arrow. */
  .account-submenu { position: relative; }
  .app-account-menu .account-submenu-btn { display: flex; align-items: center; gap: var(--space-2); width: 100%; }
  .account-submenu-chevron { margin-left: auto; color: var(--muted); flex: none; }
  .app-account-menu .account-submenu.open > .account-submenu-btn { background: var(--nav-hover); }
  .account-flyout {
    display: none; position: absolute; right: calc(100% + var(--space-2)); top: calc(-1 * var(--space-1) - 1px); width: 11rem;
    flex-direction: column; background: var(--surface); border: 1px solid var(--rule-card); border-radius: var(--radius-sm);
    padding: var(--space-1); box-shadow: var(--shadow-pop);
  }
  .account-submenu.open > .account-flyout { display: flex; }
  .app-account-menu .account-flyout button { display: flex; align-items: center; gap: var(--space-2); width: 100%; }
  .account-flyout-check { margin-left: auto; flex: none; visibility: hidden; }
  .account-flyout [aria-checked="true"] .account-flyout-check { visibility: visible; }
  /* No room beside the menu on a phone: the panel opens underneath, indented. */
  @media (max-width: 640px) {
    .account-flyout { position: static; width: auto; border: 0; box-shadow: none; padding: 0 0 0 var(--space-3); }
    .account-submenu.open .account-submenu-chevron { transform: rotate(90deg); }
  }
  /* Settings, on /profile — the "you are here" cue the sidebar item used to carry. */
  .app-account-menu a[aria-current="page"] { background: var(--accent-soft); }
  /* The Auto / Light / Dark picker inside account_widget()'s dropdown,
     right above Sign out. Auto = no data-theme, so the
     prefers-color-scheme block follows the device. The .theme-choice
     prefix outranks .app-account-menu button's full-width block rule.
     Drawn as the app's .segmented control (track + raised selected
     chip) so it reads like every other picker in the app. The track keeps
     a --rule-strong edge so the unselected options read as controls, not
     gaps (WCAG 1.4.11, whole-app audit R5). */
  .theme-choice {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
    padding: var(--space-2); font-size: var(--text-xs); font-weight: 500;
  }
  .theme-choice-options {
    display: inline-flex; gap: var(--space-0); padding: var(--space-0);
    background: var(--paper-350); border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--rule-strong);
  }
  :is(.app-account-menu, .settings-appearance) .theme-choice button {
    display: inline-flex; align-items: center; width: auto; min-height: 1.75rem; padding: 0 var(--space-2);
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2);
    font: inherit; font-size: var(--text-xs); font-weight: 400; cursor: pointer; white-space: nowrap;
  }
  :is(.app-account-menu, .settings-appearance) .theme-choice button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-rest); }
  @media (hover: hover) {
    :is(.app-account-menu, .settings-appearance) .theme-choice button:hover { background: transparent; color: var(--ink); }
    :is(.app-account-menu, .settings-appearance) .theme-choice button[aria-checked="true"]:hover { background: var(--surface); }
  }
  /* Shown instead of the avatar/email button when /api/me says no one's
     signed in — /lookup and /lobbying are the two pages that render this
     shell without requiring a session (see the module docstring's "no
     account needed to look up a bill" promise), so the sidebar footer
     needs an honest logged-out state rather than a blank avatar next to
     a "Sign out" button that wouldn't do anything. */
  /* Which of these two the footer shows is decided by the server now
     (see app.py's _fill_account_state), through data-account on both
     halves, rather than by JS unhiding one after /api/me answered. An
     unfilled page shows neither — the same empty footer it used to
     show for the length of that fetch, rather than a raw token. */
  .app-account-guest { display: none; gap: var(--space-2); }
  .app-account-guest[data-account="guest"] { display: flex; }
  .app-account[data-account="guest"] { display: none; }
  /* white-space: nowrap matters once this renders inside top_nav()'s
     own width-capped wrapper (see .app-account-menu.top-anchored's own
     comment) — without it, "Sign up" wrapped onto its own line inside
     its own button instead of the two flex:1 buttons just sizing down
     evenly, since nothing was forcing the browser to treat the label's
     natural single-line width as this button's minimum. */
  .app-account-guest a { flex: 1; justify-content: center; text-align: center; padding: var(--space-2) 0; font-size: var(--text-xs); white-space: nowrap; }
  /* top_nav()'s call (account_widget(..., guest_plain=True)) — undoes
     the sidebar's button-pair treatment above for two plain, unclassed
     <a> tags instead, which already pick up .top-nav a's color/size/
     underline-on-hover on their own. Matches how "Sign in"/"Sign up"
     always looked on a public page before this shared component
     existed — two solid pill buttons read as too heavy sitting next
     to the rest of the top bar's plain text links. */
  .app-account-guest.plain-links a { flex: none; padding: 0; font-size: var(--text-sm); }
  .app-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .app-topbar {
    height: 4rem; flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-5); border-bottom: 1px solid var(--rule); background: var(--paper); gap: var(--space-4);
    /* Above the page: its view-transition-name makes the bar a layer of
       its own, and .app-main's, later, would otherwise paint over the
       Inbox and account dropdowns that hang below it. */
    position: relative; z-index: 5;
  }
  /* Inside the window the topbar is only the date, as a quiet meta line
     over the page's own header — no bar, no rule (the design system's
     PageHeader puts the date in its meta). The hamburger row comes back
     with the drawer below 900px. */
  @media (min-width: 901px) {
    .app-topbar { height: auto; border-bottom: 0; background: none; padding: var(--space-4) var(--space-5) 0; }
  }
  .app-topbar-sub { font-size: var(--text-xs); color: var(--slate); }
  .app-topbar-lead { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
  /* A phone's topbar names the page, not the date (app_shell's script
     fills it from the tab title). Wider screens keep the date. */
  .app-topbar-title { display: none; }
  @media (max-width: 640px) {
    .app-topbar-lead .app-topbar-sub { display: none; }
    .app-topbar-title {
      display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      font-size: var(--text-sm); font-weight: 600; color: var(--ink);
    }
    /* Held back while the page's own h1 is on screen, so the name isn't
       said twice at the top of the page (dashboard audit Q7). */
    .app-topbar-title.waits { visibility: hidden; }
    .app-topbar-title.waits.shown { visibility: visible; }
  }
  /* ── Ask Mike (static/js/mike.js; mike.py) — the topbar's button, the
     and the assistant's panel. The panel slides
     out from the right edge (founder, Nov 16 2026 — replaces the Nov 1
     drop-down card), with no scrim: it is a helper you read the page next
     to, not a modal. On a wide window it docks under the topbar, which
     stays whole: the page below the bar's line slides over to make room
     rather than sitting under it. Narrower, it lies over the page's right
     side, full height; a phone gets it full-width. */
  .mike-btn { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; margin-left: auto; }
  .mike-btn[hidden] { display: none; }
  .mike-btn svg { width: 0.85rem; height: 0.85rem; }
  :root { --mike-width: min(23rem, 100vw); }
  .mike-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 105;
    width: var(--mike-width); height: 100dvh;
    display: flex; flex-direction: column; overflow: hidden; background: var(--surface);
    border-left: 1px solid var(--rule-card); box-shadow: var(--shadow-pop);
    /* A child of <body>, which some pages set to nowrap. */
    white-space: normal;
  }
  .mike-panel[hidden] { display: none; }
  /* It slides in from the right edge and back out (mike.js adds .is-open
     once the panel is laid out). Reduced motion: it simply appears. */
  .mike-panel:not(.is-open) { transform: translateX(100%); }
  @media (prefers-reduced-motion: no-preference) {
    .mike-panel { transition: transform var(--dur-slow) var(--ease-out); }
  }
  /* Docked: it starts at the topbar's line (mike.js sets --mike-top from
     the bar as it opens), and the page under the bar gives up the panel's
     width in step with the slide, so nothing is hidden under it — and no
     shadow, it's a column now. The topbar keeps its full width. */
  @media (min-width: 901px) {
    .mike-panel { top: var(--mike-top, 4rem); height: auto; }
    body.mike-open .mike-panel { box-shadow: none; }
    body.mike-open .app-main { margin-right: var(--mike-width); }
    /* The account menu hangs below the topbar, into the docked panel's
       column; while it's open the shell (fixed, so its own stacking
       context) rises above the panel, or the menu would open hidden
       behind Mike. */
    .app-shell:has(.app-account-menu.show) { z-index: 106; }
  }
  @media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
    .app-main { transition: margin-right var(--dur-slow) var(--ease-out); }
  }
  /* One quiet row: the name, then the icons (founder, Nov 16 2026). */
  .mike-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-bottom: 1px solid var(--rule);
  }
  .mike-head h2 { margin: 0; font-family: inherit; font-size: var(--text-sm); font-weight: 600; }
  .mike-head .mike-bar { display: flex; align-items: center; gap: 0; color: var(--slate); }
  .mike-head .icon-btn svg { width: 0.95rem; height: 0.95rem; }
  .mike-head .mike-past-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--ink); }
  .mike-bar { display: flex; gap: var(--space-1); padding: 0 var(--space-3) var(--space-2); border-bottom: 1px solid var(--rule); }
  .mike-head .mike-bar { padding: 0; border: 0; }
  .mike-past { max-height: 40%; overflow-y: auto; border-bottom: 1px solid var(--rule); padding: var(--space-2) var(--space-3); }
  .mike-past ul { list-style: none; margin: 0; padding: 0; }
  .mike-past li { display: flex; align-items: center; gap: var(--space-1); }
  /* button.: <body> carries .mike-open too while the panel is open, and
     must not take a past chat's one-line clipping. */
  button.mike-open {
    flex: 1; min-width: 0; text-align: left; background: transparent; color: var(--ink); font-weight: 400;
    padding: var(--space-1) var(--space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  @media (hover: hover) { button.mike-open:hover { background: var(--accent-soft); } }
  .mike-log { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
  .mike-turn p, .mike-turn ul { margin: 0; }
  .mike-turn p + p, .mike-turn p + ul, .mike-turn ul + p { margin-top: var(--space-2); }
  .mike-turn ul { padding-left: var(--space-5); }
  .mike-turn { font-size: var(--text-sm); line-height: 1.5; color: var(--ink); }
  .mike-you {
    align-self: flex-end; max-width: 85%; padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md); background: var(--accent-soft);
  }
  .mike-answer a { color: var(--link); }
  /* Suggestions: links into a page's own step, drawn as outlined
     buttons so they read as something to click, not a done deed. */
  .mike-suggestions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
  /* Thumbs up / down under an answer: quiet until hovered or chosen. */
  .mike-rate { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-top: var(--space-2); color: var(--slate); }
  .mike-thumb {
    display: inline-flex; padding: var(--space-1); border: 0; border-radius: var(--radius-md);
    background: none; color: inherit; cursor: pointer;
  }
  .mike-thumb svg { width: 16px; height: 16px; }
  .mike-thumb:focus-visible { background: var(--accent-soft); color: var(--ink); }
  @media (hover: hover) { .mike-thumb:hover { background: var(--accent-soft); color: var(--ink); } }
  .mike-thumb[aria-pressed="true"] { color: var(--accent); }
  .mike-rate-note { font-size: var(--text-xs); }
  .mike-rate-form { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink); }
  .mike-rate-form label { width: 100%; }
  .mike-rate-form textarea { display: block; width: 100%; margin-top: var(--space-1); }
  .mike-rate-form .mike-rate-share { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--slate); }
  a.secondary.mike-suggest { border-color: var(--rule-card); font-size: var(--text-sm); white-space: normal; }
  /* A Confirm card: a change Mike set up, made only on the person's
     click. Edged like a card so it reads as waiting, not done. */
  .mike-card {
    margin-top: var(--space-2); padding: var(--space-2) var(--space-3);
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); background: var(--surface);
  }
  .mike-card[data-status="done"] { border-color: var(--accent); }
  /* A meeting-request email Mike drafted: the person sends it themselves. */
  .mike-email {
    margin-top: var(--space-2); padding: var(--space-2) var(--space-3);
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); background: var(--surface);
  }
  .mike-email p { margin: 0 0 var(--space-1); }
  .mike-email .mike-card-label { font-weight: 600; }
  .mike-email-head { font-size: var(--text-sm); }
  .mike-email-head span { color: var(--slate); }
  .mike-email-body { white-space: pre-line; font-size: var(--text-sm); max-height: 12rem; overflow-y: auto; }
  .mike-email .mike-card-note { color: var(--slate); font-size: var(--text-sm); margin-top: var(--space-1); }
  .mike-card .mike-card-label { font-weight: 600; }
  .mike-card .mike-card-note { color: var(--slate); }
  .mike-card .mike-card-detail { margin-top: var(--space-1); white-space: pre-line; }
  .mike-card .mike-card-note:empty { display: none; }
  .mike-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
  .mike-card-actions:empty { display: none; }
  /* Next moves on a bill's page (mike.next_moves): the card's edge, as
     they're things to look at, with a link and a question — nothing done. */
  .mike-moves { margin-bottom: var(--space-3); }
  .mike-moves-title { margin: 0; font-size: var(--text-sm); font-weight: 600; color: var(--slate); }
  .mike-move .mike-card-label, .mike-move .mike-card-detail { margin: 0; font-size: var(--text-sm); }
  .mike-move-ask { font-size: var(--text-sm); white-space: normal; text-align: left; }
  .mike-cards > .mike-confirm-all { margin-top: var(--space-2); }
  .mike-hint { margin: 0; color: var(--slate); font-size: var(--text-sm); }
  .mike-steps { margin: var(--space-1) 0 0; padding: 0; list-style: none; color: var(--slate); font-size: var(--text-xs); }
  .mike-steps li:not(:last-child)::before { content: ""; --ic: var(--icon-check); margin-right: var(--space-1); }
  .mike-steps li:last-child::after { content: "…"; }
  .mike-greeting { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink); }
  .mike-greeting + .mike-hint { margin-top: calc(-1 * var(--space-2)); }
  .mike-error { margin: 0; color: var(--error); font-size: var(--text-sm); }
  .mike-starters { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); }
  /* button.secondary is a ghost at rest; a starter keeps its outline so
     it reads as something to click — a full-width row in the panel. */
  button.mike-starter {
    text-align: left; font-weight: 400; white-space: normal;
    border-color: var(--rule-card); border-radius: var(--radius-md);
  }
  /* The panel's empty chat: Mike's bubble and one line, centred, the
     questions under them. */
  .mike-hello { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin: var(--space-6) 0 var(--space-2); text-align: center; }
  .mike-hello svg { width: 2rem; height: 2rem; color: var(--slate); }
  .mike-hello .mike-greeting { font-size: var(--text-base); }
  .mike-panel button.mike-starter { font-size: var(--text-sm); padding: var(--space-2) var(--space-3); }
  /* The question box is one rounded field, the plus button and send inside it. */
  .mike-panel .mike-ask {
    margin: 0 var(--space-3); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
    border: 1px solid var(--rule-card); border-radius: var(--radius-lg); background: var(--surface); align-items: flex-end;
  }
  .mike-panel .mike-ask:focus-within { border-color: var(--ink); }
  .mike-panel .mike-ask textarea { border: 0; background: transparent; box-shadow: none; outline: none; padding: var(--space-2) var(--space-1); }
  .mike-panel .mike-ask textarea::placeholder { color: var(--slate); opacity: 1; }
  .mike-panel .mike-attach { align-self: flex-end; margin-bottom: 1px; }
  .mike-panel .mike-send { width: 2rem; height: 2rem; }
  .mike-ask { display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--rule); }
  .mike-ask[hidden] { display: none; }
  /* A document handed to Mike: the plus button, then above the box the
     file's name and the note that it goes to the AI. */
  .mike-attach { flex: none; align-self: center; }
  .mike-attach svg { width: 1rem; height: 1rem; }
  .mike-doc { padding: var(--space-2) var(--space-4) 0; font-size: var(--text-sm); }
  .mike-doc[hidden] { display: none; }
  .mike-doc-chip { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; padding: 0 var(--space-1) 0 var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-md); }
  .mike-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mike-doc-note { margin-top: var(--space-1); color: var(--slate); font-size: var(--text-xs); }
  .mike-doc-sent { color: var(--slate); font-size: var(--text-xs); }
  .mike-page .mike-doc { flex: none; box-sizing: border-box; width: calc(100% - 2 * var(--space-5)); max-width: 50rem; margin: 0 auto var(--space-2); padding: 0 var(--space-2); }
  .mike-ask textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: var(--text-sm); }
  /* Send: a round arrow, the way a chat sends anywhere else. Its word
     ("Ask") stays for screen readers. */
  .mike-send {
    flex: none; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0;
    border-radius: var(--radius-pill);
  }
  .mike-send svg { width: 1rem; height: 1rem; }
  .mike-send:disabled { opacity: .45; }
  /* An answer's cards and links fade in once its words have typed out. */
  @media (prefers-reduced-motion: no-preference) {
    .mike-later { animation: mike-later var(--dur) var(--ease) both; }
    @keyframes mike-later { from { opacity: 0; } }
  }
  /* /mike (mike_body.html, mike.js's mikePageFrame): the person's past
     chats in a column on the left, the chat pane beside it with its own
     heading. An empty chat (.mike-fresh) puts the greeting, the question
     box and the starter list together in the middle of the pane; the first
     question docks the box at the bottom. The panel keeps its compact
     look; all of this is the page's. The topbar's Ask Mike button has
     nothing to open here. */
  body:has(#mike-page) .mike-btn { display: none; }
  /* The page fills the app's white card edge to edge, no frame of its own. */
  .app-main:has(> #mike-page) { padding: 0; }
  .mike-page { display: flex; height: calc(100dvh - 4rem); min-height: 28rem; overflow: hidden; background: var(--surface); }
  .mike-page > .mike-pane > .mike-hint { padding: var(--space-3) var(--space-5); }

  /* The chat history column. */
  .mike-hist {
    flex: none; width: 16rem; display: flex; flex-direction: column; min-height: 0;
    background: color-mix(in srgb, var(--ink) 2%, var(--surface)); border-right: 1px solid var(--rule);
  }
  .mike-page.mike-hist-off .mike-hist { display: none; }
  .mike-page .mike-bar { padding: var(--space-4) var(--space-4) var(--space-2); border: 0; }
  .mike-page .mike-past-btn { display: none; }
  .mike-page .mike-new {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
    border-color: var(--rule-card); background: var(--surface); font-weight: 400;
  }
  .mike-page .mike-new svg { width: 0.85rem; height: 0.85rem; }
  .mike-hist-search {
    display: flex; align-items: center; gap: var(--space-2); margin: 0 var(--space-4) var(--space-2);
    padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--slate);
  }
  .mike-hist-search svg { width: 0.8rem; height: 0.8rem; flex: none; }
  .mike-hist-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: var(--space-1) 0;
    font-size: var(--text-sm); color: var(--ink);
  }
  .mike-hist-search input:focus { outline: none; }
  .mike-hist-search:focus-within { box-shadow: 0 0 0 2px var(--ink); }
  .mike-page .mike-past, .mike-page .mike-past[hidden] {
    display: block; flex: 1; min-height: 0; max-height: none; overflow-y: auto; border: 0; padding: 0 var(--space-2) var(--space-3);
  }
  .mike-page .mike-past > .mike-hint { padding: var(--space-3) var(--space-2) 0; }
  .mike-past-group { margin-top: var(--space-3); }
  .mike-past-when { margin: 0; padding: 0 var(--space-2) var(--space-1); color: var(--slate); font-size: var(--text-xs); font-weight: 500; }
  .mike-page .mike-past li { gap: 0; border-radius: var(--radius-sm); }
  @media (hover: hover) { .mike-page .mike-past li:hover { background: var(--accent-soft); } }
  .mike-page .mike-past .mike-open { padding: var(--space-2); font-size: var(--text-sm); border-radius: var(--radius-sm); }
  @media (hover: hover) { .mike-page .mike-past .mike-open:hover { background: transparent; } }
  .mike-page .mike-past li:has(.mike-open[aria-current]) { background: var(--accent-soft); }
  .mike-page .mike-past .mike-open[aria-current] { background: transparent; color: var(--ink); font-weight: 500; }
  /* The bin shows on hover, or when it has keyboard focus. */
  @media (hover: hover) {
    .mike-page .mike-past .mike-delete { opacity: 0; }
    .mike-page .mike-past li:hover .mike-delete, .mike-page .mike-past .mike-delete:focus-visible { opacity: 1; }
  }
  .mike-hist-foot {
    display: grid; gap: var(--space-3); padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--rule); color: var(--slate); font-size: var(--text-xs); line-height: 1.45;
  }
  .mike-private { margin: 0; display: flex; gap: var(--space-2); align-items: flex-start; }
  .mike-private svg { width: 0.75rem; height: 0.75rem; flex: none; margin-top: var(--space-1); }
  .mike-budget[hidden] { display: none; }
  .mike-budget p { margin: 0; display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
  .mike-budget-track { display: block; height: 4px; margin-top: var(--space-1); border-radius: var(--radius-pill); background: var(--accent-soft); }
  .mike-budget-fill { display: block; height: 4px; border-radius: var(--radius-pill); background: var(--ink); }
  .mike-budget.is-full .mike-budget-fill { background: var(--error); }

  /* The chat pane and its heading. */
  .mike-pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .mike-pane-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
    padding: var(--space-3) var(--space-5);
  }
  .mike-pane-head h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); line-height: 1; }
  .mike-pane-head .mike-tag { margin: 0; }
  .mike-pane-head .mike-note { margin: 0; }
  .mike-hist-toggle svg { width: 1rem; height: 1rem; }

  /* The conversation: one centred reading column, your questions as soft
     bubbles, each answer under Mike's name. */
  .mike-page .mike-log {
    flex: 1; min-height: 0; width: 100%; max-width: 50rem; margin-inline: auto; box-sizing: border-box;
    padding: var(--space-4) var(--space-5); gap: var(--space-5);
  }
  .mike-page .mike-turn { font-size: var(--text-base); line-height: 1.65; }
  .mike-page .mike-you { padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-lg); }
  .mike-page .mike-answer::before {
    content: "Mike"; display: block; margin-bottom: var(--space-1);
    font-family: var(--font-display); font-size: var(--text-base); font-weight: 500; color: var(--ink);
  }
  @media (prefers-reduced-motion: no-preference) {
    .mike-page .mike-waiting .mike-hint { animation: mike-breathe 1.6s ease-in-out infinite; }
    @keyframes mike-breathe { 50% { opacity: .45; } }
  }

  /* The question box: a card the cursor lives in, lit when it has focus. */
  .mike-page .mike-ask {
    flex: none; flex-wrap: wrap; align-items: flex-end; margin: 0 auto var(--space-4); width: calc(100% - 2 * var(--space-5));
    max-width: 50rem; box-sizing: border-box; padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4);
    border: 1px solid var(--rule-card); border-radius: var(--radius-window); background: var(--surface);
    box-shadow: var(--shadow-window);
  }
  .mike-page .mike-ask:focus-within { border-color: var(--ink); }
  .mike-page .mike-ask textarea {
    border: 0; background: transparent; box-shadow: none; outline: none; padding: var(--space-1) 0;
    font-size: var(--text-base); line-height: 1.5; min-height: 3.25rem;
  }
  .mike-page .mike-ask textarea:disabled { cursor: not-allowed; }
  .mike-page .mike-send { background: var(--ink); color: var(--surface); border-color: transparent; }
  .mike-page .mike-send:disabled { background: var(--accent-soft); color: var(--slate); opacity: 1; }
  .mike-page.mike-off .mike-ask { box-shadow: none; background: var(--accent-soft); }
  .mike-ask-note {
    flex-basis: 100%; margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4);
    color: var(--slate); font-size: var(--text-xs);
  }

  /* An empty chat: the greeting, the box, then the starters as a list,
     each with what part of the record it reads, and the promise. Equal
     room above and below; it scrolls as one if the pane is short. */
  .mike-after { display: none; }
  .mike-page.mike-fresh .mike-pane { overflow-y: auto; }
  .mike-page.mike-fresh .mike-pane::before, .mike-page.mike-fresh .mike-pane::after { content: ""; flex: 1 0 var(--space-5); }
  .mike-page.mike-fresh .mike-pane-head { order: -1; }
  .mike-page.mike-fresh .mike-log {
    flex: none; max-width: 40rem; padding-block: 0; align-items: center; text-align: center; gap: var(--space-4); overflow: visible;
  }
  .mike-page.mike-fresh .mike-ask { max-width: 40rem; margin: var(--space-6) auto 0; }
  .mike-page.mike-fresh .mike-after {
    display: block; width: calc(100% - 2 * var(--space-5)); max-width: 40rem; margin: var(--space-5) auto 0;
  }
  .mike-page .mike-greeting {
    margin: 0; font-family: var(--font-display); font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.5rem);
    font-weight: 500; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance;
  }
  .mike-page.mike-fresh .mike-greeting + .mike-hint { margin-top: 0; max-width: 33rem; font-size: var(--text-base); line-height: 1.55; }
  .mike-page .mike-log .ai-off { text-align: left; width: 100%; }
  .mike-after .mike-starters { list-style: none; margin: 0; padding: 0; display: block; border-top: 1px solid var(--rule); }
  .mike-after .mike-starters li { border-bottom: 1px solid var(--rule); }
  .mike-page button.mike-starter {
    width: 100%; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-1);
    border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); text-align: left; font-weight: 400;
  }
  @media (hover: hover) { .mike-page button.mike-starter:hover:not(:disabled) { background: var(--accent-soft); } }
  .mike-page button.mike-starter:disabled { opacity: .5; cursor: default; }
  .mike-starter-q { flex: 1; min-width: 0; font-size: var(--text-sm); line-height: 1.4; }
  .mike-starter-src { flex: none; color: var(--slate); font-size: var(--text-xs); white-space: nowrap; }
  .mike-starter svg { width: 0.85rem; height: 0.85rem; flex: none; color: var(--slate); }
  @media (hover: hover) { .mike-starter:hover svg { color: var(--ink); } }
  .mike-promise {
    margin: var(--space-5) 0 0; display: flex; gap: var(--space-2); align-items: flex-start;
    color: var(--slate); font-size: var(--text-sm); line-height: 1.5;
  }
  .mike-promise svg { width: 0.95rem; height: 0.95rem; flex: none; margin-top: var(--space-1); color: var(--accent); }

  /* Narrow: the history sits above the chat, shorter, without its foot;
     on a phone the page runs edge to edge. */
  @media (max-width: 899px) {
    .mike-page { flex-direction: column; height: auto; min-height: calc(100dvh - 8rem); overflow: visible; }
    .mike-hist { width: auto; max-height: 15rem; border-right: 0; border-bottom: 1px solid var(--rule); }
    .mike-hist-foot, .mike-pane-head .mike-hist-toggle { display: none; }
    .mike-page.mike-hist-off .mike-hist { display: flex; }
    .mike-page .mike-log { min-height: 16rem; }
    .mike-page.mike-fresh .mike-log { min-height: 0; }
    .mike-page.mike-fresh .mike-pane { overflow: visible; }
    .mike-page.mike-fresh .mike-pane::before, .mike-page.mike-fresh .mike-pane::after { flex: 0 0 var(--space-4); }
  }
  @media (max-width: 640px) {
    .mike-starter-src, .mike-keys { display: none; }
    .mike-pane-head, .mike-page .mike-log { padding-inline: var(--space-4); }
    .mike-page .mike-ask, .mike-page.mike-fresh .mike-after { width: calc(100% - 2 * var(--space-4)); }
  }
  @media (max-width: 640px) {
    .mike-panel { left: 0; width: auto; border-left: 0; }
    body.mike-open { overflow: hidden; }
    .mike-btn { padding: var(--space-1) var(--space-2); }
  }
  /* The way into search from every other page. There WAS a global
     search input here once, removed as redundant — /lookup is one
     sidebar click away and does the same job better, so a second
     always-visible box competing with it was furniture. Still true,
     which is why this is a link shaped like a search field and not a
     field: it navigates rather than searching in place, and its real
     job is to say that ⌘K exists (see search_shortcut.js). Sized and
     coloured off .search-box below so the two read as the same family
     without one pretending to be the other. */
  /* At the top of the sidebar now: a white field-shaped link. */
  .topbar-search {
    display: flex; align-items: center; gap: var(--space-3); height: 36px; border-radius: var(--radius-sm); flex: none;
    background: var(--nav-hover); border: 0;
    padding: 0 var(--space-3); font-size: var(--text-sm); color: var(--shell-muted);
    text-decoration: none; white-space: nowrap;
  }
  .topbar-search .side-nav-text { flex: 1; }
  @media (hover: hover) { .topbar-search:hover { background: var(--nav-active); color: var(--ink); } }
  /* On the search page itself: lit like the current nav item (Oct 19 audit). */
  .topbar-search.active { background: var(--nav-active); color: var(--ink); font-weight: 600; }
  .topbar-search svg { width: 20px; height: 20px; flex: none; }
  .topbar-search kbd {
    font: inherit; font-size: var(--text-2xs);
    border: 0; border-radius: var(--radius-xs); background: var(--nav-hover);
    padding: 0 var(--space-1); color: var(--muted);
  }
  /* The key hint only means something with a keyboard: gone on phones
     and on touch-first devices, where the magnifier link still works. */
  @media (max-width: 767px), (hover: none), (pointer: coarse) {
    .topbar-search kbd { display: none; }
  }

  /* Was shared topbar chrome on every page (a global "search LegiScan"
     box + a persistent "Flag a bill" shortcut) until both were removed
     as redundant — see .topbar-search above for what came back and how
     it differs. What follows is FLAGGED_BODY's own local
     filter-as-you-type box for the list already loaded on that page —
     a different job (filtering, not searching LegiScan), which is why
     it survived while the shared version didn't. */
  .search-box {
    display: flex; align-items: center; gap: var(--space-2); height: 2.5rem; width: 15rem; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--rule-strong); padding: 0 var(--space-3); font-size: var(--text-sm); color: var(--slate);
  }
  /* Same focus the bare inputs get, but the real <input> here is
     borderless inside the box, so it rides the wrapper via
     :focus-within. */
  .search-box:focus-within { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }
  .search-box svg { width: 0.875rem; height: 0.875rem; flex: none; }
  .search-box input {
    background: none; border: none; outline: none; color: var(--ink); font-size: var(--text-sm);
    width: 100%; font-family: inherit;
  }
  /* The pill carries the focus ring; the borderless input must not draw
     a second one inside it (global input:focus glow / :focus-visible). */
  .search-box input:focus, .search-box input:focus-visible,
  .dir-search-box input:focus, .dir-search-box input:focus-visible { outline: none; box-shadow: none; }
  .search-box input::placeholder { color: var(--slate); }
  /* /lookup's own box matched neither rule above, so its hint was the
     browser's light-theme grey on the dark field — 3.9:1, under AA's
     4.5 (search critique, Oct 21). */
  .search-bar-field input::placeholder { color: var(--slate); opacity: 1; }
  /* color belongs here and not only on the svg child below: button's
     own base rule paints text var(--accent-solid-text), which in dark
     mode is near-black — so an .icon-btn holding a text glyph rather
     than an icon (the × on a saved search, and now on a client row of
     the 601 review) came out black on black and simply wasn't there. */
  .icon-btn {
    height: 2rem; width: 2rem; border-radius: var(--radius-md); border: 1px solid var(--rule-strong); background: var(--paper);
    color: var(--slate);
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--dur-fast) var(--ease);
  }
  @media (hover: hover) { .icon-btn:hover { background: var(--accent-soft); } }
  /* flex: none matters here, not just as a style preference — without
     it this is the one svg-in-a-flex-row rule in the whole file that
     omits it (compare .side-nav-item/.search-box/.frame-nav-item svg
     above), and the default flex-shrink:1 collapses an <svg> with no
     width/height HTML attributes down to 0 width in a flex container,
     even with an explicit CSS width set. Confirmed via
     getComputedStyle() — this button's bell icon was genuinely
     rendering at 0x14px, not just a design nitpick. */
  .icon-btn svg { width: 0.85rem; height: 0.85rem; color: var(--slate); flex: none; }
  /* Used to be `display: none` below 700px — FLAGGED_BODY renders this
     inside a `display:flex;flex-wrap:wrap` panel-head row alongside the
     "Sort by" select (see that call site), so instead of removing the
     filter-as-you-type box outright (leaving mobile users with no way
     to filter their flagged list at all), give it width:100% — the
     flex-wrap parent already drops it to its own full-width row once it
     no longer fits next to Sort-by, same as any other wrapped flex
     item. */
  @media (max-width: 700px) { .search-box { width: 100%; } }
  /* The document scrolls, not .app-main: .app-shell is min-height, so
     this box grows with its content. It was overflow-y:auto anyway, and
     a scroll container that never scrolls pins nothing — every sticky
     child (the Settings rail and Save bar, /lookup's search bar, the 601
     section nav and actions) scrolled away, and each page patched it
     back with its own :has() override. `clip` still stops content
     spilling sideways without making this a scroll container. */
  .app-main { flex: 1; overflow-x: clip; padding: var(--space-6); background: var(--shell-main); }

  /* One open page (founder, Nov 16 2026 — replaces the Flow-style
     frame of Oct 29): sidebar, topbar and page share one ground, with a
     hairline down the sidebar's edge and one under the topbar. No inset
     window round the page. Phone and tablet were already flat. */
  @media (min-width: 901px) {
    body:has(.app-shell), .app-shell { background: var(--shell-main); }
    .app-sidebar { background: var(--shell-main); border-right: 1px solid var(--shell-rule); }
    .app-body { position: relative; }
    .app-topbar {
      padding: var(--space-2) var(--space-4) var(--space-2) var(--space-5);
      border-bottom: 1px solid var(--shell-rule);
    }
  }
  /* The top bar's right-hand corner, as the mockup: Ask Mike, Alerts'
     bell and the account avatar (its name stays, visually hidden, as the
     button's name). The date keeps the left. */
  .app-topbar-lead { flex: 1; }
  .app-topbar .mike-btn {
    margin-left: 0; min-width: 2.5rem; min-height: 2.5rem; justify-content: center;
    border-color: transparent; border-radius: var(--radius-pill); background: transparent;
  }
  .app-topbar .mike-btn svg { width: 1.1rem; height: 1.1rem; }
  /* Open, it stays shaded. */
  .app-topbar .mike-btn[aria-expanded="true"] { background: var(--accent-soft); }
  @media (hover: hover) { .app-topbar .mike-btn:hover { background: var(--accent-soft); } }
  .app-topbar-account { position: relative; flex: none; display: flex; align-items: center; }
  .app-topbar-account .app-account { width: auto; padding: var(--space-0); border-radius: var(--radius-pill); }
  .app-topbar-account .app-account > svg { display: none; }
  .app-topbar-account .app-account-email {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .app-topbar-account .sync-status { left: auto; right: 0; bottom: 0; }
  .app-topbar-account .sync-dot { box-shadow: 0 0 0 2px var(--shell-main); }
  .app-topbar-account .app-account-menu { z-index: 60; }
  .app-topbar-account .app-account-guest { display: flex; gap: var(--space-2); }

  /* No cards (founder, Nov 16 2026 — was "quiet boxes", Oct 29): a
     section of a signed-in page sits on the page itself — no fill, no
     edge, no corner — and the space round it and the hairlines between
     its own rows do the separating. A page's one main action keeps the
     solid ink fill (founder, Nov 21 2026 — reverses Nov 16's soft grey
     chip, which read as switched off beside the outlined buttons). */
  .app-shell .app-main :is(.card, .panel, .dash-card, .finish-setup, .needs, .worklist, .settings-card,
      .bill-progress-card, .current-status-card, .whats-new-strip) {
    background: transparent; border: 0; box-shadow: none; border-radius: 0;
    /* !important: a page's own rule for its box (.letters-page
       .card.letters-start, ...) is as specific as this one and comes
       later; with no edge, any side inset just pushes content off the
       page's left line. */
    padding-inline: 0 !important;
  }
  /* What sat inset inside those boxes starts at the page's left edge too. */
  .app-shell .app-main :is(.dash-card .dash-col-head, .worklist-head, .changes-head,
      .compliance-page .compliance-card > :is(h2, label, form, .compliance-card-sub, .empty, .due-none),
      .panel > :is(.panel-head, .settings-body)) {
    padding-inline: 0;
  }
  .app-shell .app-main :is(.dash-card h2, .worklist-title h2, .panel-head .title, .panel-head h2) {
    font-size: var(--text-md); font-weight: 500; line-height: 1.2; text-transform: none;
    letter-spacing: -0.01em; color: var(--ink); font-family: var(--font-sans);
  }
  .app-shell .side-nav-badge { background: var(--flow-accent); color: var(--shell-main); }
  /* Tables in the same voice: column headings are quiet small capitals
     on the box's own fill (no darker band), and a row takes the soft
     hover tint the sidebar rows use. */
  .app-shell .app-main :is(th, .compliance-card .disc-table thead th) {
    background: transparent; font-weight: 500; color: var(--muted); letter-spacing: 0.06em;
  }
  @media (hover: hover) { .app-shell .app-main tbody tr:hover > td { background: var(--nav-hover); } }

  @media print { .bill-peek { display: none !important; } }

  /* The bill summary panel (static/js/bill_peek.js): slides in from the
     right over the page when a bill row is clicked. A phone gets it
     full-screen, with its close button. */
  .bill-peek {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(22rem, 100vw);
    display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
    background: var(--shell-main); border-left: 1px solid var(--rule-card); box-shadow: var(--shadow-drawer);
    padding: var(--space-5) var(--space-5) var(--space-6); white-space: normal;
    transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out);
  }
  .bill-peek[hidden] { display: none; }
  .bill-peek.is-open { transform: none; }
  .bill-peek-head { display: flex; align-items: flex-start; gap: var(--space-3); }
  .bill-peek-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; }
  .bill-peek-head h2:focus { outline: none; }
  .bill-peek-nav { flex: none; display: flex; gap: var(--space-1); }
  .bill-peek-nav .icon-btn { border-color: transparent; background: transparent; }
  .bill-peek-nav .icon-btn:disabled { color: var(--muted); cursor: default; }
  .bill-peek-body { opacity: 0; transform: translateX(12px); transition: opacity var(--dur-slow) var(--dur-fast), transform var(--dur-slow) var(--dur-fast); }
  .bill-peek.is-open .bill-peek-body { opacity: 1; transform: none; }
  /* Switching bills: the last one stays, its words in --slate (still AA,
     never faded with opacity), until the next arrives. */
  .bill-peek-body.is-busy, .bill-peek-body.is-busy :is(p, h3, li, span) { color: var(--slate); }
  .bill-peek-sub { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-sm); }
  .bill-peek h3 {
    margin: var(--space-5) 0 var(--space-1); font-size: var(--text-2xs); font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  }
  .bill-peek p { margin: 0; color: var(--ink-2); line-height: 1.6; }
  .bill-peek-desc { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
  .bill-peek-muted { color: var(--slate); }
  .bill-peek-note { margin-top: var(--space-2) !important; font-size: var(--text-sm); }
  .bill-peek-when { display: block; font-size: var(--text-xs); color: var(--slate); font-variant-numeric: tabular-nums; }
  /* Where the bill is: the bill page's steps as one thin segmented bar. */
  .bill-peek-stage { display: flex; gap: var(--space-1); margin: var(--space-1) 0 var(--space-2); }
  .bill-peek-stage span { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--rule-card); }
  .bill-peek-stage span.on { background: var(--ink-2); }
  .bill-peek-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); color: var(--ink-2); line-height: 1.5; }
  .bill-peek-clients { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
  .bill-peek-clients li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); color: var(--ink-2); }
  .bill-peek-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
  .bill-peek-actions a.secondary { border-color: var(--rule-card); }
  @media (max-width: 640px) { .bill-peek { width: 100vw; border-left: 0; } }
  /* A reading pane on a wide screen: the page narrows beside the panel
     instead of sitting under it, so the list stays in view while you
     step through it. Narrower than that it covers the page as before. */
  @media (min-width: 1100px) {
    /* A spacer at the shell's end takes the panel's width; the page
       (flex: 1) gives it up, whatever the sidebar's width. */
    .app-shell::after { content: ""; flex: none; width: 0; transition: width var(--dur-slow) var(--ease-out); }
    body.peek-open .app-shell::after { width: 22rem; }
    body.peek-open .bill-peek { box-shadow: none; }
  }
  /* The row whose summary is open. */
  .peek-row { cursor: pointer; }
  .peek-selected, tr.peek-selected > td { background: var(--nav-hover); }

  /* Motion (Flow-style): list rows rise in one after another, the tab
     strip's underline slides to the tab picked, and a button gives a
     little under the press. Off for anyone who asked for less motion. */
  .settings-tabs:has(.tab-ink) { position: relative; }
  .settings-tabs.has-ink .settings-tab { border-bottom-color: transparent; }
  .tab-ink {
    position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--ink);
    pointer-events: none; transition: left var(--dur-slow) var(--ease-out), width var(--dur-slow) var(--ease-out);
  }
  /* Rows, menus and popups appear in place with no rise or fade
     (founder, Oct 29 2026 — calm like Wispr Flow). */
  @media (prefers-reduced-motion: no-preference) {
    button, a.primary, a.secondary, a.danger { transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
  }
  @media (prefers-reduced-motion: reduce) {
    .bill-peek, .bill-peek-body, .app-shell::after, .tab-ink, .setup-card-bar > span { transition: none; }
  }


  /* Smooth page-to-page navigation. Every click here is a real page
     load, so the browser's own cross-document view transition does the
     work: the sidebar and top bar are named so they stay put, and only
     the content area softly fades into place — the way a
     native app swaps a screen. Browsers without support ignore all of it. */
  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    .app-sidebar { view-transition-name: app-sidebar; }
    .app-topbar { view-transition-name: app-topbar; }
    .app-main { view-transition-name: app-main; }
    ::view-transition-group(app-sidebar), ::view-transition-group(app-topbar), ::view-transition-group(app-main) { animation-duration: 0s; }
    /* No fade (founder, Oct 29 2026 — "like Wispr Flow"): the new page
       simply replaces the old one in place. */
    ::view-transition-old(app-main), ::view-transition-new(app-main) { animation: none; }
  }
  /* page_life.js holds a swapped-in page out of sight until its data has
     arrived, so it shows up built instead of filling in. */
  .app-main.page-arriving { opacity: 0; }

  /* Calm controls: a hover or press only shifts colour (no dip, no
     grey tap flash on phones). */
  a, button, summary, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  @media (prefers-reduced-motion: no-preference) {
    button:not(:disabled), .icon-btn, .app-sidebar a, .result-card-link {
      transition-property: background-color, border-color, color, box-shadow;
      transition-duration: var(--dur-fast); transition-timing-function: var(--ease);
    }
  }
  /* The page's own big heading + description + right-aligned controls
     (e.g. filter tabs), living inside .app-main — distinct from the
     small, generic "Overview" label in .app-topbar above it. */
  .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
  .page-head h1 {
    font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500;
    line-height: 1.05; letter-spacing: -0.015em; margin: 0;
    text-wrap: balance; overflow-wrap: anywhere;
  }
  .page-head .sub { font-size: var(--text-xs); color: var(--slate); margin: var(--space-0) 0 0; }
  /* The "← Flagged bills" back link is small text on its own line, so its
     box was ~15px tall, under WCAG 2.5.8's 24px (audit F24). min-height
     grows the target without enlarging the text. */
  .page-head a.sub { display: inline-flex; align-items: center; min-height: 1.5rem; }
  /* A page's caveats, folded under its one-line description (Y24):
     "More about this data" opens them in place. The summary keeps its
     disclosure triangle (so it reads as something that opens) and its
     padding makes it a 24px target, not a 15px line of small text. */
  .page-head-more { margin-top: var(--space-1); max-width: 46rem; }
  .page-head-more > summary {
    width: fit-content; padding: var(--space-1) 0; line-height: 1.4;
    cursor: pointer; font-size: var(--text-xs); color: var(--slate);
  }
  .page-head-more > .sub { margin-top: var(--space-1); }
  .page-head .filter-tabs { margin-bottom: 0; }
  /* Settings sub-tabs (the mockup's 4-way Settings shell on /profile).
     An underline tablist: the active tab carries an --ink underline and
     full-strength text, the rest sit at --slate. --rule-strong on the
     resting underline track so the row of tabs reads as controls, not
     decoration (the same 3:1 reasoning as every other control edge). */
  .settings-tabs {
    display: flex; gap: var(--space-4); border-bottom: 1px solid var(--rule);
    margin: 0 0 var(--space-4); overflow-x: auto;
    /* overflow-x:auto turns overflow-y to auto as well, and each tab's
       underline sits 1px into the row's own bottom border — so the row
       grew a tiny up-down scrollbar beside the tabs on a laptop. A
       sideways strip never scrolls up and down. */
    overflow-y: hidden;
  }
  /* On a phone the report's and client record's tab rows are wider than
     the screen, and the only sign more tabs existed was a thin scrollbar.
     Scroll shadows, CSS only: a shade sits at each edge that has hidden
     tabs beyond it (attachment: scroll), and a page-coloured cover that
     travels with the content (attachment: local) hides it once that end
     is reached. Nothing shows when the row fits — the cover is solid for
     the shade's full 2.5rem; solid for only part of it, the rest of the
     shade showed through as grey blocks on a row that fit. The shades sit
     1px in from each edge so the cover's edge can never leave a hairline
     (a stray vertical line ended the /clients and /compliance tab bars). */
  /* D7: at every width, not just phones — the client page's row showed a
     horizontal scrollbar on a laptop. Hidden, still scrollable, edge fade. */
  .settings-tabs {
    background:
      linear-gradient(to right, var(--shell-main) 2.5rem, transparent) left / 3.5rem 100% no-repeat local,
      linear-gradient(to left, var(--shell-main) 2.5rem, transparent) right / 3.5rem 100% no-repeat local,
      linear-gradient(to right, color-mix(in srgb, var(--ink) 30%, transparent), transparent) left 1px center / 2.5rem 100% no-repeat scroll,
      linear-gradient(to left, color-mix(in srgb, var(--ink) 30%, transparent), transparent) right 1px center / 2.5rem 100% no-repeat scroll;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  /* A page's own views strip can outrun a phone, where it would cut a
     tab off mid-word with no sign of more. The same shadows there; the
     page starts the strip scrolled to its current tab (_area_views_strip). */
  .settings-tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: var(--space-2) var(--space-0); margin-bottom: -1px; color: var(--slate);
    font: inherit; font-size: var(--text-sm); font-weight: 400; white-space: nowrap;
    cursor: pointer; border-radius: 0;
  }
  /* background:none on hover too, or the base button:hover (white fill)
     wins the background cascade and paints near-white text on white. */
  @media (hover: hover) { .settings-tab:hover { color: var(--ink); background: none; } }
  .settings-tab[aria-selected="true"] { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); background: none; }
  /* A count beside a tab's label ("Bills 3") — quieter than the label
     so the row still reads as words. Empty (a zero) takes no space. */
  .tab-count { margin-left: var(--space-0); font-weight: 500; color: var(--slate); }
  .tab-count:empty { display: none; }
  /* The same strip as links between pages (/flagged's four views — see
     flagged_views_nav in app.py): aria-current marks the page you're on. */
  a.settings-tab { display: inline-flex; align-items: center; text-decoration: none; }
  a.settings-tab[aria-current="page"], a.settings-tab[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }
  /* The Bills area's scope switch (audit S4): Tracking | All California
     bills, a segmented control at the head of every page in the area.
     Two options in one track, not two tabs — it changes which set of
     bills the page is about, where the underline strip below it only
     changes the view of one set, so it must not borrow that strip's
     underline. It is drawn the way the app already draws "you are
     here": the chosen option is the sidebar's active row (.side-nav-item
     .active) — --accent-soft tint, --ink text, weight 600 — sitting in a
     rounded track, with a --rule-strong edge so it reads as a shape and
     not from colour alone. Never the cream fill that means "this does
     something". Sizes follow the sidebar and the filter pills beside it
     (--radius-md track, --text-xs), not the page heading's. */
  .scope-switch {
    display: inline-flex; gap: var(--space-0); padding: var(--space-0);
    margin: 0 0 var(--space-3); max-width: 100%;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-md);
  }
  .scope-option {
    display: inline-flex; align-items: center; min-height: 1.75rem; padding: 0 var(--space-3);
    border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 500; color: var(--slate);
    text-decoration: none; white-space: nowrap; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }
  @media (hover: hover) { .scope-option:hover { color: var(--ink); background: var(--accent-soft); } }
  .scope-option[aria-current="page"] {
    color: var(--ink); font-weight: 600; background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--rule-strong);
  }
  /* A touch target the same height as the sidebar rows on a phone. */
  @media (max-width: 900px) { .scope-option { min-height: 2.5rem; } }
  .soon-badge { margin-left: var(--space-2); border-color: var(--rule-strong); color: var(--slate); }
  /* The inert 2FA/devices panels read as "not yet" from their Coming
     soon badge and disabled button — not from fading the description,
     which is text the user is meant to read. */
  .settings-soon button[disabled] { cursor: not-allowed; }
  /* Two-step sign-in's setup (profile_body.html): the QR code stays dark on
     white in either theme — a phone camera needs the contrast. */
  #two-step-panel [hidden] { display: none; }   /* .settings-body's display:flex would win */
  .two-step-steps { margin: 0 0 var(--space-4); padding-left: var(--space-5); display: grid; gap: var(--space-3); }
  /* Connected apps' "How to connect Claude" (profile_body.html). */
  .connect-guide { margin: var(--space-3) var(--space-4) var(--space-4); }
  .connect-guide summary { cursor: pointer; font-weight: 600; }
  .connect-guide-lead { margin: var(--space-3) 0; }
  .connect-guide-off { margin: 0 0 var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm);
    border: 1px solid var(--rule-strong); }
  .connect-guide-url { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
  .connect-guide-url code { overflow-wrap: anywhere; }
  .two-step-qr { margin: var(--space-3) 0 var(--space-2); }
  .two-step-qr svg { display: block; width: 180px; height: 180px; border-radius: var(--radius-xs); }

  /* Settings › Account & security › Your data: the last person at a firm
     is told, before anything else, that the whole firm goes with them. */
  .your-data-warn { margin: 0 0 var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm);
    background: var(--error-soft); color: var(--error); }
  .your-data-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

  /* ── /profile Settings shell (vertical sub-nav, mockup parity) ───────
     The mockup rebuilds Settings as a header row (avatar-initial + name)
     over a 220px left rail and an inline-editable body. Distinct classes
     from .settings-tabs above on purpose: those stay the horizontal
     underline tablist that /report and /alerts reuse — this page is the
     only one with the side rail. */
  /* The header is the shared .page-head with the short title "Settings";
     who you are (initials, name · title · firm) is its sub line. */
  .settings-who { display: flex; align-items: center; gap: var(--space-2); }
  .settings-avatar {
    flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%;
    background: var(--accent-solid); color: var(--accent-solid-text);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-sans); font-size: var(--text-2xs); font-weight: 600;
  }
  .settings-avatar:empty { display: none; }
  .settings-head-actions { margin-left: auto; align-items: center; gap: var(--space-3); }

  .settings-layout {
    display: grid; grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(var(--space-5), 4vw, var(--space-7)); align-items: start;
  }
  .settings-nav { display: flex; flex-direction: column; gap: var(--space-0); position: sticky; top: var(--space-4); }
  .settings-nav-item {
    display: flex; align-items: center; height: 2.25rem; padding: 0 var(--space-3);
    background: none; border: none; border-radius: var(--radius-md);
    color: var(--slate); font: inherit; font-size: var(--text-sm); font-weight: 600;
    text-align: left; cursor: pointer;
  }
  @media (hover: hover) { .settings-nav-item:hover { color: var(--ink); background: var(--accent-soft); } }
  .settings-nav-item[aria-selected="true"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--gold); }   /* see .side-nav-item.active */
  .settings-content { min-width: 0; }
  .settings-lead { margin: 0; }
  .settings-lead-title { font-size: var(--text-base); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
  .settings-lead .sub { font-size: var(--text-xs); color: var(--slate); margin: var(--space-1) 0 0; }

  /* Inline-editable field grid (Profile + Org tabs). Plain <label>s, not
     inside a <form>, so they don't inherit form's flex-row wrap. */
  .settings-fields {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-4); margin-bottom: var(--space-4);
  }
  .settings-field { display: flex; flex-direction: column; gap: var(--space-1); }
  .settings-field .field-label { margin: 0; }
  .settings-field-wide { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
  .settings-field-wide .field-label { margin: 0; }
  /* Settings › Firm's example letters for Draft with AI (ai_letter.py). */
  .example-form { margin-top: var(--space-4); display: flex; flex-direction: column; align-items: flex-start; }
  .example-form[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .example-form .settings-field-wide { align-self: stretch; }
  .example-form textarea, .example-form input { width: 100%; }
  /* A field that takes the whole row of the grid — the street line in the
     Firm tab's address (workflow audit C2). */
  .settings-field-span { grid-column: 1 / -1; }
  .settings-fields[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .field-hint { font-size: var(--text-xs); color: var(--slate); }
  .settings-field input[readonly] { background: var(--accent-soft); color: var(--slate); cursor: default; }
  .settings-field input[readonly]:focus { border-color: var(--rule-strong); box-shadow: none; }

  @media (max-width: 640px) {
    .settings-layout { grid-template-columns: 1fr; gap: var(--space-4); }
    .settings-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: var(--space-1); }
    .settings-nav::-webkit-scrollbar { display: none; }
    /* Same edge-shade pattern as .settings-tabs above: a shade at each end
       with hidden tabs beyond it, covered once that end is reached. */
    .settings-nav {
      background:
        linear-gradient(to right, var(--shell-main) 2.5rem, transparent) left / 3.5rem 100% no-repeat local,
        linear-gradient(to left, var(--shell-main) 2.5rem, transparent) right / 3.5rem 100% no-repeat local,
        linear-gradient(to right, color-mix(in srgb, var(--ink) 30%, transparent), transparent) left / 2.5rem 100% no-repeat scroll,
        linear-gradient(to left, color-mix(in srgb, var(--ink) 30%, transparent), transparent) right / 2.5rem 100% no-repeat scroll;
    }
    .settings-nav-item { flex: none; white-space: nowrap; }
    /* Pinned to the bottom of the screen: as a row in the header it was
       off-screen while you edited anything below the fold. It used to
       hold a Save button; now it holds the autosave status, so it shows
       only while there is something to say. Below the drawer (40). */
    .settings-head-actions {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
      justify-content: flex-end; padding: var(--space-3) var(--space-4);
      background: var(--surface); border-top: 1px solid var(--rule);
    }
    .settings-head-actions:not(:has(.save-status:not([hidden]):not([data-state="idle"]))) { display: none; }
    .settings-layout { padding-bottom: var(--space-8); }
  }

  /* ── Settings v5 (docs/design-system: Card, forms, data) ──
     Laid over the /profile shell above, scoped to .profile-page
     (PROFILE_BODY) since .panel, .saved-row, .field-label, .field-hint,
     the .pref-* digest rows and .soon-badge are shared with other pages.
     The user's name as a serif page title; the rail's current section a
     raised white pill, as the sidebar's (the hover stays a tint, so two
     never look current); each section's title in the serif, over cards
     with a hairline edge, no shadow and no header rule, card titles in
     the serif; field and group labels in sentence case at 500; row
     titles at 500; hints and meta in --muted; the muted bills' numbers
     in mono navy; radios navy when chosen (Checkbox). Buttons and fields
     keep the app's own shape (button shape is to change app-wide in one
     pass), as do the switches, the Coming soon pill's shape, the --gold
     focus ring and the phone rail. */
  .profile-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); }

  /* The rail: 34px items in --ink-2, the current one a raised pill. */
  .profile-page .settings-nav-item {
    height: var(--nav-item); border-radius: var(--radius-sm); font-weight: 500; color: var(--ink-2);
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }
  .profile-page .settings-nav-item[aria-selected="true"] {
    background: var(--nav-active); color: var(--ink); font-weight: 600; box-shadow: none;
  }

  /* Each section's title, then its cards. */
  .profile-page .settings-lead-title {
    font-size: var(--text-lg); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  }
  .profile-page .settings-lead .sub { font-size: var(--text-sm); color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
  /* One pattern for every tab (batch 6): the section is a column of
     boxes — its title, then each box a shared .panel, an optional
     .panel-head over a .settings-body — spaced by the gap alone, so no
     box carries its own margin. */
  .profile-page :is(.settings-section, .settings-stack) { display: flex; flex-direction: column; gap: var(--space-4); }
  .profile-page .settings-section[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .profile-page .settings-body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
  .profile-page .panel-head + .settings-body { padding-top: var(--space-2); }
  .profile-page .settings-body > * { margin: 0; }
  .profile-page .settings-body > button { align-self: flex-start; }
  .profile-page .settings-foot { padding: 0 var(--space-4) var(--space-3); }
  /* A switch and its words on one line. */
  .profile-page .settings-switch { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
  /* A field with its button beside it (the invite form, the invite link). */
  .profile-page .settings-inline { display: flex; gap: var(--space-2); flex-wrap: wrap; }
  .profile-page :is(.settings-inline, #invite-f) input { flex: 1; min-width: 12rem; }
  .profile-page #invite-made { margin-top: var(--space-3); }
  .profile-page .state-input { text-transform: uppercase; }
  .profile-page .result-note { margin: 0; }
  /* Rows inside a padded box line up with its text, not indented twice. */
  .profile-page :is(.settings-body, .pref-group) .saved-row { padding-left: 0; padding-right: 0; }
  .profile-page .feed-card .field-label { margin-top: var(--space-3); }
  .profile-page .pref-group input[type="text"] { margin-top: var(--space-1); }
  .profile-page .panel-head { border-bottom: 0; padding: var(--space-4) var(--space-4) var(--space-2); }
  .profile-page .panel-head .title {
    font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  }
  .profile-page .panel-head .sub { color: var(--ink-2); }
  /* The Coming soon pill beside a serif title: Geist, a borderless tint. */
  .profile-page .soon-badge { font-family: var(--font-sans); border-color: transparent; background: var(--paper-250); color: var(--ink-2); }
  /* Forms inside a card sit in its padding, without the page-level
     form's bottom margin; the digest's groups stack full width. */
  .profile-page .panel form { margin-bottom: 0; }
  .profile-page #password-f { padding: 0 var(--space-4) var(--space-4); }
  .profile-page #password-f label { flex: 1 1 100%; }
  .profile-page #password-f input { width: 100%; }
  .profile-page #password-f .field-hint { display: block; margin-top: var(--space-1); }
  .profile-page #password-f .card-actions { padding: var(--space-2) 0 0; align-items: center; }
  .profile-page #prefs-f { display: block; }

  /* Fields: labels at 500, hints in --muted. */
  .profile-page .field-label { font-weight: 500; }
  .profile-page :is(.field-hint, .pref-hint) { color: var(--muted); }

  /* Rows: a 500 title over --muted meta. */
  .profile-page .settings-row-title { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .profile-page .saved-meta { font-size: var(--text-xs); color: var(--muted); }
  .profile-page .muted-bill-number { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); }

  /* Notifications: group labels in sentence case, radios navy. */
  .profile-page .pref-group > .pref-label {
    font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .profile-page .pref-check .pref-check-sub { display: block; color: var(--muted); }
  .profile-page .pref-subhead { margin-top: var(--space-2); }
  .profile-page .pref-divided { border-top: 1px solid var(--rule); margin-top: var(--space-2); padding-top: var(--space-2); }
  /* Settings › Notifications › "For each client" (client_alert_prefs). */
  .profile-page #client-alerts-details > summary { cursor: pointer; }
  .profile-page .client-alert-row { border: 0; border-top: 1px solid var(--rule); margin: var(--space-2) 0 0; padding: var(--space-2) 0 0; min-width: 0; }
  .profile-page .client-alert-row > legend { padding: 0; }
  .profile-page .client-alert-row .pref-check-sub { display: inline; margin-left: var(--space-1); }
  .profile-page .client-alert-switches { margin-top: var(--space-1); padding-left: var(--space-3); }
  .profile-page .pref-check input[type="radio"] { accent-color: var(--link); }


  /* ── Alerts screen ──────────────────────────────────────────────────
     The history (every change, grouped by client) and the saved-search
     inbox. */
  .digest-group { padding: var(--space-1) 0 var(--space-2); }
  .digest-group + .digest-group { border-top: 1px solid var(--rule); }
  /* A client's name over its changes — the design system's group label
     (TriageGroup): 12px, medium, muted, sentence case as written. */
  .digest-group-head {
    padding: var(--space-3) var(--space-3) var(--space-1); font-size: var(--text-2xs); font-weight: 500;
    color: var(--ink-2);
  }
  .digest-row {
    display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-2) var(--space-4);
    color: inherit; border-radius: 0;
  }
  @media (hover: hover) { .digest-row:hover { background: var(--accent-soft); } }
  /* The same row where it isn't a link of its own (change_row.js) — under
     a dashboard bill, whose row is the link, and in the bill page's "New
     since" strip: no hover wash, no inset of its own. */
  .digest-row.static { padding: var(--space-1) 0; }
  @media (hover: hover) { .digest-row.static:hover { background: none; } }
  /* Date, kind, then the change — the date sits right before the line
     it dates (Sep 29 audit Y16). A hearing's time goes under its day.
     Wide enough for "Sep 19, 2026" on one line: every date carries its
     year, since a two-year session makes a bare "Sep 19" ambiguous. */
  .digest-when { flex: none; width: 5.5rem; font-size: var(--text-xs); font-weight: 600; color: var(--slate); white-space: nowrap; }
  .digest-time { display: block; font-size: var(--text-2xs); font-weight: 400; }
  .digest-type {
    flex: none; width: 7rem; display: inline-flex; align-items: baseline; gap: var(--space-1);
    font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; padding-top: var(--space-0);
  }
  /* Each kind its own colour AND its own glyph, so Hearings and
     Amendments (both amber once) differ without colour too. */
  .digest-type { color: var(--ink-2); }   /* the kind is a word and a glyph, not a colour (D1) */
  .digest-type.type-status, .digest-type.type-amendment, .digest-type.type-vote { color: var(--ink-2); }
  .digest-type.type-hearing { color: var(--ink); }
  .digest-type.type-status .digest-icon::before { content: ""; --ic: var(--icon-chevron); }          /* moved a step */
  .digest-type.type-amendment .digest-icon::before { content: ""; --ic: var(--icon-pencil); }       /* pencil: text rewritten */
  .digest-type.type-hearing .digest-icon::before { content: ""; --ic: var(--icon-scale); }   /* scales */
  .digest-type.type-vote .digest-icon::before { content: ""; --ic: var(--icon-votes); }            /* ayes and noes */
  .digest-type.type-action { color: var(--slate); }
  .digest-type.type-action .digest-icon::before { content: ""; --ic: var(--icon-arrow); }          /* arrow: a step at the Capitol */
  .digest-redline { font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
  .digest-body { flex: 1 1 auto; min-width: 0; }
  .digest-bill { font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500; color: var(--ink); margin-right: var(--space-2); }
  .digest-summary { font-size: var(--text-sm); color: var(--slate); }
  /* When the refresh saw it, when that differs from when it happens —
     a secondary fact, so it shows on hover or keyboard focus only (and
     to a screen reader always: clipped, not display:none). */
  .digest-noticed {
    margin-left: var(--space-1); font-size: var(--text-2xs); color: var(--slate);
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .digest-row:focus-visible .digest-noticed { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  @media (hover: hover) { .digest-row:hover .digest-noticed { position: static; width: auto; height: auto; overflow: visible; clip: auto; } }
  /* Reported two or more days after it happened (Oct 7 audit A8): not a
     secondary fact any more — it explains why old news is new — so it
     shows inline everywhere, a phone included, where hover never comes. */
  .digest-reported { margin-left: var(--space-1); font-size: var(--text-2xs); color: var(--slate); white-space: nowrap; }
  /* A change the Legislature's own daily file told, often days before
     LegiScan (change_text.source_note) — a small chip after the line,
     shown everywhere like "reported". Tokens only, so both themes hold. */
  .digest-source {
    display: inline-block; margin-left: var(--space-1); padding: 0 var(--space-2);
    font-size: var(--text-2xs); font-weight: 600; color: var(--slate);
    background: var(--accent-soft); border-radius: var(--radius-pill);
  }
  /* A phone can't spare the type and date columns beside the sentence —
     it wrapped a hearing line to seven lines in a 70px strip. There the
     date and type share the top line and the sentence gets the width. */
  @media (max-width: 640px) {
    .digest-row { flex-wrap: wrap; row-gap: var(--space-0); }
    .digest-when { width: auto; }
    .digest-time { display: inline; margin-left: var(--space-1); }
    .digest-type { width: auto; flex: 1 1 auto; }
    .digest-body { order: 1; flex-basis: 100%; }
  }

  /* The digest email's schedule — a quiet line under the list (Nov 12
     cleanup). It isn't a view control or part of reading, it's a
     setting, and it's changed in Settings. */
  .alerts-email {
    margin: var(--space-4) 0 0; font-size: var(--text-xs); color: var(--ink-2);
  }
  .alerts-email a { display: inline-flex; align-items: center; min-height: 24px; }

  /* The top (Nov 12 cleanup): title, then one line of how much is new and
     how fresh the data is; Inbox options at the right holds the rest. */
  .alerts-page .page-head.inbox-head { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
  .inbox-head-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2);
    margin-top: var(--space-1); font-size: var(--text-xs); color: var(--ink-2); }
  #inbox-new-total { font-weight: 500; color: var(--ink); }
  /* The dot trails the count, so on a narrow screen it never starts the next line. */
  .inbox-head-line:has(.last-checked) #inbox-new-total:not(:empty)::after { content: " ·"; font-weight: 400; color: var(--slate); }
  .inbox-head-line [data-last-checked] { display: flex; }
  .inbox-head-line .last-checked { margin: 0; }
  .inbox-head-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
  .inbox-options { position: relative; flex: none; }
  /* A worded button, not the ⋮ icon: the shared .row-menu-btn is a 30px square. */
  .inbox-options .inbox-options-btn { width: auto; white-space: nowrap; }
  .inbox-options .row-menu-dropdown { right: 0; left: auto; min-width: 13rem; }
  .inbox-options .row-menu-dropdown a.row-menu-edit { display: block; color: var(--ink); text-decoration: none; }
  .inbox-help { display: flex; align-items: baseline; gap: var(--space-3); margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface); }
  .inbox-help[hidden] { display: none; }
  .inbox-help .sub { margin: 0; font-size: var(--text-xs); color: var(--ink-2); max-width: 46rem; }
  .inbox-help .linklike { flex: none; min-height: 24px; }

  /* The feed (All and the other kinds, Nov 7 2026): one row per item,
     its kind first as a small label, then what happened and when. */
  .inbox-feed { list-style: none; margin: 0; padding: 0 var(--space-3) var(--space-3); }
  .inbox-item + .inbox-item { border-top: 1px solid var(--rule); }
  .inbox-item-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3);
    padding: var(--space-2) var(--space-1); color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
  @media (hover: hover) { .inbox-item-main:hover { background: var(--paper-subtle, var(--rule)); } }
  .inbox-kind { font-size: var(--text-xs); font-weight: 500; color: var(--slate); min-width: 7.5rem; }
  .inbox-item-label { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
  .inbox-item-meta { font-size: var(--text-xs); color: var(--slate); }
  /* All, grouped by day (Nov 12 cleanup): a day's heading, then each
     kind's own row — a bill change is Bill changes' row, ⋯ menu and all. */
  .inbox-day + .inbox-item, .inbox-item + .inbox-day { border-top: none; }
  .inbox-day .digest-group-head { padding-left: var(--space-1); }
  .inbox-feed > .inbox-match { padding-left: var(--space-1); padding-right: var(--space-1); }
  /* The bill's clients on a change row, when the rows aren't grouped by client. */
  .digest-client { font-size: var(--text-xs); color: var(--ink-2); white-space: nowrap;
    max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }

  /* History's view filters: client, time window, kind of change. */
  .history-filters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-4) 0;
  }
  .history-filter {
    display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; max-width: 100%;
    font-size: var(--text-2xs); font-weight: 600; color: var(--slate);
  }
  .history-filter select { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); max-width: 100%; }
  .history-filters .filter-tabs { margin-bottom: 0; }
  /* Phone only: the filters fold behind one button that names them. */
  .history-filters-toggle { display: none; }
  .history-filters-summary { font-weight: 400; color: var(--slate); margin-left: var(--space-2); }
  @media (max-width: 640px) {
    .history-filters-toggle {
      display: flex; align-items: baseline; width: calc(100% - 2 * var(--space-4));
      margin: var(--space-3) var(--space-4) 0; text-align: left;
    }
    .history-filters-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .history-filters:not(.open) { display: none; }
  }
  .history-more { padding: var(--space-2) var(--space-4) var(--space-4); }

  /* The saved-search inbox: each search, then what it found. */
  /* Both are headings now (group, search) — not the browser's h3 gaps. */
  .digest-group-head, .inbox-search .saved-name { margin: 0; }
  .inbox-search + .inbox-search { border-top: 1px solid var(--rule); }
  .inbox-search .saved-row { border-bottom: 0; padding-bottom: var(--space-1); }
  /* Phone: the name and query get the full width, the buttons go under. */
  @media (max-width: 640px) {
    .inbox-search .saved-row { flex-wrap: wrap; }
    .inbox-search .saved-main { flex-basis: 100%; }
  }
  .inbox-matches { list-style: none; margin: 0; padding: 0 0 var(--space-2); }
  .inbox-match {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3);
    padding: var(--space-1) var(--space-4);
  }
  .inbox-match-main { flex: 1 1 16rem; min-width: 0; color: inherit; }
  .inbox-match-meta { display: block; font-size: var(--text-2xs); color: var(--slate); }
  .inbox-flagged { font-size: var(--text-xs); color: var(--good); white-space: nowrap; }
  .inbox-note { padding: var(--space-1) var(--space-4) var(--space-3); font-size: var(--text-xs); color: var(--slate); }

  /* Alert-rule On/Off — a switch-shaped button rather than a checkbox,
     so its label ("On"/"Off") reads the same closed and to a screen
     reader (role="switch" + aria-checked carry the state). */
  .rule-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
  .switch-btn {
    min-width: 3rem; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); font-weight: 600;
    background: none; border: 1px solid var(--rule-strong); border-radius: var(--radius-pill);
    color: var(--slate); cursor: pointer;
  }
  .switch-btn[aria-checked="true"] { background: var(--good-soft); border-color: var(--good); color: var(--good); }
  @media (hover: hover) { .switch-btn:hover { border-color: var(--ink); } }
  .saved-row.rule-off .saved-name { color: var(--slate); }

  /* ── Alerts v5 (docs/design-system) ──
     Laid over the rules above, scoped to .alerts-page since the history
     filters, change rows, inbox and switch are shared with the calendar,
     the dashboard and a client's page. Serif page and card titles; white
     18px cards with a 4px inset, no shadow and no header rule, so rows
     sit in with their own 12px corners; bill numbers mono navy; the kind
     filter a SegmentedControl; 10px-cornered buttons and fields. */
  .alerts-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .alerts-page .panel {
    background: var(--surface);
    border-radius: var(--radius-lg); padding: var(--space-1); overflow: visible;
  }
  .alerts-page .panel-head { border-bottom: none; padding: var(--space-3) var(--space-3) var(--space-1); align-items: flex-start; }
  .alerts-page .panel-head .title {
    margin: 0; font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em;
  }
  .alerts-page .panel-head .sub { font-size: var(--text-xs); color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
  .alerts-page .panel-head .sub strong { font-weight: 500; color: var(--ink); }

  /* Buttons and text actions are the shared ones (batch 6); only the
     "+" icon needs sizing, and a row's text action a 24px target. */
  .alerts-page .panel-head > button:not(.linklike) { display: inline-flex; align-items: center; gap: var(--space-2); }
  .alerts-page .panel-head > button:not(.linklike) svg { width: 0.85rem; height: 0.85rem; flex: none; }
  .alerts-page .rule-actions .linklike { display: inline-flex; align-items: center; min-height: 1.5rem; }
  /* The history's count line, loading rows and feed, in the card's inset. */
  .alerts-page .alerts-status { margin: 0; padding: var(--space-3) var(--space-3) 0; }
  .alerts-page .panel > .skeleton { padding: var(--space-3); }
  .alerts-page .alerts-feed { padding: var(--space-2) 0 0; }
  .alerts-page .modal-panel :is(input, select) { width: 100%; }

  /* Filters: the label to the select's left (Select), the kind of change
     a segmented track with its count per option. */
  .alerts-page .history-filters { align-items: center; padding: var(--space-2) var(--space-3) 0; }
  .alerts-page .history-filter { flex-direction: row; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
  .alerts-page .history-filter select, .alerts-page .modal-panel :is(input, select) { border-radius: var(--radius-sm); }
  .alerts-page .history-filter select { min-height: 1.75rem; padding: 0 var(--space-6) 0 var(--space-2); font-size: var(--text-xs); }
  /* The filters are the same pill dropdowns /flagged uses (.filter-dd*,
     styled with the shared rules in the flagged section); one popover open at a time. */
  .alerts-page .history-filters .filter-dds { gap: var(--space-2); }
  /* New / Everything sits above the filters, always in view; each tab's
     "3 new" in the tab strip. */
  .alerts-page .history-show { padding: var(--space-2) var(--space-3) 0; }
  .alerts-page .history-show .segmented { display: inline-flex; }
  .alerts-page .settings-tab .tab-count { margin-left: var(--space-2); font-size: var(--text-xs); font-weight: 500; color: var(--link); }
  .alerts-page .filter-dd-btn .dd-value { font-weight: 500; }

  /* Change rows: inset, 12px corners, hover to the subtle paper. */
  .alerts-page .digest-group { padding: 0 0 var(--space-1); }
  .alerts-page .digest-group + .digest-group { border-top: none; margin-top: var(--space-1); }
  .alerts-page .digest-row { padding: var(--space-3); border-radius: var(--radius-md); align-items: baseline; }
  /* A row plus its triage ⋮ (alert_triage.js, Oct 7 audit A6): the row
     stays the link, the menu and any "Handed to" mark sit beside it. */
  .triage-row { display: flex; align-items: center; gap: var(--space-2); }
  .triage-row > .digest-row { flex: 1; min-width: 0; }
  .triage-handed { font-size: var(--text-xs); color: var(--ink-2); white-space: nowrap; }
  .triage-handed.mine { color: var(--link); font-weight: 500; }
  /* The row j/k has landed on (triage_keys.js, Oct 7 audit T9). */
  .key-current { outline: 2px solid var(--link); outline-offset: 2px; border-radius: var(--radius-md); }
  .keys-help { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); margin: 0; }
  .keys-help dt { margin: 0; text-align: right; }
  .keys-help dd { margin: 0; color: var(--ink-2); }
  .keys-help kbd {
    font-family: inherit; font-size: var(--text-xs); padding: 0 var(--space-1); border: 1px solid var(--rule-card);
    border-radius: var(--radius-sm); background: var(--surface);
  }
  @media (hover: hover) { .alerts-page .digest-row:hover { background: var(--paper-50); } }
  .alerts-page .digest-when { font-size: var(--text-xs); font-weight: 400; color: var(--ink-2); }
  .alerts-page .digest-type { font-size: var(--text-xs); font-weight: 500; text-transform: none; letter-spacing: 0; }
  .alerts-page .digest-bill { font-weight: 400; color: var(--link); margin-right: var(--space-1); }
  .alerts-page .digest-summary { color: var(--ink); }
  /* "New" is the accent count pill (CountPill tone="accent") — on the
     Inbox's own change rows it's the dot instead (below). */
  .alerts-page .unread-dot { background: var(--info-soft); color: var(--link); font-weight: 500; }

  /* Inbox redesign (founder, Nov 17 2026). The four pills are the app's
     segmented switch (.segmented), the client and Unread only beside them.
     A change row leads with its sentence; the bill, its title, and each
     client with the firm's position sit under it. Unread is a blue dot and
     bold text, not a "New" pill on every row; the dot is the button that
     marks it read. Needs a look is a flat card at the top of All. */
  .alerts-page .inbox-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-4) 0 var(--space-3); }
  .alerts-page .inbox-controls.on-saved :is(.inbox-controls-rule, .inbox-client, .inbox-unread) { display: none; }
  .alerts-page .inbox-chips { display: inline-flex; flex-wrap: wrap; }
  .alerts-page .inbox-chips [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-rest); }
  .alerts-page .inbox-chips .tab-count { margin-left: 0; }
  .alerts-page .inbox-controls-rule { width: 1px; height: 1.25rem; background: var(--rule); }
  .alerts-page .inbox-client { min-height: 2rem; padding: 0 var(--space-6) 0 var(--space-2); font-size: var(--text-xs); border-radius: var(--radius-button); max-width: 16rem; }
  .alerts-page .inbox-unread { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2rem; margin-left: auto; font-size: var(--text-xs); color: var(--ink); cursor: pointer; }
  .alerts-page .inbox-unread input { margin: 0; width: 1rem; height: 1rem; accent-color: var(--ink); }
  .alerts-page .inbox-back { margin-bottom: var(--space-2); font-size: var(--text-xs); }

  .alerts-page .inbox-needs { margin: var(--space-2) var(--space-3) var(--space-3); border: 1px solid var(--card-edge); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
  .alerts-page .inbox-needs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); padding: var(--space-3) var(--space-3) var(--space-1); }
  .alerts-page .inbox-needs-head h3 { margin: 0; font-size: var(--text-sm); font-weight: 600; }
  .alerts-page .inbox-needs-count { font-size: var(--text-xs); color: var(--muted); }
  .alerts-page .inbox-needs-sub { flex-basis: 100%; margin: 0; font-size: var(--text-xs); color: var(--ink-2); }
  .alerts-page .inbox-needs .inbox-feed { padding: 0 var(--space-1) var(--space-1); }

  /* The change row: dot · kind · sentence over bill, title and clients · ⋮ */
  .alerts-page .triage-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto auto; align-items: center; gap: 0 var(--space-1); }
  .alerts-page .triage-row > .digest-row { grid-column: 2; padding: var(--space-2); }
  .alerts-page .inbox-steps { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }
  .alerts-page .inbox-read-dot {
    grid-column: 1; justify-self: center; width: 1.5rem; height: 1.5rem; padding: 0; border: none; border-radius: var(--radius-pill);
    background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .alerts-page .inbox-read-dot::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: var(--radius-pill); background: var(--link); }
  .alerts-page .inbox-read-dot.is-read { cursor: default; }
  .alerts-page .inbox-read-dot.is-read::before { background: none; }
  @media (hover: hover) { .alerts-page button.inbox-read-dot:hover { background: var(--accent-soft); } }
  .alerts-page .digest-row .digest-when:empty { display: none; }
  .alerts-page .digest-row .digest-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-0) var(--space-2); }
  .alerts-page .digest-row .digest-summary { order: -1; flex-basis: 100%; font-size: var(--text-sm); color: var(--ink); }
  .alerts-page .digest-row.unseen .digest-summary { font-weight: 600; }
  .alerts-page .digest-row .digest-body .unread-dot {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .alerts-page .digest-title { font-size: var(--text-xs); color: var(--ink-2); }
  .alerts-page .digest-clients { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-0) var(--space-2); }
  .alerts-page .digest-clients .digest-client { max-width: 100%; overflow: visible; white-space: normal; color: var(--ink); }
  .alerts-page .digest-clients .position-badge { margin-left: var(--space-1); white-space: nowrap; }

  @media (max-width: 640px) {
    .alerts-page .inbox-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .alerts-page .inbox-chips [role="tab"] { min-height: 2.5rem; justify-content: center; }
    .alerts-page .inbox-controls-rule { display: none; }
    .alerts-page .inbox-client { flex: 1 1 auto; min-height: 2.25rem; max-width: none; }
    .alerts-page .inbox-unread { margin-left: 0; min-height: 2.25rem; }
    .alerts-page .inbox-needs { margin-left: 0; margin-right: 0; }
  }

  /* Saved searches: each search a group in the card, its finds as rows. */
  .alerts-page .inbox-search + .inbox-search { border-top: 1px solid var(--rule); margin-top: var(--space-1); padding-top: var(--space-1); }
  .alerts-page .inbox-search .saved-row { padding: var(--space-3) var(--space-3) var(--space-1); }
  .alerts-page .inbox-search .saved-name { font-size: var(--text-base); font-weight: 500; }
  .alerts-page .saved-meta { font-size: var(--text-xs); color: var(--ink-2); }
  .alerts-page .inbox-matches { padding: 0; }
  .alerts-page .inbox-match { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); align-items: center; }
  @media (hover: hover) { .alerts-page .inbox-match:hover { background: var(--paper-50); } }
  .alerts-page .inbox-match-main { font-weight: 500; }
  .alerts-page .inbox-match-main .digest-summary { font-size: var(--text-sm); }
  .alerts-page .inbox-match-meta { font-size: var(--text-xs); font-weight: 400; color: var(--ink-2); }
  .alerts-page .inbox-flagged { font-weight: 500; }
  .alerts-page .inbox-note { padding: var(--space-1) var(--space-3) var(--space-3); color: var(--ink-2); margin: 0; }
  .alerts-page .switch-btn { font-weight: 500; }
  .alerts-page .history-more { padding: var(--space-2) var(--space-3) var(--space-3); }

  @media (max-width: 640px) {
    .alerts-page .history-filters-toggle { width: calc(100% - 2 * var(--space-3)); margin: var(--space-2) var(--space-3) 0; }
    .alerts-page .history-filter { flex-wrap: wrap; }
  }
  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
  .stat-card {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);
    border-radius: var(--radius-lg); padding: var(--space-4); transition: box-shadow var(--dur-fast) var(--ease);
  }
  @media (hover: hover) { .stat-card:hover { box-shadow: var(--shadow-hover); } }
  /* Value-first, no icon (mockup parity): the card leads with the big
     number, then the label under it, then the note. The old icon-first
     treatment is gone — markup no longer emits a .stat-icon. */
  .stat-value { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
  .stat-label { font-size: var(--text-xs); font-weight: 500; color: var(--slate); margin-top: var(--space-1); }
  .stat-foot { font-size: var(--text-2xs); color: var(--slate); margin-top: var(--space-2); }
  /* A card meant to hold a whole list/table, with its own header row —
     same visual family as .card, just with a title/subtitle slot. */
  .panel {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);
    border-radius: var(--radius-lg); overflow: hidden;
  }
  .panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    padding: var(--space-4) var(--space-4) var(--space-3);
  }
  /* No rule under the header — space alone separates it from the body. */
  /* The heading's long description takes the squeeze, not the action:
     a pill button shrunk beside it broke "+ New rule" onto two lines. */
  .panel-head > button, .panel-head > a.secondary { flex: none; white-space: nowrap; }
  /* An <h2> since the UX audit's A2 — every panel heading in the app
     was a styled div, which left the product with essentially no
     heading outline for anyone navigating by heading. margin:0 and the
     font-size here are what keep an h2 rendering exactly as the div
     did; without them the browser's own h2 defaults reshape every
     panel head in the app. */
  .panel-head .title { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.005em; margin: 0; }
  /* margin, not margin-top: the global .sub rule carries a var(--space-6) bottom
     margin that was leaving dead space under every panel subtitle. */
  .panel-head .sub { font-size: var(--text-xs); color: var(--slate); margin: var(--space-0) 0 0; }
  /* On a phone or small tablet the title and its control cluster can't
     share a row: justify-content:space-between squeezes the heading into
     a two-line sliver on the left while the controls crowd the right
     (worst on Flagged bills, whose cluster is search + sort + group +
     export). Stack them instead — title on its own full-width line,
     controls in their own wrap-row beneath — the same move the ≤700px
     .search-box rule already assumes by giving the filter box a full
     row. The hint drops its desktop right-alignment since it now leads a
     full-width line rather than trailing the controls. */
  @media (max-width: 768px) {
    .panel-head { flex-direction: column; align-items: stretch; }
  }
  .panel-link {
    height: 1.75rem; display: flex; align-items: center; gap: var(--space-1); border-radius: var(--radius-button);
    border: 1px solid var(--rule); background: var(--accent-soft); color: var(--slate);
    font: inherit; font-size: var(--text-2xs); font-weight: 500; padding: 0 var(--space-2); cursor: pointer; flex: none;
  }
  @media (hover: hover) { .panel-link:hover:not(:disabled) { background: var(--content-bg); } }
  .panel-link:disabled { cursor: not-allowed; opacity: 0.6; }
  .panel table { margin: 0; }
  .panel th { padding: var(--space-2) var(--space-4); }
  .panel td { padding: var(--space-3) var(--space-4); }
  @media (hover: hover) { .panel tbody tr:hover { background: var(--content-bg); } }
  /* Whole-row navigation (see row_nav.js): the bill-search and client
     rows are one big click target that opens the detail page. The pointer
     and hover say the row is live; the keyboard focus highlight fires on
     :has(a:focus-visible) so it shows for Tab-into-the-row (the primary
     cell's real <a>) but not for a mouse click, matching the app's other
     :focus-visible affordances. The row's own <a> keeps its outline for
     the precise indicator; this tints the rest of the row with it. */
  tr.link-row { cursor: pointer; }
  tr.link-row:has(a:focus-visible) { background: var(--accent-soft); }
  /* Organization Search's "+ N other filing variants" disclosure — a
     native <details> rather than a JS-driven toggle, and nothing in it
     is actually hidden data, just collapsed by default (see
     app.py's _cluster_client_mentions). */
  @media (hover: hover) { .variants-row:hover { background: none !important; } }
  .variants-row td { padding: 0; }
  .variants-row details { padding: var(--space-2) var(--space-4); }
  .variants-row summary {
    cursor: pointer; font-size: var(--text-xs); color: var(--slate); font-weight: 500;
    list-style: none; display: flex; align-items: center; gap: var(--space-2);
  }
  .variants-row summary::-webkit-details-marker { display: none; }
  .variants-row summary::before { content: '▸'; display: inline-block; transition: transform var(--dur-fast) var(--ease); }
  .variants-row details[open] summary::before { transform: rotate(90deg); }
  .variant-row {
    display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) 0 var(--space-2) var(--space-5);
    font-size: var(--text-xs); border-top: 1px solid var(--rule); margin-top: var(--space-2);
  }
  /* The lobbying pages' tables (search results, an organization's
     filings). Their names are the way into each record, so they read as
     links — full ink and underlined — rather than the --accent (slate,
     65% ink) every bare link gets, which on these rows was
     indistinguishable from the plain text beside it. */
  .lobbying-table td a:not(.secondary):not(.tag) { color: var(--link); }
  @media (hover: hover) { .lobbying-table td a:not(.secondary):not(.tag):hover { color: var(--ink); } }
  .lobbying-table .not-reported { color: var(--slate); }
  .lobbying-table td.report { white-space: nowrap; }
  .lobbying-table .form-code { display: block; font-size: var(--text-2xs); color: var(--slate); }
  .lobbying-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
  /* An organization page's linked spellings and groups ("Also listed as",
     "Member of"): one line each, the names as tags with a Remove word in
     the error colour (the .chip-remove rule — × only ever means close),
     then the add control. */
  .name-links { display: grid; gap: var(--space-2); margin: 0 var(--space-4) var(--space-3); }
  .name-links-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
  .name-links-row .label { font-size: var(--text-xs); color: var(--slate); min-width: 7.5rem; }
  .name-links .chip-remove {
    background: none; border: 0; padding: 0 var(--space-1); font: inherit; font-size: var(--text-2xs);
    font-weight: 600; color: var(--error); cursor: pointer;
  }
  .name-links form { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }
  .name-links input[type="text"] { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); width: 16rem; max-width: 100%; }
  /* Lobbying disclosures' one-click client searches (Y22): the firm's
     own clients as .filter-chip buttons under the search box. A list,
     so a screen reader hears how many; wraps rather than scrolls. The
     chips are 1.5rem tall at least (WCAG 2.5.8). */
  .lobbying-client-chips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
  .lobbying-client-chips > .sub { margin: 0; font-size: var(--text-xs); }
  .lobbying-client-chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
  .lobbying-client-chip { min-height: 1.5rem; }
  /* A result's Type label carries its definition as a .has-tip tooltip.
     The table's scroll wrapper clips below its last rows on desktop, so
     there the tip opens upward — the same fix .result-table uses. */
  @media (min-width: 901px) {
    .lobbying-table tbody tr:nth-last-child(-n+2) .has-tip > .tip { top: auto; bottom: calc(100% + 6px); }
  }
  /* Below 900px, one card per row instead of a sideways-scrolling table
     — the same reflow the bill tables use (see "The bill tables, wide
     and narrow"), generic here: each cell's column name comes from its
     own data-label. A cell with no label (the row's name) leads the
     card as its title. */
  @media (max-width: 900px) {
    .lobbying-table, .lobbying-table tbody, .lobbying-table tr, .lobbying-table td { display: block; width: auto; }
    .lobbying-table thead { display: none; }
    .lobbying-table tr { border-bottom: 1px solid var(--rule-strong); padding: var(--space-3) var(--space-4); }
    .lobbying-table tr:last-child { border-bottom: 0; }
    .panel .lobbying-table td { border: 0; padding: var(--space-1) 0; }
    .panel .lobbying-table td:empty { display: none; }
    /* Label beside its value rather than above it — a filing is seven
       short facts, and stacking each label on its own line left about
       one filing per phone screen. */
    .lobbying-table td[data-label] {
      display: grid; grid-template-columns: 6rem minmax(0, 1fr); column-gap: var(--space-2); align-items: baseline;
    }
    .lobbying-table td[data-label] > * { justify-self: start; }
    .lobbying-table td[data-label]::before {
      content: attr(data-label);
      font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--slate);
    }
    .lobbying-table td.lead { font-weight: 600; }
    .lobbying-table td.date, .lobbying-table td.num { white-space: normal; }
    .lobbying-table tr.variants-row { padding: 0; }
    .panel .lobbying-table tr.variants-row td { padding: 0; }
  }

  /* ── Lobbying v5 (docs/design-system) ──
     Laid over the rules above, scoped to .lobbying-page (/lobbying,
     /lobbying/detail and its not-found page), since .lobbying-table,
     .tag, .card and .panel are shared with the bill page's "Lobbying on
     this bill" card and the rest of the app. Serif page and card titles;
     white 18px cards on a hairline with no shadow and no rule under the
     head; table heads a tinted rounded band in sentence case, rows that
     tint on hover; tags in the shared .tag look;
     bill numbers mono navy (BillNumber). Buttons and fields keep the
     app's own shape; position badges keep their borders and glyphs
     (P2-31). */
  .lobbying-page #lobbying-name { overflow-wrap: anywhere; text-wrap: balance; }
  .lobbying-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .lobbying-page .lobbying-back {
    display: inline-flex; align-items: center; min-height: 1.5rem; margin: 0;
    font-size: var(--text-xs); font-weight: 500; color: var(--ink-2);
  }
  @media (hover: hover) { .lobbying-page .lobbying-back:hover { color: var(--ink); } }
  .lobbying-page .lobbying-client-chips > .sub { color: var(--ink-2); }
  /* The firm's clients as FilterChips: a borderless neutral pill. */
  .lobbying-page .lobbying-client-chip { background: var(--paper-250); color: var(--ink-2); font-weight: 500; }
  @media (hover: hover) { .lobbying-page .lobbying-client-chip:hover { background: var(--paper-350); color: var(--ink); } }

  /* Cards: hairline edge, no shadow, a serif title and no header rule. */
  .lobbying-page #detail .card { padding: var(--space-5); }
  .lobbying-page #detail .card .bill-desc { color: var(--ink-2); }
  .lobbying-page .card-actions { margin-top: var(--space-3); }
  .lobbying-page .panel > .sub { font-size: var(--text-xs); color: var(--ink-2); }
  .lobbying-page .panel > h3.title {
    margin: var(--space-4) var(--space-4) var(--space-2);
    font-size: var(--text-base); font-weight: 500; letter-spacing: -0.01em;
  }
  /* Spacing the pages' generated parts used to carry inline: the search
     card above the results, a panel's inset lines (the summary, "Sign
     in to link…", the source under a table, "Show all"), the gap
     between the detail page's sections and the "data as of" note. */
  .lobbying-page .lobbying-search { margin-bottom: var(--space-5); }
  /* Search analyses (analyses_body.html): each hit is the bill, where
     and when it was analysed, and the passage with the words marked. */
  .analysis-hit { padding: var(--space-4) 0; border-bottom: 1px solid var(--rule); }
  .analysis-hit:last-child { border-bottom: 0; }
  .analysis-hit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
  .analysis-hit-snippet { margin: var(--space-2) 0; font-size: var(--text-sm); color: var(--ink-2); overflow-wrap: anywhere; }
  .analysis-hit-snippet mark, .analysis-full mark { background: var(--accent-soft); color: var(--ink); padding: 0 var(--space-0); border-radius: var(--radius-sm); }
  .analysis-hit-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-sm); }
  .analysis-full { white-space: pre-wrap; font-size: var(--text-sm); margin: var(--space-3) 0 0; padding: var(--space-4); background: var(--accent-soft); border-radius: var(--radius-md); max-height: 32rem; overflow-y: auto; overflow-wrap: anywhere; }
  .analyses-more { margin-top: var(--space-4); }
  /* Positions on file (lobbying_positions_body.html): the filter row
     under the search box, and the link to the page from the lookup. */
  .positions-grid-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--text-sm); }
  .positions-grid-filters .positions-grid-check { display: inline-flex; align-items: center; gap: var(--space-2); margin-right: var(--space-2); }
  .positions-grid-filters #export { margin-left: auto; }
  .positions-grid-note, .lobbying-grid-link { margin: 0 0 var(--space-4); }
  .lobbying-page .lobbying-search form { margin: 0 0 var(--space-3); }
  .lobbying-page .variant-row .sub, .lobbying-page .panel-head .sub { margin: 0; }
  .lobbying-page .variants-note { margin: 0 0 var(--space-2); }
  .lobbying-page .panel > .lobbying-panel-line { margin: 0 var(--space-4) var(--space-3); }
  .lobbying-page .panel > .lobbying-panel-source { margin: var(--space-2) var(--space-4) var(--space-4); }
  .lobbying-page .lobbying-more { margin: var(--space-3) var(--space-4); }
  .lobbying-page .lobbying-section { margin-top: var(--space-4); }
  .lobbying-page .lobbying-foot-note { margin-top: var(--space-3); }
  .lobbying-page #detail .card > .bill-desc { margin-top: var(--space-2); }
  .lobbying-page #detail .card > .bill-desc:first-child { margin-top: 0; }
  .lobbying-page .lobbying-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }

  .lobbying-page .name-links-row .label { font-weight: 500; color: var(--ink-2); }
  /* Bill numbers, linked or not: mono, navy when they open a bill. */
  .lobbying-page .bill-num {
    padding: 0; border: 0; border-radius: 0; background: none;
    font-variant-numeric: tabular-nums; font-size: var(--text-sm); font-weight: 500; color: var(--ink-2);
  }
  .lobbying-page a.bill-num { color: var(--link); }
  /* "AB 5 AB 2" from one "ABs 5, 2": without the pill's fill, a little
     more room keeps two numbers from reading as one. */
  .lobbying-page .bill-num + .bill-num { margin-left: var(--space-1); }
  /* The session after a position's bill number: a muted aside. */
  .lobbying-page .lobbying-table td.lead .sub { margin-left: var(--space-1); font-size: var(--text-xs); font-weight: 400; color: var(--muted); }
  @media (hover: hover) {
    .lobbying-page a.bill-num:hover { background: none; color: var(--ink); }
    .lobbying-page .lobbying-table td a:not(.secondary):not(.tag):hover { color: var(--ink); }
  }
  .lobbying-page .lobbying-table .form-code, .lobbying-page .lobbying-table .not-reported { color: var(--muted); }
  .lobbying-page .lobbying-table td.date { color: var(--ink-2); }
  .lobbying-page .variants-row summary { color: var(--ink-2); }

  /* Tables: inset from the card edge, the head a tinted rounded band
     in sentence case, hairline row dividers, a row tint on hover. */
  @media (min-width: 901px) {
    .lobbying-page .panel .table-scroll { padding: 0 var(--space-2) var(--space-2); }
    .lobbying-page .lobbying-table { border-collapse: separate; border-spacing: 0; }
    .lobbying-page .lobbying-table th {
      border-top: 0; border-bottom: 0; background: var(--paper-50);
      font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .lobbying-page .lobbying-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .lobbying-page .lobbying-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .lobbying-page .lobbying-table th:first-child, .lobbying-page .lobbying-table td:first-child { padding-left: var(--space-3); }
    .lobbying-page .lobbying-table th:last-child, .lobbying-page .lobbying-table td:last-child { padding-right: var(--space-3); }
    .lobbying-page .lobbying-table td { padding-top: var(--space-3); padding-bottom: var(--space-3); }
    .lobbying-page .lobbying-table tbody tr:last-child td { border-bottom: 0; }
    .lobbying-page .lobbying-table td.lead { font-weight: 500; }
    @media (hover: hover) { .lobbying-page .lobbying-table tbody tr:not(.variants-row):hover td { background: var(--paper-50); } }
  }
  /* The phone card's cell labels, in sentence case like the column heads. */
  @media (max-width: 900px) {
    .lobbying-page .lobbying-table td[data-label]::before { letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--muted); }
    .lobbying-page .lobbying-table td.lead { font-weight: 500; }
  }
  @media (max-width: 640px) {
    .lobbying-page #detail .card { padding: var(--space-4); }
  }
  /* A bill row's icon+title+id block — same .bill-title/.bill-id classes
     the /report page's big card already uses, just sized down here via
     the .bill-row scope rather than given new parallel class names. */
  .bill-row { display: flex; align-items: center; gap: var(--space-2); }
  .bill-row .bill-icon {
    height: 1.75rem; width: 1.75rem; border-radius: var(--radius-md); background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center; flex: none;
  }
  .bill-row .bill-icon svg { width: 0.75rem; height: 0.75rem; color: var(--slate); }
  .bill-row .bill-title { font-size: var(--text-sm); font-weight: 500; margin: 0; }
  /* On the Hearing calendar and Sponsors & votes this line is the bill
     number AND its title; only the number (the link) is set in --mono
     (Y23) — the title reads in the body face like every other title. */
  .bill-row .bill-id { font-family: var(--font-sans); font-size: var(--text-2xs); margin: var(--space-0) 0 0; }
  .bill-row .bill-id a { font-variant-numeric: tabular-nums; font-weight: 500; }
  /* Flagged Bills inverts the pair above: the identifier leads and the
     title sits under it, muted and clamped. "SB1159" is what a lobbyist
     says out loud and scans a list for, and letting the full title set
     the row height meant six bills filled more than a screen — the list
     stopped being scannable exactly where scanning matters. Separate
     class names rather than a restyle of .bill-title/.bill-id, because
     the calendar and the /report card still want the title to lead:
     there the bill is already named and the title is the new
     information. */
  .bill-row .bill-main { flex: 1; min-width: 0; }
  /* --ink, not --accent: --accent aliases --slate in both themes, which
     is also what .bill-name uses below — the "promoted" identifier came
     out the exact same colour as the title it was supposed to lead, with
     only weight telling them apart. */
  .bill-ident { font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500; color: var(--ink); margin: 0; }
  .bill-name {
    font-size: var(--text-xs); color: var(--slate); margin: var(--space-0) 0 0;
    /* Two lines then ellipsis; the full title is on the title attribute. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* Flagged Bills — the mockup's clean grid-aligned rows (Tier 2). The
     <table> element and its card reflow below 900px are kept as-is for
     their semantics and a11y; this restyles the desktop chrome toward the
     mockup: generous row padding, a quiet uppercase header over a hairline
     top rule, hairline row separators and no per-column dividers. Scoped
     to .flagged-table so the client record's own .bill-cards table (which
     wants its default table look) is untouched. The bill number is now an
     <a> — ink at rest via .bill-ident, ink on hover like every link — so the whole identifier links to the report. */
  a.bill-ident { text-decoration: none; }
  /* Flagged's number + title as one link (whole-app audit Y5): the title
     keeps its slate, the number its ink, and both warm on hover. */
  a.bill-link { display: block; color: inherit; text-decoration: none; }
  a.bill-link .bill-ident { display: block; }
  /* The "2 new" tag trails the number it belongs to (whole-app audit Y7). */
  a.bill-link .bill-ident .unread-dot { margin: 0 0 0 var(--space-2); }
  /* The full title on keyboard focus too, not only title= on hover (Y6). */
  a.bill-link:focus-visible .bill-name { display: block; }
  @media (hover: hover) { a.bill-link:hover .bill-ident, a.bill-link:hover .bill-name { color: var(--ink); } }
  @media (min-width: 901px) {
    .flagged-table th {
      padding: var(--space-2) var(--space-3); border-top: 1px solid var(--rule-strong);
      border-bottom: 1px solid var(--rule); font-size: var(--text-2xs); font-weight: 600;
      letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate);
    }
    .flagged-table td { padding: var(--space-4) var(--space-3); border-bottom: 1px solid var(--rule); }
    /* The outer cells inset to the panel-head's own gutter, so the bill
       number lines up under the panel title instead of sitting flush
       against the card border. Desktop only — the <900px card reflow
       sets its own td padding. */
    .flagged-table th:first-child, .flagged-table td:first-child { padding-left: var(--space-4); }
    .flagged-table th:last-child, .flagged-table td:last-child { padding-right: var(--space-4); }
    /* The kebab rides in its own trailing column at the far right edge —
       content-sized so it takes no width from the columns that carry the
       row's information. */
    .flagged-table th.col-rowmenu, .flagged-table td.col-rowmenu {
      width: 1%; white-space: nowrap; text-align: right;
    }
  }

  /* The Next action column: when the user has to do something about this
     bill, which Status alone never said — an Engrossed bill with a
     hearing Monday and an Engrossed bill with nothing scheduled used to
     be the same row. */
  td.next-action { white-space: normal; min-width: 9rem; }
  .next-when { font-weight: 600; font-size: var(--text-xs); }
  .next-when.none { font-weight: 400; color: var(--slate); }
  /* The mockup colours the next-action date itself, not only the chip
     under it. Same red-now / amber-soon split the .next-chip carries, so
     the two never disagree; set on the flagged list only, where an
     urgent hearing is the thing the row exists to surface. */
  .next-when.now, .next-when.soon { color: var(--ink); }   /* the chip under it carries the urgency, once (D1) */
  .next-where { font-size: var(--text-2xs); color: var(--slate); margin-top: var(--space-0); }
  .next-chip { margin-top: var(--space-1); border-color: var(--rule-strong); background: transparent; color: var(--ink-2); }
  /* Today and tomorrow read as error rather than warning — at that range
     the thing to notice is that preparation time is gone, not short. The
     border above carries the same distinction without relying on the
     hue, since red/amber is a pair some users can't separate. */
  .next-chip.now { background: var(--error-soft); color: var(--error); }

  /* A filing's deadline on the Disclosures list. Filing dates are the
     hardest deadline these users have and the one place being late has a
     statutory consequence rather than a client-relations one, so overdue
     is styled as an error rather than a warning, and carries its own
     wording ("3 days overdue") instead of leaning on colour to say it. */
  td.col-due { white-space: normal; min-width: 8rem; }
  .due-when { font-weight: 600; font-size: var(--text-xs); }
  .due-none { font-size: var(--text-xs); color: var(--slate); font-style: italic; }
  .due-chip { margin-top: var(--space-1); border-color: currentColor; }
  .due-chip.soon { background: transparent; color: var(--ink-2); border-color: var(--rule-strong); }
  .due-chip.over { background: var(--error-soft); color: var(--error); }

  /* The unread marker on a flagged row (see unreadDot() in
     FLAGGED_BODY). A count in a pill rather than a bare dot: the number
     is already known, and "3 changes you haven't seen" is a more useful
     thing to have said than "something happened here". Sized off the
     bill identifier it sits beside so it reads as a marker on that line
     rather than as a badge of its own. --info, the dashboard's "new"
     colour, not --error: news isn't a fault, and a list of red markers
     read as a list of problems. */
  .unread-dot {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.05rem; height: 1.05rem; padding: 0 var(--space-1); margin-right: var(--space-1);
    border-radius: var(--radius-pill); background: var(--info); color: var(--surface);
    font-size: var(--text-2xs); font-weight: 700; line-height: 1; vertical-align: middle;
  }

  /* Visually hidden, still read aloud. The clip-rect incantation was
     already inline on half a dozen labels in the templates; this is the
     same thing with a name, for the places (an unread count, a status
     marker) where the visible form is a shape or a colour and the
     sentence behind it has to exist somewhere. */
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }

  /* The first focusable thing in <body> on every app_shell() page (see
     page() in app.py). Without it, keyboard and switch users tab the
     whole fifteen-item sidebar, the account button and the hamburger
     again on every single navigation — and this is a plain multi-page
     app, so that's every click. WCAG 2.4.1, Level A.

     Not .sr-only + :focus: a clip-rect element is 1x1 even while
     focused, so the revealed link has to have its own box. Parked
     off-screen instead of display:none, because a display:none link
     isn't focusable at all and there'd be nothing to reveal. */
  .skip-link {
    position: absolute; top: 0; left: -9999px; z-index: 100;
    background: var(--accent-solid); color: var(--accent-solid-text);
    padding: var(--space-2) var(--space-4); border-bottom-right-radius: var(--radius-md);
    font-size: var(--text-sm); font-weight: 600;
  }
  .skip-link:focus { left: 0; color: var(--accent-solid-text); }

  /* ── Dashboard ──
     The signed-in landing page (2026 redesign, mockup parity). A row of
     tiles and the "Needs you" list sit over the worklist (workflow audit
     A2) — the top of Flagged bills' Next action order, each bill's
     unseen changes on its own row — then a two-column body: clients
     (name + bill count) and the next 14 days as an agenda list, the full
     calendar one click away. The row cells reuse the Flagged table's
     .next-* / .change-* styles, .position-badge and .status-badge
     unchanged. */

  /* The worklist: a card (the highlight card's surface and edge) with a
     header — title, the unseen count, Mark all seen — over the rows. */
  .worklist {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);  /* the shadow is the edge — no second line */
    border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4);
  }
  .worklist-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
  .worklist-title { display: flex; align-items: baseline; gap: var(--space-1) var(--space-3); flex-wrap: wrap; min-width: 0; }
  .worklist-title h2 { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.005em; margin: 0; }
  .worklist-title .dash-col-eyebrow { text-align: left; }
  /* Mark all seen and Open alerts sit side by side, so they're styled as
     one pair — it was underlined beside a plain link (dashboard audit Q5). */
  .worklist-head .linklike {
    display: inline-flex; align-items: center; min-height: 1.5rem;   /* 24px target, as .panel-head .linklike */
    color: var(--slate); text-decoration: none;
  }
  @media (hover: hover) { .worklist-head .linklike:hover { color: var(--ink); } }
  /* The display above beat [hidden], so "Mark all seen" showed with
     nothing new to mark (found checking whole-app audit Y1). */
  .worklist-head .linklike[hidden] { display: none; }
  .worklist-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
  .worklist-alerts-link { display: inline-flex; align-items: center; min-height: 1.5rem; color: var(--slate); }
  @media (hover: hover) { .worklist-alerts-link:hover { color: var(--ink); } }
  /* The unseen count and each row's New mark, in the info blue — not
     red: a bill moving is routine news, and red is the app's error
     colour (audit F20). Both are words, so the colour is emphasis, not
     the only carrier of the meaning. */
  .worklist-count { font-size: var(--text-xs); font-weight: 600; color: var(--ink); }
  .worklist-foot { margin: var(--space-1) 0 var(--space-3); font-size: var(--text-xs); color: var(--slate); }
  .worklist-list { border-top: 1px solid var(--rule); }
  .worklist-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-4); }

  /* One row per bill: bill + what's new | Next action | clients and
     positions | status. Fixed tracks, so the columns line up down the
     list the way the Flagged table's do. */
  .worklist-row {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 10rem) minmax(0, 15rem) minmax(0, 9.5rem);
    gap: var(--space-2) var(--space-4); align-items: start;
    padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); color: var(--ink);
  }
  .worklist-row:last-child { border-bottom: none; }
  @media (hover: hover) { a.worklist-row:hover .worklist-name { color: var(--ink); } }
  /* Two lines of title before the ellipsis, at every width: one line cut
     phone titles to about two words ("AB 1024 Housing…"). */
  .worklist-name {
    font-size: var(--text-sm); font-weight: 500; overflow: hidden;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  }
  a.worklist-row:focus-visible .worklist-name { display: block; }
  /* What's new: Alerts' own change rows (.digest-row.static), which wrap
     rather than cut off — they're what the row is read for, and should
     need no click. */
  .worklist-new { margin-top: var(--space-1); }
  .worklist-new-more { font-size: var(--text-2xs); color: var(--slate); }
  .worklist-clients { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); min-width: 0; }
  .worklist-clients .position-badge { max-width: 100%; white-space: normal; text-align: left; background: transparent; color: var(--ink-2); border-color: var(--rule-strong); }   /* a stance is a word here, not a colour (D1) */
  .worklist-none { font-size: var(--text-xs); color: var(--slate); }
  .worklist-status { justify-self: end; min-width: 0; }
  /* .status-badge carries a bottom margin for its stacked use on
     /report; in this row it sits on the line, so it's zeroed here. */
  .worklist-status .status-badge { margin-bottom: 0; }
  /* Narrower: the bill takes the whole first line and the other three
     share the second. */
  @media (max-width: 1200px) {
    .worklist-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
    .worklist-bill { grid-column: 1 / -1; }
  }
  /* Phone: bill; then Next action beside the status; then the clients
     across the full width. */
  @media (max-width: 640px) {
    .worklist { padding: var(--space-4); }
    .worklist-row { grid-template-columns: minmax(0, 1fr) auto; }
    .worklist-clients { grid-column: 1 / -1; grid-row: 3; }
  }

  /* The at-a-glance strip (dashboard audit R1; Oct 19 critique): one
     slim band of linked counts under Needs you, not a row of big cards
     above it, so the queue leads and a phone reaches the first bill
     sooner. One bordered band split by hairlines, each count its number
     and label over a slate foot. Free-floating pills wrapped raggedly
     (two on a line, one alone below); here a wrapped count grows to
     fill its line, and the dividers are each count's own top and left
     edge, which the band's overflow clips off the outer row and column
     — so no line ever doubles the border or hangs past an empty cell. */
  .dash-tiles {
    display: flex; flex-wrap: wrap; overflow: hidden;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  }
  .dash-tiles[hidden] { display: none; }
  .dash-tile {
    flex: 1 1 11rem; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); row-gap: 0;
    min-width: 0; min-height: 44px; border: none; box-shadow: -1px 0 0 var(--rule), 0 -1px 0 var(--rule);
    padding: var(--space-3) var(--space-4); color: inherit;
    font-size: var(--text-sm); transition: background-color var(--dur-fast) var(--ease);
  }
  .dash-tile[hidden] { display: none; }
  @media (hover: hover) { a.dash-tile:hover { background: var(--paper-50); color: inherit; } }
  /* The count is what a glance reads — the display face at heading size,
     its label sitting on the same baseline. */
  .dash-tile-value { font-size: var(--text-lg); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
  .dash-tile-label { font-weight: 500; }
  .dash-tile-foot { flex-basis: 100%; font-size: var(--text-xs); color: var(--slate); }
  .dash-tile-foot:empty { display: none; }

  /* Finish setting up (Oct 7 audit T4): the Needs you card's surface,
     rows of number-or-tick | step and its one line | Done / To do. The
     badge is the client setup strip's .setup-num; the state is a word. */
  .finish-setup {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);  /* the shadow is the edge — no second line */
    border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4);
  }
  .finish-setup[hidden] { display: none; }
  .finish-setup-sub { margin: 0 0 var(--space-3); }
  .finish-setup-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
  .finish-step {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3);
    align-items: baseline; padding: var(--space-3) 0; border-bottom: 1px solid var(--rule);
  }
  .finish-step:last-child { border-bottom: none; }
  .finish-step.done .setup-num { color: var(--accent-solid-text); background: var(--accent-solid); }
  .finish-step-text { min-width: 0; display: flex; flex-direction: column; gap: var(--space-0); }
  .finish-step-title { font-size: var(--text-sm); font-weight: 600; }
  .finish-step.done .finish-step-title { font-weight: 400; color: var(--slate); }
  .finish-step-detail { font-size: var(--text-xs); color: var(--slate); }
  .finish-step-state { font-size: var(--text-xs); font-weight: 600; color: var(--slate); white-space: nowrap; }
  /* At least 24px tall to click or tap (WCAG 2.5.8) — they were ~20px
     (Oct 19 audit quick win 7). Same recipe as .needs-none .linklike. */
  .finish-step-title, #finish-setup-hide { display: inline-flex; align-items: center; min-height: 1.5rem; }

  /* Needs you (dashboard audit R2): the worklist's card surface, rows of
     kind word | what and where | how soon. The kind is a word in its
     colour, so the colour is emphasis, never the only carrier. */
  .needs {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);  /* the shadow is the edge — no second line */
    border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4);
  }
  .needs[hidden] { display: none; }
  .needs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
  .needs-list > li { border-bottom: 1px solid var(--rule); }
  .needs-list > li:last-child { border-bottom: none; }
  .needs-row {
    display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4);
    align-items: baseline; padding: var(--space-3) 0; color: var(--ink);
  }
  @media (hover: hover) { a.needs-row:hover .needs-title { color: var(--ink); } }
  .needs-kind { font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--slate); }
  .needs-row.kind-conflict .needs-kind, .needs-row.kind-deadline .needs-kind { color: var(--error); }
  /* The kind of thing (Hearing, Filing, Letter owed...) is muted text, never a colour (D1). */
  .needs-text { min-width: 0; display: flex; flex-direction: column; gap: var(--space-0); }
  .needs-title { font-size: var(--text-sm); font-weight: 600; }
  .needs-detail { font-size: var(--text-xs); color: var(--slate); }
  /* Whose bill, and where the firm stands (Oct 7 audit A4). */
  .needs-stake { font-size: var(--text-xs); color: var(--ink); }
  .needs-stake.conflict { color: var(--error); font-weight: 600; }
  .needs-when { font-size: var(--text-xs); font-weight: 600; color: var(--slate); white-space: nowrap; }
  .needs-when.soon { color: var(--error); }
  .needs-none { padding: var(--space-3) 0; font-size: var(--text-xs); color: var(--slate); }
  /* Nothing pending (audit Y6): one quiet line, no card. The heading and
     count are dropped from view; the line itself still announces the state. */
  .needs.needs-empty { background: none; border: none; box-shadow: none; padding: 0; }
  .needs-empty .dash-col-head { display: none; }
  .needs-empty .needs-list { border-top: none; }
  .needs-empty .needs-none { padding: var(--space-1) 0; }
  /* "Show 4 more" is a line of its own, so a standalone 24px target
     (WCAG 2.5.8), as .panel-head .linklike. */
  .needs-none .linklike { display: inline-flex; align-items: center; min-height: 1.5rem; }
  /* Phone: the kind word over the text, the countdown under it. */
  @media (max-width: 640px) {
    .needs { padding: var(--space-4); }
    .needs-row { grid-template-columns: minmax(0, 1fr); }
  }

  /* The two-column body — clients, calendar; the calendar a touch wider
     to hold its grid. Columns are borderless (a header, a top rule,
     hairline-divided rows), matching the mockup, rather than the boxed
     .panel the old dashboard used. */
  .dash-cols {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: var(--space-6); align-items: start;
  }
  .dash-col-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
  .dash-col-head h2 { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.005em; margin: 0; flex: none; }
  /* Shrinks and wraps rather than the heading: flex:none here ran a long
     eyebrow off a phone's right edge. */
  .dash-col-eyebrow { font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); min-width: 0; text-align: right; }
  .dash-col-list { border-top: 1px solid var(--rule); }
  .dash-col-more { display: inline-flex; align-items: center; min-height: 1.5rem; margin-top: var(--space-4); font-size: var(--text-xs); color: var(--slate); }
  .dash-col-more[hidden] { display: none; }
  @media (hover: hover) { .dash-col-more:hover { color: var(--ink); } }

  /* A client row: the name on the left, its bill count on the right.
     Most rows are links; hence the a.dash-row hover rule. */
  .dash-row {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); color: var(--ink);
  }
  .dash-row:last-child { border-bottom: none; }
  @media (hover: hover) { a.dash-row:hover { color: var(--ink); } }
  .dash-row-title {
    min-width: 0; font-size: var(--text-sm); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .dash-row-number { font-weight: 600; white-space: nowrap; }   /* "SB 902" never breaks in half */
  .dash-count { min-width: 1.6rem; flex: none; background: var(--accent-soft); color: var(--ink); }
  /* The front door's rows (dashboard): what happened, with its quiet
     note right under it, and a chevron saying the row opens. Rows are
     inset to line up with the card's title. */
  .front-door .dash-col-list { padding: 0 var(--space-1) var(--space-1); }
  .front-door .dash-row {
    display: grid; grid-template-columns: 1fr auto; column-gap: var(--space-3); row-gap: 0;
    padding: var(--space-2); border-bottom: none; border-radius: var(--radius-md);
  }
  .front-door .dash-row::after {
    content: ""; grid-column: 2; grid-row: 1 / span 2; align-self: center;
    width: 1rem; height: 1rem; background: var(--muted);
    -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat;
  }
  @media (hover: hover) { .front-door a.dash-row:hover { background: var(--paper-50); } }
  .front-door .dash-row-title { grid-column: 1; white-space: normal; }
  .front-door .front-door-sub { grid-column: 1; margin: 0; min-width: 0; font-size: var(--text-xs); }

  /* ── Dashboard v5 (docs/design-system, "Rotunda Dashboard v5") ──
     Laid over the rules above: the greeting header, white 18px cards
     with a serif title and inset rows, the three triage groups, the
     change feed, date and letter tiles, a 3:1 two-column body that
     wraps. Rules above still carry what v5 doesn't restyle. */
  .dash-head { align-items: flex-start; margin-bottom: var(--space-5); }
  .dash-head-text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
  /* The greeting is the page's title, so it is the size and place of
     every other page's (.page-head h1) — one title across the product. */
  .dash-greeting {
    font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg);
    line-height: 1.05; letter-spacing: -0.015em; margin: 0;
  }
  .dash-meta { margin: 0; font-size: var(--text-sm); color: var(--ink-2); text-wrap: pretty; }
  /* The topbar already shows today's date on wider screens, so the
     greeting's copy shows only on a phone, where the topbar names the
     page instead (Oct 19 audit quick win 3). */
  @media (min-width: 641px) { #dash-date { display: none; } }
  @media (max-width: 640px) { #dash-date:not(:empty) + #freshness:not(:empty)::before { content: " · "; } }
  .dash-head .page-head-actions a { min-height: 2.25rem; }
  /* Phone: the two header buttons can't share a line, so each takes the
     full width, the primary on top — not two ragged widths stacked. */
  @media (max-width: 640px) {
    .dash-head .page-head-actions { flex-direction: column; width: 100%; }
    .dash-head .page-head-actions a { justify-content: center; }
    .dash-head .page-head-actions a.primary { order: -1; }
  }
  .dash-head .page-head-actions a.primary { display: inline-flex; align-items: center; gap: var(--space-1); }

  .dash-cols { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start; }
  .dash-main { flex: 3 1 38rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
  .dash-side { flex: 1 1 18rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }

  /* Card: white, 18px, a 6px inset (space-1 + hairline) so rows sit in
     with their own 12px radius. No header rule. */
  .dash-card, .finish-setup, .needs, .worklist {
    background: var(--surface); border: 0; box-shadow: var(--shadow-rest);
    border-radius: var(--radius-lg); padding: var(--space-1); margin-bottom: 0;
  }
  #grid > .finish-setup { margin-bottom: var(--space-4); }
  .dash-card .dash-col-head, .worklist-head, .changes-head {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-3) var(--space-1); margin: 0; justify-content: flex-start;
  }
  /* Card titles are plain sans: the serif is the page title's alone
     (Oct 22 critique), so none is set here. */
  .dash-card h2, .worklist-title h2 {
    font-size: var(--text-md); font-weight: 500;
    letter-spacing: -0.01em; margin: 0; white-space: nowrap;
  }
  /* A rule below sets display on some of these cards; hidden must still win. */
  .changes[hidden], .worklist[hidden], .needs[hidden] { display: none; }
  /* The AI drawer (Nov 3 critique): briefing, overnight and radar folded
     into one card under Today. Inside it the three cards lose their own
     chrome so it reads as one card, not cards in a card. */
  .dash-ai[hidden] { display: none; }
  .dash-ai-summary {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-3);
    min-height: 44px; padding: var(--space-2) var(--space-3); cursor: pointer;
    border-radius: var(--radius-md); list-style: none;
  }
  .dash-ai-summary::-webkit-details-marker { display: none; }
  .dash-ai-summary::before {
    content: "›"; display: inline-block; flex: none; width: 0.6em; text-align: center;
    color: var(--muted); transition: transform 0.15s ease;
  }
  .dash-ai[open] > .dash-ai-summary::before { transform: rotate(90deg); }
  .dash-ai-title { font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em; }
  .dash-ai-summary .changes-sub { white-space: normal; min-width: 0; }
  .app-shell .app-main .dash-ai .dash-card,
  .dash-ai .dash-card { box-shadow: none; padding: 0; background: transparent; border: 0; border-radius: 0; }
  @media (prefers-reduced-motion: reduce) { .dash-ai-summary::before { transition: none; } }
  /* The AI morning briefing (briefing.py): client by client, why each
     change matters and one next step. */
  .briefing[hidden] { display: none; }
  .briefing-note { font-size: var(--text-xs); color: var(--ink-2); }
  .briefing-body { padding: var(--space-1) var(--space-3) var(--space-3); font-size: var(--text-sm); }
  .briefing-summary { margin: 0 0 var(--space-3); font-size: var(--text-base); }
  .briefing-client + .briefing-client { margin-top: var(--space-3); }
  .briefing-client h3 { font-size: var(--text-sm); font-weight: 600; margin: 0 0 var(--space-1); }
  .briefing-client ul { margin: 0; padding-left: var(--space-4); }
  .briefing-client li + li { margin-top: var(--space-2); }
  .briefing-next { display: block; color: var(--ink-2); margin-top: var(--space-0); }
  a.secondary.briefing-action { display: inline-block; margin-top: var(--space-1); border-color: var(--rule-card);
                                font-size: var(--text-sm); white-space: normal; }
  /* Bills you may be missing (radar.py): a bill, the client it may
     concern and why, then Flag / Not relevant. */
  .radar[hidden] { display: none; }
  .radar-list { list-style: none; margin: 0; padding: var(--space-1) var(--space-3) var(--space-3); font-size: var(--text-sm); }
  .radar-item + .radar-item { border-top: 1px solid var(--rule); margin-top: var(--space-3); padding-top: var(--space-3); }
  .radar-bill { font-weight: 600; }
  .radar-number { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink-2); margin-right: var(--space-1); }
  .radar-why { margin: var(--space-1) 0 var(--space-2); }
  .radar-gut { margin: var(--space-1) 0 0; font-size: var(--text-xs); }
  .radar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
  .radar-actions a.secondary { border-color: var(--rule-card); }
  .dash-head-link { margin-left: auto; font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; min-height: 1.5rem; }
  .dash-head-link[hidden] { display: none; }
  @media (hover: hover) { .dash-head-link:hover { color: var(--ink); } }
  .dash-count-pill {
    font-size: var(--text-2xs); font-weight: 500; color: var(--ink-2);
    background: var(--paper-250); border-radius: var(--radius-pill); padding: var(--space-0) var(--space-2);
  }
  .dash-count-pill:empty { display: none; }
  .dash-card-sub { margin: 0; padding: 0 var(--space-3) var(--space-1); }
  .dash-card-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-4);
    margin-top: var(--space-1); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--rule); font-size: var(--text-xs);
  }
  .dash-card-foot .dash-col-more { margin-top: 0; }
  .dash-card-foot #flagged-more { margin-left: auto; color: var(--ink); font-weight: 500; }
  .finish-setup-sub { padding: 0 var(--space-3); }
  .finish-setup-list, .needs-list, .worklist-list, .dash-col-list, .dash-agenda { border-top: none; }
  .finish-step { padding: var(--space-2) var(--space-3); border-bottom: none; border-radius: var(--radius-md); }

  /* Needs you: triage groups (TriageGroup) of ActionRows. */
  .needs-list > li, .needs-list > li:last-child { border-bottom: none; }
  .triage-label { padding: var(--space-3) var(--space-3) var(--space-1); font-size: var(--text-2xs); font-weight: 500; color: var(--ink-2); }
  .triage-label span { color: var(--muted); font-weight: 400; margin-left: var(--space-1); }
  .triage-group.urgent .triage-label { color: var(--ink); font-weight: 600; }
  .triage-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-0); }
  .needs-item { display: flex; align-items: center; gap: var(--space-1); padding-right: var(--space-2); border-radius: 0; }
  /* Rows share the card: a hairline between them, no box of their own (D2). */
  .triage-rows > .needs-item + .needs-item { border-top: 1px solid var(--rule); }
  .needs-item .icon-tile { background: none; color: var(--ink-2); }
  @media (hover: hover) { .needs-item:hover { background: var(--paper-50); } }
  .needs-list .needs-row {
    flex: 1; min-width: 0; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-1) var(--space-2) var(--space-3); color: var(--ink);
  }
  @media (hover: hover) { a.needs-row:hover .needs-title { color: var(--ink); } }
  /* D6: a client's name and what's owed matter — wrap to two lines before
     any "…" rather than cutting at one. */
  .needs-title, .needs-detail {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere;
  }
  .needs-title { font-size: var(--text-sm); font-weight: 500; }
  .needs-list .needs-kind { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
  .needs-item.urgent .kind-conflict .needs-kind { color: var(--error); }
  .needs-when { color: var(--ink-2); font-weight: 500; }
  .needs-action { flex: none; min-width: 4.75rem; justify-content: center; }
  .needs-list .needs-none { padding: var(--space-4) var(--space-3); text-align: center; }
  /* The calm state (isCalm): one line and a small mark, no card, said once.
     The mark is decorative. */
  .dash-calm {
    display: flex; align-items: center; gap: var(--space-3); margin: 0;
    padding: var(--space-3) var(--space-3) var(--space-1);
    font-size: var(--text-base); color: var(--ink);
  }
  .dash-calm[hidden] { display: none; }
  @media (max-width: 640px) { .dash-calm { font-size: var(--text-sm); padding-left: var(--space-1); } }
  .dash-calm svg { flex: none; width: 1.375rem; height: 1.375rem; color: var(--good); }
  /* A filing's "about this date": a small info button after the row's
     actions; its sentence opens under the row, in line with the text. */
  .needs-item.has-note { flex-wrap: wrap; }
  .needs-note-btn { color: var(--ink-2); }
  .needs-note-btn[hidden] { display: none; }
  .dash-col-head .needs-note-btn { margin-left: auto; }
  .needs-note-btn[aria-expanded="true"] { color: var(--ink); background: var(--paper-350); }
  .needs-note {
    flex-basis: 100%; margin: 0; padding: 0 var(--space-3) var(--space-2) var(--space-8);
    font-size: var(--text-xs); color: var(--ink-2); text-wrap: pretty;
  }
  /* Finished bills: one quiet line under the worklist, or alone when the
     worklist has collapsed. */
  .dash-closed { margin: 0; padding: 0 var(--space-3); font-size: var(--text-xs); }
  .dash-closed:not(:has(> :not([hidden]))) { display: none; }
  .dash-just-followed { margin: var(--space-2) 0 0; padding: 0 var(--space-3); font-size: var(--text-sm); color: var(--ink); }
  /* Phone: the action goes under its row's text, lined up with it, so
     the text keeps the card's width — beside it, it squeezed a two-line
     item into six lines. */
  @media (max-width: 640px) {
    .needs-item { flex-wrap: wrap; padding-bottom: var(--space-2); }
    .needs-list .needs-row { flex-basis: 100%; column-gap: var(--space-4); }
    /* 12px inset + the 36px tile + the 16px gap: the text's left edge. */
    .needs-item > .needs-action { margin-top: calc(-1 * var(--space-1)); margin-left: var(--space-8); }
  }

  /* The small buttons in rows and card headers (design system Button
     sm: 28px, 6px corners); 44px on a touch screen (the coarse-pointer
     block by .row-menu-btn). */
  a.small, button.small { min-height: 1.75rem; padding: 0 var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-button); display: inline-flex; align-items: center; }
  button.small[hidden] { display: none; }
  .icon-btn {
    flex: none; width: 1.875rem; height: 1.875rem; padding: 0; border: none; background: none;
    border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }
  .icon-btn svg { width: 0.9rem; height: 0.9rem; }
  @media (hover: hover) { .icon-btn:hover { background: var(--paper-350); color: var(--ink); } }

  /* IconTile / LetterTile / DateTile — decorative; a word always says it. */
  .icon-tile, .letter-tile {
    flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm);
    background: var(--paper-250); color: var(--ink-2);
  }
  .icon-tile { width: 2.25rem; height: 2.25rem; }
  .icon-tile svg { width: 1.1rem; height: 1.1rem; }
  .letter-tile { width: 1.75rem; height: 1.75rem; font-size: var(--text-2xs); font-weight: 600; }
  .tone-oppose { background: var(--error-soft); color: var(--error); }
  .tone-support { background: var(--good-soft); color: var(--good); }
  .tone-watch { background: var(--warn-soft); color: var(--warn); }
  .tone-navy { background: var(--info-soft); color: var(--link); }
  .date-tile {
    flex: none; width: 2.75rem; height: 2.875rem; border-radius: var(--radius-sm); background: var(--paper-250);
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
  }
  .date-tile span { font-size: var(--text-2xs); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
  .date-tile b { font-size: var(--text-base); font-weight: 600; }

  /* Recent changes: header with SegmentedControl, then ChangeRows. */
  .changes-sub { font-size: var(--text-xs); color: var(--ink-2); white-space: nowrap; }
  .changes-sub:empty { display: none; }
  .changes-spacer { flex: 1; }
  .segmented { display: flex; gap: var(--space-0); padding: var(--space-0); background: var(--paper-350); border-radius: var(--radius-md); }
  .segmented button {
    border: none; background: transparent; border-radius: var(--radius-sm); padding: 0 var(--space-3);
    min-height: 1.75rem; font: inherit; font-size: var(--text-xs); color: var(--ink-2); cursor: pointer;
    display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap;
  }
  .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-rest); }
  .segmented-count { color: var(--muted); font-weight: 400; }
  @media (hover: hover) { .segmented button:hover { color: var(--ink); } }
  .change-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .change-item {
    display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: start; gap: var(--space-1);
    padding: 0 var(--space-1); border-radius: var(--radius-md);
  }
  /* The triage ⋮ (alert_triage.js, Oct 7 audit A6) sits in the third column. */
  .change-item .triage-menu { margin-top: var(--space-2); }
  @media (hover: hover) { .change-item:hover { background: var(--paper-50); } }
  .seen-dot {
    width: 1.5rem; height: 1.5rem; margin-top: var(--space-3); padding: 0; border: none; background: none;
    border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .seen-dot span { width: 8px; height: 8px; border-radius: 50%; background: var(--link); box-shadow: inset 0 0 0 1.5px var(--link); }
  .seen-dot[disabled] { cursor: default; }
  .change-item.seen .seen-dot span { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
  @media (hover: hover) { .seen-dot:not([disabled]):hover { background: var(--paper-350); } }
  .change-link {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--space-3);
    padding: var(--space-3) var(--space-1); color: var(--ink);
  }
  @media (hover: hover) { a.change-link:hover { color: var(--ink); } }
  .change-text .digest-row.static { padding: 0; }
  .change-bill { margin-left: var(--space-1); }
  .change-text { display: flex; flex-direction: column; gap: var(--space-0); min-width: 0; }
  .change-bill { font-size: var(--text-xs); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .change-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); max-width: 14rem; min-width: 0; }
  /* A long position + client name stays inside its column (ellipsis, the
     full words in the title) instead of spilling over the change text. */
  .change-chips .position-badge { max-width: 100%; min-width: 0; overflow: hidden; background: transparent; color: var(--ink-2); border-color: var(--rule-strong); }   /* a stance is a word in the feed, not a colour (D1) */
  .change-chips .chip-words { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-row-number { font-variant-numeric: tabular-nums; font-weight: 500; font-size: var(--text-xs); color: var(--ink); margin-right: var(--space-1); }

  /* The worklist's rows sit inset like every other card's. */
  .worklist-row { padding: var(--space-3); border-bottom: none; border-radius: var(--radius-md); }
  @media (hover: hover) { a.worklist-row:hover { background: var(--paper-50); } a.worklist-row:hover .worklist-name { color: var(--ink); } }
  .worklist-new { font-size: var(--text-xs); color: var(--ink-2); font-weight: 600; }
  /* Flow-style rows (founder, Oct 29 2026): a document tile, the bill
     over a quiet line of what's next, then the clients' pills and the
     status at the right; a soft fill on hover rather than rules between. */
  .worklist .worklist-row {
    grid-template-columns: 2rem minmax(0, 1fr) auto auto;
    grid-template-areas: "icon bill clients status" "icon next clients status";
    gap: 0 var(--space-3); align-items: center;
    padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm);
    transition: background var(--dur-fast) var(--ease);
  }
  .worklist .worklist-row::before {
    content: ""; grid-area: icon; align-self: start; width: 2rem; height: 2rem; border-radius: var(--radius-sm);
    background: var(--flow-chip);
  }
  .worklist .worklist-row::after {
    content: ""; grid-area: icon; align-self: start; justify-self: center; margin-top: var(--space-2);
    width: 1rem; height: 1rem; background: var(--muted);
    -webkit-mask: var(--bill-row-icon) center / contain no-repeat; mask: var(--bill-row-icon) center / contain no-repeat;
  }
  .worklist .worklist-bill { grid-area: bill; }
  .worklist .worklist-next { grid-area: next; font-size: var(--text-xs); color: var(--muted); }
  .worklist .worklist-clients { grid-area: clients; justify-content: flex-end; }
  .worklist .worklist-status { grid-area: status; }
  .worklist .worklist-list { border-top: 0; }
  @media (hover: hover) { .worklist a.worklist-row:hover { background: var(--nav-hover); } }
  @media (max-width: 640px) {
    .worklist .worklist-row {
      grid-template-columns: 2rem minmax(0, 1fr) auto;
      grid-template-areas: "icon bill status" "icon next next" "icon clients clients";
    }
    .worklist .worklist-clients { justify-content: flex-start; }
  }
  /* The loading skeleton's bars: a title bar over each card, rows of
     varied widths so they read as rows of text. */
  .dash-skel .dash-skel-head { width: 55%; height: 1rem; margin: 0 0 var(--space-4); }
  .dash-skel .dash-side .dash-skel-head { width: 45%; }
  .dash-skel .worklist-head .skeleton-bar { width: 8rem; height: 1rem; margin: 0; }
  .dash-skel .skeleton-row .skeleton-bar:nth-child(1) { width: 33%; }
  .dash-skel .skeleton-row .skeleton-bar:nth-child(2) { width: 13%; }
  .dash-skel .skeleton-row .skeleton-bar:nth-child(3) { width: 18%; }
  .dash-skel .dash-side .skeleton-row .skeleton-bar:nth-child(1) { width: 20%; }
  .dash-skel .dash-side .skeleton-row .skeleton-bar:nth-child(2) { width: 48%; }

  /* Right column: agenda rows lead with a DateTile (the written date
     stays for a screen reader), client rows with a LetterTile. */
  .dash-agenda > li, .dash-agenda > li:last-child { border-bottom: none; }
  .dash-agenda .agenda-item { align-items: center; padding: var(--space-2); border-radius: var(--radius-md); }
  .dash-agenda .agenda-date { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  @media (hover: hover) { .dash-agenda a.agenda-item:hover { background: var(--paper-50); color: var(--ink); } }
  .dash-agenda .agenda-none, .dash-agenda .agenda-more { padding: var(--space-2) var(--space-3); }
  .dash-side .dash-row { justify-content: flex-start; padding: var(--space-2); border-bottom: none; border-radius: var(--radius-md); }
  .dash-side .dash-row-title {
    flex: 1; font-weight: 400; white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;   /* D6: two lines, not one cut name */
  }
  @media (hover: hover) { .dash-side a.dash-row:hover { background: var(--paper-50); color: var(--ink); } }
  .dash-side .dash-count { background: none; color: var(--ink-2); min-width: 0; }

  .changes-head .worklist-alerts-link { font-size: var(--text-xs); }
  .dash-card-foot:not(:has(> :not([hidden]))) { display: none; }
  /* Below 900px the two columns stack (flex-wrap would too, a little later). */
  @media (max-width: 900px) {
    .dash-cols > * { flex-basis: 100%; }
  }

  @media (max-width: 640px) {
    .needs-list .needs-row { grid-template-columns: 2.25rem minmax(0, 1fr); }
    .needs-list .needs-when { grid-column: 2; }
    .change-link { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
    .change-chips { justify-content: flex-start; max-width: none; }
    .changes-spacer { display: none; }
  }

  /* The dashboard's agenda: the next two weeks, one line per dated item
     (hearing, filing due, legislative deadline), date first. Each kind
     is said in a word beside its own glyph — the colour is a third cue,
     never the only one (Sep 29 audit Y2; WCAG 1.4.1). */
  .agenda { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
  .agenda > li { border-bottom: 1px solid var(--rule); }
  .agenda > li:last-child { border-bottom: none; }
  .agenda-item { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-2) 0; color: var(--ink); }
  @media (hover: hover) { a.agenda-item:hover { color: var(--ink); } }
  /* Wide enough for "Wed, Sep 30, 2026" on one line — a date carries
     its year, since a two-year session makes "Sep 30" ambiguous. */
  .agenda-date { flex: none; width: 7.5rem; font-size: var(--text-2xs); font-weight: 600; color: var(--slate); white-space: nowrap; }
  .agenda-text { min-width: 0; display: flex; flex-direction: column; gap: var(--space-0); }
  .agenda-kind {
    display: inline-flex; align-items: center; gap: var(--space-1);
    font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  }
  .agenda-kind { color: var(--ink-2); }   /* kinds are muted words (D1) */
  .agenda-kind.kind-hearing .agenda-icon::before { content: ""; --ic: var(--icon-scale); }   /* scales */
  .agenda-kind.kind-committee .agenda-icon::before { content: ""; --ic: var(--icon-list); } /* a list of bills */
  .agenda-kind.kind-firm_hearing .agenda-icon::before { content: ""; --ic: var(--icon-scale); } /* scales, like a hearing */
  .agenda-kind.kind-filing .agenda-icon::before { content: ""; --ic: var(--icon-pencil); }
  .agenda-kind.kind-compliance .agenda-icon::before { content: ""; --ic: var(--icon-pencil); }          /* pencil */
  .agenda-kind.kind-letter .agenda-icon::before { content: ""; --ic: var(--icon-mail); }   /* envelope */
  .agenda-kind.kind-deadline .agenda-icon::before { content: ""; --ic: var(--icon-clock); }        /* clock face */
  .agenda-label { font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agenda-sub { font-size: var(--text-2xs); color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agenda-none { padding: var(--space-3) 0; font-size: var(--text-xs); color: var(--slate); }
  /* On a phone, or any screen without hover, the label's title tooltip
     can't be reached and the sub line has none, so "SB318 · Assembly
     Water, Parks and …" would be all there is. There the dashboard's
     rows wrap too, like the Calendar's below; a desktop with a mouse
     keeps one tidy line each. */
  @media (max-width: 640px), (hover: none) {
    .agenda-label, .agenda-sub { white-space: normal; overflow-wrap: anywhere; }
  }
  /* The same rows on the Calendar's day panels and a client's Calendar
     tab (agenda.js, whole-app audit S3): inset to the panel's edge, and
     a deadline's long sentence wraps rather than cutting off — there is
     room here that the dashboard's column doesn't have. */
  .cal-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-4); }
  .cal-toolbar .cal-tabs { margin-bottom: 0; flex: 1 1 auto; }
  .cal-day { margin-bottom: var(--space-4); }
  .cal-agenda, .client-agenda { border-top: 0; }
  .cal-agenda > li, .client-agenda > li { padding: 0 var(--space-4); }
  .cal-agenda .agenda-label, .cal-agenda .agenda-sub,
  .client-agenda .agenda-label, .client-agenda .agenda-sub { white-space: normal; }
  .agenda-more { padding: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--slate); }
  /* Hearing-room cards (Oct 7 audit L6): one card per committee, time and
     room, a line per bill and client — letter and analysis status at a glance. */
  .room-card { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule); }
  .room-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
  .room-head .agenda-label { font-weight: 600; white-space: normal; }
  .room-bills { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
  .room-bills > li { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) 0;
    border-top: 1px solid var(--rule); font-size: var(--text-sm); }
  .room-bill { color: var(--ink); text-decoration: none; }
  .room-bill-row { display: flex; align-items: baseline; gap: var(--space-2); }
  .room-prep { font-size: var(--text-xs); color: var(--slate); }
  @media (hover: hover) { .room-prep:hover { color: var(--ink); } }
  .room-client { font-size: var(--text-xs); color: var(--slate); overflow-wrap: anywhere; }
  .room-letter.is-done { color: var(--good); }
  .room-letter.is-open { color: var(--warn); }
  .cal-week { font-size: var(--text-base); margin: var(--space-4) 0 var(--space-2); }
  .cal-week-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
  .cal-week-chips .chip { padding: var(--space-1) var(--space-3); border: 1px solid var(--rule-strong);
    border-radius: var(--radius-pill); font-size: var(--text-xs); color: var(--ink); text-decoration: none; }
  /* A hearing the firm added by hand (Oct 7 audit N6): its "Added by your
     firm" tag, and the Calendar's Edit / Delete under the row. */
  .agenda-added { margin-left: var(--space-1); white-space: nowrap; }
  .agenda-actions { display: flex; gap: var(--space-3); padding: 0 0 var(--space-2); font-size: var(--text-2xs); }
  .hearing-form { display: flex; flex-direction: column; gap: var(--space-3); max-width: 36rem; }
  .hearing-form input, .hearing-form select { display: block; width: 100%; margin-top: var(--space-1); font-weight: 400; }
  .hearing-form-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
  .hearing-form-row > label { flex: 1 1 10rem; }
  .field-optional { font-weight: 400; color: var(--slate); }
  /* A followed committee's agenda (committee_hearings.py): the count is
     the disclosure's summary, the bills a wrapping list under it, the
     firm's own marked with a Flagged tag — a word, not only a colour. */
  .agenda-bills summary { cursor: pointer; font-size: var(--text-2xs); color: var(--slate); min-height: 1.5rem; }
  .agenda-bills ul { list-style: none; margin: var(--space-1) 0 0; padding: 0;
                     display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: var(--text-xs); }
  .agenda-bills li { white-space: nowrap; }
  .agenda-bills li.is-mine { white-space: normal; flex-basis: 100%; font-weight: 600; }
  .agenda-bill-clients { font-weight: 400; color: var(--slate); font-size: var(--text-2xs); }
  /* The Calendar's "Committees you follow" picker. */
  .committee-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
  .committee-chip { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs);
                    border: 1px solid var(--rule); border-radius: var(--radius-pill); padding: var(--space-0) var(--space-1) var(--space-0) var(--space-3); }
  .committee-chip button, .committee-picker button {
    background: none; border: 0; padding: var(--space-0) var(--space-2); min-height: 1.5rem;
    font: inherit; font-size: var(--text-xs); font-weight: 600; color: var(--accent); cursor: pointer;
  }
  .committee-chip button[data-follow="0"] { color: var(--error); }
  .committee-note { color: var(--slate); }
  .committee-picker li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: var(--text-xs); }
  .committee-picker ul { list-style: none; margin: 0; padding: 0; }
  .committee-picker { max-height: 18rem; overflow-y: auto; border: 1px solid var(--rule); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
  .committee-picker h3 { font-size: var(--text-xs); margin: var(--space-2) 0 var(--space-1); color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; }

  /* ── Calendar v5 (docs/design-system) ──
     Laid over the rules above, scoped to .calendar-page since the agenda
     rows, room cards, filters and committee chips are shared with the
     dashboard, Alerts and a client's Calendar tab. Serif page and card
     titles; white 18px cards on a hairline with no shadow and no header
     rule; each day's card led by a DateTile, its rows inset with their
     own 12px corners; labels in sentence case; bill numbers mono navy;
     Upcoming / Past and the calendar-app choice as SegmentedControls;
     10px-cornered fields. Buttons keep the app's own shape. */
  .calendar-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }

  /* The four panels that open from the header (work calendar, deadlines,
     add a hearing, committees): plain cards, sans titles. */
  .calendar-page .card { padding: var(--space-5); }
  .calendar-page .card > h2.section {
    font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--space-2);
  }
  .calendar-page .card .sub { color: var(--ink-2); margin: 0 0 var(--space-3); max-width: 46rem; text-wrap: pretty; }
  .calendar-page .field-label:has(+ #deadline-paste) { margin-top: var(--space-2); }
  .calendar-page #deadline-paste { width: 100%; }
  .calendar-page #committees-followed .empty { margin: 0; }
  /* nowrap: the global form's wrap made Chrome stretch the Date / Time
     row to twice its height; the card's own padding ends the form. */
  .calendar-page .hearing-form { flex-wrap: nowrap; margin-bottom: 0; }
  .calendar-page .card .sub:empty { margin: 0; }
  .calendar-page .field-optional, .calendar-page .field-hint { color: var(--muted); }
  /* Fields: TextInput / Select / TextArea — 10px corners, 36px tall. */
  .calendar-page :is(.card, .cal-toolbar) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { border-radius: var(--radius-sm); }
  /* :where() keeps these light enough for the touch floor below to win. */
  .calendar-page .card :where(input:not([type="checkbox"]):not([type="radio"]), select) { min-height: 2.25rem; padding-top: 0; padding-bottom: 0; }
  .calendar-page .card :where(td select) { min-height: 1.875rem; font-size: var(--text-xs); }
  .calendar-page #feed-btn[hidden] { display: none; }   /* a.primary's display would otherwise beat [hidden] */
  .profile-page #feed-platforms { width: fit-content; max-width: 100%; flex-wrap: wrap; margin-top: var(--space-1); }
  /* The pasted calendar's check table: tinted sentence-case head, inset. */
  .calendar-page #deadline-preview .table-scroll { max-height: 20rem; border: 1px solid var(--rule); border-radius: var(--radius-md); }
  .calendar-page #deadline-preview td:first-child { white-space: nowrap; }
  .calendar-page #deadline-preview th {
    background: var(--paper-50); font-size: var(--text-2xs); font-weight: 500;
    letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .calendar-page #deadline-preview tbody tr:last-child td { border-bottom: 0; }

  /* This week / Next week / Later: a group label, and the jump links
     above them borderless tinted chips. */
  .calendar-page .cal-week { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); margin: var(--space-5) var(--space-1) var(--space-2); }
  .calendar-page .cal-week-chips { margin-bottom: 0; }
  .calendar-page .cal-week-chips .chip {
    display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-3);
    border: 0; background: var(--paper-250); color: var(--ink-2); font-weight: 500;
  }
  @media (hover: hover) { .calendar-page .cal-week-chips .chip:hover { background: var(--paper-350); color: var(--ink); } }

  /* A day: a card with a 4px inset, its head the DateTile, the date in
     the sans and Today / In N days; its rows inset, tinting on hover. */
  .calendar-page .cal-day { padding: var(--space-1); }
  .calendar-page .cal-day .panel-head {
    flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
    gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-1); border-bottom: 0;
  }
  .calendar-page .cal-day .panel-head .title {
    flex: 0 1 auto; min-width: 0; font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em; text-wrap: pretty;
  }
  .calendar-page .cal-when { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); white-space: nowrap; }
  .calendar-page .cal-agenda > li { padding: 0; border-bottom: 0; }
  .calendar-page .cal-agenda .agenda-item { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); }
  @media (hover: hover) { .calendar-page .cal-agenda a.agenda-item:hover { background: var(--paper-50); color: var(--ink); } }
  .calendar-page .cal-agenda .agenda-label { font-size: var(--text-sm); font-weight: 500; }
  .calendar-page .cal-agenda .agenda-sub, .calendar-page .agenda-bills summary,
  .calendar-page .room-client, .calendar-page .agenda-bill-clients { color: var(--ink-2); }
  .calendar-page .agenda-actions { padding: 0 var(--space-3) var(--space-2); }
  .calendar-page .watch-live { margin: 0; padding: 0 var(--space-3) var(--space-2); }
  /* A hearing room: an inset row, a hairline between its bills; each
     bill number in mono navy (BillNumber). */
  .calendar-page .cal-agenda > li.room-card { padding: var(--space-2) var(--space-3); border-bottom: 0; border-radius: var(--radius-md); }
  .calendar-page .room-head .agenda-label { font-weight: 500; }
  .calendar-page .room-bill strong, .calendar-page .agenda-bills li a {
    font-variant-numeric: tabular-nums; font-weight: 500; color: var(--link); white-space: nowrap;
  }
  @media (hover: hover) { .calendar-page .room-bill:hover strong, .calendar-page .agenda-bills li a:hover { color: var(--ink); } }
  .calendar-page .agenda-bills li.is-mine { font-weight: 500; }
  /* Committees you follow keep the shared .committee-chip look. */
  .calendar-page #committees-more summary { font-size: var(--text-sm); font-weight: 500; cursor: pointer; }


  /* ── Calendar grid: Month and Week (calendar_body.html) ──
     A rail of filters beside the grid, the way a calendar app lays out.
     One hue per kind of item, the agenda glyphs' own: hearings blue,
     letters amber, deadlines red. Filing dates take the hue between
     blue and red so a swatch never matches the letters'; a committee's
     hearing is a neutral tint and one the firm added is dashed, so it's
     never mistaken for the Legislature's own schedule. Colour is never
     the only cue — every item's words say what it is. */
  .calendar-page [hidden] { display: none !important; }
  .calendar-page .k-hearing { --k: var(--info); }
  .calendar-page .k-letter { --k: var(--warn); }
  .calendar-page .k-deadline { --k: var(--error); }
  .calendar-page .k-filing { --k: color-mix(in oklch, var(--info), var(--error)); }
  .calendar-page :is(.k-committee, .k-firm_hearing) { --k: var(--ink-2); }

  .calendar-page .cal-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .calendar-page[data-cal-mode="list"] .cal-layout { align-items: start; }
  .calendar-page .cal-rail { display: flex; flex-direction: column; gap: var(--space-5); position: sticky; top: var(--space-4); }
  .calendar-page .cal-icon-btn {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; min-height: 0; padding: 0;
    border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer;
  }
  .calendar-page .cal-icon-btn svg { width: 1.125rem; height: 1.125rem; }
  @media (hover: hover) { .calendar-page .cal-icon-btn:hover { background: var(--paper-250); color: var(--ink); } }

  /* The title row: the page name, a "?" that opens its explanation, the
     few header actions beside it — nothing else stands above the calendar. */
  .calendar-page .page-head { align-items: flex-start; margin-bottom: var(--space-3); }
  .calendar-page .cal-title { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
  /* The "?" is taller than the title; the negative margin keeps it from
     pushing the title below where every other page's sits. */
  .calendar-page .cal-help { position: relative; display: inline-flex; margin-block: calc(-1 * var(--space-1)); }
  .calendar-page .cal-help-btn { width: 1.75rem; height: 1.75rem; color: var(--muted); }
  .calendar-page .cal-help-btn[aria-expanded="true"] { background: var(--paper-250); color: var(--ink); }
  .calendar-page .cal-help-pop {
    position: absolute; left: 0; top: calc(100% + 0.25rem); z-index: 30; width: 22rem; max-width: calc(100vw - 2 * var(--space-4));
    padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--rule-card);
    border-radius: var(--radius-md); box-shadow: var(--shadow-pop); font-size: var(--text-sm); color: var(--ink-2);
  }
  /* On a phone the popover spans the page, not the little "?" it hangs from. */
  @media (max-width: 640px) {
    .calendar-page .page-head { position: relative; }
    .calendar-page .cal-help { position: static; }
    .calendar-page .cal-help-pop { left: 0; right: 0; width: auto; max-width: none; top: calc(100% - var(--space-3) + 0.25rem); }
  }
  .calendar-page .cal-help-pop p { margin: 0; text-wrap: pretty; }
  .calendar-page .cal-help-pop p + p { margin-top: var(--space-2); }
  .calendar-page .cal-help-pop .linklike { display: inline; min-height: 0; padding: 0; font-size: var(--text-sm); line-height: inherit; vertical-align: baseline; }

  /* The filters are the shared pill dropdowns (.filter-dd*, the flagged
     section's rules), stacked in the rail, each as wide as the rail. */
  .calendar-page .cal-filters .filter-dds { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .calendar-page .cal-filters .filter-dd-btn { width: 100%; justify-content: flex-start; text-align: left; }
  .calendar-page .cal-filters .filter-dd-btn .dd-value { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-page .cal-filters .filter-dd-btn .caret { margin-left: auto; }
  .calendar-page .cal-filters .filter-pop { min-width: 100%; max-width: none; }

  /* Which kinds to show: a coloured dot, filled when on, a ring when off,
     with its count in muted grey. A button, pressed = shown. */
  .calendar-page .cal-kinds-title { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); margin-bottom: var(--space-1); }
  .calendar-page .cal-kind {
    display: flex; align-items: center; gap: var(--space-3); width: calc(100% + 2 * var(--space-2));
    min-height: 1.875rem; padding: var(--space-1) var(--space-2); margin: 0 calc(-1 * var(--space-2));
    border: 0; border-radius: var(--radius-button); background: none; text-align: left;
    font: inherit; font-size: var(--text-sm); font-weight: 400; color: var(--ink); line-height: 1.3; cursor: pointer;
  }
  @media (hover: hover) { .calendar-page .cal-kind:hover { background: var(--paper-250); color: var(--ink); } }
  /* The kind's letter in a tinted box: the key to the phone month's tags. */
  .calendar-page :is(.cal-dot, .cal-tag) {
    display: inline-grid; place-items: center; box-sizing: border-box; font-style: normal;
    border: 1px solid var(--rule); border-color: var(--k); border-radius: var(--radius-xs); background: color-mix(in oklch, var(--k) 16%, var(--paper));
    color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1;
  }
  /* Beside a wide grid that spells each item out, the list needs no key:
     a plain round dot in the kind's colour (a tinted ring for the firm's
     own). The lettered box comes back on a phone, below. */
  .calendar-page .cal-dot { flex: none; width: 0.625rem; height: 0.625rem; margin: 0 var(--space-0); border-radius: var(--radius-pill); background: var(--k); font-size: 0; }
  .calendar-page .k-firm_hearing .cal-dot { background: color-mix(in oklch, var(--k) 16%, var(--paper)); }
  .calendar-page .cal-tag.k-firm_hearing { border-style: dashed; }
  .calendar-page .cal-kind[aria-pressed="false"] .cal-dot { background: transparent; border-color: var(--muted); color: var(--muted); }
  .calendar-page .cal-kind[aria-pressed="false"] .cal-kind-name { color: var(--muted); }
  .calendar-page .cal-kind-n { margin-left: auto; font-size: var(--text-2xs); color: var(--muted); font-variant-numeric: tabular-nums; }
  /* One quiet line about the session's own calendar, in place of the banner. */
  .calendar-page .cal-session-note { margin: 0; font-size: var(--text-xs); color: var(--muted); text-wrap: pretty; }
  .calendar-page .cal-session-note .linklike { display: inline; min-height: 0; padding: 0; font-size: var(--text-xs); line-height: inherit; vertical-align: baseline; }

  /* The bar over the grid: Today, back, forward, the period, the views. */
  .calendar-page .cal-main { position: relative; min-width: 0; }
  .calendar-page .cal-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
  .calendar-page .cal-nav { display: inline-flex; align-items: center; gap: var(--space-1); }
  .calendar-page .cal-today { min-height: 2rem; padding: 0 var(--space-4); }
  .calendar-page .cal-period {
    margin: 0 auto 0 var(--space-2); font-size: var(--text-lg); font-weight: 500;
    letter-spacing: -0.01em; white-space: nowrap;
  }
  .calendar-page[data-cal-mode="list"] .cal-views { margin-left: auto; }
  .calendar-page .cal-undated { font-size: var(--text-sm); color: var(--ink-2); margin: 0 0 var(--space-2); }

  /* The month is a framed grid; the two weeks are their own cards (below). */
  .calendar-page .cal-view { display: flex; flex-direction: column; }
  .calendar-page[data-cal-mode="month"] .cal-view {
    height: clamp(30rem, calc(100dvh - 22rem), 44rem);
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); background: var(--surface); overflow: hidden;
  }
  .calendar-page .cal-day-list { margin-top: var(--space-4); }
  .calendar-page .cal-day-list-head { display: flex; align-items: baseline; gap: var(--space-2); }
  .calendar-page .cal-day-list-title { margin: 0; font-size: var(--text-md); font-weight: 500; }
  .calendar-page .cal-day-list-sub { margin: var(--space-0) 0 var(--space-2); font-size: var(--text-xs); color: var(--ink-2); }

  /* Two weeks with nothing in them: one line over them. */
  .calendar-page .cal-empty-week { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--ink-2); }
  .calendar-page .cal-empty-week .linklike { display: inline; min-height: 0; padding: 0; font-size: var(--text-sm); line-height: inherit; vertical-align: baseline; font-weight: 500; text-align: left; }

  /* Each kind's mark is a shape as well as a colour (calendar redesign,
     Nov 24 2026): a square for a hearing on your bills, an outlined
     square for a committee's, a dashed one for a hearing your firm added,
     a diamond for a deadline, a dot for a letter, a bar for a filing. */
  .calendar-page .cal-mark { flex: none; display: inline-block; box-sizing: border-box; width: 0.5625rem; height: 0.5625rem; border-radius: var(--radius-xs); background: var(--k); }
  .calendar-page .k-committee .cal-mark { background: none; border: 2px solid var(--k); }
  .calendar-page .k-firm_hearing .cal-mark { background: none; border: 1px dashed var(--rule-strong); }
  .calendar-page .k-deadline .cal-mark { transform: rotate(45deg) scale(0.85); }
  .calendar-page .k-letter .cal-mark { border-radius: 50%; }
  .calendar-page .k-filing .cal-mark { width: 0.75rem; height: 0.375rem; border-radius: var(--radius-pill); }
  .calendar-page .is-informational .cal-mark { background: var(--muted); border-color: var(--muted); }

  /* ── Next up: the next hearing on your bills and the next deadline ── */
  .calendar-page .cal-next {
    display: flex; flex-wrap: wrap; margin: 0 0 var(--space-4); overflow: hidden;
    border: 1px solid var(--rule-card); border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--info) 6%, var(--surface));
  }
  .calendar-page .cal-next-main { flex: 3 1 32rem; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); padding: var(--space-3) var(--space-5); }
  .calendar-page .cal-next-when { display: flex; flex-direction: column; gap: var(--space-0); }
  .calendar-page .cal-next-label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
  .calendar-page .cal-next-time { font-size: var(--text-lg); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .calendar-page .cal-next-what { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-0); font-size: var(--text-sm); }
  .calendar-page .cal-next-where { font-weight: 600; }
  .calendar-page .cal-next-what a { color: var(--link); font-variant-numeric: tabular-nums; }
  .calendar-page .cal-next-client, .calendar-page .cal-next-sub { color: var(--ink-2); font-size: var(--text-xs); }
  .calendar-page .cal-next-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .calendar-page .cal-next-actions:empty { display: none; }
  .calendar-page .cal-next-deadline {
    flex: 1 1 15rem; display: flex; flex-direction: column; justify-content: center; gap: var(--space-0); padding: var(--space-3) var(--space-5);
    background: var(--surface); border-left: 1px solid var(--rule-card); font-size: var(--text-sm);
  }
  .calendar-page .cal-next-deadline:only-child { border-left: 0; }

  /* ── Two weeks: this week and next, weekdays across, each day's items
     listed in time order (calendar redesign, Nov 24 2026) ── */
  .calendar-page .cal-two-week {
    display: grid; grid-template-columns: repeat(var(--cal-cols, 5), minmax(0, 1fr));
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); background: var(--surface); overflow: hidden;
  }
  .calendar-page .cal-two-week + .cal-two-week { margin-top: var(--space-3); }
  .calendar-page .cal-two-day {
    display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; min-height: 11rem;
    padding: var(--space-2) var(--space-2) var(--space-3); border-left: 1px solid var(--rule);
  }
  .calendar-page .cal-two-day:first-child { border-left: 0; }
  .calendar-page .cal-two-day.is-today { background: color-mix(in srgb, var(--info) 4%, var(--surface)); }
  .calendar-page .cal-two-day.is-before { background: var(--paper-50); }
  .calendar-page .cal-two-head { display: flex; align-items: center; gap: var(--space-2); min-height: 2.25rem; }
  .calendar-page .cal-week-dow { font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
  .calendar-page .cal-week-num {
    display: grid; place-items: center; width: 2rem; height: 2rem; min-height: 0; padding: 0;
    border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
    font: inherit; font-size: var(--text-md); font-weight: 500; font-variant-numeric: tabular-nums;
  }
  @media (hover: hover) { .calendar-page .cal-two-day:not(.is-today) .cal-week-num:hover { background: var(--paper-350); } }
  .calendar-page .cal-two-day.is-today .cal-week-dow { color: var(--ink); }
  .calendar-page .cal-two-day.is-today .cal-week-num { background: var(--accent-solid); color: var(--accent-solid-text); }
  .calendar-page .cal-two-today { font-size: var(--text-xs); font-weight: 600; }
  .calendar-page .cal-two-none { font-size: var(--text-xs); color: var(--muted); padding: 0 var(--space-1); }

  /* A card: the kind's tint, its mark and time on top, then what, which
     bills, where, and whose — every word of it, nothing cut to "Genera…". */
  .calendar-page .cal-card {
    display: flex; flex-direction: column; align-items: stretch; gap: var(--space-0); width: 100%; min-width: 0; min-height: 0;
    padding: var(--space-2) var(--space-3); text-align: left; cursor: pointer; white-space: normal;
    font: inherit; font-size: var(--text-xs); line-height: 1.35; color: var(--ink);
    background: color-mix(in srgb, var(--k) 9%, var(--surface));
    border: 1px solid transparent; border-color: color-mix(in srgb, var(--k) 30%, transparent); border-radius: var(--radius-button);
  }
  .calendar-page .cal-card.k-committee { background: var(--paper-50); border-color: var(--rule-card); }
  .calendar-page .cal-card.k-committee.is-followed { background: var(--paper-250); border-color: var(--rule-strong); }
  .calendar-page .cal-card.k-firm_hearing { background: var(--surface); border: 1px dashed var(--rule-strong); }
  .calendar-page .cal-card.k-deadline { color: color-mix(in srgb, var(--k) 70%, var(--ink)); }
  .calendar-page .cal-card.is-informational, .calendar-page .cal-card.is-past { background: var(--paper-50); border-color: var(--rule-card); color: var(--ink-2); }
  .calendar-page .cal-card.is-open { box-shadow: 0 0 0 2px var(--ink); }
  @media (hover: hover) { .calendar-page .cal-card:hover { border-color: var(--rule-strong); } }
  .calendar-page .cal-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); font-weight: 600; font-variant-numeric: tabular-nums; }
  .calendar-page .cal-card-time { white-space: nowrap; }
  .calendar-page .cal-card-tag { margin-left: auto; font-size: var(--text-2xs); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
  .calendar-page .cal-card-what { font-weight: 500; }
  .calendar-page .cal-card-bills { display: flex; flex-direction: column; }
  .calendar-page .cal-card-bills span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--ink-2); }
  .calendar-page .cal-card-bills b { font-weight: 600; color: var(--link); font-variant-numeric: tabular-nums; }
  .calendar-page .cal-card.is-past .cal-card-bills b { color: var(--ink-2); }
  .calendar-page .cal-card-room { color: var(--ink-2); }
  .calendar-page .cal-card-client { color: var(--ink-2); font-weight: 500; }
  .calendar-page .cal-card .cal-ev-star { display: inline-flex; }
  /* Now: a line between what's earlier and what's next, never across a card. */
  .calendar-page .cal-now-mark { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-2xs); font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 0.04em; }
  .calendar-page .cal-now-mark::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); }
  .calendar-page .cal-now-mark::after { content: ""; flex: 1; height: 2px; background: var(--gold); }

  /* An item in a month square: a tint of its kind's hue, its start time first. */
  .calendar-page .cal-ev {
    display: flex; align-items: baseline; gap: var(--space-1); width: 100%; min-height: 0; min-width: 0;
    padding: 1px var(--space-2); text-align: left; overflow: hidden; white-space: nowrap; cursor: pointer;
    font: inherit; font-size: var(--text-2xs); line-height: 1.4; color: var(--ink);
    background: color-mix(in srgb, var(--k) 13%, var(--surface));
    border: 1px solid transparent; border-color: color-mix(in srgb, var(--k) 35%, transparent); border-radius: var(--radius-button);
  }
  .calendar-page .cal-ev-time { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
  .calendar-page .cal-ev-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .calendar-page .cal-ev.k-deadline { background: var(--k); color: var(--surface); border-color: transparent; font-weight: 500; }
  .calendar-page .cal-ev.k-committee { background: var(--paper-250); border-color: var(--rule-card); }
  .calendar-page .cal-ev.k-firm_hearing { background: var(--surface); border: 1px dashed var(--rule-strong); }
  .calendar-page .cal-ev.is-informational { color: var(--ink-2); background: var(--paper-50); border-color: var(--rule-card); }
  .calendar-page .cal-ev.is-open { box-shadow: 0 0 0 2px var(--ink); }
  @media (hover: hover) {
    .calendar-page .cal-ev:hover { background: color-mix(in srgb, var(--k) 24%, var(--surface)); }
    .calendar-page .cal-ev.k-deadline:hover { background: color-mix(in srgb, var(--k) 85%, var(--ink)); }
    .calendar-page .cal-ev:is(.k-committee, .k-firm_hearing, .is-informational):hover { background: var(--paper-350); }
  }

  /* Month: weekdays only, unless something falls on a weekend that month. */
  .calendar-page .cal-month-head, .calendar-page .cal-month {
    display: grid; grid-template-columns: repeat(var(--cal-cols, 5), minmax(0, 1fr));
  }
  .calendar-page .cal-month-head div {
    padding: var(--space-2) 0 var(--space-1); text-align: center; font-size: var(--text-2xs); font-weight: 500;
    color: var(--muted); border-bottom: 1px solid var(--rule);
  }
  .calendar-page .cal-month { flex: 1; min-height: 0; }
  .calendar-page .cal-cell {
    display: flex; flex-direction: column; gap: var(--space-0); min-width: 0; min-height: 0; overflow: hidden;
    padding: var(--space-1) var(--space-1) var(--space-2);
    border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  }
  .calendar-page .cal-month:not(.has-weekend) .cal-cell:nth-child(5n),
  .calendar-page .cal-month.has-weekend .cal-cell:nth-child(7n) { border-right: 0; }
  .calendar-page .cal-cell.is-weekend { background: var(--paper-50); }
  .calendar-page .cal-cell.is-selected:not(.is-today) { box-shadow: inset 0 0 0 2px var(--ink); }
  .calendar-page .cal-daynum {
    flex: none; align-self: flex-start; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0;
    border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
    font: inherit; font-size: var(--text-xs); font-weight: 500; font-variant-numeric: tabular-nums;
  }
  .calendar-page .cal-cell.is-out .cal-daynum { color: var(--muted); }
  .calendar-page .cal-cell.is-today .cal-daynum { background: var(--accent-solid); color: var(--accent-solid-text); font-weight: 600; }
  @media (hover: hover) { .calendar-page .cal-cell:not(.is-today) .cal-daynum:hover { background: var(--paper-350); } }
  .calendar-page .cal-more {
    min-height: 0; padding: 0 var(--space-2); border: 0; background: none; text-align: left; cursor: pointer;
    font: inherit; font-size: var(--text-2xs); font-weight: 500; color: var(--link);
  }
  @media (hover: hover) { .calendar-page .cal-more:hover { color: var(--ink); } }
  /* Phone month: one letter tag per kind on the day, with a count past one. */
  .calendar-page .cal-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-0); }
  .calendar-page .cal-tag { display: inline-flex; gap: 1px; min-width: 1.125rem; height: 1.125rem; padding: 0 var(--space-0); font-size: var(--text-2xs); }
  .calendar-page .cal-tag b { font-weight: 500; }
  .calendar-page .cal-tag-more { --k: var(--muted); background: none; color: var(--ink-2); }

  /* The detail card: the event's own row from the list, beside it. */
  .calendar-page .cal-detail {
    position: absolute; z-index: 20; width: 24rem; max-width: 100%; padding: var(--space-2) var(--space-1) var(--space-1);
    background: var(--surface); border: 1px solid var(--rule-card); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  }
  .calendar-page .cal-detail-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 0 var(--space-1) 0 var(--space-3); }
  .calendar-page .cal-detail-day { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
  .calendar-page .cal-detail .cal-agenda { margin: 0; }

  /* A phone: the rail folds behind "Filters", the two weeks stack day
     by day, the month shows tags, and the detail card is a sheet from
     the bottom. */
  .calendar-page .cal-filters-btn { display: none; }
  @media (max-width: 900px) {
    .calendar-page .cal-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
    .calendar-page .cal-filters-btn { display: inline-flex; }
    .calendar-page .cal-rail { position: static; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--rule-card); border-radius: var(--radius-md); background: var(--surface); }
    .calendar-page .cal-rail:not(.is-open) { display: none; }
    .calendar-page .cal-filters .filter-dds { flex-direction: row; }
    .calendar-page .cal-filters .filter-dds .filter-dd { display: block; flex: 1 1 0; min-width: 0; }
    .calendar-page .cal-filters .filter-dd:last-child .filter-pop { left: auto; right: 0; }
    .calendar-page .cal-filters .filter-pop { min-width: 13rem; }
    /* The kind switches are the key to the month squares' letters. */
    .calendar-page .cal-dot { width: 1.125rem; height: 1.125rem; margin: 0; border-radius: var(--radius-xs); background: color-mix(in oklch, var(--k) 16%, var(--paper)); font-size: var(--text-2xs); }
    .calendar-page .k-firm_hearing .cal-dot { border-style: dashed; }
    .calendar-page .cal-period { flex-basis: 100%; order: -1; margin: 0; }
    .calendar-page .cal-views { margin-left: auto; }
    .calendar-page .cal-next-main, .calendar-page .cal-next-deadline { padding: var(--space-3) var(--space-4); }
    .calendar-page .cal-next-deadline { border-left: 0; border-top: 1px solid var(--rule-card); }
    .calendar-page .cal-next-actions { width: 100%; }
    .calendar-page .cal-next-actions > * { flex: 1; justify-content: center; }
    /* Two weeks: one day under another; a quiet day is one short line. */
    .calendar-page .cal-two-week { grid-template-columns: minmax(0, 1fr); }
    .calendar-page .cal-two-day { min-height: 0; border-left: 0; border-top: 1px solid var(--rule); }
    .calendar-page .cal-two-day:first-child { border-top: 0; }
    .calendar-page .cal-two-day.is-empty { flex-direction: row; align-items: center; padding-block: var(--space-1); }
    .calendar-page .cal-card { font-size: var(--text-sm); }
    .calendar-page[data-cal-mode="month"] .cal-view { height: auto; }
    .calendar-page .cal-month { grid-auto-rows: 3.25rem; }
    .calendar-page .cal-cell { align-items: center; gap: var(--space-0); padding: var(--space-1) 0; }
    .calendar-page .cal-daynum { align-self: center; width: 2rem; height: 2rem; }
    .calendar-page .cal-detail {
      position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 70dvh; overflow-y: auto;
      border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-up);
      padding-bottom: clamp(var(--space-4), calc(var(--space-4) + env(safe-area-inset-bottom)), var(--space-8));
    }
  }

  /* The master calendar (Nov 6 2026 beta review): Following | All
     hearings, the committees folded by house with a star each, and a
     followed committee's hearing starred and tinted on the grid. Stars
     and rings are ink, never gold. */
  .calendar-page .cal-show .cal-scope { display: flex; }
  .calendar-page .cal-scope button { flex: 1; }
  .calendar-page .cal-show .cal-session-note { margin-top: var(--space-1); }
  .calendar-page .cal-read { display: flex; align-items: center; gap: var(--space-2); margin: calc(-1 * var(--space-2)) 0 var(--space-3); font-size: var(--text-xs); color: var(--ink-2); }
  .calendar-page .cal-read:empty { display: none; }
  /* The doors to Today at the Capitol and the floor files: two quiet links
     beside the title (calendar redesign, Nov 24 2026). */
  .calendar-page .cal-title { flex-wrap: wrap; column-gap: var(--space-4); }
  .calendar-page .cal-doors { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 0 var(--space-2); }
  .calendar-page .cal-door {
    display: inline-flex; align-items: center; gap: var(--space-0); min-height: 1.75rem;
    color: var(--link); font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  }
  .calendar-page .cal-door svg { flex: none; width: 0.875rem; height: 0.875rem; }
  @media (hover: hover) { .calendar-page .cal-door:hover { color: var(--ink); } }
  /* "More": Search hearings and Subscribe in a small menu. */
  .calendar-page .cal-menu { position: relative; display: inline-flex; }
  .calendar-page #cal-menu-btn svg { width: 0.875rem; height: 0.875rem; margin-left: var(--space-1); }
  .calendar-page .cal-menu-pop {
    position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 30; display: flex; flex-direction: column; min-width: 13rem; padding: var(--space-1);
    background: var(--surface); border: 1px solid var(--rule-card); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  }
  .calendar-page .cal-menu-pop a, .calendar-page .cal-menu-pop a.secondary {
    display: flex; align-items: center; min-height: 2.25rem; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-button);
    background: none; color: var(--ink); font-size: var(--text-sm); font-weight: 400; text-decoration: none; white-space: nowrap;
  }
  @media (hover: hover) { .calendar-page .cal-menu-pop a:hover { background: var(--paper-250); } }
  .calendar-page .cal-filters-n { font-variant-numeric: tabular-nums; }
  .calendar-page .cal-fresh { flex: none; width: 0.4375rem; height: 0.4375rem; border-radius: var(--radius-pill); background: var(--good); }
  .calendar-page .cal-cmt-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
  .calendar-page .cal-cmt-toggle {
    display: flex; align-items: center; gap: var(--space-2); width: calc(100% + 2 * var(--space-2)); min-height: 2.25rem;
    margin: 0 calc(-1 * var(--space-2)); padding: 0 var(--space-2); border: 0; border-radius: var(--radius-button);
    background: none; font: inherit; font-size: var(--text-sm); font-weight: 500; color: var(--ink); text-align: left; cursor: pointer;
  }
  .calendar-page .cal-cmt-toggle .cal-kind-n { font-weight: 400; }
  .calendar-page .cal-caret { flex: none; width: 0.9375rem; height: 0.9375rem; color: var(--ink-2); transition: transform var(--dur) var(--ease); }
  .calendar-page .cal-cmt-toggle[aria-expanded="true"] .cal-caret { transform: rotate(90deg); }
  @media (hover: hover) { .calendar-page .cal-cmt-toggle:hover { background: var(--paper-250); } }
  .calendar-page .cal-cmt-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
  .calendar-page .cal-cmt { display: flex; align-items: center; gap: var(--space-1); min-height: 1.875rem; font-size: var(--text-xs); color: var(--ink-2); }
  .calendar-page .cal-cmt.is-on { color: var(--ink); font-weight: 500; }
  .calendar-page .cal-cmt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-page .agenda-follow {
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 2rem; padding: 0 var(--space-3);
    border: 1px solid var(--rule-card); border-radius: var(--radius-button); background: none;
    font: inherit; font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  }
  .calendar-page .agenda-follow[aria-pressed="true"] { background: var(--accent-solid); border-color: transparent; color: var(--accent-solid-text); }
  .calendar-page .agenda-follow.is-icon { flex: none; width: 1.75rem; min-height: 1.75rem; padding: 0; justify-content: center; border: 0; color: var(--muted); }
  .calendar-page .agenda-follow.is-icon[aria-pressed="true"] { background: none; color: var(--ink); }
  .calendar-page .agenda-star { width: 0.875rem; height: 0.875rem; flex: none; }
  .calendar-page .agenda-follow.is-icon .agenda-star { width: 1rem; height: 1rem; }
  @media (hover: hover) { .calendar-page .agenda-follow:not([aria-pressed="true"]):hover { background: var(--paper-250); color: var(--ink); } }
  .calendar-page .cal-ev.is-followed { background: var(--paper-350); border-color: var(--rule-strong); font-weight: 500; }
  .calendar-page .cal-ev-star { flex: none; align-self: center; display: inline-flex; }
  .calendar-page .cal-ev-star .agenda-star { width: 0.6875rem; height: 0.6875rem; }
  .calendar-page .cal-ev-flag { flex: none; align-self: center; width: 0.6875rem; height: 0.6875rem; margin-left: auto; }
  .calendar-page .agenda-site { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-1); font-size: var(--text-xs); font-weight: 500; color: var(--link); text-decoration: none; }
  .calendar-page .agenda-site svg { width: 0.8125rem; height: 0.8125rem; }
  @media (hover: hover) { .calendar-page .agenda-site:hover { color: var(--ink); } }
  .calendar-page .agenda-mine { list-style: none; margin: var(--space-1) 0 0; padding: 0; font-size: var(--text-sm); }
  .calendar-page .agenda-mine li { padding: var(--space-0) 0; }
  .calendar-page .agenda-mine a, .calendar-page .agenda-compact-bills { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--link); }
  .calendar-page .agenda-compact .agenda-item { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-1); padding-bottom: var(--space-1); }
  .calendar-page .agenda-compact .agenda-text { flex: 1; min-width: 0; }
  .calendar-page .agenda-compact .agenda-label { font-weight: 400; }
  .calendar-page .cal-follow-note {
    margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px dashed var(--rule-strong);
    border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--ink-2);
  }
  .calendar-page .cal-follow-note p { margin: 0; text-wrap: pretty; }
  .calendar-page .cal-follow-note .linklike { display: inline; min-height: 0; padding: 0; font-size: var(--text-sm); vertical-align: baseline; }
  .calendar-page .cal-suggest { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

  /* A touch screen keeps the app's 44px floor on the compact controls. */
  @media (hover: none), (pointer: coarse) {
    .calendar-page :is(.agenda-follow, .cal-cmt-toggle) { min-height: 2.75rem; }
    .calendar-page .agenda-follow.is-icon { width: 2.75rem; }
    .calendar-page :is(.segmented button, .cal-week-chips .chip, .card select, .filter-dd-btn) { min-height: 2.75rem; }
    .calendar-page .filter-option { min-height: 2.75rem; }
    .calendar-page :is(.cal-today, .cal-icon-btn, .cal-kind, .cal-door, .cal-menu-pop a, .page-head-actions > * > button, .page-head-actions > button) { min-height: 2.75rem; }
    .calendar-page .cal-week-num { width: 2.75rem; height: 2.75rem; }
    .calendar-page .cal-daynum { width: 2.75rem; height: 2.75rem; }
    .calendar-page .cal-icon-btn { width: 2.75rem; }
  }

  /* On a narrow screen the two dashboard columns stack. minmax(0, …)
     as on desktop: a bare 1fr won't shrink below its longest no-wrap
     line. */

  /* ── The bill tables, wide and narrow (P2-23) ──
     Two tables carry a client's position on a bill: the flagged list and
     the client record. Both used to hand a phone a five-column table
     inside a sideways scroller, which put the position <select> — the
     one control worth reaching between hearings — past the right edge,
     reachable only by horizontal drag.

     The wrapper is a class rather than the inline style="overflow-x:auto"
     it was, because below the breakpoint there is nothing left to scroll
     and the wrapper has to stop clipping: overflow-x on a block clips
     overflow-y too (per spec), which is what the row menu's own
     open-up hack exists to work around (see row_menu.js). */
  .table-scroll { overflow-x: auto; }

  /* Wide: let the positions column own the slack. At 1440px the browser
     was giving the width to the title and clipping Clients & positions
     at the card edge; these caps say which columns are content-sized and
     leave the rest to the two that need room to breathe. */
  @media (min-width: 901px) {
    .bill-cards th.col-next, .bill-cards th.col-status {
      width: 1%; white-space: nowrap;
    }
    .bill-cards td.col-next, .bill-cards td.col-status { white-space: nowrap; }
    /* Status holds one short badge; its definition tooltip is absolutely
       placed, so the column can be exactly the badge wide (Y6). */
    .flagged-table th.col-status, .flagged-table td.col-status { width: 1%; }
    .bill-cards th.col-clients, .bill-cards th.col-position { min-width: 15rem; }
    /* D6: the title is what you read the row by — it gets a floor so it
       never collapses to a word per line while Author sits wide; if the
       row runs out of room the table scrolls (.table-scroll) instead. */
    .bill-cards th.col-title { min-width: 15rem; }
    .client-bills th.col-position { min-width: 11rem; }
    /* The client's Bills table fits a ~1280px laptop without sideways
       scrolling (Nov 13 declutter): its Next action and Status cells may
       wrap, cells are a touch tighter, the title floor is 10rem, and the
       position control's own fields shrink to its column. The ⋯ menu
       column is content-sized. .table-scroll stays as the fallback. */
    .client-bills th, .client-bills td { padding-left: var(--space-3); padding-right: var(--space-3); }
    .client-bills th.col-next, .client-bills td.col-next,
    .client-bills th.col-status, .client-bills td.col-status { white-space: normal; width: auto; min-width: 7rem; }
    .client-bills th.col-title { min-width: 10rem; }
    .client-bills th.col-rowmenu, .client-bills td.col-rowmenu { width: 1%; padding-left: var(--space-1); padding-right: var(--space-1); }
    .client-bills .pc-since { flex-wrap: wrap; }
    .client-bills td.col-position :is(input, select, textarea) { max-width: 100%; min-width: 0; }
    /* Author is a name to call, content-sized. A committee author's
       whole name ("Assembly Committee on Judiciary") is clipped rather
       than widening the column; the tooltip has it in full. */
    .bill-cards th.col-author { width: 1%; white-space: nowrap; }
    .bill-cards td.col-author .author-short {
      display: inline-block; max-width: 8rem; vertical-align: bottom;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
  }
  .bill-cards td.col-author .author-none { color: var(--slate); }

  /* Narrow: one card per bill. The table elements are re-declared as
     blocks, which does drop the grid roles — correct here, since a
     stacked card has no columns to be the third of. What each value
     means comes back as a label per cell, generated from CSS so the row
     builder stays one shape for both layouts. */
  @media (max-width: 900px) {
    .table-scroll { overflow: visible; }
    .bill-cards, .bill-cards tbody, .bill-cards tr, .bill-cards td { display: block; width: auto; }
    .bill-cards thead { display: none; }
    /* --rule-strong, not --rule-card: stacked bill cards are all this
       view has, and this border is the only thing between one bill and
       the next. See the token's own comment.

       Flat rows under a rule, not a bordered card inside the panel's own
       card: the nesting cost 32px of a 375px screen and, with every cell
       on its own labelled line, left one bill per screen (8 bills was
       4,200px). A two-column grid gets that back — the row menu takes
       the top-right corner beside the bill instead of a line of its own,
       and status sits beside next action. Everything else spans. */
    .bill-cards tr {
      position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
      column-gap: var(--space-3);
      border-bottom: 1px solid var(--rule-strong); padding: var(--space-3) var(--space-4);
    }
    .bill-cards tr:last-child { border-bottom: 0; }
    .panel .bill-cards td { border: 0; padding: var(--space-1) 0; grid-column: 1 / -1; }
    .bill-cards td.col-bill { grid-column: 1; grid-row: 1; }
    .bill-cards td.col-rowmenu { grid-column: 2; grid-row: 1; align-self: start; }
    .bill-cards td.col-next, .bill-cards td.col-title { grid-column: 1; grid-row: 2; }
    .bill-cards td.col-status { grid-column: 2; grid-row: 2; justify-self: end; }
    /* The client's own table has a title AND a next action; the title
       keeps the row beside status and Next action takes a line under it. */
    .bill-cards.client-bills td.col-next { grid-column: 1 / -1; grid-row: auto; }
    /* "Our take" is its own row in the table; on a phone it closes the
       bill's card rather than starting one of its own. */
    .bill-cards.client-bills tr:has(+ tr.take-row) { border-bottom: 0; padding-bottom: 0; }
    .bill-cards.client-bills tr.take-row { display: block; padding-top: 0; }
    /* The whole card opens the report. The bill number was the only link
       — about 46x15, the smallest target on the most-used screen — so its
       hit area is stretched over the row, and the cells holding their
       own controls are lifted above it. The row menu sits highest: its
       dropdown opens down over the status cell of the same card. */
    .bill-cards td.col-bill a::after { content: ""; position: absolute; inset: 0; }
    .bill-cards td.col-status, .bill-cards td.col-clients,
    .bill-cards td.col-position { position: relative; z-index: 1; }
    .bill-cards td.col-rowmenu { position: relative; z-index: 2; }
    /* The identity of the thing needs no label — it is the card's title,
       and "Bill: CA SB1159" reads as a form field rather than a heading. */
    .bill-cards td.col-next::before,
    .bill-cards td.col-status::before,
    .bill-cards td.col-position::before,
    .bill-cards td.col-clients::before {
      display: block; margin-bottom: var(--space-1);
      font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--slate);
    }
    .bill-cards td.col-next::before { content: "Next action"; }
    .bill-cards td.col-status::before { content: "Status"; }
    .bill-cards td.col-clients::before { content: "Clients & positions"; }
    /* The client record already knows whose position it is — the page is
       that client — so the same cell gets the shorter true label. */
    .bill-cards td.col-position::before { content: "Position"; }
    /* Author: one short line on the card, its label beside the name
       rather than above it — a surname doesn't need a line to itself. */
    .bill-cards td.col-author::before {
      content: "Author"; margin-right: var(--space-2);
      font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--slate);
    }

    /* Phone-first card (full-app audit, strategic 5): a flagged card was
       357px at 375 wide — two bills a screen. Three lines were spent on
       layout, not content: "LAST CHANGE" wrapping onto two lines beside
       its text, the "In 5 days" chip on a line under the room, and the
       client cell's edit pencil wrapping below the client. Now the chip
       sits beside the date, the label stays on one line, and the pencil
       stays beside the client. */
    .bill-cards td.col-next { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); }
    .bill-cards td.col-next::before { flex-basis: 100%; }
    .bill-cards td.col-next > .next-where { flex-basis: 100%; order: 1; }
    .bill-cards td.col-next > .next-chip { margin-top: 0; }
    .bill-cards td.col-clients .clients-summary { flex-wrap: nowrap; align-items: flex-start; }
    .bill-cards td.col-clients .clients-summary-list { min-width: 0; }
    /* The clients cell spans both columns, so a long client name's
       one-line width would widen them and push the row menu past the
       card's edge; sized by the card, the name ellipsizes instead. */
    .bill-cards td.col-clients { contain: inline-size; }

    /* The whole point of the breakpoint: the position control, full
       width, at a real touch height, with the client's name above it
       rather than truncated beside it. */
    .bill-cards td.col-clients, .bill-cards td.col-position {
      border-top: 1px solid var(--rule) !important;
      margin-top: var(--space-2); padding-top: var(--space-3) !important;
    }
    .bill-cards td.col-clients .add-client-select { width: 100%; min-height: 2.75rem; }
    /* The client record's Position column holds the shared position
       control; on a phone its parts stack, full width. */
    .bill-cards td.col-position .position-control { flex-direction: column; align-items: stretch; }
    .bill-cards td.col-position select.position-select { width: 100%; }
    /* On the client record the title is its own cell rather than part of
       the bill's identity block, so it gets the heading treatment the
       bill number gets on the flagged list. */
    .bill-cards td.col-title { font-weight: 600; }

    /* The filter rail at this width: the group label sits above its own
       tabs rather than sharing a line with them, since a 4.5rem label
       column plus a wrapped row of client names leaves the tabs about
       two words wide. A long client name gets to be a long tab and
       wrap — this is the one control where truncating the name defeats
       the purpose of having it. */
    .search-filters .filter-group { flex-direction: column; align-items: stretch; }
    .search-filters .filter-group-head { padding-right: 0; border-right: 0; }
    .search-filters .filter-group-label { min-width: 0; }
    .search-filters .filter-tab { text-align: left; white-space: normal; }
  }
  /* Flow-style rows on a wide screen too (founder, Oct 29 2026): the
     flagged list reads as the dashboard's rows — a document tile, the
     bill over a quiet line of next action and author, the clients'
     positions and the status at the right, the row menu last. The
     Sort by menu above the list does the column headers' job. */
  @media (min-width: 901px) {
    .flagged-table, .flagged-table tbody, .flagged-table td { display: block; width: auto; }
    .flagged-table thead { display: none; }
    .flagged-table tr {
      position: relative; display: grid; align-items: center; gap: 0 var(--space-3);
      grid-template-columns: auto 2rem minmax(0, 1fr) fit-content(11rem) auto 2rem;   /* D6/D7: clients are small chips — the title gets the slack */
      grid-template-areas: "pick icon bill clients status menu" "pick icon next clients status menu" "pick icon author clients status menu";
      padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease);
    }
    .flagged-table tr::before {
      content: ""; grid-area: icon; align-self: start; width: 2rem; height: 2rem;
      border-radius: var(--radius-sm); background: var(--flow-chip);
    }
    .flagged-table tr::after {
      content: ""; grid-area: icon; align-self: start; justify-self: center; margin-top: var(--space-2);
      width: 1rem; height: 1rem; background: var(--muted);
      -webkit-mask: var(--bill-row-icon) center / contain no-repeat; mask: var(--bill-row-icon) center / contain no-repeat;
    }
    .app-main .panel .flagged-table tbody tr > td { border: 0; padding: 0; white-space: normal; min-width: 0; width: auto; max-width: none; contain: none; }
    .flagged-table td.col-pick { grid-area: pick; align-self: start; }
    .flagged-table td.col-bill { grid-area: bill; }
    .flagged-table td.col-next {
      grid-area: next; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2);
      font-size: var(--text-xs); color: var(--muted);
    }
    .flagged-table td.col-next > * { flex: none; width: auto; margin: 0; font-size: var(--text-xs); }
    .flagged-table td.col-author { grid-area: author; font-size: var(--text-xs); color: var(--muted); }
    .flagged-table td.col-clients { grid-area: clients; }
    .panel .flagged-table tbody tr > td.col-status { grid-area: status; justify-self: end; white-space: nowrap; }
    .flagged-table td.col-status .status-badge { margin-bottom: 0; }
    .flagged-table td.col-rowmenu { grid-area: menu; }
  }
  /* The row is the tint — on hover and while its preview is open, at
     every width: the app-wide table rule tints each cell too, which
     stacked into patches over the row's own with the gaps between cells
     showing as lines (founder, Nov 2 2026). */
  @media (hover: hover) {
    .flagged-table tbody tr:hover { background: var(--nav-hover); }
    .app-main .flagged-table tbody tr:hover > td { background: none; }
  }
  .flagged-table tbody tr.peek-selected { background: var(--nav-hover); }
  .app-main .flagged-table tbody tr.peek-selected > td { background: none; }
  /* The box that picks a bill for "change the selected bills" (the bulk
     bar, with .selection-bar below). First in the row at every width; a
     ticked row keeps a tint so the selection reads without hunting for
     boxes. Below 901px the card is one stretched link (.col-bill a::after),
     so the box is lifted above it and given a column of its own. */
  .flagged-table .pick-label { margin: 0; padding: var(--space-1); min-width: 32px; min-height: 32px; justify-content: center; }
  .flagged-table .pick, .bulk-select-line .pick { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-solid); }
  .flagged-table tbody tr.picked { background: var(--accent-soft); }
  .app-main .flagged-table tbody tr.picked > td { background: none; }
  .bulk-select-line { padding: var(--space-1) var(--space-4) 0; }
  .bulk-select-line .pick-label { margin-left: 0; padding-left: var(--space-2); min-height: 32px; }
  @media (min-width: 901px) { .bulk-select-line { padding-left: var(--space-5); } }
  @media (max-width: 900px) { .flagged-table .pick-label, .bulk-select-line .pick-label { min-width: 44px; min-height: 44px; } }

  .row-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-1); }
  /* Open + delete on one line at the end of a table row. .icon-btn is
     display:flex (block-level), so beside an inline link it dropped
     under it instead of sitting next to it. */
  .cell-actions { display: inline-flex; align-items: center; gap: var(--space-2); }
  .row-actions a { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  /* A "..." overflow menu for row actions that are real but shouldn't
     shout — a bright red button on every row was too loud for
     something you do occasionally, not the primary action of the row. */
  .row-menu { position: relative; text-align: right; }
  /* The design system's RowMenu trigger: a borderless 30px icon button,
     the same everywhere. A boxed ⋮ on every row of a list was the
     loudest thing in it; the icon alone (--muted, 4.8:1 light / 6.8:1
     dark) carries the control, and a fill appears on hover or while
     its menu is open. */
  .row-menu-btn {
    height: 1.875rem; width: 1.875rem; padding: 0; border: none; border-radius: var(--radius-sm); background: none;
    color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }
  .row-menu-btn[aria-expanded="true"] { background: var(--paper-350); color: var(--ink); }
  @media (hover: hover) { .row-menu-btn:hover { background: var(--paper-350); color: var(--ink); } }
  /* flex: none for the same reason .icon-btn svg (above) needs it — an
     <svg> with no width/height HTML attributes collapses to 0 width in
     a flex container's default flex-shrink:1, even with this explicit
     CSS width set. Confirmed via getComputedStyle(): this "..." button
     was rendering the icon at 0px wide, an empty-looking button. */
  .row-menu-btn svg { width: 1rem; height: 1rem; flex: none; }
  /* Touch targets under the ~44px guideline (Apple HIG / WCAG 2.5.5) —
     fine with a mouse pointer's precision, but risky to tap accurately
     with a finger, especially .row-menu-btn sitting right next to other
     row content. Scoped to (pointer: coarse) rather than a width
     breakpoint since the risk is about input precision, not viewport
     size — a touch laptop at desktop width has the same problem, and a
     mouse-driven narrow window doesn't.
     Placed here, after .icon-btn/.panel-link/.row-menu-btn's own base
     rules, on purpose — not just for proximity to .row-menu-btn. All
     four selectors here tie with their unconditional base rule on
     specificity (one class each), so the later rule in source order
     wins regardless of whether this media query matches. .icon-btn
     (defined above, ~line 728) and .side-nav-item (~line 620) happen to
     sit before their base rule either way, but .panel-link (~line 797)
     and .row-menu-btn (directly above) don't — this block used to sit
     above both of those, silently losing the cascade and leaving those
     two buttons stuck at their small desktop size under a coarse
     pointer. Same tie-breaking issue .icon-btn.app-topbar-menu-btn's
     own comment (see STYLE, app-topbar section) works around with an
     extra class instead; source-order suffices here since every base
     rule this needs to beat is already above this point. */
  @media (pointer: coarse) {
    .icon-btn, .row-menu-btn { height: 2.75rem; width: 2.75rem; }
    .panel-link { height: 2.75rem; padding: 0 var(--space-4); }
    .side-nav-item { height: 2.75rem; }
    /* The four rules above name five specific classes and miss the two
       controls a touch user actually reaches for all day: the filter
       tabs on /flagged and /lookup (~24px, and shrunk further to
       0.2rem padding inside .filter-group) and the position select in
       a .client-chip (padding: 0.1rem). Both are covered here by their
       element rather than their class, along with the plain form
       button (~35px), .filter-chip and the toast's two buttons.

       min-height, not height: nothing else in this file sets it on a
       button or select, so this reaches every one of them no matter
       where below this point their own rule is defined or how small a
       padding that rule gives them. (Compare this block's own comment
       above about source order — that problem only exists between
       rules setting the *same* property.)

       Not covered on purpose: a.tag. Its clickable form is a bill
       number inside a sentence of CAL-ACCESS free text (see
       billPills() in LOBBYING_DETAIL_BODY), and WCAG 2.5.8 exempts a
       target inline in a block of text — a 44px pill mid-paragraph
       would be a regression, not a fix. */
    button, select { min-height: 2.75rem; }
    /* .small's own 28px min-height outranks the element rule above. */
    a.small, button.small { min-height: 2.75rem; }
    /* Height alone leaves this one about 16px wide: its whole content
       is a single "×". */
    .toast-close { min-width: 2.75rem; }
    /* The shared position control stacks: full-width dropdown, then the
       date with its label above the field, each at a real touch height. */
    .position-control { flex-direction: column; align-items: stretch; }
    .position-control select.position-select { width: 100%; }
    .position-control .pc-since { flex-direction: column; align-items: stretch; gap: var(--space-0); text-align: left; }
    .position-control .pc-since input[type="date"] { width: 100%; min-height: 2.75rem; }
    /* iOS Safari zooms the whole page into any focused field under 16px,
       and leaves it zoomed. At 375px the flagged filter box, the sort
       menu, every position <select>, the report's "in force since" date
       and the letter body were all 11.5-14px — each tap cost a pinch.
       !important because the floor has to beat every denser component
       size (.pc-since input[type="date"] and friends) regardless
       of where or how specifically that rule is written. */
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: var(--text-base) !important; }
    /* Standalone links and controls this block's element rules miss,
       each measured under 40px at 375px: the topbar search icon (an <a>,
       38x32), "View all bills/clients", the dashboard's hearing rows
       (36px), the history disclosure (19px), the report's date field
       (25px), and the auth/landing "Sign in"/"Create an account" links. */
    .topbar-search { height: 2.75rem; min-width: 2.75rem; justify-content: center; }
    .dash-col-more, .auth-alt a, .lp-signin { display: inline-flex; align-items: center; min-height: 2.75rem; }
    /* Two classes, so it beats .worklist-head .linklike's 24px (a tie
       on specificity, won here by coming later) — the element-level
       button rule above loses to it. */
    .worklist-head .linklike, .worklist-alerts-link, .setup-links a { min-height: 2.75rem; }
    .agenda-item, .position-history-disclosure summary, input[type="date"] { min-height: 2.75rem; }
    /* What a phone still left under the floor (measured as a touch phone,
       critique Nov 21 2026): the top bar's home mark, links dressed as
       buttons ("Follow a bill", "Open letter"), the back links above a
       page's title, the "How this works" disclosures and the page tabs.
       !important for the same reason as the font size above: each has a
       denser component rule (.dash-head's 36px actions, #back-link's
       30px, .search-kind's 36px tabs, the inbox's 40px chips) written
       more specifically than this block can be, and the floor must win. */
    .app-topbar-home { width: 2.75rem; height: 2.75rem; }
    a:is(.primary, .secondary, .danger), .dash-head-link,
    a.sub:not(p a, li a, td a) { display: inline-flex; align-items: center; min-height: 2.75rem !important; }
    summary { min-height: 2.75rem !important; align-content: center; }
    .settings-tab, .inbox-chip, .scope-option, .search-kind button { min-height: 2.75rem !important; }
  }
  .row-menu-dropdown {
    position: absolute; right: 0; top: calc(100% + 0.25rem); background: var(--surface);
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); padding: var(--space-1); min-width: 9rem;
    box-shadow: var(--shadow-pop); z-index: 20; display: none; flex-direction: column; gap: var(--space-1);
  }
  .row-menu-dropdown.show { display: flex; }
  /* Opens upward instead of down — set by toggleRowMenu() when the table's
     own overflow-x:auto wrapper (which clips overflow-y too, per the CSS
     spec, once overflow-x is anything but visible) would otherwise cut
     the menu off. Hits the last row in the table hardest, since there's
     no more table content below it to grow the wrapper's height for. */
  .row-menu-dropdown.open-up { top: auto; bottom: calc(100% + 0.25rem); }
  .row-menu-dropdown button {
    background: none; border: none; color: var(--error); font: inherit; font-weight: 500; font-size: var(--text-xs);
    text-align: left; padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm); cursor: pointer;
  }
  @media (hover: hover) { .row-menu-dropdown button:hover { background: var(--error-soft); } }
  /* Flagged Bills' kebab carries two neutral links (Open bill report,
     View on LegiScan) above the destructive Archive button — they read as
     ordinary menu rows, not more red actions, and stay ink on hover
     rather than warming to --gold like a plain link would. */
  .row-menu-dropdown a {
    color: var(--ink); font: inherit; font-weight: 500; font-size: var(--text-xs);
    text-decoration: none; text-align: left; padding: var(--space-2) var(--space-2);
    border-radius: var(--radius-sm);
  }
  @media (hover: hover) { .row-menu-dropdown a:hover { background: var(--accent-soft); color: var(--ink); } }
  /* Same anchored-dropdown shape as .row-menu-dropdown (position,
     border, shadow, z-index), but plain neutral rows instead of that
     one's red "destructive action" styling — this is a list of name
     suggestions to pick from (see the Add Client form's live
     CAL-ACCESS autofill), not a menu of things to delete. */
  .autofill-dropdown {
    position: absolute; background: var(--surface); border: 1px solid var(--rule-card);
    border-radius: var(--radius-md); padding: var(--space-1); box-shadow: var(--shadow-pop);
    z-index: 20; display: none; flex-direction: column; gap: var(--space-1); max-height: 14rem; overflow-y: auto;
  }
  .autofill-dropdown.show { display: flex; }
  .autofill-dropdown button {
    background: none; border: none; color: var(--ink); font: inherit; font-size: var(--text-sm);
    text-align: left; padding: var(--space-2); border-radius: var(--radius-sm); cursor: pointer;
  }
  @media (hover: hover) { .autofill-dropdown button:hover { background: var(--accent-soft); } }
  /* Firms/coalitions still show up when a typed name matches one (still
     useful to see), but visually recede behind employer matches — an
     employer is what this app means by "client", so it's the one match
     type that should look like the obvious pick. */
  .autofill-dropdown button.non-employer-match { color: var(--slate); }
  th {
    background: var(--content-bg); font-size: var(--text-2xs); font-weight: 600; color: var(--slate);
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  /* A sortable header (sortable_table.js): the header's own words as a
     plain button, with the arrow every spreadsheet shows once sorted. */
  th .th-sort {
    all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1);
    font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
  }
  th .th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
  /* Unsorted, the arrow shows only when pointed at or focused. */
  th .th-sort::after { content: ""; }
  th .th-sort:focus-visible::after { content: "↕"; }
  @media (hover: hover) { th .th-sort:hover { color: var(--ink); } th .th-sort:hover::after { content: "↕"; } }
  th[aria-sort="ascending"] .th-sort::after { content: "↑"; }
  th[aria-sort="descending"] .th-sort::after { content: "↓"; }
  @media (max-width: 900px) {
    /* Used to be `display: none` — the sidebar (and everything only it
       held: section nav, Profile, account menu, sign-out, dark-mode
       toggle) just vanished below 900px with no replacement, leaving
       every app_shell() page with zero navigation on a phone. Now it's
       an off-canvas drawer instead: same markup, positioned fixed and
       slid off-screen by default, brought on-screen by adding .show
       (see app_shell()'s own script for the hamburger button that
       toggles it plus the backdrop/Escape/outside-click handling). */
    .app-sidebar {
      position: fixed; top: 0; left: 0; z-index: 40; transform: translateX(-100%);
      transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur); box-shadow: var(--shadow-drawer);
      /* Oct 7 audit T8: closed, the drawer is only slid off-screen, so a
         keyboard or screen reader still met every nav link before the
         page itself. Hidden while closed, the page's content comes first
         and the hamburger is the way in. */
      visibility: hidden;
      /* The screen you can see, not 100vh: on a phone 100vh is the height
         with the browser's bars hidden, so the drawer ran under them and
         its last links (Settings, the account card) could never be
         scrolled into view (Nov 6 beta review). 100vh first for browsers
         without dvh. */
      height: 100vh; height: 100dvh;
      /* Wider than the desktop column (248px), which left a phone's rows
         cramped beside half a screen of scrim; never the whole screen, so
         the page behind still shows what a tap outside returns to. */
      width: min(20rem, 86vw);
    }
    .app-sidebar.show { transform: translateX(0); visibility: visible; transition: transform var(--dur) var(--ease); }
    .icon-btn.app-topbar-menu-btn { display: flex; }
    .app-topbar-home { display: flex; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
  }

    /* ── Position history ──
     Append-only record of every stance change (see position_history in
     schema.sql), on the bill report and the client record. An ordered
     list rather than a table: each entry is one sentence with a
     timestamp under it, and four columns of mostly-empty cells was the
     wrong shape for that. */
  ol.position-history { list-style: none; margin: 0; padding: 0; }
  .position-history-row { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
  .position-history-row:last-child { border-bottom: 0; }
  .position-history-what { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
  .position-history-subject { font-weight: 600; font-size: var(--text-sm); }
  .position-arrow { color: var(--slate); }
  .position-history-reconfirmed { font-size: var(--text-xs); color: var(--slate); }
  .position-history-when { font-size: var(--text-2xs); color: var(--slate); margin-top: var(--space-0); }

  /* ── A bill's notes — signed, dated entries (Oct 7 audit T5) ──
     The same list shape as the position history above: one entry per
     row, who and when on a small line over the words. Edit and Delete
     sit on that line, on the writer's own entries only. */
  .bill-note-add { display: flex; justify-content: flex-end; margin: var(--space-2) 0 var(--space-1); }
  ol.bill-notes { list-style: none; margin: 0; padding: 0; }
  .bill-note { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
  .bill-note:last-child { border-bottom: 0; }
  .bill-note-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
                    font-size: var(--text-2xs); color: var(--slate); }
  .bill-note-actions { display: inline-flex; gap: var(--space-2); margin-left: auto; }
  .bill-note-actions .linklike { display: inline-flex; align-items: center; min-height: 1.5rem; font-size: var(--text-xs); }
  .bill-note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-sm); margin-top: var(--space-0); }
  .bill-note-edit-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-1); }
  /* ── A flagged bill's Tracking card (bill_tracking.js) ──
     The four fields as the Settings field grid; tags as removable
     .filter-chip pills with the add box at the end of the same row. */
  .tracking-fields { margin-bottom: var(--space-3); }
  .tracking-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
  .tracking-tag-add { display: inline-flex; align-items: center; gap: var(--space-2); }
  .tracking-tag-add input { width: 10rem; }
  /* The same fields as one quiet line under a flagged-list row's title. */
  .tracking-line { font-size: var(--text-2xs); color: var(--slate); margin-top: var(--space-0); }
  .tracking-priority { font-weight: 600; }
  .tracking-priority.high { color: var(--ink); }
  .tracking-tag { color: var(--ink-2); }
  /* Settings › Firm: the firm's own bill fields (db_custom_fields.py). */
  .custom-fields-settings { border-top: 1px solid var(--rule); }
  .custom-fields-title { margin: 0 0 var(--space-1); font-size: var(--text-sm); }
  .custom-fields-list { list-style: none; margin: var(--space-3) 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
  .custom-field-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
  .custom-field-actions { display: flex; gap: var(--space-2); }
  .custom-field-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-3); align-items: end; }
  /* ── The meeting and contact log (Oct 7 audit P1; meeting_log.js) ──
     Its timeline is the notes list above, one entry a row that opens to
     the whole entry; its dialog is the shared .modal-panel, Kind and
     stance as .filter-tab pills. Layout only — every colour is an
     existing token. */
  .meeting-log-body { padding: var(--space-2) var(--space-4) var(--space-4); }
  .meeting-log-body > .meeting-log-actions { margin-top: 0; }
  .meeting-who .autofill-dropdown .sub { margin: 0; }
  .meeting-entry summary { display: flex; align-items: baseline; gap: var(--space-2); cursor: pointer; font-size: var(--text-sm); }
  .meeting-line { min-width: 0; overflow-wrap: anywhere; }
  .meeting-first { color: var(--slate); }
  .meeting-initials { margin-left: auto; flex: none; font-size: var(--text-2xs); font-weight: 600; color: var(--slate); text-decoration: none; }
  .meeting-full { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-2); }
  .meeting-form .filter-tabs { margin-bottom: var(--space-2); }
  .meeting-who { position: relative; }
  .meeting-who .autofill-dropdown { top: 100%; left: 0; right: 0; }
  .meeting-follow { display: flex; flex-direction: column; gap: var(--space-3); }
  .meeting-follow[hidden] { display: none; }
  .needs-list > li.needs-has-action { display: flex; align-items: baseline; gap: var(--space-3); }
  .needs-has-action > .needs-row { flex: 1; min-width: 0; }
  .needs-has-action > .linklike { flex: none; display: inline-flex; align-items: center; min-height: 1.5rem; }
  /* On the bill report the history is a collapsed disclosure at the foot
     of the "Clients & positions" card (audit S3 — it used to be its own
     panel on a Positions tab that repeated the card). Same native
     <details> + rotating ▸ as Organization Search's variants row. The
     lobbying card's "Possibly about an earlier law" (.lobbying-earlier)
     is the same widget. */
  .position-history-disclosure, .lobbying-earlier { border-top: 1px solid var(--rule); padding: var(--space-2) var(--space-4) var(--space-3); }
  .position-history-disclosure summary, .lobbying-earlier summary {
    cursor: pointer; font-size: var(--text-xs); color: var(--slate); font-weight: 600;
    list-style: none; display: flex; align-items: center; gap: var(--space-2);
  }
  .position-history-disclosure summary::-webkit-details-marker, .lobbying-earlier summary::-webkit-details-marker { display: none; }
  .position-history-disclosure summary::before, .lobbying-earlier summary::before { content: '▸'; display: inline-block; transition: transform var(--dur-fast) var(--ease); }
  .position-history-disclosure[open] summary::before, .lobbying-earlier[open] summary::before { transform: rotate(90deg); }
  .position-history-disclosure summary .count, .lobbying-earlier summary .count { font-weight: 400; }
  .position-history-disclosure > .sub, .lobbying-earlier > .sub { margin: var(--space-2) 0 var(--space-1); }
  /* A vetoed bill's Governor's letter (veto_messages.py), the same
     disclosure: kept as written, line breaks and all. */
  .veto-message-text { white-space: pre-line; font-size: var(--text-sm); line-height: 1.55; margin-top: var(--space-2); max-width: 70ch; }


  /* ── Autosave status (autosave.js) ──
     The one "Saving… / Saved / Couldn't save — Retry" indicator every
     editable surface shows beside its edit (whole-app audit Y18/S8).
     Quiet while saving, green with a tick once saved, the error colour
     with a Retry when it didn't land. Empty (idle) it takes no space. */
  .save-status { font-size: var(--text-xs); color: var(--slate); }
  .save-status[data-state="saved"] { color: var(--good); }
  .save-status[data-state="saved"]::before { content: ""; --ic: var(--icon-check); margin-right: var(--space-1); }
  .save-status[data-state="error"] { color: var(--error); font-weight: 600; }
  .save-status-retry { font-weight: 600; color: inherit; }

  /* ── Toast ──
     One at a time, bottom left, out of the way of the sidebar and of
     anything a page pins to its own bottom right. Carries the undo for a
     position change (see toast.js), so it has to be reachable by
     keyboard and readable long enough to act on. */
  .toast {
    position: fixed; left: 1rem; bottom: 1rem; z-index: 60;
    display: flex; align-items: center; gap: var(--space-3);
    max-width: min(28rem, calc(100vw - 2rem));
    background: var(--ink); color: var(--surface);
    padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    font-size: var(--text-xs);
  }
  /* Past the sidebar where there is one: at its 1rem from the window's
     edge the toast sat on the account widget at the sidebar's foot, and a
     "Saved." printed over "Pat Critic" read as neither (search critique,
     Oct 21). Below 901px the sidebar is a drawer and the corner is free. */
  @media (min-width: 901px) {
    body:has(.app-shell) .toast { left: calc(var(--sidebar-width) + 1rem); }
    body:has(.sidebar-collapsed) .toast, .sidebar-collapsed .toast { left: calc(68px + 1rem); }
  }
  .toast-text { flex: 1; }
  .toast-action {
    background: transparent; color: inherit; border: 1px solid currentColor;
    font-size: var(--text-xs); font-weight: 700; padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-button); cursor: pointer; flex: none;
  }
  .toast-close {
    background: transparent; color: inherit; border: 0; font-size: var(--text-base);
    line-height: 1; padding: 0 var(--space-0); cursor: pointer; flex: none;
    min-width: 1.5rem; min-height: 1.5rem;
  }
  @media (prefers-reduced-motion: no-preference) {
    .toast { animation: toast-in var(--dur-fast) var(--ease); }
  }
  @keyframes toast-in { from { opacity: 0; } }

  /* Floating label for icon-only controls (tooltip.js), shown on hover
     and on keyboard focus. position:fixed off <body> so a table cell's
     overflow wrapper can't clip it (same reason .toast lives there);
     z-index clears the modal backdrop (100) so the Close × inside a
     dialog gets one too, and stays under the page-progress bar (200).
     Same dark-on-light chip as .toast — one carries confirmation, the
     other a name — so they read as one family. pointer-events:none so
     it never sits between the cursor and the button it describes. */
  .app-tooltip {
    position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none;
    /* Wraps (and keeps a line break it is given) rather than spilling out
       of its box: Flagged's client chips say "California Hospital
       Association — Support if amended", one line per client. A short
       label is still one short line. */
    width: max-content; max-width: 16rem; white-space: pre-line;
    background: var(--ink); color: var(--surface);
    padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
    font-size: var(--text-2xs); font-weight: 600; line-height: 1.3;
    box-shadow: var(--shadow-float);
    opacity: 0; transform: translateY(0.15rem);
  }
  /* Several lines (the sidebar's sync status): the breaks are the text's
     own newlines. */
  .app-tooltip.wrap { white-space: pre-line; max-width: 18rem; }
  .app-tooltip.show { opacity: 1; transform: none; }
  .app-tooltip.below { transform: translateY(-0.15rem); }
  .app-tooltip.below.show { transform: none; }
  /* Beside its control (the folded sidebar's icons): it eases in from the left. */
  .app-tooltip.side { transform: translateX(-0.15rem); }
  .app-tooltip.side.show { transform: none; }
  @media (prefers-reduced-motion: no-preference) {
    .app-tooltip { transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
  }

  /* ── Search results ──
     The results table stopped being a read-only list: it now carries a
     per-row flag control, a selection checkbox, and what the user has
     already decided about each bill. */

  /* Right-aligned action cell, still used by the Capitol directory's
     table (directory_body.html). */
  td.flag-cell { white-space: nowrap; text-align: right; }

  /* A bill the user already tracks: dimmed rather than hidden, since the
     useful signal is "you settled this one", not "this isn't a result".
     Applies to the search result cards (.result-card.tracked-row below)
     and any table row that opts in. */
  tr.tracked-row { background: var(--content-bg); }
  .result-tracked { margin-top: var(--space-1); display: flex; flex-wrap: wrap; gap: var(--space-1); font-size: var(--text-2xs); color: var(--slate); }

  /* ── Search results as cards (Tier 1 rebuild) ──
     The dense results table became a list of bordered cards, one per
     result: a bill number + title, the inferred-status pill and — when
     flagged — the client RAG position badges up in the head, a meta line
     of session/chamber/last-action, and two pill actions (Bill report,
     Flag this bill). Same fields the table row carried (see renderRowsNow
     in LOOKUP_BODY), given room to read. The whole card stays a click
     target to the report (class link-row + data-href, row_nav.js); the
     number, title and Bill-report pill are the reachable anchors in it. */
  /* One grid row per card — [select] bill + meta, status + flag — so a
     card is its title's height plus one meta line, not five stacked
     rows (search/dashboard audit S4: 167px each, four to a screen). */
  /* An <ol role="list"> so a screen reader says "list, 25 items" (audit
     L3); the reset keeps it looking exactly as the <div> did. */
  .result-cards { display: flex; flex-direction: column; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
  /* The results panel has no padding of its own (its head and the
     legend pad themselves, the compact table runs edge to edge), so the
     group heading, the cards and "Show more" sat flush against its
     border at every width. They take the head's inset. */
  .results-panel > .result-group-head, .results-panel > .result-cards,
  .results-panel > .result-more, .results-panel > .save-search-form { margin-inline: var(--space-4); }
  /* The header's View menu drops below the header; .panel's
     overflow: hidden cut it off over a one- or two-result list. */
  .panel.results-panel { overflow: visible; }
  .result-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: start;
    background: var(--surface); border: 1px solid var(--rule-card);
    border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4);
    cursor: pointer; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  }
  .result-card.has-pick { grid-template-columns: auto minmax(0, 1fr) auto; }
  .result-card .pick-label { margin: 0; padding: var(--space-1); }
  .result-card .pick { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-solid); }
  .pick-spacer { display: block; width: 24px; }
  @media (hover: hover) { .result-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-rest); } }
  /* A bill already tracked reads as settled, not as "not a result" — the
     same dim the table row used (tr.tracked-row above), kept here. */
  .result-card.tracked-row { background: var(--content-bg); }
  .result-card-headline { min-width: 0; padding-top: var(--space-0); }
  .result-card-link { display: block; color: var(--ink); text-decoration: none; }
  @media (hover: hover) {
    .result-card-link:hover .result-card-number,
    .result-card-link:hover .result-card-title { color: var(--accent); }
  }
  .result-more { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) 0 0; }
  .result-more .sub { margin: 0; }
  /* The title is the link's headline; the number is its label, leading
     the same line. */
  .result-card-number {
    font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500;
    letter-spacing: 0.01em; color: var(--slate); margin-right: var(--space-2);
  }
  @media (hover: hover) { .result-card-number:hover { color: var(--accent); } }
  .result-card-title {
    font-size: var(--text-base); font-weight: 600; line-height: 1.4; color: var(--ink);
  }
  @media (hover: hover) { .result-card-title:hover { color: var(--accent); } }
  /* The head's right rail: the inferred-status pill, and beneath it the
     RAG position badges when the bill is flagged, right-aligned so the
     two kinds of status stack clear of the title. */
  .result-card-flags {
    flex: none; display: flex; flex-direction: column; align-items: flex-end;
    gap: var(--space-1); text-align: right;
  }
  .result-card-flags .status-badge { margin-bottom: 0; }
  .result-card-flags .result-tracked { margin-top: 0; justify-content: flex-end; }
  .result-card-flags .flag-toggle { margin-left: 0; }
  .result-card .match-note { margin-top: var(--space-1); }
  /* Session as a label + value pair, then the last action — its date and
     what it was. */
  .result-card-meta {
    display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin-top: var(--space-1);
    font-size: var(--text-xs); color: var(--slate);
  }
  .result-card-meta strong { font-weight: 600; color: var(--ink); }
  /* One line however long the action ("Enrolled and presented to the
     Governor at 3 p.m."), ellipsized, the whole text in its title. */
  .result-card-meta .result-card-action {
    min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .result-card-meta .match-meta { font-style: italic; }
  /* The label is the hit area — 24px tall at least, word included. */
  .pick-label {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; min-width: 24px;
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1); margin-left: calc(-1 * var(--space-1)); cursor: pointer;
    font-size: var(--text-xs); color: var(--slate); border-radius: var(--radius-sm);
  }
  @media (hover: hover) { .pick-label:hover { background: var(--content-bg); } }
  /* Flag as an icon toggle: outline at rest, filled once pressed. */
  .flag-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
    min-width: 32px; min-height: 32px; padding: 0 var(--space-2); margin-left: auto;
    background: transparent; color: var(--slate); border: 1px solid var(--rule-strong);
    border-radius: var(--radius-button); font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer;
  }
  .flag-toggle svg { width: 14px; height: 14px; }
  @media (hover: hover) { .flag-toggle:hover { color: var(--accent); border-color: var(--accent); } }
  .flag-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: transparent; cursor: default; }
  .flag-toggle[aria-pressed="true"] svg path { fill: currentColor; }
  /* Flagged, but more clients it could be flagged for: still a button. */
  .flag-toggle-more[aria-pressed="true"] { cursor: pointer; }
  @media (hover: hover) { .flag-toggle-more[aria-pressed="true"]:hover { border-color: var(--accent); } }
  .flag-more { font-weight: 700; }
  /* A followed bill's flag opens a menu (Pick client, Unfollow): the
     wrapper anchors it, and its items read left-aligned and unwrapped
     however narrow the flag column is. */
  .follow-menu { display: inline-block; vertical-align: middle; }
  .follow-menu .row-menu-dropdown { min-width: 11rem; text-align: left; }
  .follow-menu .row-menu-dropdown > * { white-space: nowrap; }
  /* Cards stack full-width on a phone, and the head's right rail drops
     under the title rather than fighting it for the narrow row. */
  @media (max-width: 640px) {
    /* The select box sits top-left, level with the bill number it picks;
       title, meta and the status/flag line all hang from one left edge
       beside it. It used to drop to the bottom-left, by the status line,
       where it read as belonging to the next row (search critique,
       Nov 10). Kept rather than hidden: picking several bills to follow
       at once is as useful on a phone, and Select all is in View. A
       flagged bill's empty spacer keeps its text on the same edge. The
       status/flag line spans the card, under the box too: beside it,
       Follow had no room and wrapped to a line of its own. */
    .result-card, .result-card.has-pick { grid-template-columns: minmax(0, 1fr); }
    .result-card.has-pick { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-2); }
    .result-card-headline { grid-column: -2; grid-row: 1; }
    .result-card > .pick-label { grid-column: 1; grid-row: 1; align-self: start; }
    .result-card > .pick-spacer { grid-column: 1; grid-row: 1; width: 1rem; }
    .result-card-flags {
      grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: center;
      text-align: left; margin-top: var(--space-1);
    }
    /* Status and flag share a line; the client chips, when there are
       any, take the next one. */
    .result-card-flags .result-tracked { justify-content: flex-start; order: 3; flex-basis: 100%; }
    .result-card-flags .flag-toggle, .result-card-flags .follow-menu { margin-left: auto; }
    .result-card-flags .follow-menu .flag-toggle { margin-left: 0; }
    /* Two lines of the latest action, not one: cut at ~35 characters it
       lost what actually happened ("Ordered to third reading…"). */
    .result-card-meta .result-card-action {
      white-space: normal; display: -webkit-box; -webkit-box-orient: vertical;
      -webkit-line-clamp: 2; line-clamp: 2;
    }
  }
  /* A thumb's target on a touch screen: the 32px flag and 24px select box
     were sized for a pointer (search critique, Oct 21). */
  @media (pointer: coarse) {
    .result-card .flag-toggle { min-width: 44px; min-height: 44px; }
    .result-card .pick-label { min-width: 44px; min-height: 44px; justify-content: center; }
  }
  /* On a phone the box's 44px reach spills into the card's padding, so
     the title column gives up the 16px box, not the 44px target: pulled
     up and left, the box itself lands level with the number's line. */
  @media (pointer: coarse) and (max-width: 640px) {
    .result-card > .pick-label { margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) 0 calc(-1 * var(--space-3)); }
  }

  /* The bulk-flag bar, present only while something is selected — an
     empty "0 selected" toolbar would be permanent furniture for an
     occasional action. It follows the results and pins to the bottom of
     the window while they scroll, so it is always beside the box just
     ticked. The tint is layered over the page surface because the bar
     now sits over cards as they scroll past; the soft tint alone lets
     them show through. */
  .selection-bar {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; gap: var(--space-3); flex-wrap: nowrap;
    background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface);
    color: var(--accent); box-shadow: var(--shadow-hover);
    border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-top: var(--space-3);
  }
  /* One line at desktop widths: "Clear" used to wrap to a second line at
     1280px, doubling the bar over the cards. Nothing in it wraps its
     words; a long client name narrows its own picker (ellipsized) rather
     than pushing the buttons down. Only a phone wraps the bar. */
  .selection-bar > * { flex: none; white-space: nowrap; }
  .selection-bar > label { display: inline-flex; align-items: center; gap: var(--space-1); }
  .selection-bar > label:first-of-type { flex: 0 1 auto; min-width: 0; }
  .selection-count { font-weight: 700; font-size: var(--text-sm); }
  .selection-bar select { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  .selection-bar > label:first-of-type select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
  /* A phone wraps it to three rows rather than five: the count with
     Clear, the client picker the full width, then position and Flag. */
  @media (max-width: 640px) {
    .selection-bar { flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
    .selection-bar > .secondary { order: 1; margin-left: auto; }
    .selection-bar > label:first-of-type { order: 2; flex: 1 1 100%; }
    .selection-bar > label:first-of-type select { flex: 1 1 auto; }
    .selection-bar > label ~ label { order: 3; }
    .selection-bar > #bulk-flag-btn { order: 4; }
  }
  /* The bar keeps its own space after the last card, being in the flow;
     this keeps a card tabbed to (or scrolled into view) from landing
     behind it while it is pinned over the list. */
  html:has(.selection-bar) { scroll-padding-bottom: calc(var(--space-8) + var(--space-5)); }
  /* The same bar on the followed-bills list, where it changes the ticked
     bills together (flagged_body.html). It stays in the page while empty
     (hidden), so [hidden] has to beat the display above. Its parts may
     wrap: the action, its value and Apply travel as one group. */
  .selection-bar[hidden], .bulk-bar [hidden] { display: none; }
  .bulk-bar { flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
  .bulk-bar .bulk-change { display: flex; align-items: center; gap: var(--space-2); flex: 0 1 auto; min-width: 0; }
  .bulk-bar .bulk-change label { font-size: var(--text-xs); font-weight: 600; }
  .bulk-bar .bulk-value { display: inline-flex; min-width: 0; }
  .bulk-bar :is(select, input) { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); min-width: 0; max-width: 14rem; width: auto; }
  .bulk-bar .linklike { font-size: var(--text-xs); min-height: 24px; }
  .bulk-bar #bulk-unfollow { margin-left: auto; }
  /* The confirmation (toast.js) sits in the same corner; while the bar is
     up it stands clear of it rather than over its first controls. */
  body:has(#bulk-bar:not([hidden])) .toast { bottom: calc(var(--space-8) + var(--space-7)); }
  .bulk-bar .bulk-error { flex: 1 1 100%; margin: 0; font-size: var(--text-xs); font-weight: 600; color: var(--error); white-space: normal; }
  @media (max-width: 640px) {
    .bulk-bar .bulk-change { flex: 1 1 100%; order: 2; flex-wrap: wrap; }
    .bulk-bar .bulk-value { flex: 1 1 8rem; }
    .bulk-bar .bulk-value :is(select, input) { flex: 1 1 auto; max-width: none; width: 100%; }
    .bulk-bar #bulk-unfollow { order: 1; }
    .bulk-bar .bulk-error { order: 4; }
    body:has(#bulk-bar:not([hidden])) .toast { bottom: calc(var(--space-8) * 3 + var(--space-4)); }
  }
  /* A row's "Flag AB 610 for [client] as [position]", opened by its flag
     button (see flagDraftHtml in LOOKUP_BODY) — the selection bar's two
     choices, for one bill, in the row itself: a full-width last row of
     the card's grid, or a row of its own under a table row. In the flow
     rather than floating, so a table's scroll wrapper can't clip it. */
  .flag-draft {
    grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
    margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
    background: var(--accent-soft); color: var(--accent); cursor: default;
  }
  .flag-draft-label { font-weight: 700; font-size: var(--text-sm); }
  .flag-draft select { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  /* A long client name sized the select past a phone-width card. The
     label is a shrinkable flex row, so the select can give way inside it
     (max-width alone resolves against a label sized by the select). */
  .flag-draft label { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; max-width: 100%; }
  .flag-draft select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
  .flag-draft-row td { padding-top: 0; }
  .flag-draft-row .flag-draft { margin-top: 0; }

  /* ── Search results as a compact table ──
     The same rows as the cards, one line each, for triaging a long
     result set (see resultTableHtml in LOOKUP_BODY). Content-sized
     columns hold to their content; the title takes the slack and wraps
     to at most two lines, and cells pad only --space-1 top and bottom, so
     a row is ~48px and a 1280x800 screen holds 12+ bills (checklist L4;
     untrimmed, a long title wrapped to six lines in a ~200px column).
     The last action's text is one ellipsized line under its date, whole
     in the title tooltip. Scrolls sideways when the column is too narrow
     for it (a laptop with both sidebars open, or a phone); the last two
     rows' status tips open upward so they don't stretch that scroll box
     from the bottom. */
  .result-table-wrap { overflow-x: auto; }
  .result-table { width: 100%; min-width: 42rem; border-collapse: collapse; font-size: var(--text-sm); }
  .result-table th {
    text-align: left; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--slate); padding: 0 var(--space-2) var(--space-2); border-bottom: 1px solid var(--rule-strong);
  }
  .result-table td { padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--rule); vertical-align: top; }
  .result-table tbody tr { cursor: pointer; }
  @media (hover: hover) { .result-table tbody tr:hover { background: var(--content-bg); } }
  .result-table th.col-pick, .result-table td.col-pick { width: 1%; padding-right: 0; }
  .result-table .pick-label { margin-left: 0; padding: var(--space-1); }
  .result-table .pick { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent-solid); }
  .result-table .col-bill, .result-table .col-status, .result-table .col-chamber, .result-table .col-flag { width: 1%; white-space: nowrap; }
  .result-table td.col-bill a { font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500; color: var(--ink); }
  @media (hover: hover) { .result-table td.col-bill a:hover { color: var(--accent); } }
  .result-table td.col-title { line-height: 1.4; }
  .result-table .col-title-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .result-table td.col-title .result-tracked { margin-top: var(--space-1); }
  .result-table .status-badge { margin: 0; }
  .result-table .col-action { width: 11rem; max-width: 11rem; }
  .result-table .col-action-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
  .result-table .col-sub {
    display: block; margin-top: var(--space-0); font-size: var(--text-2xs); color: var(--slate);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .result-table td.col-action .col-sub { max-width: 11rem; }
  .result-table tbody tr:nth-last-child(-n+2) .has-tip > .tip { top: auto; bottom: calc(100% + 6px); }
  .result-table td.col-flag .flag-toggle { margin-left: 0; }
  /* The two drawings, first in the results header's View menu. The
     current one carries a check; a dropdown button is otherwise styled
     as a destructive red row (.row-menu-dropdown button), which these
     aren't. */
  .view-toggle { display: flex; flex-direction: column; gap: var(--space-0); }
  .view-menu-label {
    padding: var(--space-1) var(--space-2) 0; font-size: var(--text-2xs); font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate);
  }
  .view-menu-dropdown { min-width: 11rem; text-align: left; }
  .row-menu-dropdown.view-menu-dropdown button { color: var(--ink); white-space: nowrap; }
  @media (hover: hover) { .row-menu-dropdown.view-menu-dropdown button:hover { background: var(--accent-soft); } }
  .view-menu-dropdown button::before { content: ""; display: inline-block; width: 1.1em; }
  .view-menu-dropdown button[aria-pressed="true"]::before { content: ""; --ic: var(--icon-check); }
  .view-menu-dropdown .view-menu-select { border-top: 1px solid var(--rule); border-radius: 0; }

  /* ── The search page's start state (P2-28) ──
     Two columns under the box: the firm's client interests and this
     browser's recent searches, each a list of one-click queries. Rows,
     not chips: an interest row carries its client and a count, and the
     arrow / magnifier say "press this and a search runs". One column
     alone (a guest has no clients; a fresh browser no history) takes
     the full width; below 768px they stack. */
  .start-columns { margin-top: var(--space-5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-6); }
  .start-columns:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
  @media (max-width: 767px) { .start-columns { grid-template-columns: minmax(0, 1fr); } }
  .start-col[hidden] { display: none; }
  .start-col-head {
    display: flex; align-items: baseline; gap: var(--space-3);
    padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule);
  }
  .start-col-title { margin: 0; font-size: var(--text-base); font-weight: 600; white-space: nowrap; }
  .start-col-sub { font-size: var(--text-xs); color: var(--slate); }
  .start-col-action { margin-left: auto; font-size: var(--text-sm); }
  .start-col-clear { font: inherit; font-size: var(--text-sm); padding: 0; background: none; border: 0; text-decoration: none; cursor: pointer; }
  /* background too, or the base button:hover's fill wins on Clear. */
  @media (hover: hover) { .start-col-action:hover { color: var(--ink); background: none; } }
  .start-list { list-style: none; margin: 0; padding: 0; }
  .start-list > li { border-bottom: 1px solid var(--rule); }
  .start-row {
    display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 3rem;
    padding: var(--space-3) var(--space-3); text-align: left; cursor: pointer;
    font: inherit; color: var(--ink); background: transparent; border: 0; border-radius: 0;
  }
  @media (hover: hover) { .start-row:hover { background: var(--accent-soft); color: var(--ink); } }
  .start-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .start-row-term { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .start-row-sub { font-size: var(--text-sm); color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .start-row-arrow { flex: none; width: 1rem; height: 1rem; color: var(--slate); }
  .start-row-icon { flex: none; width: 1rem; height: 1rem; color: var(--slate); }
  .start-row-wrap { display: flex; align-items: stretch; }
  .start-row-x {
    flex: none; min-width: 2.75rem; padding: 0; font: inherit; font-size: var(--text-md); line-height: 1;
    color: var(--slate); background: transparent; border: 0; border-radius: 0; cursor: pointer;
  }
  @media (hover: hover) { .start-row-x:hover { color: var(--error); background: var(--accent-soft); } }
  .start-tip { margin: var(--space-6) 0 0; font-size: var(--text-sm); color: var(--slate); }
  .start-tip[hidden] { display: none; }
  .start-tip p { margin: var(--space-2) 0 0; }
  #saved-slot:not(:empty) { margin-top: var(--space-5); }
  /* Above results the saved searches fold to one line (whole-app audit
     Y13) — a full card there pushed the first result down its height. */
  #saved-slot:has(> .saved-disclosure) { margin-top: var(--space-3); margin-bottom: var(--space-3); }
  .saved-disclosure > summary {
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.5rem;
    cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--slate);
  }
  @media (hover: hover) { .saved-disclosure > summary:hover { color: var(--ink); } }
  .saved-disclosure-n { font-weight: 400; }
  .saved-disclosure-panel { margin-top: var(--space-2); }
  .saved-disclosure-sub { padding: var(--space-3) var(--space-4) 0; }

  /* ── The search bar: one box, the scope dropdowns inside it ──
     The box is the field, not a card around it: magnifier, input, then
     "Search in" and Session as borderless dropdowns past a divider, the
     Search button beside. The input gives up its own pill and glow to
     the box, so focus lights the whole thing. On a phone the dropdowns
     drop to a row of their own under the input. */
  .search-card-query .lookup-query-form { align-items: stretch; flex-wrap: nowrap; gap: var(--space-3); }
  .search-bar-field {
    flex: 1; min-width: 0; min-height: 3.5rem; padding-right: var(--space-3);
    border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--surface);
  }
  /* The global 2px ring, on the box: the old faint glow was only
     2.03:1 from the resting border (WCAG 2.4.7 / 1.4.11; whole-app
     audit Y26). Same on .search-box and .dir-search-box. */
  .search-bar-field:focus-within {
    border-color: var(--ink);
    outline: 2px solid var(--ink); outline-offset: 2px;
  }
  .search-bar-field .search-field-icon { position: static; margin-left: var(--space-4); width: 1rem; height: 1rem; }
  .search-field.search-bar-field input,
  .search-field.search-bar-field:has(.search-field-clear:not([hidden])) input {
    flex: 1; min-width: 0; align-self: stretch; font-size: var(--text-md);
    padding: 0 var(--space-2) 0 var(--space-3);
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  /* The box already lights up on focus; the input's own :focus-visible
     outline drew a second, square ring inside the rounded one. */
  .search-field.search-bar-field input:focus-visible { outline: none; }
  .search-bar-field .search-field-clear { position: static; flex: none; }
  .search-scope {
    display: flex; align-items: center; gap: var(--space-1); flex: none;
    margin-left: var(--space-2); padding-left: var(--space-2); border-left: 1px solid var(--rule-strong);
  }
  .search-scope:not(:has(> select:not([hidden]))) { display: none; }
  .search-scope-select[hidden] { display: none; }
  .search-scope-select {
    -webkit-appearance: none; appearance: none; font-size: var(--text-base); color: var(--ink);
    padding: var(--space-1) var(--space-5) var(--space-1) var(--space-2);
    border: 0; border-radius: var(--radius-md); background-color: transparent; box-shadow: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%),
                      linear-gradient(135deg, var(--slate) 50%, transparent 50%);
    background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%;
    background-size: 5px 5px; background-repeat: no-repeat;
  }
  .search-scope-select:focus { box-shadow: none; }
  @media (hover: hover) { .search-scope-select:hover { background-color: var(--accent-soft); } }
  .search-card-query .lookup-query-form > button[type="submit"] {
    flex: none; min-height: 3.5rem; padding: 0 var(--space-5); border-radius: var(--radius-md);
    font-size: var(--text-base);
  }
  @media (max-width: 599px) {
    /* The gap under the dropdown row belongs to that row: a bar with
       no dropdowns (or none showing) stays level with its button. */
    .search-bar-field { flex-wrap: wrap; min-height: calc(3.25rem + 2px); }
    .search-field.search-bar-field input { min-height: 3.25rem; flex-basis: calc(100% - 5rem); }
    /* The Search button takes a full-width row under the box. Beside it,
       it squeezed the box until its two dropdowns stacked — a box three
       rows tall with the button floating off its top right (search
       critique, Nov 10). Under it, the box keeps the whole width, so both
       dropdowns share one row. A fixed 44px, not the box's 52px: the
       keyboard's own Search key makes the same press. */
    .search-card-query .lookup-query-form { flex-wrap: wrap; gap: var(--space-2); }
    .search-card-query .lookup-query-form > .search-bar-field { flex-basis: 100%; }
    .search-card-query .lookup-query-form > button[type="submit"] {
      flex: 1 1 100%; height: 2.75rem; min-height: 0; padding: 0 var(--space-4);
    }
    /* Bill-number suggestions hang from the box, over the button, not
       under it: the button's height and the gap above it, taken back. */
    .search-card-query .bill-suggest { top: calc(100% - 2.75rem - var(--space-2) + var(--space-1)); }
    .search-scope { flex-basis: 100%; margin-left: 0; padding-left: var(--space-2); border-left: 0; border-top: 1px solid var(--rule); padding-top: var(--space-1); padding-bottom: var(--space-1); }
  }

  /* ── The search page's two columns ──
     The search bar pins to the top of the viewport; beneath it, filters
     in a sticky left column and results to their right, so narrowing a
     long result set never means scrolling back up to reach a control.

     The document scrolls, not .app-main (see .app-main), which is what
     lets anything pin. The bar is a band of page background around the search card,
     so what scrolls beneath it is hidden rather than peeking past the
     card's rounded corners. The sidebar's `top` is the bar's measured
     height (--lookup-bar-h, set by LOOKUP_BODY's ResizeObserver), and it
     scrolls within itself if it outgrows the viewport. Status tips are
     held to the column's width so they never widen that scroll box.

     Two columns need room: below 1100px (a laptop with the app sidebar
     open leaves the results 480px) the filters go back to being the
     horizontal rail above the results. Below 900px nothing pins either:
     a pinned search card is a third of a phone screen. */
  .lookup-search-bar > .search-card-query { margin-bottom: 0; }
  /* relative: the "Skip to results" link inside it is revealed at the
     bar's corner, not the page's, when the bar isn't pinned. */
  .lookup-search-bar { position: relative; margin-bottom: var(--space-4); }
  /* "Finding bills for <client>" under the query row (LOOKUP_BODY's
     renderClientContext) — one wrapping line, not a card. */
  .client-context { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); font-size: var(--text-sm); color: var(--slate); }
  .client-context[hidden] { display: none; }
  .client-context strong { color: var(--ink); }
  /* "Bill text: 2 of about 4,200 bills indexed — results are incomplete."
     under the query row while a local index is partial (Oct 7 audit B2). */
  .search-coverage { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--slate); }
  .search-coverage[hidden] { display: none; }
  .lookup-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3) var(--space-4); align-items: start; }
  .lookup-main { min-width: 0; }
  /* The count is one phrase; the view controls beside it wrap instead. */
  .lookup-main .panel-head > .sub { white-space: nowrap; }
  /* Where the matches were found, on a line of its own under the count:
     it is a sentence, and wraps like one. */
  .lookup-main .panel-head .count-split { display: block; white-space: normal; margin-top: var(--space-0); }
  .lookup-sidebar .search-filters { margin-bottom: 0; }
  /* Below 768px the rail is out of the page and behind the results
     header's Filters button, opening as .filter-sheet (LOOKUP_BODY's
     railHtml): stacked open above the results it pushed the first bill
     two screens down. */
  @media (max-width: 767px) {
    .lookup-sidebar:not(.filter-sheet) { display: none; }
  }
  /* The sheet is the frame; the rail's own card inside it was a second. */
  .lookup-sidebar.filter-sheet .search-filters { border: 0; padding: 0; background: none; }
  /* Whatever Tab or a skip link brings into view stops below the pinned
     bar rather than under it (WCAG 2.4.11; search critique, Oct 21). */
  @media (min-width: 901px) {
    .lookup-main :is(a, button, input, select, [tabindex]) {
      scroll-margin-top: calc(var(--lookup-bar-h, 0px) + var(--space-3));
    }
  }
  @media (min-width: 901px) {
    /* No band above the bar: at rest it sits under the page heading,
       and pinned it meets the window's top edge. */
    .lookup-search-bar {
      position: sticky; top: 0; z-index: 15; background: var(--shell-main);
      padding: 0 0 var(--space-3); margin: 0 0 var(--space-1);
    }
  }
  /* No left rail since Nov 25 2026: the filters are one wrapping bar
     above the list at every width that shows them (the phone keeps its
     Filters sheet), so the bills take the whole width and the box above
     never shifts when a rail appears (design critique, Nov 24 2026). */
  @media (min-width: 768px) {
    .lookup-page .lookup-sidebar .search-filters {
      padding: var(--space-2) 0; border: 0; border-block: 1px solid var(--rule); border-radius: 0; background: none;
    }
    .lookup-sidebar .facet-groups { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }
    .lookup-sidebar .filter-group { gap: var(--space-1) var(--space-2); }
    .lookup-sidebar .filter-group-head { border-right: 0; padding-right: 0; }
    .lookup-sidebar .filter-group-head .filter-group-label, .lookup-sidebar .filter-group-label { min-width: 0; }
    .lookup-sidebar .filter-select { width: auto; max-width: 18rem; }
    .lookup-sidebar .filter-tab { border-color: transparent; background: var(--paper-250); }
    .lookup-sidebar .filter-tab .n { margin-left: var(--space-1); color: var(--ink-2); }
  }

  /* ── Search filters (P1-11) ──
     The rail above the results. Every dimension here is DERIVED from a
     field getSearch already returns (see _shape_search_rows in
     legiscan_client.py) — chamber and measure type off the bill number's
     prefix, session off the result's own LegiScan URL, status off the
     last-action text via bill_status.js. Nothing here costs an API call,
     which is why filtering a 150-row result set is affordable at all.

     Author and committee are deliberately absent: getSearch carries
     neither, and the only way to know them is a getBill per row. Same
     house rule as the 601's "Known gaps" card — leave out what we can't
     know rather than guess it. */
  .search-filters {
    display: flex; flex-direction: column; gap: var(--space-3);
    background: var(--surface);
    border-radius: var(--radius-md); padding: var(--space-4) var(--space-4); margin-bottom: var(--space-3);
  }
  .filter-group { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
  /* The three client-side facet groups flow together and wrap as units,
     instead of each claiming a full row of its own. A wider column-gap
     than the gap inside a group keeps the groups reading as separate
     things once two share a line. */
  /* One row per facet group, labels in a left column — groups flowing
     together read as one run of pills with no clear boundaries. */
  .facet-groups { display: flex; flex-direction: column; gap: var(--space-2); }
  /* A group label with a shortcut beside it — Status's "Active only",
     which is a preset over that group's own tabs. */
  .filter-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
  /* In a wrapping row the preset would read as one more status; a rule
     after it sets it apart. The sidebar's column layout doesn't need it. */
  .filter-group-head { padding-right: var(--space-2); border-right: 1px solid var(--rule); }
  .filter-group-head .filter-group-label { min-width: 5.5rem; }
  .save-search-open, .result-controls .linklike { font-size: var(--text-xs); }
  .save-search-open { padding: var(--space-1) var(--space-3); }
  /* Opens beneath the results header, spanning it. */
  .save-search-form {
    display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-xs);
    margin: 0 0 var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule);
  }
  .save-search-form label { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--slate); }
  .save-search-note { flex-basis: 100%; margin: 0; }
  .save-search-form input { padding: var(--space-1) var(--space-2); font-size: var(--text-xs); }
  /* At phone width the inline label + field pairs wrapped "Save for
     client:" onto three lines beside a select wider than the panel. Each
     label goes above its own full-width field instead. */
  @media (max-width: 767px) {
    .save-search-form label { flex: 1 1 100%; flex-direction: column; align-items: stretch; min-width: 0; }
    .save-search-form input, .save-search-form select { width: 100%; min-width: 0; }
  }
  /* min-height: the uppercase label alone made an 18px target (WCAG
     2.5.8 wants 24px; see .linklike's standalone rule). */
  .filter-group-toggle {
    background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.5rem;
  }
  /* The fold mark at the label's own size: at --text-2xs it was a 6px
     triangle, easy to miss as the one sign the group opens. */
  .filter-group-toggle::after { content: ""; --ic: var(--icon-chevron); font-size: var(--text-sm); }
  .filter-group-toggle[aria-expanded="true"]::after { transform: rotate(90deg); }
  .filter-group-folded { margin: 0; font-size: var(--text-xs); }
  .filter-group-folded-key { font-weight: 600; }
  .filter-group-label {
    font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--slate); min-width: 5.5rem;
  }
  .filter-group .filter-tab { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  /* A filter that would empty the list is shown, disabled, with its zero
     visible — "no Senate bills here" is an answer, and a control that
     silently vanishes teaches the user the filter is unreliable.

     Which is exactly why this can't be a blanket opacity: 0.45 over
     --slate measured 1.94:1, and a count nobody can read is not an
     answer either. WCAG's exemption for inactive controls doesn't cover
     a disabled control being used to carry information. The border
     fades instead — it's decoration here — and the text stays at
     --slate's 5.8:1. "Off" now reads from the flat, borderless shape
     and the zero, not from the text being faint. */
  .filter-tab[disabled] {
    cursor: default; color: var(--slate);
    background: transparent; border-color: var(--rule);
  }
  /* The zero-count facet tab: same look, but aria-disabled so it stays
     focusable and announced rather than skipped. */
  .filter-tab[aria-disabled="true"] { cursor: default; color: var(--slate); background: transparent; border-color: var(--rule); }
  @media (hover: hover) { .filter-tab[disabled]:hover, .filter-tab[aria-disabled="true"]:hover { border-color: var(--rule); } }
  /* The results panel head's right cluster: how you view the set (view,
     Sort, Select all) and what to do with the whole search (Save). What
     is IN the set — Active only, Hide N tracked — is the rail's; here
     they read as view switches that quietly moved the rail's status
     tabs (search/dashboard audit S9). */
  .result-controls { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
  .result-controls .filter-tab { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); }
  .view-sort {
    display: inline-flex; align-items: center; gap: var(--space-1);
    font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate);
  }
  .view-sort select {
    font: inherit; font-size: var(--text-xs); font-weight: 400; letter-spacing: 0; text-transform: none;
    padding: var(--space-1) var(--space-2);
  }
  /* Save this search lives in the View menu on a phone (and only
     there): the header's own button hides and the menu's item shows. */
  .view-menu-dropdown .view-menu-save { display: none; }
  /* On a phone: Filters, Sort, View on one line, the count on its own
     above. Sort takes what the two buttons leave, its select shrinking
     to fit (a phone's 16px select was as wide as its longest option,
     so Sort took a row of its own, alone on the right — search critique,
     Nov 10). A "Saved as" note, when there is one, takes the next line. */
  @media (max-width: 767px) {
    .result-controls { flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }
    .result-controls .filter-sheet-btn { order: 0; flex: none; }
    .result-controls .view-sort { order: 1; flex: 1 1 0; min-width: 0; }
    /* The word stays the select's name for a screen reader; on screen
       the select alone, so "Last action: newest" fits beside the two
       buttons. */
    .result-controls .view-sort-word {
      position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .result-controls .view-sort select { flex: 1 1 auto; min-width: 0; width: 100%; text-overflow: ellipsis; }
    .result-controls .view-menu { order: 2; flex: none; margin-left: auto; }
    .result-controls > [role="status"] { order: 3; flex-basis: 100%; }
    .result-controls > .save-search-open { display: none; }
    .view-menu-dropdown .view-menu-save { display: block; border-top: 1px solid var(--rule); border-radius: 0; }
  }

  /* Active filters restated as removable chips. The tabs above already
     show their own state, but once three groups are set the only way to
     see everything that is narrowing the list — without reading four
     rows of controls — is one line that says so. */
  .active-filters {
    display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
    border-top: 1px solid var(--rule); padding-top: var(--space-3);
  }
  /* Empty, the row takes no room at all: holding a chip's height left a
     ~50px dead band (and, in dark, an empty strip) between the filters
     and the results (search critique, Nov 10 2026). Picking a filter
     happens in the rail above this row, so the row opening up moves the
     results, not the control under the pointer. */
  .active-filters { min-height: 1.7rem; }
  .active-filters.is-empty { display: none; }
  .filter-chip {
    font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: var(--space-1);
    background: var(--accent-soft); color: var(--accent); border: none;
    border-radius: var(--radius-pill); padding: var(--space-1) var(--space-2);
  }
  @media (hover: hover) { .filter-chip:hover { background: var(--accent-solid); color: var(--accent-solid-text); } }
  .filter-chip .x { font-size: var(--text-sm); line-height: 1; }
  .filter-clear { font-size: var(--text-xs); }

  /* ── Bill search v5 (docs/design-system) ──
     Laid over the search rules above, scoped to .lookup-page since the
     filter tabs, chips, rail, saved-search rows, status pills and the
     search field are shared with Flagged bills, Lobbying, Alerts and a
     client's page. Serif page and card titles; white 18px cards on a
     hairline with no shadow and no header rule; result, start-state and
     saved-search rows inset with their own 12px corners, tinting on
     hover (CardRow); labels and column heads in sentence case; bill
     numbers mono navy before the title (BillNumber); filter chips
     borderless neutral pills (FilterChip); a picked filter tinted navy
     (FilterDropdown); status the Flagged list's white StatusDot pill.
     Buttons and fields keep the app's own shape. */
  .lookup-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .lookup-page .lookup-query-form { margin: 0; }
  .lookup-page .results-count, .lookup-page .flag-choice-field { margin: 0; }
  .lookup-page #saved-panel { margin-bottom: var(--space-4); }

  /* Cards: the results, the saved searches and the filter rail. */
  .lookup-page .panel-head { border-bottom: 0; }
  .lookup-page .panel-head .title {
    font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em;
  }
  .lookup-page .panel-head .sub { color: var(--ink-2); }
  .lookup-page .search-filters { border-color: var(--rule); border-radius: var(--radius-lg); }
  .lookup-page .filter-sheet-head .title { font-weight: 500; }

  /* Result rows: inset 4px from the card's edge, their text level with
     the head's; no border of their own, a tint on hover. */
  .lookup-page .results-panel > .result-cards { margin-inline: var(--space-1); gap: var(--space-0); }
  .lookup-page .result-card { border: 0; border-radius: var(--radius-md); padding: var(--space-3); }
  @media (hover: hover) { .lookup-page .result-card:hover { background: var(--paper-50); box-shadow: none; } }
  .lookup-page .result-card-number, .lookup-page .result-table td.col-bill a {
    font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; color: var(--link);
  }
  .lookup-page .result-card-title { font-size: var(--text-sm); font-weight: 500; }
  /* A phone fits more bills a screen: 8px above and below, not 12px.
     The 44px select box and Follow set each row's floor, not padding. */
  @media (max-width: 640px) { .lookup-page .result-card { padding-block: var(--space-2); } }
  /* Links go to ink on hover: the title underlines, the number stays navy. */
  @media (hover: hover) {
    .lookup-page .result-card-number:hover,
    .lookup-page .result-card-link:hover .result-card-number,
    .lookup-page .result-table td.col-bill a:hover { color: var(--link); }
    .lookup-page .result-card-title:hover,
    .lookup-page .result-card-link:hover .result-card-title { color: var(--ink); }
  }
  .lookup-page .result-card-meta { color: var(--ink-2); }
  .lookup-page .result-card-meta strong { font-weight: 500; }
  .lookup-page .result-group-head { font-weight: 500; }
  .lookup-page .result-group-head.is-text-only h3 { font-weight: 500; }

  /* StatusDot pill: a white pill on a hairline, the word in --ink-2, the
     stage glyph alone carrying the stage's colour (as on Flagged bills). */
  .lookup-page .status-badge[class*="tone-"] { background: var(--surface); border-color: var(--rule); color: var(--ink-2); }
  .lookup-page .status-badge.tone-early::before { color: var(--muted); }
  .lookup-page .status-badge.tone-moving::before { color: var(--link); }
  .lookup-page .status-badge.tone-passed::before { color: var(--good); }
  .lookup-page .status-badge.tone-ended::before { color: var(--error); }

  /* The compact table: a tinted, rounded head band in sentence case,
     inset from the card's edge; rows tint on hover. */
  .lookup-page .result-table-wrap { padding: 0 var(--space-2); }
  .lookup-page .result-table { border-collapse: separate; border-spacing: 0; }
  .lookup-page .result-table th {
    padding-top: var(--space-2); border-bottom: 0; background: var(--paper-50);
    font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .lookup-page .result-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
  .lookup-page .result-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
  .lookup-page .result-table th:first-child, .lookup-page .result-table td:first-child { padding-left: var(--space-3); }
  .lookup-page .result-table tbody tr:last-child td { border-bottom: 0; }
  @media (hover: hover) { .lookup-page .result-table tbody tr:hover td { background: var(--paper-50); } }

  /* The header's Sort and View menu labels, in sentence case. */
  .lookup-page .view-sort, .lookup-page .view-menu-label {
    font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2);
  }

  /* The filter rail: sentence-case group labels; a picked filter tints
     navy and keeps its leading check, so it never rests on colour. */
  .lookup-page .filter-group-label { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
  .lookup-page .filter-tab { font-weight: 500; }
  .lookup-page .filter-tab.active:not([disabled]):not([aria-disabled="true"]) { background: var(--info-soft); border-color: var(--link); color: var(--link); }
  @media (hover: hover) {
    .lookup-page .filter-tab.active:not([disabled]):not([aria-disabled="true"]):hover { background: var(--info-soft); color: var(--link); }
  }
  /* FilterChip: a borderless neutral pill with its ×; "Clear all" a link. */
  .lookup-page .filter-chip { background: var(--paper-250); color: var(--ink-2); font-weight: 500; }
  @media (hover: hover) { .lookup-page .filter-chip:hover { background: var(--paper-350); color: var(--ink); } }
  .lookup-page .filter-chip .x { color: var(--muted); }
  .lookup-page .filter-clear { font-size: var(--text-xs); font-weight: 500; color: var(--link); text-decoration: none; }
  @media (hover: hover) { .lookup-page .filter-clear:hover { color: var(--ink); } }

  /* The start state: each column a card with a serif title and inset
     rows; "Edit in Clients →" and "Clear" muted text actions. Each card
     holds to its own rows rather than stretching to its neighbour's. */
  .lookup-page .start-columns { align-items: start; }
  .lookup-page .start-col {
    background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-1);
  }
  .lookup-page .start-col-head { padding: var(--space-2) var(--space-3) var(--space-1); border-bottom: 0; }
  .lookup-page .start-col-title {
    font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em;
  }
  .lookup-page .start-col-sub { color: var(--ink-2); }
  .lookup-page .start-col-action { font-size: var(--text-xs); font-weight: 500; text-decoration: none; }
  .lookup-page .start-list > li { border-bottom: 0; }
  .lookup-page .start-row, .lookup-page .start-row-x { border-radius: var(--radius-md); }
  .lookup-page .start-row-term { font-weight: 500; }
  .lookup-page .start-row-sub { font-size: var(--text-xs); color: var(--ink-2); }
  @media (hover: hover) {
    .lookup-page .start-row:hover { background: var(--paper-50); }
    .lookup-page .start-row-x:hover { background: var(--paper-50); }
  }
  .lookup-page .start-tip { color: var(--ink-2); }

  /* Saved searches: a card of inset rows; "N new" the accent count pill. */
  .lookup-page #saved-panel.panel, .lookup-page .saved-disclosure-panel { padding: var(--space-1); }
  .lookup-page #saved-panel .panel-head { padding: var(--space-2) var(--space-3) var(--space-1); }
  .lookup-page .saved-disclosure-sub { padding: var(--space-2) var(--space-3) var(--space-1); color: var(--ink-2); }
  .lookup-page .saved-disclosure > summary { font-weight: 500; color: var(--ink-2); }
  .lookup-page #saved-list .saved-row { border-bottom: 0; border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); align-items: center; }
  @media (hover: hover) { .lookup-page #saved-list .saved-row:hover { background: var(--paper-50); } }
  .lookup-page .saved-name { font-weight: 500; }
  @media (hover: hover) { .lookup-page .saved-name:hover { color: var(--ink); } }
  .lookup-page .saved-meta { font-size: var(--text-xs); color: var(--ink-2); }
  .lookup-page .unread-dot {
    height: auto; padding: 0 var(--space-2); background: var(--info-soft); color: var(--link);
    font-weight: 500; line-height: 1.4;
  }

  /* ── One place for the box (Nov 25 2026 layout) ──
     The box sits where every page's content starts, at the same width and
     height before a search and after one: the old centred front door
     moved it ~440px and changed its height on every search (design
     critique, Nov 24 2026). Under it, "Search in" as a row of choices,
     then the start page's two columns or the results. */
  .lookup-page .search-bar-field { min-height: 3.25rem; border-radius: var(--radius-md); }
  .lookup-page .search-bar-field input { font-size: var(--text-md); }
  @media (min-width: 600px) {
    .lookup-page .search-card-query .lookup-query-form > button[type="submit"] { min-height: 3.25rem; padding: 0 var(--space-5); }
  }
  .lookup-page .page-head .sub[hidden] { display: none; }

  /* Search in: a quiet label, a wrapping row of pressable choices (the
     one in use filled), the analyses page as a link, the word tricks at
     the far end. */
  .search-in {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-2);
    margin: 0 0 var(--space-5);
  }
  .search-in-label { font-size: var(--text-xs); color: var(--ink-2); margin-right: var(--space-1); }
  .search-in-choices { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
  .search-in-choice, .search-in-link {
    display: inline-flex; align-items: center; min-height: 2rem; padding: 0 var(--space-3);
    border: 1px solid var(--rule-card); border-radius: var(--radius-pill); background: var(--surface);
    color: var(--ink); font-size: var(--text-sm); font-weight: 500; box-shadow: none; white-space: nowrap;
  }
  .search-in-choice[aria-pressed="true"] { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-solid-text); }
  .search-in-choice:disabled { color: var(--muted); border-style: dashed; cursor: default; }
  .search-in-note { margin-left: var(--space-1); font-weight: 400; }
  .search-in-link { text-decoration: none; color: var(--ink-2); border-color: transparent; background: none; }
  @media (hover: hover) {
    .search-in-choice[aria-pressed="false"]:not(:disabled):hover { background: var(--paper-50); border-color: var(--rule-strong); color: var(--ink); }
    .search-in-link:hover { color: var(--ink); }
  }
  .search-in-tips { margin: 0 0 0 auto; font-size: var(--text-xs); color: var(--ink-2); }
  .search-in-tips[hidden] { display: none; }
  .search-in-tips code { font-size: var(--text-xs); white-space: nowrap; }
  /* The pinned bar's own bottom margin is the gap to the row. */
  .lookup-page .lookup-search-bar { margin-bottom: var(--space-3); }
  @media (min-width: 901px) { .lookup-page .lookup-search-bar { margin-bottom: 0; } }

  /* The start page: two columns, your searches then what's new. #start-
     state only groups them in the markup; its children take the grid's
     cells beside #saved-slot. */
  .lookup-page.is-start .start-layout {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto 1fr;
    column-gap: var(--space-7); align-items: start;
  }
  .lookup-page.is-start #start-state:not([hidden]) { display: contents; }
  .lookup-page.is-start #saved-slot { grid-column: 1; grid-row: 1; }
  .lookup-page.is-start .start-columns { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: var(--space-4); margin: 0; }
  .lookup-page.is-start #start-empty { grid-column: 1; grid-row: 3; }
  .lookup-page.is-start .start-new { grid-column: 2; grid-row: 1 / -1; }
  @media (max-width: 767px) {
    .lookup-page.is-start .start-layout { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
    .lookup-page.is-start .start-new { grid-column: 1; grid-row: auto; }
  }
  .lookup-page.is-start #saved-slot:not(:empty) { margin-bottom: var(--space-4); }
  /* Every block in either column is a plain titled list on the page, no
     card around it: the titles line up across the two columns. */
  .lookup-page.is-start :is(#saved-panel, .start-col) { padding: 0; border: 0; background: none; box-shadow: none; }
  .lookup-page.is-start #saved-panel .panel-head, .lookup-page.is-start .start-col-head { padding: 0 0 var(--space-2); }
  .lookup-page.is-start #saved-panel .panel-head .title, .lookup-page .start-col-title {
    font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; color: var(--ink); margin: 0;
  }
  .lookup-page.is-start #saved-panel .panel-head .sub { font-size: var(--text-xs); }
  .lookup-page.is-start #saved-list { border-top: 1px solid var(--rule); }
  .lookup-page.is-start #saved-list .saved-row { border-radius: 0; border-bottom: 1px solid var(--rule); padding: var(--space-2) 0; }
  .lookup-page.is-start .start-list { border-top: 1px solid var(--rule); }
  .lookup-page.is-start .start-list > li { border-bottom: 1px solid var(--rule); }
  .start-empty-text { margin: var(--space-2) 0; font-size: var(--text-sm); color: var(--ink-2); max-width: 32rem; }
  .start-empty-link { font-size: var(--text-sm); font-weight: 500; }

  /* Describe it: one big soft box, its one-line promise of what's sent,
     then the words it searched as chips to remove or add to. */
  /* block: forms are a flex row app-wide. */
  .describe-form { display: block; margin: 0 0 var(--space-4); }
  .describe-form[hidden], .describe-terms[hidden] { display: none; }
  .describe-box {
    display: flex; flex-direction: column; gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-3); border: 1px solid var(--rule);
    border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-rest);
  }
  .describe-box:focus-within { border-color: var(--rule-strong); box-shadow: var(--ring-focus); }
  .describe-box textarea {
    min-height: 3.5rem; padding: 0; border: 0; background: none; box-shadow: none;
    width: 100%; font-size: var(--text-base); line-height: 1.5; resize: vertical;
  }
  .describe-box textarea:focus { outline: none; box-shadow: none; }
  .describe-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
  .describe-note { flex: 1 1 14rem; font-size: var(--text-xs); color: var(--ink-2); }
  .describe-note.is-blocked { color: var(--error); }
  .describe-terms { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--paper-50); }
  .describe-terms-head { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--ink-2); }
  .describe-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .describe-add { display: inline-flex; flex: 0 0 auto; width: auto; margin: 0; order: 1; }
  .describe-add input { width: 9rem; min-height: 2rem; border-style: dashed; border-radius: var(--radius-pill); font-size: var(--text-sm); }

  /* A result is two lines (Nov 25 2026 layout): number and title, then
     status and Follow, on the first; author, committee, version and the
     latest action on the second, each line cut rather than wrapped — the
     whole title is the link's tooltip, the whole action its own. Rows
     sit on the page between hairlines in both themes. */
  .lookup-page .results-panel > .result-cards { gap: 0; }
  .lookup-page .result-card {
    background: none; border-radius: 0; border-bottom: 1px solid var(--rule-soft);
    padding: var(--space-3) var(--space-2); align-items: center;
  }
  .lookup-page .result-card.tracked-row { background: none; }
  @media (min-width: 768px) {
    .lookup-page .result-card-link { display: flex; align-items: baseline; min-width: 0; }
    .lookup-page .result-card-number { flex: none; min-width: 4.75rem; }
    .lookup-page .result-card-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lookup-page .result-card-meta { flex-wrap: nowrap; overflow: hidden; column-gap: var(--space-3); }
    .lookup-page .result-card-meta > * { flex: none; white-space: nowrap; }
    .lookup-page .result-card-meta > .result-card-action { flex: 1 1 auto; min-width: 0; }
    .lookup-page .result-card-flags { flex-direction: row; align-items: center; gap: var(--space-2); }
    .lookup-page .result-card-flags .result-tracked { order: -1; }
  }
  /* On a phone, once results are on screen, the page gives them the
     room: the heading goes (still there for a screen reader), the
     Search in row is one line to swipe, and a card's title gets two
     lines and its details one (design critique: one bill a screen). */
  @media (max-width: 767px) {
    .lookup-page:not(.is-start) .page-head h1 {
      position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .lookup-page:not(.is-start) .page-head { margin: 0; }
    .lookup-page:not(.is-start) .search-in { flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--space-3); scrollbar-width: none; }
    .lookup-page:not(.is-start) .search-in-choices { flex-wrap: nowrap; }
    .lookup-page:not(.is-start) :is(.search-in-label, .search-in-tips) { display: none; }
    .lookup-page .search-in-tips { flex-basis: 100%; margin: 0; }
    .lookup-page .result-card { padding: var(--space-2) var(--space-1); }
    /* Status and Follow stack at the card's right edge, beside the
       title, rather than taking a line of their own under it. */
    .lookup-page .result-card, .lookup-page .result-card.has-pick { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); align-items: start; }
    .lookup-page .result-card.has-pick { grid-template-columns: auto minmax(0, 1fr) auto; }
    .lookup-page .result-card-headline { grid-column: -3; grid-row: 1; }
    .lookup-page .result-card-flags {
      grid-column: -2; grid-row: 1; flex-direction: column; flex-wrap: nowrap; align-items: flex-end;
      gap: var(--space-1); margin-top: 0; text-align: right;
    }
    .lookup-page .result-card-flags .result-tracked { order: 0; flex-basis: auto; justify-content: flex-end; }
    .lookup-page .result-card-flags :is(.flag-toggle, .follow-menu) { margin-left: 0; }
    /* Once results are in, the box is one line: the session beside the
       words, small, and the keyboard's own Search key (the box asks for
       it) in place of a full-width button. */
    .lookup-page:not(.is-start) .search-bar-field { flex-wrap: nowrap; min-height: 2.75rem; }
    .lookup-page:not(.is-start) .search-field.search-bar-field input { min-height: 2.75rem; flex: 1 1 0; font-size: var(--text-base); }
    .lookup-page:not(.is-start) .search-scope {
      flex: none; flex-basis: auto; border-top: 0; border-left: 1px solid var(--rule); padding: 0 var(--space-1);
    }
    .lookup-page:not(.is-start) .search-scope-select { font-size: var(--text-xs); max-width: 7rem; }
    .lookup-page:not(.is-start) .search-card-query .lookup-query-form > button[type="submit"] { display: none; }
    .lookup-page:not(.is-start) .search-card-query .bill-suggest { top: calc(100% + var(--space-1)); }
    .lookup-page .result-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
    /* One line, cut with an ellipsis wherever it runs out. */
    .lookup-page .result-card-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: var(--space-0); }
    .lookup-page .result-card-meta > * { display: inline; margin-right: var(--space-3); }
    .lookup-page .result-card-meta > .result-card-version { display: none; }
    .lookup-page .result-card-flags { margin-top: var(--space-1); }
  }

  /* New at the Capitol: a list, one row per morning list — its name and
     day on the left, how many are left to read on the right. A day that
     printed none says so and greys. */
  .lately { margin-bottom: var(--space-3); }
  .lately .start-col-title { margin: 0 0 var(--space-2); }
  .lately-cards { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
  .lately-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: center;
    padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--rule);
    color: var(--ink); text-decoration: none;
  }
  .lately-card strong { grid-column: 1; font-size: var(--text-sm); font-weight: 500; }
  .lately-card span { grid-column: 1; font-size: var(--text-xs); color: var(--ink-2); }
  .lately-count { grid-column: 2; grid-row: 1 / span 2; font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
  .lately-card.is-empty strong, .lately-card.is-empty .lately-count { color: var(--muted); font-weight: 500; }
  @media (hover: hover) { .lately-card:hover { background: var(--paper-50); color: var(--ink); } }

  /* Author and latest version on a result; an author's name searches
     their other bills. */
  .author-offer { margin: 0 0 var(--space-3); }
  .changed-notice { margin: 0 0 var(--space-3); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; }
  .changed-notice .sub { display: block; margin-top: var(--space-1); font-family: var(--font-sans); font-size: var(--text-sm); color: var(--ink-2); }
  /* The controls under that heading: a "changed" search's kind, quick
     picks and two dates, or a committee search's picker. One wrapping row. */
  .date-range { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
  .date-range select, .date-range input[type="date"] {
    width: auto; min-width: 0; max-width: 100%; margin: 0; min-height: 2rem; font-size: var(--text-sm);
  }
  .date-range-field { display: inline-flex; align-items: center; gap: var(--space-1); margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
  .date-step { display: inline-flex; gap: var(--space-3); font-size: var(--text-sm); }
  /* Browse by date or committee, on the start page: a committee picker
     and two dates, as two quiet cards folded behind one line. */
  .browse { margin-bottom: var(--space-4); }
  .browse > summary, .start-tip > summary {
    display: inline-block; width: auto; font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); cursor: pointer;
    border-radius: var(--radius-button);
  }
  .browse > summary::before, .start-tip > summary::before { content: "+ "; }
  .browse[open] > summary::before, .start-tip[open] > summary::before { content: "\2212  "; }
  .browse > summary::-webkit-details-marker, .start-tip > summary::-webkit-details-marker { display: none; }
  .browse > summary, .start-tip > summary { list-style: none; }
  @media (hover: hover) { .browse > summary:hover, .start-tip > summary:hover { color: var(--ink); } }
  .browse[open] > summary { margin-bottom: var(--space-2); }
  .browse-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: var(--space-2); }
  .browse-form {
    display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); min-width: 0; margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--surface);
  }
  .browse-form[hidden] { display: none; }
  .browse-form > label, .browse-label { margin: 0; font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .browse-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); width: 100%; min-width: 0; }
  .browse-row select, .browse-row input[type="date"] { width: auto; min-width: 0; max-width: 100%; margin: 0; font-size: var(--text-sm); }
  .browse-row #browse-committee { flex: 1 1 12rem; }
  .browse-date { display: inline-flex; align-items: center; gap: var(--space-1); margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
  /* "Include coauthors", under the bar in an author search. */
  .search-option { display: inline-flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--ink-2); }
  .search-option[hidden] { display: none; }
  .search-option input { width: auto; margin: 0; }
  /* The rail's one dropdown: the committee a bill sits in. */
  .filter-select { width: 100%; max-width: 100%; margin: 0; min-height: 2rem; font-size: var(--text-xs); }
  .result-card-role.is-lead { font-weight: 600; }
  /* "Budget · Trailer bill" (budget_bills.py) — on search rows, the
     Followed list and the Budget view. A label, not a status pill. */
  .budget-badge {
    display: inline-block; padding: 0 var(--space-2); border-radius: var(--radius-sm);
    font-size: var(--text-xs); font-weight: 600; line-height: 1.6; white-space: nowrap;
    color: var(--slate); background: var(--accent-soft);
  }
  /* Reviewed: the row's own button (the Follow button's shape, green once
     pressed), who reviewed it in the meta line, and the bar above the list
     with what's left and "Mark all shown". */
  .review-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
    min-height: 32px; padding: 0 var(--space-2); white-space: nowrap;
    background: transparent; color: var(--slate); border: 1px solid var(--rule-strong);
    border-radius: var(--radius-button); font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer;
  }
  @media (hover: hover) { .review-toggle:hover { color: var(--accent); border-color: var(--accent); } }
  .review-toggle[aria-pressed="true"] { color: var(--good); background: var(--good-soft); border-color: transparent; }
  .result-card-review em { font-style: normal; color: var(--warn); }
  .col-review { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
  .col-review .review-toggle { min-height: 1.5rem; }
  .review-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); padding: var(--space-2) var(--space-3);
    border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-50);
    font-size: var(--text-sm); color: var(--ink-2);
  }
  .review-bar strong { color: var(--ink); }
  .saved-list-notice { margin: 0 0 var(--space-3); }
  /* A failed search's way out: Try again, and for All sessions the current
     session instead — under the error's sentence or after the saved-list
     notice, wrapping on a phone rather than overflowing. */
  .search-recovery { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
  #error .search-recovery { display: flex; margin-top: var(--space-2); }
  .author-link {
    min-height: 0; padding: 0; font: inherit; color: inherit;
    text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 2px;
  }
  @media (hover: hover) { .author-link:hover { color: var(--ink); text-decoration-color: currentColor; } }
  .result-card-version em { font-style: normal; color: var(--warn); }

  /* The subtitle restates what the box's placeholder already says, and
     on a phone it was two lines between the heading and the first result
     (search critique, Oct 21 — the first card started at y≈546 of 812). */
  @media (max-width: 640px) {
    .lookup-page .page-head .sub { display: none; }
  }
  /* On a phone the box beside Search is ~210px wide, and "Search in"
     and Session side by side are ~330px: the Session dropdown ran out
     past the box's edge. They wrap to a line each instead. */
  @media (max-width: 599px) {
    .lookup-page .search-scope { flex-wrap: wrap; }
    .lookup-page .search-scope-select { max-width: 100%; }
  }

  /* ── Flagged list: views, grouping, export (P2-24) ──
     The rail above reuses .search-filters/.filter-group/.filter-tab
     wholesale — same component, second page. Only what the flagged list
     adds is here. */

  /* A saved view is a filter composition under a name, so it reads as a
     filter tab with a delete beside it rather than as a list item — it
     does the same thing the tabs above do when clicked. */
  .saved-views { gap: var(--space-3); }

  /* The flagged list's one filter bar (audit S2): the text filter, a
     dropdown per dimension, then the active chips and saved views, all
     flowing on one line inside the results panel between its controls
     and its rows. The chips and views lose the rule .active-filters
     draws on /lookup — here they're further items on the same bar. */
  .filter-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule);
  }
  .filter-bar-rail { display: contents; }
  .filter-bar .active-filters { border-top: 0; padding-top: 0; }
  .filter-dds { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
  .filter-dd { position: relative; }
  .filter-dd-btn, .filter-sheet-btn { display: inline-flex; align-items: center; gap: var(--space-0); }
  .filter-dd-btn .caret { margin-left: var(--space-1); width: 0.625rem; height: 0.625rem; flex: none; }
  .filter-sheet-btn { display: none; }
  /* The same anchored surface as .row-menu-dropdown (see row_menu.js),
     opening left-aligned under its button since the bar reads from the
     left. max-height is set per open by fitOpenPopover(). */
  .filter-pop {
    position: absolute; left: 0; top: calc(100% + 0.25rem); background: var(--surface);
    border: 1px solid var(--rule-card); border-radius: var(--radius-md); padding: var(--space-1);
    min-width: 13rem; max-width: 20rem; max-height: 18rem; overflow-y: auto;
    box-shadow: var(--shadow-pop); z-index: 20;
    display: flex; flex-direction: column;
  }
  .filter-pop[hidden] { display: none; }
  .filter-option {
    display: flex; align-items: center; gap: var(--space-2); cursor: pointer;
    font-size: var(--text-xs); color: var(--ink); padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
  }
  @media (hover: hover) { .filter-option:hover { background: var(--accent-soft); } }
  .filter-option input { margin: 0; flex: none; accent-color: var(--accent-solid); }
  .filter-option-label { flex: 1; }
  .filter-option .n { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--slate); }
  /* A value that would empty the list, shown with its zero — same rule
     as .filter-tab[disabled]: no opacity, the text stays at --slate. */
  .filter-option.off { cursor: default; color: var(--slate); }
  @media (hover: hover) { .filter-option.off:hover { background: none; } }

  /* Below 768px the dropdowns fold into one "Filters" button and a
     bottom sheet. Fixed to the viewport's bottom edge, over a scrim, at
     most 85% of the screen so the page behind still reads as behind. */
  .view-controls { display: flex; align-items: flex-start; gap: var(--space-2) var(--space-4); flex-wrap: wrap; }
  @media (max-width: 767px) {
    .filter-dds .filter-dd { display: none; }
    .filter-sheet-btn { display: inline-flex; }
    /* The sheet holds these at this width; the bar keeps the text filter
       and the Filters button side by side, then the chips. */
    .filter-bar .saved-views, .filter-bar > .view-controls { display: none; }
    .filter-bar .search-box { flex: 1 1 8rem; width: auto; }
  }
  .sheet-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 99; }
  .sheet-scrim[hidden] { display: none; }
  .filter-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; max-height: 85vh;
    display: flex; flex-direction: column; background: var(--surface);
    border-top: 1px solid var(--rule-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-hover);
  }
  .filter-sheet[hidden] { display: none; }
  .filter-sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-4); border-bottom: 1px solid var(--rule);
  }
  .filter-sheet-head .title { font-size: var(--text-base); font-weight: 700; margin: 0; }
  .filter-sheet-scroll { overflow-y: auto; padding: var(--space-2) var(--space-4); }
  .filter-sheet-view .view-controls { flex-direction: column; align-items: stretch; margin-top: var(--space-2); }
  .filter-sheet-group { border: 0; margin: 0; padding: var(--space-2) 0; }
  .filter-sheet-group + .filter-sheet-group, #filter-sheet-body:not(:empty) + .filter-sheet-view { border-top: 1px solid var(--rule); }
  .filter-sheet-group legend { padding: var(--space-2) 0; }
  .filter-sheet .filter-option { min-height: 2.75rem; font-size: var(--text-sm); }
  .filter-sheet-foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--rule); }
  .filter-sheet-foot button { width: 100%; min-height: 2.75rem; }
  .saved-view { display: inline-flex; align-items: center; gap: var(--space-0); }
  .saved-view .icon-btn { font-size: var(--text-sm); padding: 0 var(--space-1); }

  /* Sort by: the same pill dropdown as the filters beside it, opening
     right-aligned since it sits at the bar's right end. In the phone
     sheet the options are listed inline under "Sort & view" instead. */
  .sort-dd .filter-pop { left: auto; right: 0; }
  .filter-sheet-view .sort-dd .filter-dd-btn { display: none; }
  .filter-sheet-view .sort-dd .filter-pop,
  .filter-sheet-view .sort-dd .filter-pop[hidden] {
    display: flex; position: static; max-width: none; max-height: none;
    border: 0; box-shadow: none; padding: 0;
  }
  /* The app's switch (input.switch), the label in ink at the same 30px
     line as the Sort pill beside it. */
  .group-toggle {
    display: flex; align-items: center; gap: var(--space-2); min-height: 1.875rem;
    font-size: var(--text-xs); color: var(--ink); cursor: pointer; white-space: nowrap;
  }
  /* The checkbox with its one-line explanation directly under it
     (whole-app audit Y4), rather than the hint trailing the whole row. */
  .group-toggle-wrap { display: flex; flex-direction: column; gap: var(--space-0); }
  .group-toggle-wrap .control-hint { margin: 0; font-size: var(--text-2xs); color: var(--muted); }
  /* Export as quiet text: the least-used control in the row, it used to
     be its only bordered button. Same 24px target as .panel-head
     .linklike, also once the controls move into the phone filter sheet.
     The design system's link button: navy, no underline, ink on hover. */
  .view-controls .export-link {
    display: inline-flex; align-items: center; min-height: 1.5rem;
    font-size: var(--text-xs); white-space: nowrap;
    color: var(--link); font-weight: 500; text-decoration: none;
    margin-top: var(--space-0);   /* centred on the 30px select beside it */
  }
  @media (hover: hover) { .view-controls .export-link:hover { color: var(--ink); } }
  /* One-click tidy-up beside Export (tidyUp in flagged_body.html): as
     quiet as the export link it sits next to. */
  .view-controls .tidy-select { font-size: var(--text-sm); max-width: 14rem; }

  /* One section per client. The heading is a band rather than a table
     caption because each section is its own scrollable table — the
     grouped view is really N small tables, so the client's name has to
     sit outside the overflow container to stay put while a wide row
     scrolls under it. */
  .row-group { border-bottom: 1px solid var(--rule); }
  .row-group:last-child { border-bottom: 0; }
  .row-group-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-3) var(--space-4) var(--space-2);
    background: var(--accent-soft);
  }
  .row-group-name { font-size: var(--text-sm); font-weight: 700; }
  .row-group-count { font-size: var(--text-2xs); color: var(--slate); }

  /* ── Flagged bills v5 (docs/design-system: Card, data, forms, actions) ──
     Laid over the rules above for this page only: .flagged-card is the
     results panel. A flush Card — white, 18px, hairline edge, no shadow,
     a serif title, no rule under the head — holding a 36px text filter
     and 30px filter dropdowns, then a table whose head is a tinted,
     rounded band in sentence case and whose rows tint on hover. Bill
     numbers are mono navy over an ink title. Shapes and tones the app
     keeps on purpose stay: the pills' one base shape and their borders
     and glyphs (P2-31), the --gold focus ring, the 44px touch floor. */
  /* The card has no title of its own any more: the page title says
     "Flagged bills", and the count sits quietly beside it ("22 bills",
     or "14 of 62 bills" while a filter is on) with Mark all seen, which
     only appears when there is something to mark. */
  .flagged-head .flagged-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-0) var(--space-3); }
  .flagged-head .flagged-count { font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
  .flagged-head .flagged-count:empty { display: none; }
  .flagged-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .flagged-head .linklike { color: var(--link); font-weight: 500; font-size: var(--text-xs); text-decoration: none; }
  @media (hover: hover) { .flagged-head .linklike:hover { color: var(--ink); } }

  /* The filter bar is the card's first row, with no rule of its own; the
     table's tinted head band is the divider. Sort, group and export ride
     at its right end (margin-left: auto), on the same line where it fits. */
  .flagged-card .filter-bar { border-bottom: 0; padding: var(--space-4) var(--space-4) var(--space-3); }
  .flagged-card .filter-bar > .view-controls { margin-left: auto; align-items: center; flex-wrap: nowrap; }
  /* The group hint is the checkbox's tooltip here (same words); it stays
     in the page for a screen reader. The phone sheet shows it in full. */
  .flagged-card .filter-bar .control-hint {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  /* TextInput: 36px, control radius, white field on a control edge. */
  .flagged-card .search-box {
    height: 2.25rem; border-radius: var(--radius-sm);
    background: var(--surface); box-shadow: var(--shadow-rest); color: var(--muted);
  }
  /* Below 768px the phone rules above size it to the row. */
  @media (min-width: 768px) { .flagged-card .search-box { width: 15rem; } }
  .flagged-card .search-box input { font-size: var(--text-sm); }
  .flagged-card .search-box svg { width: 0.8rem; height: 0.8rem; }
  /* FilterDropdown: 30px, control radius, quiet at rest; with anything
     picked it tints navy and the count sits in a navy pill. The count is
     the non-colour cue, so the active tab's leading check is dropped. */
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-tab {
    min-height: 1.875rem; padding: 0 var(--space-2) 0 var(--space-3); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink-2); font-weight: 400; box-shadow: var(--shadow-rest);
  }
  @media (hover: hover) { :is(.flagged-card, .alerts-page, .calendar-page) .filter-tab:hover { border-color: var(--ink); color: var(--ink); } }
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-tab.active { background: var(--info-soft); border-color: var(--link); color: var(--link); font-weight: 500; }
  @media (hover: hover) {
    :is(.flagged-card, .alerts-page, .calendar-page) .filter-tab.active:not([disabled]):not([aria-disabled="true"]):hover { background: var(--info-soft); color: var(--link); }
  }
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-dd-btn.active::before, :is(.flagged-card, .alerts-page, .calendar-page) .filter-sheet-btn.active::before { content: none; }
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-dd-btn .n, :is(.flagged-card, .alerts-page, .calendar-page) .filter-sheet-btn .n {
    margin-left: var(--space-1); padding: 0 var(--space-1); border-radius: var(--radius-pill);
    background: var(--link); color: var(--surface); font-size: var(--text-2xs); font-weight: 600; line-height: 1.4;
  }
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-pop { border-radius: var(--radius-md); }
  @media (hover: hover) { :is(.flagged-card, .alerts-page, .calendar-page) .filter-option:hover { background: var(--paper-50); } }
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-option input, #filter-sheet .filter-option input { accent-color: var(--accent); }
  :is(.flagged-card, .alerts-page, .calendar-page) .filter-option .n { color: var(--muted); }
  /* FilterChip: a borderless neutral pill with its ×; "Clear all" and
     "Save view" are link buttons. */
  :is(.flagged-card, .alerts-page) .filter-chip {
    min-height: 1.625rem; padding: 0 var(--space-2) 0 var(--space-3);
    background: var(--paper-250); color: var(--ink-2); font-weight: 500;
  }
  @media (hover: hover) { :is(.flagged-card, .alerts-page) .filter-chip:hover { background: var(--paper-350); color: var(--ink); } }
  :is(.flagged-card, .alerts-page) .filter-chip .x { color: var(--muted); }
  :is(.flagged-card, .alerts-page) .filter-clear {
    background: none; border-color: transparent; padding: 0 var(--space-1);
    color: var(--link); font-weight: 500; font-size: var(--text-xs);
  }
  @media (hover: hover) { :is(.flagged-card, .alerts-page) .filter-clear:hover { background: none; border-color: transparent; color: var(--ink); } }
  :is(.flagged-card, .alerts-page) .filter-group-label, #filter-sheet .filter-group-label {
    text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted);
  }

  /* The table: inset from the card edge, a tinted rounded head band in
     sentence case, hairline row dividers, a row tint on hover. */
  .flagged-card .bill-ident { font-weight: 400; color: var(--link); }
  .flagged-card .bill-name { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  @media (hover: hover) {
    .flagged-card a.bill-link:hover .bill-ident { color: var(--link); }
    .flagged-card a.bill-link:hover .bill-name { color: var(--ink); }
  }
  /* CountPill, accent tone: "1 new" on the navy tint, in the UI face. */
  .flagged-card .unread-dot {
    height: auto; padding: 0 var(--space-2); background: var(--info-soft); color: var(--link);
    font-family: var(--font-sans); font-weight: 500; line-height: 1.4;
  }
  .flagged-card td.col-author { color: var(--ink-2); font-size: var(--text-xs); }
  /* Fit at 1280px with the sidebar open, and never scroll sideways.
     The title is the widest column and takes whatever the rest leave;
     everything else is content-sized and kept short — the clients are a
     chip each ("+ CHA"), the date and its place wrap rather than push,
     and a long status wraps inside its pill. Author folds away below
     1280px (the bill's own page has it). Below 901px the rows are cards
     (see the phone block further down) and none of this applies. */
  .flagged-card .flagged-table td { padding-block: var(--space-2); }
  .flagged-card .clients-summary-list { gap: var(--space-1); }
  .flagged-card .clients-summary, .flagged-card .clients-summary-list { min-width: 0; max-width: 100%; }
  @media (min-width: 901px) {
    .flagged-card .flagged-table th.col-clients { min-width: 0; width: 1%; white-space: nowrap; }
    .flagged-card .flagged-table td.col-clients { width: 1%; }
    .flagged-card .clients-summary-list { max-width: 13rem; }
    .flagged-card td.next-action { min-width: 0; }
    .flagged-card .flagged-table td.col-next .next-where { white-space: normal; max-width: 10rem; }
    /* D7: a status pill never wraps ("Died — session deadline" was two lines
       in one pill); the row gives the title less room instead. */
    .flagged-card .flagged-table td.col-status .status-badge { white-space: nowrap; }
    /* A client is a short code in its position's colour and glyph. Its
       name, position and any re-review note stay in the markup for a
       screen reader (billClientSummaryHtml) and show on hover/focus. */
    .flagged-card .client-position { display: inline-flex; }
    .flagged-card .clients-summary .client-position-name,
    .flagged-card .clients-summary .client-position-badge,
    .flagged-card .clients-summary .client-position .rereview-note {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
  }
  /* Where the Author column folds away, the author moves under the
     bill's title instead (beta review, Nov 2026: the followed-bills list
     showed no author on a laptop). Hidden wherever the column shows. */
  .flagged-card .bill-author-inline { display: none; }
  @media (min-width: 901px) and (max-width: 1279px) {
    .flagged-card .flagged-table :is(th, td).col-author { display: none; }
    .flagged-card .bill-author-inline { display: block; font-size: var(--text-xs); color: var(--ink-2); }
  }
  .flagged-card .client-code { font-size: var(--text-2xs); letter-spacing: 0.02em; }
  /* "Support if amended" and "Oppose unless amended" share their side's
     colour and glyph; a dashed edge tells them from the plain stance
     (the words are in the tooltip and for a screen reader). */
  .flagged-card .client-code.support_if_amended, .flagged-card .client-code.oppose_unless_amended { border-style: dashed; }
  .flagged-card .client-code.rereview::after { content: "!"; margin-left: var(--space-0); color: var(--warn); font-weight: 700; }
  /* The phone card has the room for the name beside its position badge
     and no hover for a chip's tooltip, so it keeps the full words. */
  @media (max-width: 900px) {
    .flagged-card .client-code { display: none; }
    .flagged-card .client-position {
      gap: var(--space-1); padding: 0 var(--space-2); border: 1px solid var(--rule);
      border-radius: var(--radius-pill); background: var(--surface); max-width: 100%; min-width: 0;
    }
    .flagged-card .client-position-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  }
  .flagged-card .next-when { font-weight: 500; }
  .flagged-card .next-where { color: var(--muted); }
  /* StatusDot pill: a white pill on a hairline, the word in --ink-2, the
     stage glyph alone carrying the stage's colour. */
  .flagged-card .status-badge[class*="tone-"] { background: var(--surface); border-color: var(--rule); color: var(--ink-2); }
  .flagged-card .status-badge.tone-early::before { color: var(--muted); }
  .flagged-card .status-badge.tone-moving::before { color: var(--link); }
  .flagged-card .status-badge.tone-passed::before { color: var(--good); }
  .flagged-card .status-badge.tone-ended::before { color: var(--error); }
  /* Status is the last column but the kebab, so a tip hung from the
     badge's left edge ran ~90px past the table's scroller and gave every
     client group a sideways (and, on its last row, an up-down) scrollbar
     on hover. Hang it from the right edge, and above on a group's last
     row, so it stays inside the box. */
  .flagged-card .flagged-table .has-tip > .tip { left: auto; right: 0; }
  .flagged-card .flagged-table tbody tr:last-child .has-tip > .tip { top: auto; bottom: calc(100% + 6px); }
  .flagged-card .client-position-name { font-weight: 500; }
  @media (hover: hover) { .flagged-card .clients-summary:hover { background: var(--paper-50); } }
  .flagged-card .clients-summary[aria-expanded="true"] { background: var(--paper-50); }
  @media (min-width: 901px) {
    .flagged-card .table-scroll { padding: 0 var(--space-2); }
    .flagged-card .flagged-table { border-collapse: separate; border-spacing: 0; }
    /* The bill takes the room the design gives it (its widest column);
       everything else is content-sized (see the fit rules above). */
    .flagged-card .flagged-table th.col-bill { min-width: 15rem; }
    .flagged-card .flagged-table th {
      border-top: 0; border-bottom: 0; background: var(--paper-50);
      font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .flagged-card .flagged-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .flagged-card .flagged-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .flagged-card .flagged-table th:first-child, .flagged-card .flagged-table td:first-child { padding-left: var(--space-3); }
    .flagged-card .flagged-table th:last-child, .flagged-card .flagged-table td:last-child { padding-right: var(--space-2); }
    .flagged-card .flagged-table td { padding-top: var(--space-3); padding-bottom: var(--space-3); }
    .flagged-card .flagged-table tbody tr:last-child td { border-bottom: 0; }
  }
  /* The phone card's cell labels, in sentence case like the column heads. */
  .flagged-card .bill-cards td::before { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
  /* At 375px a long status ("Died — session deadline") took the whole
     right column and laid its pill over the end of the next-action date
     ("1:30 PM" hidden). The date keeps the room it needs; a long status
     wraps inside its pill instead. */
  @media (max-width: 900px) {
    .flagged-card .bill-cards tr { grid-template-columns: auto minmax(min-content, 1fr) auto; }
    .flagged-card .bill-cards td.col-status .status-badge { white-space: nowrap; }
    /* The row's select box takes a first column of its own, above the
       card's stretched link; every other cell moves one column over. */
    .flagged-card .bill-cards td { grid-column: 2 / -1; }
    .flagged-card .bill-cards td.col-pick {
      grid-column: 1; grid-row: 1; align-self: start; position: relative; z-index: 2;
      margin-left: calc(-1 * var(--space-2));
    }
    .flagged-card .bill-cards td.col-bill, .flagged-card .bill-cards td.col-next { grid-column: 2; }
    .flagged-card .bill-cards td.col-rowmenu, .flagged-card .bill-cards td.col-status { grid-column: 3; }
  }
  /* On a phone the status takes its own line under the next action, so a
     long one ("Died — session deadline") sits on one line in its pill
     rather than squeezing into three beside the date. */
  @media (max-width: 640px) {
    .flagged-card .bill-cards td.col-status { grid-column: 2 / -1; grid-row: auto; justify-self: start; }
  }

  /* Group by client: a LetterTile, the client's name in the serif, and
     a count pill — no band, no rule between the groups. */
  .flagged-card .row-group, .flagged-card .row-group:last-child { border-bottom: 0; }
  .flagged-card .row-group-head {
    align-items: center; justify-content: flex-start; gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-2); background: none;
  }
  .flagged-card .row-group-head .letter-tile { width: 1.5rem; height: 1.5rem; }
  .flagged-card .row-group-name { font-size: var(--text-base); font-weight: 500; }
  .flagged-card .row-group-count {
    padding: var(--space-0) var(--space-2); border-radius: var(--radius-pill);
    background: var(--paper-250); color: var(--ink-2); font-weight: 500;
  }

  /* The 30px sizes above are pointer sizes: on a touch screen every one
     of these controls keeps the app's 44px floor (see the coarse-pointer
     block by .row-menu-btn), which their extra class would otherwise beat. */
  @media (pointer: coarse) {
    .flagged-card .filter-tab, .flagged-card .filter-chip, .flagged-card .filter-clear { min-height: 2.75rem; }
  }

  /* ── Bill sub-pages v5 (docs/design-system: Card, data, forms, actions) ──
     The pages that hang off Flagged bills — Archived, Sponsors & votes,
     Whip count, Import a bill list and New session — laid over the
     shared rules for these pages only (.bill-subpage on each page's
     wrapper). Serif page and card titles; white 18px cards on a hairline
     with no shadow and no rule under the head, their content inset from
     the edge; tables with a tinted, rounded head band in sentence case
     and rows that tint on hover, each row a labelled card on a phone
     rather than a sideways scroller hiding columns; bill numbers mono
     navy before their titles (BillNumber). Buttons and fields keep the
     app's own shape; position badges keep their borders and glyphs
     (P2-31); the --gold focus ring and 44px touch floor stay. */
  .bill-subpage .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .bill-subpage .page-head a.sub { margin-top: 0; font-size: var(--text-xs); font-weight: 500; }
  @media (hover: hover) { .bill-subpage .page-head a.sub:hover { color: var(--ink); } }
  .bill-subpage .page-head-more > summary { color: var(--ink-2); }
  .whip-page .whip-bill-line { color: var(--ink); font-weight: 500; }
  /* BillNumber: mono navy, regular weight, a small gap before the title. */
  .bill-subpage .subpage-bill-number {
    font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500; color: var(--ink); white-space: nowrap;
  }

  /* Cards: hairline edge, no shadow, serif title, no header rule. */
  .bill-subpage .panel + .panel { margin-top: var(--space-5); }
  .bill-subpage .subpage-stack { display: grid; gap: var(--space-4); }
  .bill-subpage .subpage-stack > .panel + .panel { margin-top: 0; }
  .bill-subpage .panel-head { border-bottom: 0; padding: var(--space-4) var(--space-4) var(--space-3); }
  .bill-subpage .panel-head .title {
    font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  }
  .bill-subpage .panel-head .sub { color: var(--ink-2); }
  .bill-subpage .subpage-body { padding: 0 var(--space-4) var(--space-4); }
  .bill-subpage .subpage-body:empty { display: none; }
  .bill-subpage .subpage-body .sub, .bill-subpage .subpage-note { margin: 0 0 var(--space-3); color: var(--ink-2); }
  .bill-subpage .subpage-body > :first-child { margin-top: 0; }
  .bill-subpage .subpage-body > :last-child { margin-bottom: 0; }
  .bill-subpage .subpage-note { padding: 0 var(--space-4); }
  .bill-subpage .empty { color: var(--ink-2); }
  /* Field labels (TextInput / TextArea): 12px, medium, secondary ink. */
  .bill-subpage .field-label { font-weight: 500; color: var(--ink-2); }

  /* StatusDot pill: white on a hairline, the stage glyph alone coloured. */
  .bill-subpage .status-badge[class*="tone-"] { background: var(--surface); border-color: var(--rule); color: var(--ink-2); }
  .bill-subpage .status-badge.tone-early::before { color: var(--muted); }
  .bill-subpage .status-badge.tone-moving::before { color: var(--link); }
  .bill-subpage .status-badge.tone-passed::before { color: var(--good); }
  .bill-subpage .status-badge.tone-ended::before { color: var(--error); }

  /* Tables: sentence-case heads; on a wide screen inset from the card
     edge with a tinted rounded head band and a row tint on hover. */
  .bill-subpage .subpage-table th { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
  .bill-subpage .subpage-table td.sub, .bill-subpage .subpage-table td .sub { color: var(--ink-2); }
  @media (min-width: 901px) {
    .bill-subpage .subpage-rows { padding: 0 var(--space-2) var(--space-2); }
    .bill-subpage .subpage-table { border-collapse: separate; border-spacing: 0; }
    .bill-subpage .subpage-table th {
      border-top: 0; border-bottom: 0; background: var(--paper-50); padding-top: var(--space-2); padding-bottom: var(--space-2);
    }
    .bill-subpage .subpage-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .bill-subpage .subpage-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .bill-subpage .subpage-table th:first-child, .bill-subpage .subpage-table td:first-child { padding-left: var(--space-3); }
    .bill-subpage .subpage-table th:last-child, .bill-subpage .subpage-table td:last-child { padding-right: var(--space-3); }
    .bill-subpage .subpage-table td { padding-top: var(--space-3); padding-bottom: var(--space-3); }
    .bill-subpage .subpage-table tbody tr:last-child td { border-bottom: 0; }
    @media (hover: hover) {
      .bill-subpage .subpage-table tbody tr:hover { background: none; }
      .bill-subpage .subpage-table tbody tr:hover td { background: var(--paper-50); }
    }
    .archived-page .subpage-table th.col-bill { min-width: 14rem; }
    .archived-page .subpage-table td.col-actions { text-align: right; white-space: nowrap; }
  }
  /* Phone: one card per row, each value under its column's name. */
  @media (max-width: 900px) {
    .bill-subpage .subpage-table, .bill-subpage .subpage-table tbody,
    .bill-subpage .subpage-table tr, .bill-subpage .subpage-table td { display: block; width: auto; }
    .bill-subpage .subpage-table thead { display: none; }
    .bill-subpage .subpage-table tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule); }
    .bill-subpage .subpage-table tr:last-child { border-bottom: 0; }
    .bill-subpage .panel .subpage-table td { border: 0; padding: var(--space-1) 0; }
    .bill-subpage .subpage-table td:empty { display: none; }
    .bill-subpage .subpage-table td[data-label]::before {
      content: attr(data-label); display: block; margin-bottom: var(--space-0);
      font-size: var(--text-xs); font-weight: 500; color: var(--muted);
    }
    .bill-subpage .subpage-table td.lead { font-weight: 500; }
    .bill-subpage .subpage-table td.date { white-space: normal; }
    .bill-subpage .subpage-table .position-badge { white-space: normal; text-align: left; }
    .archived-page .subpage-table td.col-actions { padding-top: var(--space-2); }
    .whip-page .subpage-table td select, .whip-page .subpage-table td input.note { width: 100%; }
  }

  /* Archived: the bill number mono navy over its title. */
  .archived-page .bill-ident { font-weight: 400; color: var(--link); }
  .archived-page .bill-name { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .archived-page #list > .empty { margin: 0; padding: 0 var(--space-4) var(--space-4); }

  /* Sponsors & votes: each bill a row, number before title. */
  .sponsors-page .sponsor-bills { padding: 0 var(--space-2) var(--space-2); }
  .sponsors-page .bill-row.sponsor-bill { flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-3); }
  .sponsors-page .sponsor-bill + .sponsor-bill { border-top: 1px solid var(--rule); }
  .sponsors-page .bill-row .bill-id { font-size: var(--text-sm); color: var(--ink); margin: 0 0 var(--space-1); }
  .sponsors-page .bill-row .bill-id a { font-size: var(--text-xs); color: var(--link); margin-right: var(--space-1); }
  @media (hover: hover) { .sponsors-page .bill-row .bill-id a:hover { color: var(--ink); } }
  .sponsors-page .sponsor-bill-title { font-weight: 500; }
  .sponsors-page .sponsor-bill .status-badge { margin-bottom: 0; }
  .sponsors-page .member-row { justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3); }
  .sponsors-page .member-row + .member-row { border-top: 1px solid var(--rule); }
  .sponsors-page .member-row .title { font-size: var(--text-base); font-weight: 600; line-height: 1.3; margin: 0; }
  .sponsors-page .member-row > div > .sub { font-size: var(--text-xs); color: var(--ink-2); margin: 0; }
  .sponsors-page .member-counts { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-start; }
  .sponsors-page .member-count > summary { cursor: pointer; font-size: var(--text-sm); }
  .sponsors-page .sponsor-positions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
  /* Chips: borderless neutral, the words as LegiScan wrote them. */
  .sponsors-page .tag { text-transform: none; letter-spacing: 0; background: var(--paper-250); color: var(--ink-2); }
  /* VerdictChip: its edge a softer step of its own tone, so it reads
     apart from the position badge it judges. The shape stays the one
     pill (the base rule owns radius, border style and weight). */
  .sponsors-page .verdict-chip.with_us, .sponsors-page .verdict-chip.against_us { border-color: color-mix(in srgb, currentColor 45%, transparent); }
  /* VoteBar: venue and motion over the bar, counts in words under it. */
  .sponsors-page .vote-where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
  .sponsors-page .vote-venue { font-size: var(--text-sm); font-weight: 500; }
  .sponsors-page .vote-when { font-size: var(--text-xs); color: var(--ink-2); }
  .sponsors-page .vote-bar { margin-top: var(--space-2); }
  .sponsors-page .sponsor-note { margin: 0 0 var(--space-2); }
  /* The client filter: the same row shape as Flagged's view controls. */
  .sponsors-page .filter-row { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); font-size: var(--text-xs); color: var(--ink-2); }
  .sponsors-page .filter-row[hidden] { display: none; }
  .sponsors-page .filter-row select {
    min-height: 1.875rem; padding: 0 var(--space-2); border-radius: var(--radius-sm);
    font-size: var(--text-xs); color: var(--ink); box-shadow: var(--shadow-rest);
  }
  @media (max-width: 640px) {
    .sponsors-page .sponsor-positions .position-badge { white-space: normal; text-align: left; }
  }

  /* Whip count. */
  .whip-page .whip-seats { margin-top: var(--space-4); }
  .whip-page #venue-select { max-width: 100%; }
  .whip-page .whip-tally p { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
  .whip-page .whip-counts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); color: var(--ink-2); }

  /* Roll call card (roll_call_card.py): a blank tally sheet. On screen a
     white card under the controls; on paper only the card, black on
     white, the boxes big enough to tick with a pen, no row split across
     pages, the header row repeated on each page. */
  .rollcall-page #venue-select { max-width: 100%; }
  .rollcall-page .rollcall-whip { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--text-sm); }
  .rollcall-page .rollcall-whip[hidden] { display: none; }
  .rollcall-page .rollcall-actions { padding-top: var(--space-3); }
  .rollcall-page .rollcall-card {
    margin-top: var(--space-5); padding: var(--space-5); background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius-md); color: var(--ink);
  }
  .rollcall-page .rollcall-title { margin: 0 0 var(--space-3); font-size: var(--text-lg); }
  .rollcall-page .rollcall-lines { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-4); font-size: var(--text-sm); }
  .rollcall-page .rollcall-motion { flex: 1 1 16rem; display: flex; }
  .rollcall-page .rollcall-blank { display: inline-block; min-width: 8rem; border-bottom: 1px solid currentColor; padding: 0 var(--space-1); }
  .rollcall-page .rollcall-blank-wide { flex: 1; min-width: 10rem; margin-left: var(--space-1); }
  .rollcall-page .rollcall-blank-short { min-width: 3rem; }
  .rollcall-page .rollcall-totals { margin: var(--space-4) 0 0; }
  .rollcall-page .rollcall-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .rollcall-page .rollcall-table th, .rollcall-page .rollcall-table td { border: 1px solid var(--rule-strong); padding: var(--space-1) var(--space-2); text-align: left; }
  .rollcall-page .rollcall-table th { font-weight: 600; }
  .rollcall-page .rollcall-table th.rollcall-box, .rollcall-page .rollcall-table td.rollcall-box { width: 4.5rem; text-align: center; }
  .rollcall-page .rollcall-n { width: 2rem; color: var(--ink-2); }
  .rollcall-page .rollcall-role { font-size: var(--text-xs); font-weight: 600; margin-left: var(--space-1); }
  .rollcall-page .rollcall-meta, .rollcall-page .rollcall-whip-cell { white-space: nowrap; color: var(--ink-2); }
  .rollcall-page .rollcall-note { margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--ink-2); }
  .rollcall-page .rollcall-note:empty { display: none; }
  /* A phone: the table scrolls inside the card, never past the page. */
  @media (max-width: 640px) {
    .rollcall-page .rollcall-card { padding: var(--space-3); overflow-x: auto; }
    .rollcall-page .rollcall-table th.rollcall-box, .rollcall-page .rollcall-table td.rollcall-box { width: 3rem; }
  }
  @media print {
    body:has(.rollcall-page) :is(.app-sidebar, .app-topbar, .skip-link, #page-progress),
    .rollcall-page .page-head, .rollcall-page .rollcall-controls, .rollcall-page #error,
    .rollcall-page #loading, .rollcall-page #empty { display: none !important; }
    body:has(.rollcall-page) .app-main { padding: 0 !important; }
    .rollcall-page .rollcall-card { margin: 0; padding: 0; border: 0; color: #000; background: #fff; }
    .rollcall-page .rollcall-table th, .rollcall-page .rollcall-table td { border-color: #000; color: #000; padding: var(--space-1) var(--space-2); }
    .rollcall-page .rollcall-table thead { display: table-header-group; }
    .rollcall-page .rollcall-table tr { break-inside: avoid; page-break-inside: avoid; }
    .rollcall-page .rollcall-n, .rollcall-page .rollcall-meta, .rollcall-page .rollcall-whip-cell,
    .rollcall-page .rollcall-note { color: #000; }
  }

  /* Search hearings (hearing_search_body.html): each hit is a hearing,
     and under it the moments the words were said — the time in the
     recording and the passage, hits marked. */
  .hearing-search-page .said-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); font-size: var(--text-sm); }
  .hearing-search-page .said-hearing { padding: var(--space-4) 0; border-bottom: 1px solid var(--rule); }
  .hearing-search-page .said-hearing:last-child { border-bottom: 0; }
  .hearing-search-page .said-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
  .hearing-search-page .said-head h2 { margin: 0; font-size: var(--text-base); }
  .hearing-search-page .said-moment { display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--space-3); margin: var(--space-3) 0 0; }
  .hearing-search-page .said-at { font-variant-numeric: tabular-nums; font-size: var(--text-sm); font-weight: 600; color: var(--ink); white-space: nowrap; }
  .hearing-search-page .said-text { margin: 0; font-size: var(--text-sm); color: var(--ink-2); overflow-wrap: anywhere; }
  .hearing-search-page .said-text mark { background: var(--accent-soft); color: var(--ink); padding: 0 var(--space-0); border-radius: var(--radius-xs); font-weight: 600; }
  .hearing-search-page .said-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); font-size: var(--text-sm); }
  .hearing-search-page .said-more { margin-top: var(--space-4); }
  .hearing-search-page .said-note { margin-top: var(--space-4); }

  /* Today at the Capitol (hearing_day.py): each hearing a card, each
     bill a block with what's been reported from the room and the buttons
     to report. Buttons wrap and keep the 44px touch floor — this page is
     used standing in a hearing room, on a phone. */
  .hearing-day-page .hd-when { margin: 0; padding: 0 var(--space-4); font-size: var(--text-sm); color: var(--ink-2); }
  /* "Watch live on the Senate's site" (hearing_time.js watchLiveHtml) —
     here under each hearing card's time, and on the Calendar, the bill
     page and hearing prep on the event's own day. */
  .watch-live { margin: var(--space-1) 0 0; font-size: var(--text-sm); }
  .hearing-day-page .watch-live { padding: 0 var(--space-4); }
  .hearing-day-page .hd-bill { padding: var(--space-4); border-top: 1px solid var(--rule); }
  .hearing-day-page .hd-bill-line { margin: 0; font-weight: 500; color: var(--ink); }
  .hearing-day-page .hd-clients { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--ink-2); }
  .hearing-day-page .hd-reports { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
  .hearing-day-page .hd-report { padding: var(--space-2) var(--space-3); border-left: 2px solid var(--accent); background: var(--paper-50); border-radius: var(--radius-sm); font-size: var(--text-sm); }
  .hearing-day-page .hd-report strong { color: var(--ink); }
  .hearing-day-page .hd-report .hd-by { color: var(--ink-2); }
  .hearing-day-page .hd-report .hd-note { display: block; margin-top: var(--space-1); color: var(--ink); }
  .hearing-day-page .hd-caption { border-left-color: var(--rule-strong); }
  .hearing-day-page .hd-note-sub { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--ink-2); }
  .hearing-day-page .hd-official { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--ink-2); }
  .hearing-day-page .hd-official.confirmed { color: var(--good); }
  .hearing-day-page .hd-official.differs { color: var(--error); font-weight: 500; }
  .hearing-day-page .hd-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
  .hearing-day-page .hd-actions button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .hearing-day-page .hd-form { margin-top: var(--space-3); display: grid; gap: var(--space-2); max-width: 32rem; }
  .hearing-day-page .hd-counts { display: flex; gap: var(--space-3); }
  .hearing-day-page .hd-counts label { display: grid; gap: var(--space-1); font-size: var(--text-xs); color: var(--ink-2); }
  .hearing-day-page .hd-counts input { width: 5.5rem; }
  .hearing-day-page .hd-form-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
  .hearing-day-page .hd-foot { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--ink-2); }

  /* On the floor (floor_file.py): each house a card, its file's parts
     (Third Reading, consent, the Inactive File…) as sections, each
     bill a row led by its printed item number. The firm's own bills
     carry an accent rule so they read first in an opened list. */
  .floor-file-page .ff-when { margin: 0; padding: 0 var(--space-4) var(--space-3); font-size: var(--text-sm); color: var(--ink-2); }
  .floor-file-page .ff-group { padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--rule); }
  .floor-file-page .ff-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
  .floor-file-page .ff-group-head h3 { margin: 0; font-size: var(--text-base); font-weight: 600; color: var(--ink); }
  .floor-file-page .ff-about { font-size: var(--text-xs); color: var(--ink-2); }
  .floor-file-page .ff-file { margin-top: var(--space-3); }
  .floor-file-page .ff-file-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); font-size: var(--text-sm); }
  .floor-file-page .ff-file-head h4 { margin: 0; font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .floor-file-page .ff-count { color: var(--ink-2); }
  .floor-file-page .ff-file-head button { min-height: 0; font-size: var(--text-sm); }
  .floor-file-page .ff-items { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-1); }
  .floor-file-page .ff-item {
    display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--space-2);
    padding: var(--space-2) var(--space-3); border-left: 2px solid var(--rule);
    background: var(--paper-50); border-radius: var(--radius-sm); font-size: var(--text-sm);
  }
  .floor-file-page .ff-item.mine { border-left-color: var(--accent); }
  .floor-file-page .ff-num { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .floor-file-page .ff-line, .floor-file-page .ff-chips, .floor-file-page .ff-facts { margin: 0; }
  .floor-file-page .ff-line { color: var(--ink); overflow-wrap: anywhere; }
  .floor-file-page .ff-title { color: var(--ink-2); }
  .floor-file-page .ff-yours { font-size: var(--text-xs); font-weight: 500; color: var(--accent); white-space: nowrap; }
  .floor-file-page .ff-main { min-width: 0; }
  .floor-file-page .ff-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
  .floor-file-page .ff-chips .position-badge { white-space: normal; max-width: 100%; text-align: left; }
  .floor-file-page .ff-facts { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--ink-2); }
  .floor-file-page .ff-foot { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--ink-2); max-width: 46rem; }
  /* Paging back through past days' files: earlier / a held day / later,
     and a past day's file says so in a warn-tinted band above it. */
  .floor-file-page .ff-paging { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); font-size: var(--text-sm); }
  .floor-file-page .ff-paging label { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-2); }
  .floor-file-page .ff-paging select { max-width: 100%; }
  .floor-file-page .ff-past { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--warn-soft); color: var(--ink); font-size: var(--text-sm); }

  /* Hearing prep packet (hearing_prep.py): the memo, its footnotes, and
     the facts on file. On paper only the memo and its sources print —
     or the facts, when no memo has been written yet. */
  .prep-page .prep-bill-line { color: var(--ink); font-weight: 500; }
  .prep-page .prep-buttons { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
  .prep-page .prep-earlier { display: flex; flex-direction: column; gap: var(--space-1); }
  .prep-page .prep-earlier[hidden] { display: none; }
  .prep-page .prep-actions { padding-top: var(--space-4); }
  .prep-page .prep-earlier select { max-width: 100%; }
  .prep-page #write-status:empty { display: none; }
  .prep-page .subpage-body h3 { font-size: var(--text-sm); font-weight: 600; margin: var(--space-4) 0 var(--space-2); }
  .prep-page .subpage-body h4 { font-size: var(--text-sm); font-weight: 500; margin: var(--space-3) 0 var(--space-1); }
  .prep-page .subpage-body p { font-size: var(--text-sm); margin: 0 0 var(--space-2); }
  .prep-page .prep-items, .prep-page .prep-votes, .prep-page .prep-blanks, .prep-page .prep-sources {
    margin: 0 0 var(--space-2); padding-left: var(--space-5); font-size: var(--text-sm);
  }
  .prep-page .prep-items li + li, .prep-page .prep-sources li + li { margin-top: var(--space-1); }
  .prep-page .prep-votes { padding-left: var(--space-4); }
  .prep-page .prep-party { white-space: nowrap; }
  .prep-page .prep-cite { font-size: var(--text-xs); color: var(--link); margin-left: var(--space-0); }
  .prep-page .prep-cite + .prep-cite { margin-left: var(--space-1); }
  .prep-page .prep-sources { color: var(--ink-2); }
  .prep-page .prep-ai-label {
    padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
    background: var(--paper-50); color: var(--ink-2); font-size: var(--text-xs);
  }
  @media print {
    .prep-page .prep-actions-panel, .prep-page .prep-facts.has-memo, .prep-page .prep-card-link, #loading { display: none !important; }
    .prep-page .panel { border: 0; box-shadow: none; }
    .prep-page .page-head { display: block !important; }
    .prep-page .page-head a, .prep-page .page-head-actions { display: none; }
    .prep-page .prep-memo, .prep-page .prep-facts { color: #000; background: #fff; }
  }

  /* Import a bill list. */
  .bill-import-page textarea { display: block; width: 100%; margin-bottom: var(--space-3); }
  /* The file picker wraps under its words on a phone, never past the card. */
  .bill-import-page input[type="file"] { max-width: 100%; }
  .bill-import-page .bill-import-notes { padding-bottom: var(--space-3); }
  .bill-import-page .bill-import-new-clients { border: 0; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
  .bill-import-page .bill-import-new-clients legend { padding: 0; margin-bottom: var(--space-2); }
  .bill-import-page .bill-import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-top: var(--space-3); }
  .bill-import-page .bill-import-done { margin: var(--space-3) 0 0; padding: 0 var(--space-3); font-weight: 500; }

  /* New session: each bill a row with a navy Checkbox. */
  .rollover-page .rollover-list, .rollover-page .rollover-matches { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
  .rollover-page .rollover-row {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-2); border-radius: var(--radius-md); cursor: pointer;
  }
  @media (hover: hover) { .rollover-page .rollover-row:hover { background: var(--paper-50); } }
  .rollover-page .rollover-row input[type="checkbox"] { flex: none; margin: var(--space-0) 0 0; accent-color: var(--link); }
  .rollover-page .rollover-row-main { display: flex; flex-direction: column; gap: var(--space-0); min-width: 0; }
  .rollover-page .rollover-row-title { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  .rollover-page .rollover-row-meta { font-size: var(--text-xs); color: var(--ink-2); }
  .rollover-page .rollover-year { color: var(--muted); font-weight: 400; }
  .rollover-page .rollover-matches { margin-bottom: 0; }
  .rollover-page .match { padding: var(--space-3) 0; }
  .rollover-page .match + .match { border-top: 1px solid var(--rule); }
  .rollover-page .match .sub { margin: var(--space-1) 0 0; font-size: var(--text-xs); }
  .rollover-page .rollover-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
  .rollover-page .rollover-actions:not(:has(button)) { display: none; }
  .rollover-page .offer:not(:empty) { margin-top: var(--space-3); }
  .rollover-page .offer p { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
  .rollover-page #matches > .empty { margin: 0; }


  /* Why this row is here. LegiScan matches on full bill text but returns
     none of it, so a title can share no word with the query (live, that
     is ~79% of a broad result set). Where a query term IS in the title
     it gets marked; where it is not, the row says the match was in the
     text rather than leaving the user to guess — see matchNoteHtml(). */
  /* The tint reaches past the word, but the negative margin takes the
     padding back, so the text sits where it would unmarked: padding alone
     pushed what followed away ("housing : tenant protections"). */
  mark.match-hit {
    background: var(--warn-soft); color: inherit;
    border-radius: var(--radius-sm); padding: 0 var(--space-0);
    margin: 0 calc(-1 * var(--space-0));
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
  .match-note { margin-top: var(--space-1); font-size: var(--text-2xs); color: var(--slate); font-style: italic; }

  /* A real full-text snippet, unlike the italic note above it replaces:
     this is the bill's own words, so it is set upright and readable
     rather than as an aside about the result. Clamped to three lines —
     the point is to see the hit in context, not to read the statute in
     a table cell. */
  .match-snippet {
    font-style: normal; color: var(--ink); line-height: 1.45;
    font-size: var(--text-2xs); max-width: 62ch;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* A match only an earlier version had: said above its passage, in the
     warn tone, so old words are never read as the bill's current ones. */
  .match-earlier { font-style: normal; color: var(--warn); font-weight: 600; }
  .match-earlier a { font-weight: 400; margin-left: var(--space-1); }

  /* The citations that put a bill in a code-section search. Set as
     chips rather than prose because they are read by scanning — "does
     this one amend or repeal my section" is the question, and the verb
     is what the eye needs to land on first. */
  .match-citations { font-style: normal; display: flex; flex-wrap: wrap; gap: var(--space-1); }
  .cite {
    display: inline-flex; align-items: baseline; gap: var(--space-1);
    border: 1px solid var(--rule); border-radius: var(--radius-sm);
    padding: var(--space-0) var(--space-1); font-size: var(--text-2xs); color: var(--slate);
  }
  .cite strong { color: var(--ink); font-weight: 600; }
  /* Repeal reads as the consequential one, so it carries the warn tone;
     add and amend stay quiet. Colour is not the only signal — the verb
     is written out in each chip — so this stays readable to anyone who
     can't tell the three apart. */
  .cite-repeal { border-color: var(--warn); background: var(--warn-soft); }
  .cite-range {
    font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.03em;
    border: 1px solid var(--rule); border-radius: var(--radius-sm);
    padding: 0 var(--space-1); cursor: help;
  }

  /* Quieter than .result-truncated: that one is a warning about
     incomplete results, this one just restates how a query was read. */
  .result-note {
    background: var(--accent-soft); color: var(--ink); border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); font-size: var(--text-xs);
  }

  /* Title matches, then text-only matches (lookup's matchGroups). The
     heading names what every row under it has in common, so the cards
     don't each repeat it. */
  .result-group-head {
    font-size: var(--text-sm); font-weight: 600; color: var(--ink);
    margin: var(--space-4) 0 var(--space-2);
  }
  .result-group-head:first-child { margin-top: 0; }
  .result-group-head.is-text-only {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    border-top: 1px solid var(--rule); padding-top: var(--space-4);
  }
  .result-group-head.is-text-only h3 { font-size: var(--text-sm); margin: 0; }
  .result-group-head.is-text-only .sub { margin: var(--space-1) 0 0; font-weight: 400; }
  .result-group-head.is-text-only > button { flex-shrink: 0; }

  /* ── Capitol directory (see directory.py) ────────────────────────
     One flat table, a row per staffer, the office carried in its own
     column. Was a card per office; the table lets a search that spans
     offices read as one list and lets the committee select narrow it
     without collapsing whole cards. The row-level styles (staffer link,
     legislator meta, stale/matched treatment, filter toolbar) live near
     the bottom of this section, beside .dir-search. */
  /* ── The AI bill explainer (see bill_explainer.py) ────────────────
     The Summary tab's "In plain English" card and the Compare tab's
     "What this amendment changed". The label under each says it was
     written by AI, small but never hidden. */
  .explain-overview { margin: 0 0 var(--space-2); }
  .explain-points { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
  .explain-points li { margin: var(--space-1) 0; }
  .explain-label { font-size: var(--text-xs); margin: 0; }
  .explain-error:empty { display: none; }
  .explain-amend {
    padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule); margin-bottom: var(--space-2);
  }
  .explain-amend-title { font-size: var(--text-sm); margin: 0 0 var(--space-2); }

  /* ── Ask about this bill (report_body.html's askPanelHtml) ───────
     Under the explainer: Ask Mike's
     three questions as buttons that wrap, then a line to type one's own.
     Outlined at rest, like the panel's starters, so they read as
     something to click. */
  .ask-bill .title .mike-tag { margin-left: var(--space-2); font-family: var(--font-sans); font-size: var(--text-2xs); font-weight: 500; color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }
  .ask-bill-qs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
  .ask-bill-q.secondary { border-color: var(--rule-card); border-radius: var(--radius-md); font-weight: 400; white-space: normal; text-align: left; height: auto; padding-block: var(--space-1); }
  .ask-bill-form { display: flex; align-items: center; gap: var(--space-2); }
  .ask-bill-form input { flex: 1 1 auto; min-width: 0; }

  /* ── Possibly related bills this session (see related_bills.py) ───
     The Summary tab's suggestion list: each bill's number and status,
     its title, and why it was suggested, so the reader judges it. */
  .related-bills { list-style: none; margin: 0; }
  .related-bill { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
  .related-bill:last-child { border-bottom: 0; }
  .related-bill-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .related-bill-number { font-weight: 600; }
  .related-bill-title { font-size: var(--text-sm); color: var(--ink); margin-top: var(--space-1); overflow-wrap: anywhere; }
  .related-bill-why { margin: var(--space-1) 0 0; padding-left: var(--space-5); font-size: var(--text-xs); color: var(--slate); }
  .related-bill-follow { margin-top: var(--space-2); }

  /* ── Redline (see bill_diff.py) ──────────────────────────────────
     Struck text and its replacement inline, the way a redline reads on
     paper. <del>/<ins> carry the meaning to a screen reader and survive
     a copy-paste, so colour is reinforcement rather than the signal. */
  .redline-picker {
    display: flex; align-items: flex-end; gap: var(--space-2); flex-wrap: wrap;
    padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule); margin-bottom: var(--space-2);
  }
  .redline-picker label { display: flex; flex-direction: column; gap: var(--space-1); }
  /* Bill text is long; the panel scrolls rather than the page. */
  .redline { max-height: 34rem; overflow-y: auto; font-size: var(--text-xs); line-height: 1.55; }
  .redline-block { margin: var(--space-2) 0; }
  .redline-equal { color: var(--slate); }
  .redline del {
    background: var(--warn-soft); color: var(--ink);
    text-decoration: line-through; text-decoration-thickness: 1px;
  }
  .redline ins {
    background: var(--accent-soft); color: var(--ink); text-decoration: none;
    box-shadow: inset 0 -1px 0 var(--accent);
  }
  /* The bill's untouched bulk, said as a count. The point of opening a
     redline is the parts that are not the same. */
  .redline-skip {
    color: var(--slate); font-size: var(--text-2xs); font-style: italic;
    padding: var(--space-1) 0; border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule); margin: var(--space-2) 0;
  }

  /* ── Bill report: tabs, progress, authors, votes (see report_body.html) ──
     The report is a header + progress tracker + a six-tab body. The
     tablist reuses .settings-tabs; the rules below are the parts unique
     to this screen. Colours are the same semantic tokens the rest of the
     app uses (--good/--error/--info with their -soft grounds), so nothing
     new needs the contrast test — the pairs are already covered. */
  .report-tabs { margin-top: var(--space-4); }
  /* Panels stack with a gap inside every tab and column; the first block
     of each stacking context sits flush under the thing above it. */
  .report-panel .panel,
  .report-panel .current-status-card { margin-top: var(--space-4); }
  /* The description sits in the header on a wide screen and under What's
     next on a phone (summaryPanelHtml): at 375px a long one pushed the
     next hearing ~720px down. Same text, two slots, one shown. */
  .bill-desc-phone { display: none; }
  @media (max-width: 640px) {
    .bill-desc-header { display: none; }
    .report-panel .bill-desc-phone { display: block; margin-top: var(--space-4); }
  }
  /* Read-only client chips (clientChipsHtml: Clients & positions on a
     bill the firm no longer follows) and the header's contents lines
     (glanceContentsHtml). The header used to carry an at-a-glance strip
     of the next date and every client; What's next and Clients &
     positions, first on Overview, say both once. */
  .glance-next-where { font-size: var(--text-xs); color: var(--slate); overflow-wrap: anywhere; }
  /* What the latest amendment did to the contents, and the 72-hour note (Oct 7 audit A2). */
  .glance-contents { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-3); }
  /* The bill's short facts under its status (billBadgesHtml; bill_badges.py):
     quiet .tag pills, in sentence case — they are labels, not raw values. */
  .bill-facts { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: var(--space-2) 0 0; padding: 0; }
  .bill-facts .bill-fact { text-transform: none; cursor: help; }
  .glance-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
  .glance-chip { min-height: 1.5rem; text-decoration: none; }
  /* A long client name with a long position ("Oppose unless amended")
     is wider than a phone's card; it wraps inside its chip rather than
     running off the edge. */
  .glance-chips li { min-width: 0; max-width: 100%; }
  .glance-chip { max-width: 100%; white-space: normal; text-align: left; }
  .bill-header .card-actions { margin-top: var(--space-3); }
  .bill-header .bill-desc-header { margin-top: var(--space-3); }
  /* "Who handles this" inside What's next (renderWhoHandles). */
  .whats-next-who { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--rule); }
  /* "New since you last opened" (whatsNewStripHtml) — the top of the
     Summary. Its edge is --info, the unread dot's own colour: it is the
     dot's changes, named. Full width above the two columns, one change
     per line so a long hearing line wraps rather than widening a phone. */
  .whats-new-strip {
    border: 1px solid var(--card-edge);
    border-radius: var(--radius-lg); padding: var(--space-3) var(--space-5);
    margin-bottom: var(--space-4); background: var(--surface); min-width: 0;
  }
  .whats-new-strip .whats-new-title {
    font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--slate); margin: 0 0 var(--space-2);
  }
  .whats-new-list { list-style: none; margin: 0; padding: 0; }
  .whats-new-list li { overflow-wrap: anywhere; }
  .whats-new-strip .whats-new-more {
    display: inline-flex; align-items: center; min-height: 1.5rem;
    margin-top: var(--space-1); font-size: var(--text-xs);
  }
  /* "Lobbying on this bill" (lobbyingPanelHtml) — the organization pages'
     .lobbying-table, one tbody per quarter led by its quarter's name. */
  .lobbying-caveat { max-width: 44rem; }
  .lobbying-pad { padding: var(--space-3) var(--space-4); margin: 0; }
  .lobbying-totals { padding-bottom: 0; }
  .lobbying-table tr.quarter-row th {
    text-align: left; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--slate); padding: var(--space-3) var(--space-4) var(--space-1);
  }
  .lobbying-earlier .table-scroll { margin: var(--space-2) calc(-1 * var(--space-4)) var(--space-2); }
  @media (max-width: 900px) {
    .lobbying-table tr.quarter-row { padding-bottom: 0; border-bottom: 0; }
    .lobbying-table tr.quarter-row th { display: block; padding: var(--space-3) 0 0; }
  }
  /* "Support & opposition on file" (onFilePanelHtml) — the analysis
     it's as of with its picker, then Support and Opposition side by side,
     stacked on a phone. Names wrap anywhere: an analysis can list a
     coalition's full name as one long unbroken line. */
  .onfile-asof { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding-bottom: 0; }
  .onfile-asof > p { margin: 0; }
  .onfile-picker { display: flex; align-items: center; gap: var(--space-2); min-width: 0; max-width: 100%; }
  .onfile-picker select { min-width: 0; max-width: 100%; }
  .onfile-newer { padding-bottom: 0; }
  .onfile-sides {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4); padding: var(--space-3) var(--space-4);
  }
  @media (max-width: 600px) { .onfile-sides { grid-template-columns: minmax(0, 1fr); } }
  .onfile-side-head { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: var(--text-sm); }
  .onfile-side-head .count { font-weight: 600; color: var(--slate); }
  .onfile-list { list-style: none; margin: 0; padding: 0; }
  .onfile-list li { padding: var(--space-1) 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
  .onfile-list li:first-child { border-top: 0; }
  .onfile-none { margin: 0; }
  .onfile-neutral { overflow-wrap: anywhere; padding-top: 0; }
  .onfile-client {
    display: inline-flex; align-items: center; margin-left: var(--space-1);
    padding: var(--space-0) var(--space-2); border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent);
    font-size: var(--text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; vertical-align: middle;
  }
  .report-panel > :first-child,
  .summary-main > :first-child,
  .summary-side > :first-child { margin-top: 0; }

  /* Summary = a wide working column + a narrow author sidebar. */
  .summary-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 18rem;
    gap: var(--space-4); align-items: start;
  }
  /* minmax(0, 1fr), not 1fr: a bare 1fr track's minimum is its content's
     min-content width, so one long unbroken line (a code citation, a
     wide table) stretched the single column past a 375px screen and every
     panel below the top card ran off the right edge. */
  @media (max-width: 860px) { .summary-grid { grid-template-columns: minmax(0, 1fr); } }
  /* Our work (workPanelHtml): two equal columns of open folds, one on a
     narrow screen. minmax(0, 1fr) for the same reason as above. */
  .work-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4); align-items: start;
  }
  .work-col { min-width: 0; }
  .report-panel .work-col > :first-child { margin-top: 0; }
  .work-col:empty { display: none; }
  @media (max-width: 860px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }
  /* Text's Current text / Compare versions switch (textPanelHtml). */
  .text-views { display: inline-flex; }
  /* The newest history line, inside What's next (latestActionLineHtml). */
  .whats-next-latest {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-0) var(--space-2);
    margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--rule);
    font-size: var(--text-xs); color: var(--ink-2); overflow-wrap: anywhere;
  }
  .whats-next-latest-label { font-weight: 600; color: var(--ink); }
  .whats-next-latest-when { color: var(--muted); }

  /* The Summary's folds (report_body.html foldHtml): every box below
     What's next and Clients & positions is a native <details>, closed by
     default. The fold is the card; the panel it holds drops its own card
     chrome and its heading (kept for screen readers — the summary row
     already names it), so an open fold reads as one box, not a box in a
     box. Same rotating ▸ as .position-history-disclosure. */
  .report-fold {
    background: var(--surface); box-shadow: var(--shadow-rest);
    border-radius: var(--radius-lg); overflow: hidden;
  }
  .report-panel .report-fold { margin-top: var(--space-4); }
  .report-fold-head {
    cursor: pointer; list-style: none; display: flex; align-items: baseline;
    flex-wrap: wrap; gap: var(--space-1) var(--space-3);
    padding: var(--space-3) var(--space-4); min-height: 2.75rem;
  }
  .report-fold-head::-webkit-details-marker { display: none; }
  .report-fold-head::before {
    content: '▸'; display: inline-block; color: var(--slate);
    transition: transform var(--dur-fast) var(--ease);
  }
  .report-fold[open] > .report-fold-head::before { transform: rotate(90deg); }
  .report-fold-title { font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
  .report-fold-meta { font-size: var(--text-xs); color: var(--slate); }
  .report-fold-meta:empty { display: none; }
  .report-fold-body .panel { box-shadow: none; border-radius: 0; background: transparent; margin: 0; }
  .report-fold-body > .current-status-card { margin: 0 var(--space-4) var(--space-4); }
  #report .report-fold-body .panel-head { padding-top: 0; }
  .report-fold-body .panel-head .title {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }

  /* The 8-step legislative progress tracker: dots on a connecting line,
     each dot's incoming segment filled once the bill has passed it. The
     current step is a hollow dot with a gold focus-style ring. */
  .bill-progress {
    list-style: none; display: flex; margin: var(--space-4) 0 0; padding: 0;
    overflow-x: auto; overflow-y: hidden; position: relative;   /* offsetParent for scrollTrackerToCurrent() */
    scroll-snap-type: x proximity;   /* a swipe settles on a step's edge, never mid-label */
    container-type: inline-size;     /* the steps size off the track, not the viewport */
  }
  .bp-step {
    flex: 1 0 4.5rem; position: relative; text-align: center; scroll-snap-align: start;
    padding-top: var(--space-5); font-size: var(--text-2xs); color: var(--slate);
  }
  .bp-step::before {
    content: ""; position: absolute; top: 0.58rem; left: -50%; width: 100%;
    height: 2px; background: var(--rule); z-index: 0;
  }
  .bp-step:first-child::before { display: none; }
  .bp-dot {
    position: absolute; top: 0.15rem; left: 50%; transform: translateX(-50%);
    width: 0.85rem; height: 0.85rem; border-radius: var(--radius-pill);
    background: var(--surface); border: 2px solid var(--rule-strong); z-index: 1;
  }
  .bp-step.done::before,
  .bp-step.current::before { background: var(--ink); }
  .bp-step.done .bp-dot { background: var(--ink); border-color: var(--ink); }
  .bp-step.current .bp-dot {
    background: var(--surface); border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .bp-step.done .bp-label,
  .bp-step.current .bp-label { color: var(--ink); }
  .bp-step.current .bp-label { font-weight: 700; }
  /* A bill that stopped short (vetoed, died) ends on its own marker — a
     ✕ in the dot and the way it ended — not on a borrowed "Signed". */
  .bp-step.ended::before { background: var(--ink); }
  .bp-step.ended .bp-dot {
    display: flex; align-items: center; justify-content: center;
    width: 1rem; height: 1rem; top: 0.08rem;
    background: var(--error-soft); border-color: var(--error); color: var(--error);
    font-size: var(--text-2xs); font-weight: 700; line-height: 1;
  }
  .bp-step.ended .bp-label { color: var(--error); font-weight: 700; }
  /* Too narrow for all eight: four steps to a screen, exactly, so every
     scroll stop — the far end included — is a step's edge and no label
     is cut in half (audit Y25). 36rem = eight 4.5rem steps. */
  @container (max-width: 36rem) {
    .bp-step { flex: 1 0 25%; }   /* D7: four to a screen — "Chaptered" was cut at five */
  }
  .bill-progress { scrollbar-width: none; }
  .bill-progress::-webkit-scrollbar { display: none; }

  /* Author / coauthor sidebar. Party pills reuse the soft/solid semantic
     pairs so they read the same as every other status chip. */
  .author-name { font-weight: 600; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
  .author-primary .sub { margin: var(--space-0) 0 0; }
  .author-co { margin-top: var(--space-3); }
  .author-co-head { margin: 0 0 var(--space-1); }
  .author-co-list { list-style: none; margin: 0; padding: 0; }
  .author-co-list li { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) 0; font-size: var(--text-sm); }
  .author-asof { margin-top: var(--space-3); font-size: var(--text-2xs); font-style: italic; }

  /* Votes needed (votesNeededPanelHtml; votes_needed.py): the threshold,
     then the remaining steps. Each step's state is a word (.vn-state);
     the left rule only echoes it. */
  .votes-needed-panel { margin-top: var(--space-4); }
  .vn-threshold { font-size: var(--text-sm); }
  .vn-note { margin: var(--space-1) 0 0; font-size: var(--text-2xs); }
  .vn-head { margin: var(--space-3) 0 var(--space-1); }
  .vn-steps { list-style: none; margin: 0; padding: 0; }
  .vn-step { padding: var(--space-2) 0 var(--space-2) var(--space-3); border-left: 2px solid var(--rule); font-size: var(--text-sm); }
  .vn-step.current { border-left-color: var(--accent); }
  .vn-step.done .vn-label, .vn-step.skipped .vn-label { color: var(--slate); }
  .vn-step.stopped { border-left-color: var(--error); }
  .vn-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
  .vn-label { font-weight: 600; }
  .vn-state { font-size: var(--text-2xs); color: var(--slate); white-space: nowrap; }
  .vn-step.current .vn-state { color: var(--ink); font-weight: 600; }
  .vn-vote { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin-top: var(--space-1); }
  .party-pill { background: var(--accent-soft); color: var(--slate); }
  .party-pill.dem { background: var(--info-soft); color: var(--info); }
  .party-pill.rep { background: var(--error-soft); color: var(--error); }
  .party-pill.ind { background: var(--accent-soft); color: var(--slate); }

  /* Votes as proportional aye/nay bars. The bar is a flex row of coloured
     segments; the legend repeats the counts so the numbers aren't carried
     by colour alone. */
  .vote-card { padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); }
  .vote-card:first-child { padding-top: var(--space-1); }
  .vote-card:last-child { border-bottom: 0; padding-bottom: var(--space-1); }
  .vote-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
  .vote-desc { font-weight: 600; font-size: var(--text-sm); }
  .vote-outcome { }
  .vote-outcome.pass { background: var(--good-soft); color: var(--good); }
  .vote-outcome.fail { background: var(--error-soft); color: var(--error); }
  .vote-meta { margin: var(--space-0) 0 var(--space-2); }
  .vote-bar {
    display: flex; gap: var(--space-0); height: 0.7rem; border-radius: var(--radius-pill);
    overflow: hidden; background: var(--accent-soft);
  }
  .vote-seg { height: 100%; }
  .vote-seg.yea { background: var(--good); }
  .vote-seg.nay { background: var(--error); }
  .vote-seg.other { background: var(--rule-strong); }
  .vote-legend { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-2); font-size: var(--text-xs); color: var(--slate); }
  .vote-key { display: inline-flex; align-items: center; gap: var(--space-1); }
  .vote-key::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: var(--radius-xs); background: currentColor; }
  .vote-key.yea::before { background: var(--good); }
  .vote-key.nay::before { background: var(--error); }
  .vote-key.other::before { background: var(--rule-strong); }
  .vote-who-btn { margin-top: var(--space-2); }
  .vote-who { margin-top: var(--space-3); display: grid; gap: var(--space-3); }
  .vote-who[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .vote-who-group h3 { margin: 0 0 var(--space-1); font-size: var(--text-xs); font-weight: 600; color: var(--slate); }
  .vote-who-list { list-style: none; margin: 0; padding: 0; columns: 15rem auto; column-gap: var(--space-4); font-size: var(--text-sm); }
  .vote-who-list li { padding: var(--space-0) 0; break-inside: avoid; }
  .vote-who-list li > * + * { margin-left: var(--space-1); }

  /* The indexed full text (Text tab) — its own scroller, like the redline. */
  .bill-text { max-height: 40rem; overflow-y: auto; font-size: var(--text-sm); line-height: 1.6; }
  .bill-text p { margin: 0 0 var(--space-3); }

  /* Compare, two-pane: facing "Was" / "Now" columns. Each pane keeps the
     existing .redline scroller; a gap block holds the line where one side
     added or removed a paragraph the other doesn't have. */
  .redline-2pane { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .redline-pane { min-width: 0; }
  .redline-pane-head {
    margin: 0 0 var(--space-1); font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; font-size: var(--text-2xs);
  }
  .redline-gap { min-height: 1.3rem; border-left: 2px solid var(--rule); opacity: 0.4; margin: var(--space-2) 0; }
  @media (max-width: 720px) { .redline-2pane { grid-template-columns: 1fr; } }

  /* Compare, by section (Oct 7 audit D3): an Inline / Side by side
     toggle, an outline of the changed sections, then each section with
     its own "Copy this change". The sections scroll as one — inside a
     section the panes no longer scroll on their own, so the Was and Now
     of one paragraph stay level. A section a client watches is marked. */
  .redline-toolbar { display: flex; justify-content: flex-end; margin: var(--space-2) 0; }
  .redline-view { display: inline-flex; gap: var(--space-1); }
  .redline-view button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
  .redline-outline ol { margin: 0 0 var(--space-3); padding-left: var(--space-5); font-size: var(--text-xs); }
  .redline-outline li { margin: var(--space-1) 0; }
  .redline-outline li .sub { margin-left: var(--space-2); }
  .redline-outline-client a { font-weight: 600; }
  .redline-sections { max-height: 40rem; overflow-y: auto; }
  .redline-sections .redline { max-height: none; overflow: visible; }
  .redline-section { border-top: 1px solid var(--rule); padding: var(--space-3) 0; }
  .redline-section--client { border-left: 2px solid var(--accent); padding-left: var(--space-3); }
  .redline-section-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-sm);
  }
  .redline-client-note { font-size: var(--text-2xs); color: var(--accent); font-weight: 600; margin-top: var(--space-1); }

  /* The loading card's bars, and the lazy lists' row bars: named here
     rather than set per bar in the template. */
  .report-skel-badge { width: 18%; height: 1.4rem; margin-bottom: var(--space-2); }
  .report-skel-meta { width: 22%; height: 0.9rem; margin-bottom: var(--space-3); }
  .report-skel-title { width: 70%; height: 1.1rem; margin-bottom: var(--space-2); }
  .report-skel-line { width: 55%; }
  .report-skel-pair .skeleton-bar { width: 40%; }
  .report-skel-pair .skeleton-row + .skeleton-row .skeleton-bar:last-child { width: 30%; }
  .report-skel-trio .skeleton-bar { width: 30%; }
  .report-skel-trio .skeleton-bar:last-child { width: 15%; }
  /* A quiet line that sits flush in its box (an error, a "nothing to
     compare"), a note's full-width field, and the Text tab's two notes. */
  #report .report-msg { margin: 0; }
  #report .bill-note-text { width: 100%; }
  #report .report-text-cost { margin-top: var(--space-2); }
  #report .report-text-offer { margin-bottom: var(--space-2); }
  /* History tables scroll sideways inside their panel, phone included
     (unlike .table-scroll, which lets bill cards reflow under 900px). */
  #report .report-table-scroll { overflow-x: auto; }
  #redline-body { padding: 0 var(--space-4) var(--space-4); }

  /* ── Bill report v5 (docs/design-system; ui_kits/app BillReport) ──
     Laid over the rules above and over the shared .card / .panel /
     .settings-tabs / .current-status-card ones, scoped to #report (this
     page's own container) and #back-link, so no other page moves. White
     cards on a hairline, no shadow, a serif title row and no header rule;
     the bill number in mono navy ahead of a serif page title; labels in
     sentence case; the progress tracker in its own card, navy as it
     moves. Buttons and fields keep the app's shapes, as on the
     dashboard; in-card actions are the dashboard's 30px .small. */
  #back-link {
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.875rem;
    margin: 0; padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-button);
    background: none; color: var(--ink-2); font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
  }
  @media (hover: hover) { #back-link:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; } }

  /* The header card: status line, the title, what's next + clients,
     then the actions under a hairline and the description in a tint. */
  #report .bill-header {
    display: flex; flex-direction: column; gap: var(--space-3);
    padding: var(--space-5);
  }
  #report .bill-header > * { margin: 0; }
  #report .bill-header .status-line { align-items: center; gap: var(--space-1) var(--space-3); }
  #report .bill-header .status-badge { margin: 0; }
  #report .bill-header .status-since { margin: 0; font-size: var(--text-xs); color: var(--muted); }
  #report .bill-title {
    font-family: var(--font-display); font-size: var(--text-display); font-weight: 500;
    line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance;
  }
  #report .bill-title-number {
    font-variant-numeric: tabular-nums; font-size: var(--text-xl); font-weight: 500; letter-spacing: 0; color: var(--ink);
  }
  #report .bill-header .card-actions { padding-top: var(--space-3); border-top: 1px solid var(--rule); }
  #report .card-actions .flagged-mark { color: var(--muted); }
  /* D7: the "Flagged by … on …" note is the one part of the action row that
     may give way: it shrinks and wraps its own text (basis 0), so the buttons
     and the ⋮ menu stay together on one line. On a phone the note takes a
     line of its own above them rather than pushing the ⋮ down.
     In between (a ~1024px window, sidebar open) the row was too narrow for
     the note's 7rem beside every button, and the line broke before the ⋮
     (fresh-eyes walkthrough, Nov 12 2026). So once the row is narrower than
     28rem — the widest button set (two buttons and the ⋮, now that Print
     and Copy update are in the menu) plus the note's 7rem — the note's basis
     jumps to the whole row (capped at 100%) and it sits on its own line
     above the buttons; wider, the calc is negative, clamps to 0, and the
     note shares the line as before. A width check on the row itself, not
     the viewport, so it holds with the sidebar open or closed. */
  #report .bill-header .card-actions > .flagged-mark {
    flex: 1 1 0; min-width: 7rem;
    flex-basis: max(0px, calc((28rem - 100%) * 999)); max-width: 100%;
  }
  #report .bill-header .card-actions > button, #report .bill-header .card-actions > .row-menu { flex: none; }
  @media (max-width: 480px) {
    #report .bill-header .card-actions { gap: var(--space-1); }
    #report .bill-header .card-actions > button { padding-inline: var(--space-2); }
    /* The note and the ⋮ share the first line; the two buttons share the
       second, stretched. Left in markup order the ⋮ (a 44px touch target)
       missed the buttons' line by a few pixels and sat on a third alone. */
    #report .bill-header .card-actions > .flagged-mark { order: -2; flex-basis: calc(100% - 4rem); }   /* the ⋮, the gap and the note's own margin; it grows into the rest */
    #report .bill-header .card-actions > .row-menu { order: -1; }
    #report .bill-header .card-actions > button { flex: 1 1 auto; }
  }
  #report .bill-desc {
    padding: 0;   /* plain text, not a box inside the card (D2) */
    color: var(--ink-2); font-size: var(--text-sm); line-height: 1.55; max-width: 54rem; text-wrap: pretty;
  }
  #report .bill-header .bill-link { align-self: flex-start; font-size: var(--text-xs); color: var(--link); }
  @media (hover: hover) { #report .bill-header .bill-link:hover { color: var(--ink); } }

  /* The progress tracker in its own card; navy where the bill has been. */
  #report .bill-progress-card {
    margin-bottom: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-3);
    background: var(--surface); border: 1px solid var(--card-edge); border-radius: var(--radius-lg);
  }
  /* The bottom pad keeps a phone's sideways scrollbar off the labels. */
  #report .bill-progress-card .bill-progress { margin: 0; padding-bottom: var(--space-1); }
  /* Inside the header card it is part of the bill's identity, not a
     second box: no card of its own. */
  #report .bill-header .bill-progress-card {
    margin: var(--space-4) 0 0; padding: 0; background: none; border: 0; border-radius: 0;
  }
  #report .bp-step.done::before, #report .bp-step.current::before, #report .bp-step.ended::before { background: var(--link); }
  #report .bp-step.done .bp-dot { background: var(--link); border-color: var(--link); }
  #report .bp-step.current .bp-dot { border-color: var(--link); box-shadow: 0 0 0 3px var(--info-soft); }
  #report .bp-step.done .bp-label { color: var(--ink-2); }
  #report .bp-step.current .bp-label { color: var(--ink); font-weight: 600; }
  #report .bp-step.ended .bp-label { font-weight: 600; }

  /* Tabs: the design system's underline strip — muted words, the
     current one in ink. */
  #report .report-tabs { gap: var(--space-5); margin-top: 0; }
  #report .report-tabs .settings-tab { font-size: var(--text-sm); font-weight: 400; color: var(--muted); }
  #report .report-tabs .settings-tab[aria-selected="true"] { color: var(--ink); font-weight: 500; }
  @media (hover: hover) { #report .report-tabs .settings-tab:hover { color: var(--ink); } }

  /* "New since you last opened": a navy-tinted card, its title led by
     the unread dot it names. */
  #report .whats-new-strip {
    border: 1px solid var(--card-edge); border-radius: var(--radius-lg); padding: var(--space-4);
    background: var(--surface);
  }
  #report .whats-new-strip .whats-new-title {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--text-xs); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink);
  }
  #report .whats-new-title::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-pill); background: currentColor; flex: none; }

  /* Cards: hairline edge, no shadow, serif title, no rule under it. */
  #report .panel-head { border-bottom: 0; padding: var(--space-4) var(--space-4) var(--space-1); }
  #report .panel-head .title,
  #report .current-status-card > .current-status-label {
    font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em; text-transform: none; color: var(--ink);
  }
  #report .panel-head .sub { color: var(--muted); }
  /* A card header's action is a 30px small button (the dashboard's
     .small), including the ones shared scripts draw (Log a meeting). */
  #report .panel-head > button.secondary {
    min-height: 1.875rem; padding: 0 var(--space-3); font-size: var(--text-xs);
  }
  .report-panel-body { padding: var(--space-2) var(--space-4) var(--space-4); }
  p.report-panel-body { margin: 0; }
  /* What's next and Latest action are cards too. The milestone's left
     edge on Latest action stays (milestoneClass(), as in History). */
  #report .current-status-card {
    padding: var(--space-4);
  }
  #report .current-status-card.whats-next { border-left: 0; }
  #report .current-status-card > .current-status-label { margin-bottom: var(--space-2); }
  #report .current-status-card .current-status-action { font-weight: 600; }
  #report .whats-next-who .current-status-label {
    font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none;
    color: var(--muted); margin-bottom: var(--space-1);
  }
  /* Letters on this bill: rows inset in a tint, as the kit draws them. */
  #report #letters-list .saved-row {
    padding: var(--space-2) var(--space-3); margin-bottom: var(--space-1);
    border-bottom: 0; border-radius: var(--radius-md); background: var(--paper-50);
  }
  #report .author-name { font-weight: 500; }

  /* Tables: a tinted head row in sentence case; rows tint on hover. */
  #report .panel th {
    background: var(--paper-50); font-size: var(--text-2xs); font-weight: 500;
    letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  @media (hover: hover) { #report .panel tbody tr:hover { background: var(--paper-50); } }
  /* History's chamber / hearing-type column: a plain secondary word in
     sentence case, not a navy all-caps label. */
  #report td.chamber { font-size: var(--text-sm); font-weight: 400; text-transform: none; color: var(--ink-2); }
  #report td.chamber::first-letter { text-transform: uppercase; }
  #report td .tag { text-transform: none; letter-spacing: 0; }
  #report .lobbying-table tr.quarter-row th {
    background: transparent; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2);
  }
  #report .redline-pane-head { font-size: var(--text-xs); letter-spacing: 0; text-transform: none; color: var(--muted); }

  /* Votes: each roll call in its own tinted, rounded block; "Who
     voted" opens as a white card inside it. */
  #report .vote-card,
  #report .vote-card:first-child,
  #report .vote-card:last-child {
    padding: var(--space-3); margin-bottom: var(--space-1);
    border-bottom: 0; border-radius: var(--radius-md); background: var(--paper-50);
  }
  #report .vote-who {
    padding: var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--surface);
  }

  @media (max-width: 640px) {
    #report .bill-header { padding: var(--space-4); }
    #report .bill-title { font-size: var(--text-lg); }
    #report .bill-title-number { font-size: var(--text-md); }
  }


  .head-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

  /* One suggested recipient on the letter editor (see routing.py). A
     row rather than a card: this is a list to scan down, and the reason
     each name is on it matters as much as the name. */
  .routing-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--rule);
  }
  .routing-row:last-child { border-bottom: 0; }
  .routing-row .sub { margin: var(--space-0) 0 0; font-size: var(--text-xs); }
  .routing-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); flex-shrink: 0; }
  @media (max-width: 640px) {
    .routing-row { flex-direction: column; }
  }
  /* The other house's staff (D3): collapsed under the hearing's own
     house, since they cover the subject but not this committee. */
  .routing-other { margin-top: var(--space-2); border-top: 1px solid var(--rule); padding-top: var(--space-2); }
  .routing-other > summary { cursor: pointer; font-size: var(--text-sm); color: var(--slate); }
  /* Only the top match shows; the rest fold behind a "Show N more"
     button (N3-b), at every width. The button is .linklike; this gives
     it a finger-sized hit area without making it look like a button. */
  .routing-more-toggle {
    display: inline-flex; align-items: center; min-height: 2.75rem;
    padding: var(--space-1) 0; font-size: var(--text-sm);
  }
  .routing-directory-link { margin: var(--space-2) 0 0; font-size: var(--text-sm); }
  /* "Address to" / "Brief and follow up" (Oct 7 audit P4): the two
     halves of the letter editor's panel, labelled like a field label. */
  .routing-heading {
    color: var(--ink); font-weight: 600; font-size: var(--text-xs);
    margin: var(--space-3) 0 var(--space-1);
  }
  .routing-heading:first-child { margin-top: 0; }

  /* The flat table. Cells top-align so a staffer's two lines (name +
     title) and a legislator's two lines (name + meta) read straight
     across, and the committee chips wrap without dragging the row's
     other cells to the middle. */
  .dir-table td { vertical-align: top; }
  .dir-staffer { font-weight: 600; }
  @media (hover: hover) { .dir-staffer:hover { color: var(--ink); } }
  .dir-legislator { font-size: var(--text-sm); }
  /* .sub carries a 2rem bottom margin for use as a page subtitle. In a
     table cell that turns a two-line staffer into a 212px row, so it is
     reset for the secondary lines inside this page's tables. */
  .dir-table .sub { margin: 0; font-size: var(--text-xs); }
  .dir-legislator-meta { display: inline-flex; align-items: center; gap: var(--space-2); }
  /* The party dot — a small square in the party's own hue (see
     partyDotClass() in directory_body.html), so the chamber/district/
     party line carries the party at a glance without a coloured word. */
  .party-dot { width: 7px; height: 7px; border-radius: var(--radius-xs); flex: none; }
  .party-dot.party-d { background: var(--info); }
  .party-dot.party-r { background: var(--error); }
  .party-dot.party-other { background: var(--slate); }
  .dir-asof { white-space: nowrap; }
  .dir-asof > div { font-size: var(--text-xs); color: var(--slate); }
  /* The stale pill and its toggle sit under the date, stacked. The pill
     is the warn hue as an outline; the toggle is a plain text control
     (.linklike) so the row isn't crowded with a button per line. */
  .dir-stale-badge { margin-top: var(--space-1); border-color: var(--warn); color: var(--warn); }
  .dir-stale-toggle { display: block; margin-top: var(--space-1); font-size: var(--text-xs); }
  /* The row's own ways in — the staffer's direct line and email under
     their title, the office's room and main line under the office. */
  .dir-reach { margin-top: var(--space-0); overflow-wrap: anywhere; }
  /* An office the sheet lists with nobody under it: still a row, with
     its room and main line, quieter than a named contact. */
  .dir-office-row .dir-staffer { color: var(--slate); }
  /* "Showing 50 of 496" and the Show more button under the table. */
  .dir-more {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
    padding: var(--space-3) 0;
  }
  .dir-more .sub { margin: 0; font-size: var(--text-xs); }

  /* Phone: the same card reflow the bill tables use (.bill-cards, P2-23)
     — the four-column table was 440px of content in a 327px column,
     scrolled sideways. Each row becomes a stacked block under a rule;
     the staffer and office lead, committees follow with a label, and
     the as-of date sits on one line with its stale toggle. */
  @media (max-width: 900px) {
    .dir-table, .dir-table tbody, .dir-table tr, .dir-table td { display: block; width: auto; }
    .dir-table thead { display: none; }
    .dir-table tr { border-bottom: 1px solid var(--rule-strong); padding: var(--space-3) 0; }
    .dir-table tr:last-child { border-bottom: 0; }
    .dir-table td { border: 0; padding: var(--space-1) 0; }
    /* A labelled dash says nothing a card can't say by leaving it out. */
    .dir-table td.col-committees.is-empty { display: none; }
    .dir-table td.col-committees::before {
      content: "Committees"; display: block; margin-bottom: var(--space-1);
      font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em;
      text-transform: uppercase; color: var(--slate);
    }
    .dir-table td.col-asof {
      display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
      white-space: normal;
    }
    .dir-table td.col-asof .dir-stale-badge, .dir-table td.col-asof .dir-stale-toggle { margin-top: 0; }
  }
  /* A contact somebody has reported as wrong. Dimmed rather than
     hidden: it is still the only number anyone has, and the person
     dialling it should see both that it exists and that it's suspect.
     Dimmed by --slate, not opacity: 0.55 took the number itself below
     AA, and the Stale badge already says why the row is quieter. */
  .stale-row td { color: var(--slate); }
  .stale-note { color: var(--warn); font-style: italic; }
  /* Which staffer the search actually hit. The office is shown whole
     for context, so without this a search for "water" lists four names
     and says nothing about which one handles water. */
  .matched-row { background: var(--accent-soft); }
  .matched-note { color: var(--accent); font-style: italic; }
  /* A value the firm typed over the sheet (contact_detail_body.html):
     the "Your edit" pill, then the sheet's own value one click away.
     Wraps under the value on a phone rather than pushing it wide. */
  .dir-edit-badge { color: var(--slate); background: var(--accent-soft); }
  .dir-edit-line {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2);
    margin-top: var(--space-1); font-size: var(--text-xs);
  }
  .dir-head-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .dir-head-line .dir-edit-line { margin-top: 0; }
  .dir-sheet-changed { color: var(--warn); font-weight: 600; }
  .dir-use-sheet { font-size: var(--text-xs); text-align: left; }
  .dir-head-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .dir-notes { margin: var(--space-1) 0 0; font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
  /* The contact's edit form: one labelled field per row, full width. */
  .dir-edit-form { display: grid; gap: var(--space-3); margin: var(--space-4) 0 0; }
  .dir-edit-field input, .dir-edit-field textarea { width: 100%; }
  .dir-edit-hint { margin: 0; }
  .dir-edit-actions { margin-top: 0; }
  /* Assignment chips reuse .cite from the code-section results — same
     job, a small labelled fact attached to a row. */
  .cite-caucus { border-color: var(--accent); }
  .cite-issue { border-style: dashed; }

  /* The filter toolbar: a search box that grows, then the chamber and
     committee selects. Wraps to stacked full-width controls on a phone.
     The search box is a bordered field wrapping the icon + a borderless
     input, so the icon sits inside the field rather than beside it.
     Same rounded-rectangle shape as .search-bar-field on /lookup. */
  .dir-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
  .dir-toolbar[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .dir-search-box {
    display: flex; align-items: center; gap: var(--space-2); flex: 1 1 16rem;
    min-width: 0; padding: 0 var(--space-3); height: 3rem;
    border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--slate);
  }
  .dir-search-box:focus-within { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }
  .dir-search-box svg { flex: none; }
  .dir-search-box input {
    flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; color: var(--ink);
  }
  .dir-toolbar select { flex: 0 0 auto; }
  /* The filters behind the "Filters" button: their own wrapping row
     under the search box, chamber and sort. */
  .dir-more-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); flex: 1 1 100%; }
  .dir-more-filters[hidden] { display: none; }
  .dir-toolbar .dir-filters-toggle { flex: 0 0 auto; width: auto; margin: 0; }
  .dir-toolbar .dir-filters-toggle[hidden] { display: none; }
  .dir-toolbar .dir-filters-toggle[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--rule-strong); }
  @media (max-width: 640px) {
    /* Chamber and sort share a line; the folded filters stack. */
    .dir-toolbar select { flex: 1 1 8rem; }
    .dir-more-filters select { flex: 1 1 100%; }
  }
  /* "More" beside "Add a contact": the app's row menu under an ordinary button. */
  .dir-more-menu[hidden] { display: none; }
  .dir-more-menu .row-menu-dropdown button { font-size: var(--text-sm); white-space: nowrap; }
  .import-row { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; }
  .import-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
  .file-drop {
    display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer;
    border: 1px dashed var(--rule-strong); border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4); font-size: var(--text-xs);
  }
  @media (hover: hover) { .file-drop:hover { border-color: var(--accent); color: var(--accent); } }
  /* The mapping table can be ninety rows long (one per column of the
     sheet), so its own scroller is capped in height — .table-scroll
     already handles the sideways case for every table here. */
  #map-table { font-size: var(--text-xs); }
  #import-step-map .table-scroll { max-height: 26rem; overflow-y: auto; }
  /* Under each role select: how that column will actually be read —
     "Committee" means two different things depending on whether the
     header names one committee or just says "Committees". */
  .map-role-note { margin-top: var(--space-1); }
  /* .modal-panel label is display:block and modal inputs stretch, so the
     box-then-words row is spelled out at that specificity. */
  .modal-panel .map-commas { display: flex; align-items: center; gap: var(--space-1);
    margin-top: var(--space-1); font-size: var(--text-xs); }
  .modal-panel .map-commas[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */
  .modal-panel .map-commas input { width: auto; flex: none; margin: 0; }
  /* "Add a contact": the office-or-committee choice, as one row of
     radios borrowing the box-then-words row above. */
  .modal-panel .add-where { border: 0; padding: 0; margin: 0; display: flex;
    flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
  .modal-panel .add-where legend { padding: 0; margin-bottom: var(--space-1); width: 100%; }
  .modal-panel .add-where .map-commas { font-size: var(--text-sm); margin-top: 0; }
  #add-committee-wrap[hidden], #add-office-wrap[hidden] { display: none; }
  /* The dry-run counts, the sheet's warnings, and the stale flags that
     won't carry over — above the Import button, and again on the page
     afterwards, as a short list. */
  .import-result-list { margin: var(--space-1) 0 0; padding-left: var(--space-5); }
  /* The import dialog holds a column-mapping table dozens of rows wide,
     so it opts out of .modal-panel's 26rem cap — wide enough for the
     table, still capped shy of the viewport on a laptop. */
  .modal-panel-wide { max-width: 44rem; }

  /* ── Capitol directory v5 (docs/design-system: Card, data, forms) ──
     Laid over the directory rules above, scoped to .directory-page
     (DIRECTORY_BODY; the contact page keeps its own). Serif page, card
     and dialog titles; the three counts as StatTiles led by a ringed
     IconTile, hairline edge, no lift; the staff table in a flush Card
     whose head is a tinted, rounded band in sentence case, whose rows
     tint on hover, and whose "Showing N of M" is the footer under a
     hairline; committee / caucus / issue chips and the Stale pill as
     borderless tinted pills. Buttons and fields keep the app's own
     shape (button shape is to change app-wide in one pass), as do the
     --gold focus ring, the party dot and the phone card reflow. */
  .directory-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  /* Spacing the page's cards, dialogs and import notes used to carry
     inline: a card's own title flush to its top, a paste box the full
     width, a block a small / medium / full step below the last, and the
     roster preview a scroller of its own. */
  .directory-page .dir-card-title { margin-top: 0; }
  .directory-page .dir-wide { width: 100%; }
  .directory-page .dir-gap-sm { margin-top: var(--space-2); }
  .directory-page .dir-gap-md { margin-top: var(--space-3); }
  .directory-page .dir-gap { margin-top: var(--space-4); }
  .directory-page .dir-roster-scroll { max-height: 20rem; }

  /* The counts as one slim line (Nov 13 declutter, was three StatTiles
     that pushed the list halfway down the screen): a small icon tile
     before each, a stale count above zero as the warning pill. */
  .dir-stats {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4);
    margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--ink-2);
  }
  .dir-stats:empty { display: none; }
  .dir-stats .dir-stat { display: inline-flex; align-items: center; gap: var(--space-2); }
  .dir-stats .dir-stat strong { color: var(--ink); font-weight: 600; }
  .dir-stats .icon-tile { width: 1.5rem; height: 1.5rem; box-shadow: inset 0 0 0 1px var(--rule); }
  .dir-stats .icon-tile svg { width: 0.875rem; height: 0.875rem; }
  .dir-stats .dir-stat-quiet { color: var(--muted); }
  .dir-stats .dir-stat-stale {
    background: var(--warn-soft); color: var(--ink); font-weight: 500;
    border-radius: var(--radius-pill); padding: var(--space-0) var(--space-3) var(--space-0) var(--space-0);
  }
  /* A notice's "More": the rest of it, on its own line once opened. */
  .directory-page .dir-more-toggle { margin-left: var(--space-1); }
  .directory-page .dir-more-toggle + .linklike { margin-left: var(--space-3); }
  .directory-page .dir-more-rest:not([hidden]) { display: block; margin-top: var(--space-1); }

  /* The staff table's flush Card. */
  .directory-page .dir-card {
    background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  }
  .directory-page .dir-card .dir-more { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--rule); }
  .directory-page .dir-more .sub { color: var(--muted); }
  /* A row: the staffer in ink (underlined on hover — a link to their
     page), the office in ink over muted meta. */
  .directory-page a.dir-staffer { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  @media (hover: hover) { .directory-page a.dir-staffer:hover { color: var(--ink); } }
  .directory-page .dir-office-row .dir-staffer { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }
  .directory-page .dir-legislator { font-weight: 500; color: var(--ink); }
  .directory-page .dir-table .sub { color: var(--ink-2); }
  .directory-page .dir-asof > div { color: var(--muted); }
  /* A stale row stays dimmed, the names included. */
  .directory-page .stale-row :is(a.dir-staffer, .dir-legislator, .sub) { color: var(--slate); }
  /* Chips: borderless tinted pills. Caucus takes the navy tint; an issue
     area keeps its dashed edge, so the three still differ without colour. */
  .directory-page .dir-table .cite {
    align-items: center; min-height: 1.375rem; margin: 0 var(--space-1) var(--space-1) 0; padding: 0 var(--space-2);
    border: 0; border-radius: var(--radius-pill); background: var(--paper-250); color: var(--ink-2);
    font-size: var(--text-2xs); font-weight: 500; line-height: 1.3;
  }
  .directory-page .dir-table .cite-caucus { background: var(--info-soft); color: var(--link); }
  .directory-page .dir-table .cite-issue { border: 1px solid var(--rule-card); border-style: dashed; }
  .directory-page .dir-stale-badge { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
  @media (min-width: 901px) {
    .directory-page .dir-card .table-scroll { padding: var(--space-2) var(--space-2) 0; }
    .directory-page .dir-table { border-collapse: separate; border-spacing: 0; }
    .directory-page .dir-table th {
      border-top: 0; border-bottom: 0; background: var(--paper-50); padding-top: var(--space-2); padding-bottom: var(--space-2);
      font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .directory-page .dir-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .directory-page .dir-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .directory-page .dir-table th:first-child, .directory-page .dir-table td:first-child { padding-left: var(--space-3); }
    .directory-page .dir-table th:last-child, .directory-page .dir-table td:last-child { padding-right: var(--space-3); }
    .directory-page .dir-table td { padding-top: var(--space-3); padding-bottom: var(--space-3); }
    .directory-page .dir-table tbody tr:last-child td { border-bottom: 0; }
    @media (hover: hover) { .directory-page .dir-table tbody tr:hover td { background: var(--paper-50); } }
  }
  /* The phone card reflow, inside the card: inset from its edge, a
     hairline between people, the Committees label in sentence case. */
  @media (max-width: 900px) {
    .directory-page .dir-card .table-scroll { padding: 0 var(--space-4); }
    .directory-page .dir-table tr { border-bottom-color: var(--rule); }
    .directory-page .dir-table td.col-committees::before {
      font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
  }

  /* Office by office (Nov 14 2026): each office is a block under a
     hairline — the member, then the room and main line, then how many
     staff (the button that opens them) — with its people in the same
     .dir-table rows as before, indented under a rule. The staff tables
     share fixed column widths so names, numbers and committees line up
     from one office to the next. */
  .directory-page .dir-office + .dir-office { border-top: 1px solid var(--rule); }
  .directory-page .dir-office-head {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    gap: var(--space-1) var(--space-4); align-items: start; padding: var(--space-3) var(--space-4);
  }
  .directory-page .dir-office-head .sub { margin: 0; font-size: var(--text-xs); color: var(--ink-2); }
  .directory-page .dir-office-side {
    display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); text-align: right;
  }
  .directory-page .dir-office-side .sub { color: var(--muted); }
  .directory-page .dir-office-side .linklike { font-size: var(--text-sm); }
  .directory-page .dir-office-toggle {
    display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); white-space: nowrap;
  }
  .directory-page .dir-office-toggle .dir-stale-badge { margin-top: 0; }
  .directory-page .dir-office-toggle::after {
    content: ""; width: 0.4rem; height: 0.4rem; margin-left: var(--space-1);
    border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
    transform: translateY(-25%) rotate(45deg);
  }
  .directory-page .dir-office-toggle[aria-expanded="true"]::after { transform: translateY(15%) rotate(-135deg); }
  .directory-page .dir-office-staff {
    margin: 0 var(--space-4) var(--space-3); padding-left: var(--space-2); border-left: 2px solid var(--rule);
  }
  .directory-page .dir-office-staff[hidden] { display: none; }
  .directory-page .dir-staff-table { width: 100%; margin: 0; }
  @media (min-width: 901px) {
    .directory-page .dir-staff-table { table-layout: fixed; }
    .directory-page .dir-staff-table td { padding-top: var(--space-2); padding-bottom: var(--space-2); }
    .directory-page .dir-staff-table td.col-staffer { width: 26%; }
    .directory-page .dir-staff-table td.col-reach { width: 30%; }
    .directory-page .dir-staff-table td.col-asof { width: 8.5rem; text-align: right; }
    .directory-page .dir-staff-table .dir-stale-toggle { margin-top: 0; }
  }
  @media (max-width: 900px) {
    .directory-page .dir-office-head { grid-template-columns: minmax(0, 1fr); }
    .directory-page .dir-office-reach:empty { display: none; }
    .directory-page .dir-office-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); text-align: left; }
    .directory-page .dir-staff-table td.col-reach.is-empty { display: none; }
  }

  /* The Members / Committees tabs, and a committee's block: the same
     shape as an office, its seats in three columns — the member, the
     office's room and line, the staffer there who covers the committee. */
  .directory-page .dir-views { margin-bottom: var(--space-4); }
  .directory-page .dir-toolbar select[hidden] { display: none; }
  .directory-page .dir-committee-table .cite { margin-left: var(--space-2); }
  .directory-page .dir-committee-table .dir-legislator-meta { display: flex; }
  .directory-page .dir-seat-staffer + .dir-seat-staffer { margin-top: var(--space-2); }
  .directory-page span.dir-staffer { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
  @media (min-width: 901px) {
    .directory-page .dir-committee-table td.col-reach { width: 24%; }
  }

  /* The "Needs a check" tick beside the selects, the house (or
     recently-changed) jump strip above the list, and the heading over
     each of those groups. The alphabetical list has neither. */
  .directory-page .dir-check-filter {
    display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm);
    color: var(--ink-2); white-space: nowrap;
  }
  .directory-page .dir-check-filter[hidden] { display: none; }
  .directory-page .dir-az {
    display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3);
    margin-bottom: var(--space-3); font-size: var(--text-sm);
  }
  .directory-page .dir-az[hidden] { display: none; }
  .directory-page .dir-az span { color: var(--muted); }
  .directory-page .dir-letter {
    margin: 0; padding: var(--space-2) var(--space-4); background: var(--paper-50);
    font-size: var(--text-xs); font-weight: 600; color: var(--muted);
    border-top: 1px solid var(--rule); scroll-margin-top: var(--space-4);
  }
  .directory-page .dir-letter:first-child { border-top: 0; }
  .directory-page .dir-letter + .dir-office { border-top: 0; }

  /* The counts and "Sources and updates" on one quiet line under the
     search; the housekeeping it opens sits between that line and the list. */
  .directory-page .dir-meta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--space-1) var(--space-4); margin-bottom: var(--space-3);
  }
  .directory-page .dir-meta .dir-stats { margin-bottom: 0; }
  .directory-page .dir-meta-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4);
    margin-left: auto; font-size: var(--text-sm);
  }
  .directory-page .dir-sources-toggle { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .directory-page .dir-sources-toggle .dir-stale-badge { margin-top: 0; }
  /* Nothing to flag: the toggle's marker stays out of sight. */
  .directory-page .dir-sources-toggle > [hidden] { display: none; }
  .directory-page .dir-sources { margin-bottom: var(--space-4); }
  .directory-page .dir-sources[hidden] { display: none; }
  .directory-page .dir-sources-import { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
  .directory-page .dir-sources-import .sub { margin: 0; }

  /* Committee rosters: a card with a serif title. */
  .directory-page .card > h2.section {
    font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--space-2);
  }
  .directory-page .card .sub { color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
  .directory-page .field-label { font-weight: 500; }
  /* The dialogs' titles in the card serif. */
  .directory-page .modal-head .title {
    font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em;
  }
  .directory-page .modal-head .sub { color: var(--ink-2); }
  /* The column-mapping and pasted-roster check tables: inset on a
     hairline, a tinted sentence-case head. */
  .directory-page :is(#import-step-map, #roster-preview) .table-scroll { border: 1px solid var(--rule); border-radius: var(--radius-md); }
  .directory-page :is(#import-step-map, #roster-preview) th {
    background: var(--paper-50); font-size: var(--text-2xs); font-weight: 500;
    letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .directory-page :is(#import-step-map, #roster-preview) tbody tr:last-child td { border-bottom: 0; }
  .directory-page #map-body td > strong { font-weight: 500; }

  /* ── Contact page v5 (docs/design-system: Card, data, forms) ──
     One directory contact (CONTACT_DETAIL_BODY), laid over the directory
     rules above and scoped to .contact-page, since .client-facts, .cite,
     .result-truncated and the "Your edit" pill are shared. The name as a
     serif title in a white card on a hairline with no shadow; fact labels
     in sentence case over ink values; committee chips as borderless
     tinted pills; the as-of line and actions as the card's footer under
     a hairline. Buttons and fields keep the app's own shape (that changes
     app-wide in one pass), as do the --gold focus ring and the meeting
     log below the card, which is shared. */
  .contact-page .contact-card {
    display: flex; flex-direction: column; gap: var(--space-4);
    padding: var(--space-5);
  }
  .contact-page .contact-card > * { margin: 0; }
  .contact-page .office-head { display: flex; flex-direction: column; gap: var(--space-3); }
  .contact-page .office-head > div:first-child { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
  .contact-page #contact-name { overflow-wrap: anywhere; text-wrap: balance; }
  .contact-page .contact-card .sub { margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
  .contact-page .dir-edit-badge { border-color: transparent; }
  .contact-page .dir-use-sheet { color: var(--link); }
  /* The two banners: a borderless amber tint, the stale one with its
     button on the same line when there is room. */
  .contact-page .contact-banner { margin: 0; font-size: var(--text-sm); }
  .contact-page .contact-banner-stale { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  /* Facts: muted sentence-case labels over ink values, none bolded. */
  .contact-page .client-facts { margin: 0; padding: 0; border-top: 0; }
  .contact-page .client-fact { min-width: 0; }
  .contact-page .client-fact-label {
    font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .contact-page .client-fact-value { color: var(--ink); overflow-wrap: anywhere; }
  .contact-page .client-fact:first-child .client-fact-value { font-weight: 400; }
  .contact-page .contact-copy { margin-left: var(--space-2); font-size: var(--text-xs); }
  .contact-page .contact-block .client-fact-label { display: block; }
  .contact-page .contact-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
  .contact-page .contact-chips .cite {
    align-items: center; min-height: 1.375rem; padding: 0 var(--space-2);
    border: 0; border-radius: var(--radius-pill); background: var(--paper-250); color: var(--ink-2);
    font-size: var(--text-2xs); font-weight: 500; line-height: 1.3;
  }
  .contact-page .dir-notes { color: var(--ink); }
  /* The footer: the as-of line, Flag as stale and Back, under a hairline. */
  .contact-page .contact-foot { margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--rule); }
  .contact-page .contact-foot .sub { font-size: var(--text-xs); color: var(--muted); }
  .contact-page .contact-foot-back { margin-left: auto; }
  .contact-page .field-label { font-weight: 500; }
  .contact-page .dir-edit-hint { color: var(--muted); }
  @media (max-width: 640px) {
    .contact-page .contact-card { padding: var(--space-4); }
  }

  /* ── Member page (MEMBER_DETAIL_BODY, db_member.py) ──
     One office's page: a stack of hairline cards, each a titled section
     (staff, votes, bills, hearings, whip marks, meetings). The tables
     scroll sideways on a phone rather than squeeze. */
  .member-page #member { display: flex; flex-direction: column; gap: var(--space-4); }
  .member-page #member-meta { margin-top: var(--space-1); color: var(--ink-2); }
  .member-page .member-section { padding: var(--space-5); margin: 0; }
  .member-page .member-section h2 { margin: 0 0 var(--space-3); font-size: var(--text-lg); }
  .member-page .member-note { margin: calc(-1 * var(--space-2)) 0 var(--space-3); font-size: var(--text-xs); color: var(--muted); }
  .member-page .member-empty { margin: 0; color: var(--muted); }
  .member-page .member-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
  .member-page .member-chip {
    display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-2);
    border-radius: var(--radius-pill); background: var(--paper-250); color: var(--ink-2);
    font-size: var(--text-xs); font-weight: 500;
  }
  .member-page .member-chip.is-lead { color: var(--ink); font-weight: 600; }
  .member-page .member-staff, .member-page .member-list {
    list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3);
  }
  .member-page .member-staff { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
  .member-page .member-staff .sub, .member-page .member-list .sub { margin: 0; font-size: var(--text-sm); color: var(--ink-2); }
  .member-page .member-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .member-page .member-table th {
    text-align: left; font-weight: 500; font-size: var(--text-2xs); color: var(--muted);
    padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--rule);
  }
  .member-page .member-table td { vertical-align: top; padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--rule); }
  .member-page .member-table .sub { font-size: var(--text-xs); color: var(--ink-2); }
  .member-page .member-tally { margin: 0 0 var(--space-3); }
  .member-page .member-vote { font-weight: 600; }
  .member-page .member-align-with { color: var(--good); }
  .member-page .member-align-against { color: var(--error); }
  .member-page .member-client { display: inline-flex; align-items: center; gap: var(--space-1); margin: 0 var(--space-2) var(--space-1) 0; }
  .member-page .member-more { margin-top: var(--space-3); }
  @media (max-width: 640px) {
    .member-page .member-section { padding: var(--space-4); }
  }

  /* Labels that exist for screen readers only. Was repeated inline on
     every field that needed one; named here since the directory's
     mapping table generates them per column. */
  .visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }

  /* A button that has to read as a link because it sits mid-sentence.
     Kept a <button> so it is reachable and announced as the action it
     is, rather than an <a href="#"> that goes nowhere. */
  .linklike {
    background: none; border: 0; padding: 0; font: inherit; color: var(--link);
    text-decoration: none; cursor: pointer;
  }
  @media (hover: hover) { .linklike:hover { color: var(--ink); } }
  /* The edit button (founder, Nov 17 2026: "Change" read as an old
     underlined link). Every "Edit"/"Change" that opens a setting or a
     record for editing takes this one look: a soft grey chip with a
     pencil, quiet beside a page's real buttons but plainly a button.
     24px tall (WCAG 2.5.8) wherever it sits, mid-sentence included.
     `:is(a, button)` so it out-ranks a context's bare `x a` rule. */
  :is(a, button).edit-btn {
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.5rem;
    padding: 0 var(--space-2); border: 0; border-radius: var(--radius-button);
    background: var(--accent-soft); color: var(--ink);
    font: inherit; font-size: var(--text-xs); font-weight: 500; font-style: normal; line-height: 1;
    text-decoration: none; white-space: nowrap; vertical-align: middle; cursor: pointer;
  }
  .edit-btn::before {
    content: ""; flex: none; width: 0.8rem; height: 0.8rem; background: currentColor;
    -webkit-mask: var(--icon-pencil) center / contain no-repeat;
    mask: var(--icon-pencil) center / contain no-repeat;
  }
  @media (hover: hover) {
    :is(a, button).edit-btn:hover { background: color-mix(in srgb, var(--ink) 13%, transparent); color: var(--ink); }
  }
  /* On a line of its own — a toolbar, a chip row, a form's Cancel — it
     is a standalone target, and it measured 19px tall ("Select all 25",
     "Show all 1,504"): under WCAG 2.5.8's 24px, the same fix as audit
     F24's links. Opt-in by where it sits, not on .linklike itself: one
     mid-sentence (.result-note, .result-truncated) is exempt as inline
     text, and padding it out would break the line it sits in. */
  .panel-head .linklike, .active-filters .linklike, .save-search-form .linklike, .flag-draft .linklike {
    display: inline-flex; align-items: center; min-height: 1.5rem;
  }
  .panel-head .linklike[hidden] { display: none; }   /* the display above would otherwise beat [hidden] */

  /* Said out loud when filters cover only a prefix of the matches (see
     SEARCH_PAGE_CAP). A filter over part of a result set that presents
     itself as a filter over all of it is the failure this avoids. */
  .result-truncated {
    background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); font-size: var(--text-xs);
  }
  /* Link blue on the warm tint read 4:1 at this size; a shade toward ink
     clears AA in both themes (axe, Nov 18 2026). */
  .result-truncated a, .result-truncated .linklike { color: color-mix(in srgb, var(--link) 80%, var(--ink)); }

  /* ── Disclosure review: making sign-off a real review (P1-21) ──
     Three additions, all answering the same thing: sign-off recorded who
     attested, and gave them nothing to attest against. */

  /* What is still outstanding, counted, at the top, with a jump link per
     row. A red asterisk per field says which ones matter; it does not
     say how many are left or where they are, and on a five-page form
     that difference is a hunt. */
  .review-banner {
    background: var(--warn-soft); border: 1px solid var(--rule);
    border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5);
  }
  .review-banner.ok { background: var(--good-soft); }
  .review-banner-head { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2); }
  .review-banner.ok { font-size: var(--text-sm); }
  .review-banner-list { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-0); }
  .review-banner-list button {
    background: none; border: 0; padding: 0; font: inherit; font-size: var(--text-xs);
    color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline;
    text-underline-offset: 2px;
  }
  @media (hover: hover) { .review-banner-list button:hover { color: var(--accent); } }

  .field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-1); }
  /* The asterisk carries a title, because a red glyph on its own means
     "required" only to someone who already knows that convention — and
     it is the one cue on this screen that is otherwise colour alone. */
  /* No cursor:help any more — the asterisk carried its own explanation
     in a title= that never appeared on a phone. Every form that uses it
     now states what it means once, in a .req-legend above the fields. */
  .req { color: var(--error); font-weight: 700; }
  .req-legend { font-size: var(--text-xs); margin: 0 0 var(--space-4); }
  /* The signup password hint, once it knows whether it's been met.
     --good/--error rather than colour alone: the ✓ and the reworded
     sentence carry the state on their own. */
  .hint-met { color: var(--good); }
  .hint-unmet { color: var(--error); }
  /* Its checklist form: one row per server rule (accounts.PASSWORD_CHECKS). */
  .pw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-0); }
  .pw-rules li { display: flex; gap: var(--space-2); align-items: baseline; }
  .pw-rule-mark { width: 1em; flex: none; text-align: center; }
  /* Red only once the field has been touched (or a generate/sign-off was
     tried) — see disclosure_review_body.html's issueRevealed(). The
     message is rendered either way, hidden until then. */
  .field-block.has-issue.issue-shown input,
  .field-block.has-issue.issue-shown textarea { border-color: var(--error); }
  .field-issue { font-size: var(--text-xs); color: var(--error); margin-top: var(--space-1); }
  .field-block.has-issue:not(.issue-shown) .field-issue { display: none; }

  /* Provenance. Every field on this screen looked hand-typed, so a
     reviewer could not tell a value pulled from Profile from one typed
     over it. `edited` is the state worth a second look, so it is the
     one that carries weight — the others are quiet by design, since
     "this is still what Profile says" is the resting state of most of
     the form and should not shout on every field. */
  .provenance { font-size: var(--text-2xs); color: var(--slate); margin-top: var(--space-1); }
  .provenance a { color: inherit; display: inline-flex; align-items: center; min-height: 1.5rem; }
  .provenance a.edit-btn { color: var(--ink); }   /* the edit chip keeps its ink, not the note's slate */
  .provenance.edited { color: var(--ink); }
  .provenance-was {
    font-weight: 600; background: var(--warn-soft);
    border-radius: var(--radius-sm); padding: 0 var(--space-1);
  }
  /* The resting states ("From profile", "Not in profile") as a tag on
     the label's own line rather than a sentence under the input — see
     provenanceTagHtml(). Same 24px target as .provenance a. */
  .field-label-meta { display: inline-flex; align-items: baseline; gap: var(--space-2); }
  .provenance-tag {
    font-size: var(--text-2xs); color: var(--slate); white-space: nowrap;
    display: inline-flex; align-items: center; min-height: 1.5rem;
  }
  .provenance-tag.blank { font-style: italic; }

  /* Fields sized to what they hold (audit F7): a six-column grid, each
     field spanning what disclosure_review_body.html's fieldSpan() gives
     it. On a phone the narrow ones pair up two to a row and the
     half-width ones go full width. */
  .field-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 var(--space-3); }
  .field-grid .field-block { display: block; margin-bottom: var(--space-2); min-width: 0; }
  .field-grid .span-1 { grid-column: span 1; }
  .field-grid .span-2 { grid-column: span 2; }
  .field-grid .span-3 { grid-column: span 3; }
  .field-grid .span-4 { grid-column: span 4; }
  .field-grid .span-6 { grid-column: span 6; }
  .field-grid .field-label-row { flex-wrap: wrap; gap: 0 var(--space-2); }
  @media (max-width: 640px) {
    .field-grid .span-1, .field-grid .span-2, .field-grid .span-4 { grid-column: span 3; }
    .field-grid .span-3 { grid-column: span 6; }
  }

  /* Autosave, said out loud. "Edits save automatically as you leave each
     field" was the only evidence anything saved at all, on a screen
     whose output is a document somebody attests to. */
  .field-saved { min-height: 1em; }
  .field-saved.save-status { font-size: var(--text-2xs); }   /* the shared indicator, a size down beside a label */

  /* ── Disclosure review: client rows (P1-20) ──
     Only rows holding something are rendered now, so each row needs its
     own header: who is in it, which row number the PDF will use, and a
     way off the form. The row number stays visible because the paper
     form and the generated PDF both count in them — a reviewer checking
     one against the other is matching row 7 to row 7. */
  .client-row-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-2); margin-bottom: var(--space-2);
  }
  .client-row-meta { display: flex; align-items: center; gap: var(--space-2); flex: none; }
  /* A client card sits inside the Clients card, and on a phone the
     page gutter plus two cards' side padding left each field 227px wide
     (audit N4). The inner card keeps its border and loses most of its
     padding; the outer one trims to match. */
  @media (max-width: 640px) {
    #sec-clients.card { padding-left: var(--space-3); padding-right: var(--space-3); }
    .client-row-card.card { padding: var(--space-3) var(--space-2); }
  }
  .client-row-add {
    display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
    padding-top: var(--space-2);
  }
  /* The clients left off a Form 601 (workflow audit C3): each one named,
     with whether it's ticked and the one button that adds it. */
  .not-on-form { flex-direction: column; align-items: stretch; }
  .not-on-form-list { list-style: none; margin: 0; padding: 0; }
  .not-on-form-item {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    flex-wrap: wrap; padding: var(--space-2) 0; border-top: 1px solid var(--rule);
  }
  .not-on-form-name { min-width: 0; overflow-wrap: anywhere; }

  /* Generate PDF is this page's primary action and used to sit below
     everything it acts on — under nine client cards, roughly thirty of
     whose fields were blank. Pinned to the bottom of the viewport it is
     reachable from anywhere in the form, and it carries the one line
     saying whether the PDF currently matches the page. */
  .sticky-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3);
    flex-wrap: wrap; margin: 0 0 var(--space-4);
    background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-up);
  }
  /* A toast on this page ("Sign-off undone", "Also saved to your firm's
     details") sits above that pinned bar, not over its Generate button —
     on a phone it covered the button for the toast's nine seconds. */
  body:has(.sticky-actions) .toast { bottom: calc(var(--space-8) + var(--space-4)); }

  /* ── Disclosure review as a guided flow (audit S5) ──
     The form's sections in a sticky rail beside it, each with its own
     count, and one running total in the sticky bar above — chunking and
     a visible finish line make a long form feel shorter. Same 220px rail
     grammar as .settings-layout. On a phone the rail becomes a strip of
     chips that scrolls sideways within itself, above the form. */
  .guided-layout {
    display: grid; grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(var(--space-4), 3vw, var(--space-6)); align-items: start;
  }
  .guided-main { min-width: 0; }
  .guided-main > [id^="sec-"] { scroll-margin-top: var(--space-4); }
  .section-nav { position: sticky; top: var(--space-4); }
  .section-nav ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-0); }
  .section-nav-item {
    display: flex; flex-direction: column; gap: var(--space-0); padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md); border-left: 2px solid transparent;
    color: var(--slate); text-decoration: none; font-size: var(--text-sm); font-weight: 600;
  }
  @media (hover: hover) { .section-nav-item:hover { color: var(--ink); background: var(--accent-soft); } }
  .section-nav-item[aria-current="location"] { color: var(--ink); background: var(--accent-soft); border-left-color: var(--ink); }
  .section-nav-count { font-size: var(--text-xs); font-weight: 400; color: var(--slate); }
  /* A tick as well as the colour, so "finished" isn't colour alone. */
  .section-nav-item.done .section-nav-count { color: var(--good); }
  .section-nav-item.done .section-nav-count::before { content: ""; --ic: var(--icon-check); margin-right: var(--space-1); }

  .form-progress { display: flex; flex-direction: column; gap: var(--space-1); margin-right: auto; min-width: 12rem; }
  .form-progress-text { font-size: var(--text-sm); font-weight: 600; }
  /* The phone's shorter copy — shown instead of the sentence at ≤768px. */
  .form-progress-text .fp-short { display: none; }
  .form-progress-track {
    height: 4px; border-radius: var(--radius-pill); overflow: hidden;
    background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--rule);
  }
  .form-progress-fill { display: block; height: 100%; width: 0; background: var(--good); transition: width var(--dur) var(--ease); }
  /* Amber, not green, while a section is still empty (unfinishedSections). */
  .form-progress-fill.incomplete { background: var(--warn); }
  @media (prefers-reduced-motion: reduce) { .form-progress-fill { transition: none; } }

  @media (max-width: 768px) {
    .guided-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
    .section-nav { position: static; min-width: 0; }
    .section-nav ol { flex-direction: row; gap: var(--space-2); overflow-x: auto; overflow-y: hidden; padding-bottom: var(--space-1); scrollbar-width: thin; }
    .section-nav-item {
      flex: none; white-space: nowrap; padding: var(--space-1) var(--space-3);
      border: 1px solid var(--rule-strong); border-radius: var(--radius-pill);
    }
    .section-nav-item[aria-current="location"] { border-color: var(--ink); }
    /* One row on a phone — the total and the button. The PDF-state line
       is the "Review & sign off" chip's status already, and a three-row
       bar pinned over the form ate a fifth of the screen. */
    .sticky-actions { flex-wrap: nowrap; }
    .sticky-actions > button { flex: none; white-space: nowrap; }
    .form-progress { min-width: 0; flex: 1 1 auto; margin-right: 0; }
    .sticky-actions-hint { display: none; }
    /* And the total itself on one line: the full sentence wrapped to
       three, making the bar 97px tall (audit N4). The short copy is the
       same count; the full sentence stays for a screen reader. */
    .form-progress-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .form-progress-text .fp-long {
      position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .form-progress-text .fp-short { display: inline; }
  }

  /* Jump to section from the pinned bar (decision N3-a). At ≤768px the
     strip above is static and scrolls away, so the bar's count becomes a
     button opening the section list; on a wide screen the side strip
     sticks and this stays hidden. One line at 375px has room for two
     things, not three, so the count *is* the button (a separate one
     squeezed it to 22px), its bar moves to a hairline along the top edge
     of the pinned bar, and the gap and Generate's side padding tighten a
     step. The wrapper stays
     position:static so the panel is placed against the sticky bar itself
     — full bar width, opening upward — rather than against the button. */
  .jump-menu { display: none; }
  @media (max-width: 768px) {
    .sticky-actions { gap: var(--space-2); }
    .sticky-actions > button { padding-left: var(--space-3); padding-right: var(--space-3); }
    .sticky-actions .form-progress-text { display: none; }
    .sticky-actions .form-progress-track {
      position: absolute; top: var(--space-1); left: var(--space-4); right: var(--space-4);
    }
    .jump-menu { display: block; min-width: 0; }
    .jump-btn {
      display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%;
      padding-left: var(--space-2); padding-right: var(--space-2);
      font-size: var(--text-sm); font-weight: 600;
    }
    .jump-btn-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .jump-chevron { flex: none; width: 0.5rem; height: 0.5rem; transition: transform var(--dur-fast) var(--ease); }
    .jump-btn[aria-expanded="true"] .jump-chevron { transform: rotate(180deg); }
    .jump-menu-panel {
      position: absolute; left: 0; right: 0; bottom: calc(100% + var(--space-2));
      max-height: 60vh; overflow-y: auto;
      background: var(--surface); border: 1px solid var(--rule-strong);
      border-radius: var(--radius-md); padding: var(--space-1);
      box-shadow: var(--shadow-up);
    }
    .jump-menu-title {
      padding: var(--space-1) var(--space-3); font-size: var(--text-xs); font-weight: 600; color: var(--slate);
    }
    .jump-menu-panel ol { list-style: none; margin: 0; padding: 0; }
    .jump-item {
      display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
      min-height: 2.75rem; padding: var(--space-1) var(--space-3);
      border-radius: var(--radius-md); border-left: 2px solid transparent;
      color: var(--ink); text-decoration: none; font-size: var(--text-sm); font-weight: 600;
    }
    .jump-item[aria-current="location"] { background: var(--accent-soft); border-left-color: var(--ink); }
    .jump-item-count { font-size: var(--text-xs); font-weight: 400; color: var(--slate); white-space: nowrap; }
    /* A tick as well as the colour, as on the strip. */
    .jump-item.done .jump-item-count { color: var(--good); }
    .jump-item.done .jump-item-count::before { content: ""; --ic: var(--icon-check); margin-right: var(--space-1); }
  }
  @media (prefers-reduced-motion: reduce) { .jump-chevron { transition: none; } }

  /* The review page's ⋮ menu. When the header wraps on a phone the
     button dropped to the left edge, and the menu — anchored to its right
     edge — opened off-screen (x -76). Kept at the right however the
     header wraps, so the right-anchored menu always opens inward. */
  .disc-head-menu { margin-left: auto; align-self: flex-start; }
  /* Beside the title at every width, rather than wrapping onto a line of
     its own under the status pill on a phone. */
  .page-head:has(> .disc-head-menu) { flex-wrap: nowrap; align-items: flex-start; }
  .page-head:has(> .disc-head-menu) > div { flex: 1 1 auto; min-width: 0; }
  .disc-head-status { margin-top: var(--space-2); }
  .disc-head-status:empty { display: none; }

  /* The review page's own parts, named rather than styled inline
     (batch 5) — each the spacing it had. */
  .section-nav-label, .jump-item-label { min-width: 0; overflow-wrap: anywhere; }
  .save-to-profile { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0 0 var(--space-3); }
  .save-to-profile input { width: auto; margin-top: var(--space-1); }
  .autosave-note { margin: 0 0 var(--space-3); }
  .field-block > :is(input, textarea) { width: 100%; }
  .field-label-row .field-label { margin: 0; }
  .client-row-card { margin-bottom: var(--space-3); }
  .client-row-head .bill-title { margin: 0; }
  .client-row-note { margin: 0 0 var(--space-2); }
  .review-banner.no-clients { margin: 0 0 var(--space-3); }
  .review-banner.no-clients .sub { margin: 0; }
  .not-on-form-state { display: block; margin: 0; }
  .not-on-form-full { margin: 0 0 var(--space-2); }
  .not-on-form-title { margin: 0; }
  #sec-deadline .disc-kind-line { margin: 0 0 var(--space-3); }
  .deadline-help { margin: var(--space-3) 0; }
  #sec-deadline .deadline-note { margin-top: var(--space-2); }
  .deadline-aside { margin-top: var(--space-1); }
  .deadline-dates { display: flex; gap: var(--space-4); flex-wrap: wrap; }
  .deadline-dates > .save-status { align-self: flex-end; }
  .review-date-field { flex: 1; min-width: 11rem; }
  .review-date-field input { width: 100%; }
  .review-date-label { margin-bottom: var(--space-1); }
  .continuation-title { margin: var(--space-3) 0 var(--space-2); }
  #review-heading { margin-top: 0; }
  .compliance-page .pdf-preview.card { padding: 0; overflow: hidden; }
  .pdf-preview-frame { display: block; width: 100%; height: 70vh; border: none; }
  /* A prepared Form 615/625's saved worksheet (disclosure_quarterly_body):
     plain text, kept as laid out, wrapping on a phone rather than scrolling. */
  .quarterly-sheet { margin: var(--space-2) 0 0; white-space: pre-wrap; overflow-wrap: anywhere;
    font: inherit; font-size: var(--text-sm); line-height: 1.55; color: var(--ink); max-height: 60vh; overflow-y: auto; }
  .pdf-preview-actions { margin: calc(-1 * var(--space-2)) 0 var(--space-5); }
  #sec-review .card > .bill-title { margin-bottom: var(--space-2); }
  .signoff-note { margin: var(--space-2) 0 0; }
  .signoff-lead { margin: 0 0 var(--space-3); }
  .signoff-foot { margin-top: var(--space-3); }
  #undo-filed-btn { margin-top: var(--space-3); }
  #mark-filed-form { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: flex-end; }
  .signoff-name { flex: 1 1 100%; }
  .signoff-name input { width: 100%; }
  .signoff-confirm {
    flex: 1 1 100%; display: flex; align-items: flex-start; gap: var(--space-2);
    margin-top: var(--space-3); font-size: var(--text-sm);
  }
  .signoff-confirm input { margin-top: var(--space-1); width: auto; }
  #sign-btn { margin-top: var(--space-4); }
  .sticky-actions-hint { margin: 0; }

  /* "Known gaps in this draft" as a disclosure: open on a wide screen,
     closed on a phone, where it pushed the first field below the fold. */
  .known-gaps > summary {
    cursor: pointer; display: flex; align-items: center; min-height: 1.5rem; margin: 0;
  }
  .known-gaps[open] > summary { margin-bottom: var(--space-2); }
  @media (pointer: coarse) { .known-gaps > summary { min-height: 2.75rem; } }

  /* ── Disclosure status pill ──
     The mockup's status marker for the disclosure screens: a hairline
     outline pill with a leading dot, rather than the soft-filled
     .status-badge the rest of the app uses. It reads as one small enum
     (a filing is a draft, or it is signed off and ready), so it carries
     the state in the dot's HUE — amber for a draft in progress, green
     once it's ready — and keeps the text a neutral --slate so the colour
     isn't the only cue. The border is decoration around a label, not the
     outline of a control, so its colour-mix is outside 1.4.11's 3:1. */
  .disc-pill { border-color: var(--rule-strong); color: var(--slate); }
  .disc-pill::before { content: ""; width: 0.44rem; height: 0.44rem; border-radius: 50%; background: var(--warn); flex: none; }
  .disc-pill.draft::before { background: var(--warn); }   /* the resting state, named */
  .disc-pill.ready { border-color: color-mix(in srgb, var(--good) 55%, transparent); }
  .disc-pill.ready::before { background: var(--good); }
  /* Filed: done and read-only, so the dot goes neutral rather than
     louder — the green "ready" is the last state that asks anything of
     the user. The word "Filed" carries it, not the hue. */
  .disc-pill.filed::before { background: var(--slate); }

  /* ── Prepared-filings list ──
     The mockup renders the filings as a clean list, not a bordered
     table-in-a-panel: a strong hairline over an uppercase micro-header,
     then one filing per row divided only by a rule. It stays a real
     <table> (screen-reader columns, and the same rebuild idiom as
     .dir-table) — only the chrome changes. The form label is the row's
     primary link into review; the trailing cell keeps the app's own
     Review link and ⋮ row menu, which the mockup has no equivalent for. */
  .disc-table thead th {
    font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.06em;
    font-weight: 600; color: var(--slate); padding: var(--space-2) var(--space-2);
    border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule);
  }
  .disc-table td { padding: var(--space-3) var(--space-2); vertical-align: middle; }
  .disc-table th:first-child, .disc-table td:first-child { padding-left: 0; }
  .disc-table th:last-child, .disc-table td:last-child { padding-right: 0; text-align: right; }
  .disc-form-link { font-weight: 600; color: var(--ink); }
  /* "Renewal · 2027–2028" under a renewal's form name. */
  .disc-kind-line { font-size: var(--text-xs); color: var(--slate); margin-top: var(--space-1); }
  .disc-table .disc-kind-line { white-space: nowrap; }  /* one line in a narrow Form column */
  /* The one form's name, where a one-choice dropdown was (Y19): sized as
     a card heading, under the page's h1 rather than louder than it. */
  .disc-form-name { font-size: var(--text-base); font-weight: 600; margin: 0; }
  /* The start form's first-registration / renewal choice. */
  .disc-kind-option {
    display: flex; align-items: flex-start; gap: var(--space-2);
    font-size: var(--text-sm); margin-top: var(--space-2);
  }
  .disc-kind-option input { margin-top: var(--space-1); }
  .disc-kind-option .field-hint { display: block; }
  /* The start form's parts each take a full row of the form's wrap. */
  .disc-start-form > :not(button) { flex: 1 1 100%; }
  .disc-start-form [hidden] { display: none; }
  .disc-start-form .disc-form-intro .sub { margin: var(--space-1) 0 0; }
  .disc-start-form :is(#period_note, #renewal_why, #renewal_note) { margin: var(--space-2) 0 0; }
  .disc-start-form :is(.disc-form-pick, #quarter_row) { margin-top: var(--space-3); }
  .disc-start-form :is(#form_type, #quarter, #lobbyist_id) { width: 100%; max-width: 32rem; }
  .disc-quarter-row { display: grid; gap: var(--space-3); }
  .quarterly-pdf-actions { margin: var(--space-2) 0 var(--space-4); }
  .disc-start-form :is(#period_row .field-label, #kind_row, #needs-registration),
  .disc-start-form > button { margin-top: var(--space-4); }
  @media (hover: hover) { .disc-form-link:hover { color: var(--ink); } }
  .disc-row-actions { display: inline-flex; align-items: center; gap: var(--space-3); justify-content: flex-end; }
  .disc-review-link { font-size: var(--text-xs); color: var(--slate); white-space: nowrap; }
  @media (hover: hover) { .disc-review-link:hover { color: var(--ink); } }
  /* "Add your firm's legal name →" under the new-draft form was a 15px
     line of text — the only way forward from that state. 24px, and 44px
     for a finger, like the app's other targets. */
  .disc-fix-link { display: inline-flex; align-items: center; min-height: 1.5rem; }
  @media (pointer: coarse) { .disc-fix-link { min-height: 2.75rem; } }

  /* ── Compliance v5 (docs/design-system: Card, data, forms, actions) ──
     Laid over the rules above for the Compliance area only — Due dates
     (COMPLIANCE_BODY), Positions by quarter, Prepared forms and the
     review page — each wrapped in .compliance-page. .disc-table, the
     pills and the section rail are shared with Documents > Client
     reports and the client list, which keep theirs. Serif page and card
     titles; white 18px cards on a hairline with no shadow; each list a
     flush card whose table has a tinted, rounded head band in sentence
     case; bill numbers mono navy; status and due chips borderless tinted
     pills; the Prepared forms counts as StatTiles; the section rail's
     current item a raised white pill. Buttons and fields keep the app's
     own shape for now (that changes app-wide in one pass); the --gold
     focus ring, the pills' one base shape, the position chips' borders
     and glyphs (P2-31) and the 44px touch floor stay. */
  .compliance-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .compliance-page .page-head a.sub { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
  @media (hover: hover) { .compliance-page .page-head a.sub:hover { color: var(--ink); } }

  /* Cards: hairline edge, no shadow, serif titles. A card's own title is
     an h2.section, a .bill-title or (Positions by quarter) the client's
     name; "Preview and sign off" sits over its cards the same way. */
  .compliance-page .card { padding: var(--space-4); }
  .compliance-page .disc-form-name {
    font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; letter-spacing: -0.01em;
  }
  /* A card's own title in the one card-heading voice: sentence-case sans,
     18.4px, medium (polish D14) — the same as every .panel-head .title. */
  .compliance-page :is(h2.section, .card > .bill-title, .card > h2, .report-part h2, .money-card-head h2) {
    font-family: var(--font-sans); font-size: var(--text-md); font-weight: 500; line-height: 1.2;
    text-transform: none; letter-spacing: -0.01em; color: var(--ink);
  }
  .compliance-page .card > h2.section { margin: 0 0 var(--space-2); }
  .compliance-page .card > .compliance-card-sub { margin: 0; padding: 0 var(--space-3) var(--space-2); }
  .compliance-page #roster .saved-row { padding-left: var(--space-3); padding-right: var(--space-3); }
  .compliance-page .card > h2 > a { color: var(--ink); }
  @media (hover: hover) { .compliance-page .card > h2 > a:hover { color: var(--link); } }
  .compliance-page .card .sub, .compliance-page .bill-desc { color: var(--ink-2); }
  .compliance-page .field-label { font-weight: 500; }
  /* The global form and .sub margins left a blank band at the foot of a
     card; the card's own padding ends it. */
  .compliance-page .card > form, .compliance-page .card > :last-child { margin-bottom: 0; }

  /* A flush card holding a list: a small inset, the title on its own
     padding, the table's tinted head band as the only divider. */
  .compliance-page .compliance-card { padding: var(--space-1); }
  .compliance-page .compliance-card > h2 { margin: 0; padding: var(--space-3) var(--space-3) var(--space-2); }
  /* The ledgers' add forms (Expenses, Contributions) and the quarter
     picker above them. With only the bare form rule they were a ragged
     flex wrap flush to the card's edge, the submit stretched into a tall
     slab beside the officials box. Now an even grid of fields inset like
     the card's rows, the officials box a full-width group of its own,
     and the submit an ordinary button under it all. */
  .compliance-page .compliance-card > label { display: block; padding: var(--space-2) var(--space-3) var(--space-1); }
  .compliance-page .compliance-card > form {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: var(--space-3) var(--space-4); align-items: end; margin: 0; padding: var(--space-1) var(--space-3) var(--space-3);
  }
  .compliance-page .compliance-card > form label { display: flex; flex-direction: column; min-width: 0; }
  .compliance-page .compliance-card > form input:not([type="checkbox"]):not([type="radio"]), .compliance-page .compliance-card > form select { width: 100%; min-width: 0; }
  .compliance-page .compliance-card > form > :is(fieldset, .ban-warning) { grid-column: 1 / -1; }
  .compliance-page .compliance-card > form > fieldset {
    margin: 0; padding: var(--space-2) var(--space-3) var(--space-3); min-width: 0;
    border: 1px solid var(--rule); border-radius: var(--radius-md);
  }
  .compliance-page .compliance-card > form > fieldset > legend { padding: 0 var(--space-1); }
  .compliance-page .expense-person {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: var(--space-3) var(--space-4); align-items: end; margin-bottom: var(--space-3);
  }
  .compliance-page .expense-person > p { grid-column: 1 / -1; margin: 0; }
  .compliance-page .compliance-card > form > button[type="submit"] { grid-column: 1 / -1; justify-self: start; }
  /* The quarterly report (Form 625): each part a section inset like the
     card's rows and split by a hairline, titled like every other card
     title (the serif, not a heavy sans h2), its Copy the in-card small
     button. Its notes and lists sat flush to the card's edge. */
  .compliance-page #report > :is(.sub, .empty) { padding: 0 var(--space-3); }
  .compliance-page .report-part { padding: var(--space-3); border-top: 1px solid var(--rule); }
  .compliance-page .report-part h2 { margin: 0; }
  .compliance-page .report-part-head {
    display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2);
  }
  .compliance-page .report-part h3 { font-size: var(--text-base); font-weight: 600; margin: var(--space-3) 0 var(--space-1); }
  .compliance-page .report-part ul { margin: 0; padding-left: var(--space-5); }
  /* The quarter picker with "Download PDF" beside it, and the hint under. */
  .compliance-page .report-tools {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-1);
  }
  .compliance-page .report-tools > label { display: block; }
  .compliance-page .report-hint { margin: 0; padding: 0 var(--space-3) var(--space-2); }
  /* One value that copies itself into CARS: reads as the text it is, a
     dotted underline saying it does something; the global focus ring. */
  .compliance-page .copy-value {
    all: unset; cursor: copy; border-radius: var(--radius-xs); overflow-wrap: anywhere;
    text-decoration: underline dotted var(--rule-strong); text-underline-offset: 3px;
  }
  @media (hover: hover) {
    .compliance-page .copy-value:hover { background: var(--paper-50); text-decoration-color: currentColor; }
  }
  .compliance-page .copy-value:focus-visible { box-shadow: var(--ring-focus); }
  .compliance-card .empty, .compliance-card > .due-none, .compliance-card [role="status"] {
    margin: 0; padding: 0 var(--space-3) var(--space-3);
  }
  .compliance-card .disc-table { border-collapse: separate; border-spacing: 0; }
  .compliance-card .disc-table thead th {
    border-top: 0; border-bottom: 0; background: var(--paper-50); padding: var(--space-2);
    font-size: var(--text-2xs); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .compliance-card .disc-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
  .compliance-card .disc-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
  .compliance-card .disc-table th:first-child, .compliance-card .disc-table td:first-child { padding-left: var(--space-3); }
  .compliance-card .disc-table th:last-child, .compliance-card .disc-table td:last-child { padding-right: var(--space-3); }
  .compliance-card .disc-table tbody tr:last-child td { border-bottom: 0; }
  .compliance-card .disc-table td { color: var(--ink); }
  .compliance-card .disc-table td.date, .compliance-card .disc-review-link { color: var(--ink-2); }
  .compliance-card .disc-form-link { font-weight: 500; }
  /* Compliance > Contributions: the lobbyist-ban warning (Gov. Code §85702)
     on a row and beside the add form. It warns; it never blocks. */
  .compliance-page .ban-warning { color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
  @media (hover: hover) {
    .compliance-card .disc-form-link:hover, .compliance-card .disc-review-link:hover { color: var(--link); }
  }

  /* BillNumber: mono navy, ahead of the title column. */
  .compliance-page .compliance-bill-number { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); white-space: nowrap; }
  @media (hover: hover) { .compliance-page .compliance-bill-number:hover { color: var(--ink); } }

  /* Chips: borderless tinted pills that say their state in words. A
     draft is amber, signed off green, filed neutral (it asks nothing
     more of anyone); a due date close or past keeps its amber / red. */
  .compliance-page .disc-pill { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
  .compliance-page .disc-pill.ready { border-color: transparent; background: var(--good-soft); color: var(--good); }
  .compliance-page .disc-pill.filed { background: var(--paper-250); color: var(--ink-2); }
  .compliance-page .due-chip { border-color: transparent; }

  /* ── Compliance's four tabs (founder-approved redesign, Nov 8 2026) ──
     This quarter: the report as six numbered steps beside a side column;
     Money and Records: flush cards with a title row and its one action;
     Forms: one card per form, named by what it does. Plain words first,
     the form number a small mono label after them (.form-no). */
  .compliance-page .form-no {
    font-size: var(--text-2xs); font-weight: 500; color: var(--muted); letter-spacing: 0.02em;
    padding: 0 var(--space-1); border: 1px solid var(--rule); border-radius: var(--radius-sm); white-space: nowrap;
    vertical-align: 0.1em;
  }
  .compliance-page .soon-pill {
    display: inline-flex; align-items: center; font-size: var(--text-2xs); color: var(--ink-2);
    background: var(--paper-250); border-radius: var(--radius-pill); padding: 0 var(--space-2); white-space: nowrap;
  }
  .quarter-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); gap: var(--space-4); align-items: start; }
  /* Side by side only where the checklist still gets room: below this
     (the sidebar takes ~15rem) the side column drops under it. */
  @media (max-width: 1180px) { .quarter-layout { grid-template-columns: minmax(0, 1fr); } }
  .quarter-main, .quarter-side { display: grid; gap: var(--space-3); min-width: 0; }
  .compliance-page :is(.quarter-main, .quarter-side) .card, .quarter-steps > .quarter-step { margin: 0; }
  .quarter-head-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
  .compliance-page .quarter-title { margin: 0; font-size: var(--text-lg); font-weight: 500; letter-spacing: -0.01em; }
  .compliance-page .quarter-head .sub { margin: var(--space-1) 0 0; }
  .compliance-page .quarter-head .due-chip { margin-top: 0; background: var(--paper-250); color: var(--ink); }
  .compliance-page .quarter-head .due-chip.soon { background: var(--warn-soft); color: var(--warn); }
  .compliance-page .quarter-head .due-chip.filed { background: var(--good-soft); color: var(--good); }
  .quarter-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--ink-2); }
  .quarter-bar { flex: 1 1 8rem; height: 0.5rem; background: var(--paper-250); border-radius: var(--radius-pill); overflow: hidden; }
  .quarter-bar > span { display: block; height: 100%; background: var(--good); border-radius: inherit; }
  .quarter-pick select { min-height: 2rem; font-size: var(--text-sm); }
  .quarter-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
  .compliance-page .quarter-step { padding: 0; }
  .quarter-step-head {
    all: unset; box-sizing: border-box; width: 100%; cursor: pointer; min-height: 44px;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
    padding: var(--space-3) var(--space-4); border-radius: inherit;
  }
  /* The highlight and focus ring go on the whole step card, not the
     header button: on an open step the header is only the top strip, so
     lighting it alone drew a half-box inside the card. */
  .quarter-step { transition: background var(--dur-fast) var(--ease); }
  .quarter-step:has(> .quarter-step-head:focus-visible) { box-shadow: var(--ring-focus); }
  @media (hover: hover) { .quarter-step:has(> .quarter-step-head:hover) { background: var(--paper-50); } }
  .step-num {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center;
    font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-strong);
  }
  .quarter-step.is-done .step-num { background: var(--good-soft); color: var(--good); box-shadow: none; }
  .step-text { display: grid; gap: var(--space-0); min-width: 0; }
  .step-title { font-weight: 500; color: var(--ink); }
  .step-summary { font-size: var(--text-xs); color: var(--ink-2); }
  .step-pill { font-size: var(--text-2xs); font-weight: 500; border-radius: var(--radius-pill); padding: var(--space-0) var(--space-2); white-space: nowrap; }
  .step-pill.done { background: var(--good-soft); color: var(--good); }
  .step-pill.look { background: var(--warn-soft); color: var(--warn); }
  .step-pill.todo { background: var(--paper-250); color: var(--ink); }
  .step-pill.wait { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule); }
  /* Indented past the step number: its 2.25rem circle + the 12px gap. */
  .quarter-step-body { padding: 0 var(--space-4) var(--space-4); margin-left: var(--space-7); }
  @media (max-width: 600px) { .quarter-step-body { margin-left: 0; } }
  .compliance-page .quarter-step-body > .sub { margin: 0 0 var(--space-2); }
  .step-rows { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
  .step-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
    padding: var(--space-2) 0; border-top: 1px solid var(--rule); font-size: var(--text-sm);
  }
  .step-row-name { flex: 1 1 12rem; min-width: 0; }
  .step-row-state { color: var(--ink-2); }
  .step-row-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
  .step-missing { color: var(--warn); font-weight: 500; }
  .step-check { display: flex; gap: var(--space-2); align-items: flex-start; cursor: pointer; }
  .step-check input { margin-top: var(--space-1); }
  .step-check .due-none { display: block; }
  .compliance-page .step-why { font-size: var(--text-xs); color: var(--ink-2); background: var(--paper-50); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
  .step-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
  .step-actions label { display: grid; gap: var(--space-0); }
  .compliance-page .ban-warning ul { margin: var(--space-1) 0 0; }
  .quarter-side-list { list-style: none; margin: 0; padding: 0; }
  .quarter-side-list > li {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-2);
    padding: var(--space-2) 0; border-top: 1px solid var(--rule); font-size: var(--text-sm);
  }
  .quarter-side-list > li:first-child { border-top: 0; }
  .compliance-page .quarter-side .sub { font-size: var(--text-xs); margin: 0 0 var(--space-2); }
  .money-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
  .money-tools label { display: inline-flex; align-items: center; gap: var(--space-2); }
  .compliance-page .compliance-card + .compliance-card { margin-top: var(--space-3); }
  .money-card-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-2);
    padding: var(--space-3) var(--space-3) var(--space-2);
  }
  .compliance-page .money-card-head h2 { margin: 0; }
  .compliance-page .money-card-head .sub { margin: var(--space-1) 0 0; font-size: var(--text-xs); max-width: 40rem; }
  .compliance-page .money-note { font-size: var(--text-xs); margin: 0; padding: var(--space-2) var(--space-3) var(--space-3); }
  .gift-over { color: var(--error); font-weight: 500; }
  .compliance-page .cars-banner {
    margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
    background: var(--info-soft); color: var(--ink); font-size: var(--text-sm);
  }
  .compliance-page .forms-section-h { margin: 0 0 var(--space-2); }
  .form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
  .compliance-page .form-card { margin: 0; display: grid; gap: var(--space-1); align-content: start; text-decoration: none; color: var(--ink); }
  .compliance-page .form-card .sub { font-size: var(--text-xs); margin: 0; }
  .form-card-title { font-weight: 500; }
  .form-card-go { font-size: var(--text-xs); font-weight: 500; color: var(--link); margin-top: var(--space-1); }
  @media (hover: hover) { .compliance-page a.form-card:hover { border-color: var(--rule-strong); } .compliance-page a.form-card:hover .form-card-go { color: var(--ink); } }
  .compliance-page .form-card.is-soon { background: var(--paper-50); }
  .compliance-page .form-card.is-soon .soon-pill { justify-self: start; margin-top: var(--space-1); }

  /* Prepared forms' counts as StatTiles: a ringed icon tile beside the
     number, a hairline edge, no lift. */
  .compliance-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: var(--space-3); }
  .compliance-stats .stat-card {
    display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: var(--space-3); align-items: center;
    padding: var(--space-4);
  }
  @media (hover: hover) { .compliance-stats .stat-card:hover { box-shadow: none; } }
  .compliance-stats .icon-tile {
    grid-row: 1 / span 3; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--rule);
  }
  .compliance-stats .icon-tile svg { width: 1.125rem; height: 1.125rem; }
  .compliance-stats .stat-value { letter-spacing: -0.02em; line-height: 1; }
  .compliance-stats .stat-label { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--ink); }
  .compliance-stats .stat-foot { margin-top: var(--space-0); font-size: var(--text-2xs); color: var(--muted); }

  /* Positions by quarter: the Quarter Select with its label to its left. */
  .compliance-page .history-filter { flex-direction: row; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }

  /* The review page. A client's row inside the Clients card is an inset
     row (12px corners, hairline) titled in the sans, not a second card. */
  .compliance-page .client-row-card.card { border-radius: var(--radius-md); }
  .compliance-page .client-row-head .bill-title { font-size: var(--text-base); font-weight: 600; }
  .compliance-page .review-banner { border-color: transparent; }
  .compliance-page .review-banner-head { font-weight: 600; }
  /* The section rail: 10px items; the current one a raised white pill
     rather than a tint with an ink bar. On a phone the rail's chips are
     borderless tints, the current one raised the same way. */
  .compliance-page .section-nav-item { border-radius: var(--radius-sm); font-weight: 500; color: var(--ink-2); }
  .compliance-page .section-nav-item[aria-current="location"] {
    background: var(--nav-active); border-color: transparent; color: var(--ink);
  }
  .compliance-page .jump-item { border-radius: var(--radius-sm); font-weight: 500; }
  .compliance-page .jump-item[aria-current="location"] { border-left-color: transparent; }
  @media (max-width: 768px) {
    .compliance-page .section-nav-item { border-color: transparent; border-radius: var(--radius-pill); background: var(--paper-250); }
    .compliance-page .section-nav-item[aria-current="location"] { background: var(--surface); }
  }

  @media (max-width: 640px) {
    .compliance-page .history-filter { flex-wrap: wrap; }
    .compliance-stats .stat-card { grid-template-columns: auto minmax(0, 1fr); row-gap: 0; padding: var(--space-3); }
    .compliance-stats .icon-tile { grid-row: 1; width: 2.25rem; height: 2.25rem; }
    .compliance-stats .stat-label, .compliance-stats .stat-foot { grid-column: 1 / -1; }
    .compliance-stats .stat-label { margin-top: var(--space-2); }
    /* A list's table becomes one block per row, so nothing scrolls
       sideways: no column head, each row's cells stacked under its
       first, and a muted label leading the cells a head used to name
       (data-label). */
    .compliance-card .disc-table, .compliance-card .disc-table tbody,
    .compliance-card .disc-table tr, .compliance-card .disc-table td { display: block; }
    .compliance-card .disc-table thead { display: none; }
    .compliance-card .disc-table tr { padding: var(--space-3); border-bottom: 1px solid var(--rule); }
    .compliance-card .disc-table tbody tr:last-child { border-bottom: 0; }
    .compliance-card .disc-table td, .compliance-card .disc-table td:first-child, .compliance-card .disc-table td:last-child {
      min-width: 0; padding: 0; border-bottom: 0; text-align: left; white-space: normal;
    }
    .compliance-card .disc-table td + td { margin-top: var(--space-1); }
    .compliance-card .disc-table td[data-label] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
    .compliance-card .disc-table td[data-label]::before {
      content: attr(data-label); font-size: var(--text-2xs); font-weight: 500; color: var(--muted);
    }
  }

  /* ── Campaigns: contribution plans (campaign_plan_body.html) ──
     Rides on the Compliance frame (.compliance-page / -card / disc-table);
     only what a plan adds. A blocked row says so in words, not colour alone. */
  .compliance-page .campaign-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); }
  .compliance-page .compliance-card > form > .campaign-lobbyist { display: flex; flex-direction: row; align-items: center; gap: var(--space-2); grid-column: 1 / -1; }
  .compliance-page .compliance-card > form > .campaign-lobbyist[hidden] { display: none; }
  .compliance-page .compliance-card > form[hidden], .compliance-page .send-confirm[hidden] { display: none; }
  .compliance-page .send-confirm { margin-top: var(--space-3); }
  .compliance-page .campaign-picker + .campaign-picker { margin-top: var(--space-3); }
  .compliance-page .campaign-picker label { flex: 1 1 14rem; }
  .campaign-plan select { max-width: min(22rem, 100%); min-width: 0; }
  .campaign-plan .amount-input { width: 8rem; text-align: right; font-variant-numeric: tabular-nums; }
  .campaign-plan .year-input { width: 4.5rem; margin-top: var(--space-1); }
  .campaign-plan .note-input { display: block; width: 100%; margin-top: var(--space-1); font-size: var(--text-xs); }
  .campaign-plan .limit-cell, .campaign-plan tfoot td { font-variant-numeric: tabular-nums; }
  .campaign-plan .paid-cell :is(input, button) { margin-top: var(--space-1); }
  .campaign-plan .paid-cell .paid-date { width: 9.5rem; }
  .campaign-plan .paid-cell .paid-ref { width: 10rem; display: block; }
  .status-badge.blocked { background: var(--error-soft); color: var(--error); }
  .campaign-plan .block-reasons { margin: var(--space-1) 0 0; padding-left: var(--space-4); font-size: var(--text-xs); color: var(--error); max-width: 26rem; }

  /* ── Admin pages (owners only: Approvals, AI usage, LegiScan usage,
     Capitol lead time, Usage) ──
     Shared parts only — .page-head, .panel with a .panel-head title, the
     shared empty state; this spaces a page's panels apart and sets the
     month picker on the head's line. */
  .admin-page .panel + .panel { margin-top: var(--space-4); }
  .admin-page > #summary { margin: 0 0 var(--space-3); }
  .admin-page .page-head-actions { align-items: center; }
  .admin-page .page-head-actions input { width: auto; }
  /* The tab row across every admin page (app.admin_tabs). Wraps on a
     phone rather than scrolling sideways; the current page reads by
     weight and an underline, not colour alone. */
  .admin-tabs { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4);
    margin: 0 0 var(--space-4); border-bottom: 1px solid var(--rule); }
  .admin-tabs a { padding: var(--space-2) 0; color: var(--muted); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px; }
  @media (hover: hover) { .admin-tabs a:hover { color: var(--ink); } }
  .admin-tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
  /* /admin/firms: one <details> per firm, its people inside. The status
     is a word, never colour alone. */
  .admin-firm { border-top: 1px solid var(--rule); }
  .admin-firm:first-child { border-top: 0; }
  .admin-firm > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3);
    padding: var(--space-3) var(--space-4); cursor: pointer; }
  .admin-firm-actions { padding: 0 var(--space-4) var(--space-2); }
  .admin-status { font-size: var(--text-2xs); font-weight: 600; color: var(--muted); text-transform: uppercase;
    letter-spacing: .04em; }
  .admin-status[data-status="paused"], .admin-status[data-status="declined"] { color: var(--ink); }

  /* ── Registration form: address rows ──
     City, State and ZIP shared one row at every width, which left the ZIP
     box 63px wide on a phone. There, City takes its own row and State and
     ZIP share the next. */
  .reg-city { flex: 2 1 12rem; }
  .reg-state, .reg-zip { flex: 1 1 5rem; }
  @media (max-width: 640px) {
    .reg-city { flex: 1 1 100%; }
  }

  /* ── Registration form v5 (docs/design-system: Card, forms) ──
     /registration (REGISTRATION_BODY), scoped to .registration-page:
     the layout the template used to carry inline, then the design
     system over it. A serif page title; the form one white card on a
     hairline with no shadow; the two address heads in the card serif;
     labels at 500 and "(optional …)" asides in --muted; the registrant
     radios navy when chosen (Checkbox), each hint under its label.
     Buttons, fields and the switch keep the app's own shape (that
     changes app-wide in one pass), as does the --gold focus ring. */
  .registration-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }
  .registration-page .page-head a.sub { color: var(--link); }
  .registration-page .reg-card { padding: var(--space-5); }
  .registration-page .reg-card .req-legend { color: var(--muted); }
  .registration-page #f { margin-bottom: 0; }
  .registration-page #f input:not([type="checkbox"]):not([type="radio"]) { width: 100%; }
  .registration-page .reg-full { flex: 1 1 100%; }
  .registration-page .reg-gap { margin-top: var(--space-4); }
  .registration-page .reg-date { flex: 1 1 10rem; }
  .registration-page .reg-st { text-transform: uppercase; }
  .registration-page .reg-mail-fields { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: var(--space-2); }
  .registration-page .reg-mail-fields[hidden] { display: none; }
  .registration-page .field-label { font-weight: 500; }
  .registration-page .field-optional, .registration-page .field-hint { color: var(--muted); }
  .registration-page .reg-section {
    margin: var(--space-4) 0 var(--space-2); font-size: var(--text-md);
    font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
  }
  .registration-page .reg-choice {
    display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink);
  }
  .registration-page .reg-choice + .reg-choice { margin-top: var(--space-2); }
  .registration-page .reg-choice input { width: auto; margin-top: var(--space-1); accent-color: var(--link); }
  .registration-page .reg-choice .field-hint { display: block; }
  .registration-page .reg-same {
    display: inline-flex; align-items: center; gap: var(--space-2);
    font-size: var(--text-sm); margin-bottom: var(--space-3);
  }
  .registration-page .reg-submit { margin-top: var(--space-4); }
  @media (max-width: 640px) {
    .registration-page .reg-card { padding: var(--space-4); }
  }

  /* ── Saved searches ──
     The list above the search box (see saved_searches in schema.sql).
     Rows, not cards: each is a name, the query behind it, and a count of
     what's new — one line of content and one of detail. */
  .saved-row {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule);
  }
  .saved-row:last-child { border-bottom: 0; }
  .saved-main { flex: 1; min-width: 0; }
  .saved-name {
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: var(--text-sm); font-weight: 600; color: var(--ink); text-align: left;
  }
  @media (hover: hover) { .saved-name:hover { color: var(--accent); } }
  .saved-meta { font-size: var(--text-2xs); color: var(--slate); margin-top: var(--space-0); }

  /* ── Letters ──
     The editor is a document being read as a document, not a form field
     (whole-app audit Y17): the body face at body size with generous
     leading, on a calm card inset with page-like margins, and the letter
     column capped at 46rem so a wide window doesn't stretch lines to a
     length nobody proofreads accurately (~75 characters). It used to be
     monospace at half the window with the right half blank; that half
     now holds "Who handles this". */
  .letter-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
  .letter-layout > * { min-width: 0; max-width: 46rem; }
  /* Write, check, submit (fresh-eyes review H1): the letter first, then
     the side column — "Before you submit" and "Who handles this" — then
     Ready to submit. On a phone that is the order down the page. */
  .letter-side { display: flex; flex-direction: column; gap: var(--space-4); }
  .letter-side:not(:has(> :not([hidden]))) { display: none; }
  /* Two columns only when the side column has something showing — a
     hidden pair (still loading, or an AI draft that is never submitted)
     leaves the letter alone rather than beside an empty column. The side
     column spans both rows, so Ready to submit sits under the letter. */
  @media (min-width: 1200px) {
    .letter-layout:has(> .letter-side > :not([hidden])) {
      grid-template-columns: minmax(0, 46rem) minmax(16rem, 24rem); align-items: start;
    }
    .letter-layout:has(> .letter-side > :not([hidden])) > .letter-main { grid-column: 1; grid-row: 1; }
    .letter-layout > .letter-side { grid-column: 2; grid-row: 1 / span 2; max-width: none; }
    .letter-layout > .letter-send { grid-column: 1; }
    /* A 24rem column is too narrow for a name beside three buttons. */
    .letter-aside .routing-row { flex-direction: column; }
  }
  textarea.letter-body {
    display: block; width: 100%;
    font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.7; white-space: pre-wrap;
    background: var(--surface); border: 1px solid var(--rule-card); border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    /* Vertical only: dragging it wider broke the page on a phone. Its
       height follows the text (fitBody() in LETTER_EDIT_BODY), so the
       page is the one scroller rather than a box scrolling inside it. */
    resize: vertical; overflow-y: hidden;
  }
  /* The subject line: a textarea only so it can wrap and grow
     (fitSubject() in LETTER_EDIT_BODY); it reads as the text field it is. */
  textarea.letter-subject { resize: none; overflow-y: hidden; line-height: 1.4; }
  textarea.letter-subject { width: 100%; }
  .letter-subject-label { display: block; margin: 0 0 var(--space-1); }
  /* The letter and sign-on panels' insides, and their head's tools. */
  .letter-body-panel, .letter-signons { margin-top: var(--space-4); }
  .letter-panel-body { padding: var(--space-4); }
  .letter-body-panel .panel-head .card-actions, .letter-send .panel-head .card-actions { margin: 0; }
  .letter-body-panel .panel-head .save-status { align-self: center; }
  .letter-signature-source { margin: var(--space-2) 0 0; }
  #routing-list { padding: var(--space-2) var(--space-4) var(--space-4); }
  #routing-list .routing-note { margin: 0; }
  /* "Submit by" — the committee's deadline and where the letter stands,
     a one-line strip atop the letter (fresh-eyes H1: committees have hard
     cutoffs, so the date stays in view; the rest of submitting comes
     after the letter). Wraps to two lines on a phone. */
  .letter-deadline {
    max-width: 46rem; margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
    display: flex; flex-direction: column; gap: var(--space-2);
  }
  .letter-deadline[hidden] { display: none; }
  .letter-due-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
  .letter-due-strip .title { margin: 0; font-size: var(--text-base); font-weight: 600; }
  .letter-due-field { display: flex; flex-direction: column; gap: var(--space-1); }
  .letter-due-input { display: flex; align-items: center; gap: var(--space-3); }
  .letter-due-suggest { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; align-items: flex-start; }
  .letter-due-suggest[hidden], .letter-due-input [hidden], .letter-deadline > p[hidden] { display: none; }
  .letter-due-suggest .sub, .letter-deadline > p.sub { margin: 0; font-size: var(--text-2xs); }
  /* The submitted mark, last in Ready to submit, under the portal steps. */
  .letter-submit {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
    padding-top: var(--space-3); border-top: 1px solid var(--rule);
  }
  .letter-submit .sub { margin: 0; }
  .letter-portal-link { font-size: var(--text-xs); font-weight: 600; }
  /* Where a letter stands with the committee — the editor and the Letters
     list. Each state carries its own words ("Overdue — due …"); colour
     is the second cue, not the only one. */
  .letter-pill { border-color: var(--rule-strong); color: var(--slate); }
  .letter-pill.soon { background: var(--warn-soft); color: var(--warn); border-color: currentColor; }
  .letter-pill.over { background: var(--error-soft); color: var(--error); border-color: currentColor; }
  .letter-pill.submitted { background: var(--good-soft); color: var(--good); }
  /* Phone: the Letters list as stacked cards, as the directory table
     does — six columns scrolled sideways put the status out of sight. */
  @media (max-width: 900px) {
    .letters-table, .letters-table tbody, .letters-table tr, .letters-table td { display: block; width: auto; }
    .letters-table thead { display: none; }
    .letters-table tr { border-bottom: 1px solid var(--rule-strong); padding: var(--space-3) var(--space-4); }
    .letters-table tr:last-child { border-bottom: 0; }
    .letters-table td { border: 0; padding: var(--space-1) 0; }
    .letters-table td.col-edited::before { content: "Last edited "; color: var(--slate); }
    .letters-table td:last-child .cell-actions { justify-content: flex-start; }
  }
  /* On a phone the page margins shrink so the measure stays ~40
     characters rather than losing a third of the width to padding. */
  @media (max-width: 767px) {
    textarea.letter-body { padding: var(--space-3) var(--space-4); line-height: 1.6; }
  }
  /* Printing a letter should produce the letter, not the app around it
     — the sidebar, topbar and every control are furniture on paper. */
  @media print {
    .app-sidebar, .app-topbar, .card-actions, .page-head, .panel-head .sub, #error,
    .skip-link { display: none !important; }
    .app-main { padding: 0 !important; }
    .letter-aside { display: none !important; }
    .letter-side { display: none !important; }
    .letter-deadline { display: none !important; }
    .letter-layout { display: block; }
    textarea.letter-body {
      border: 0; padding: 0; max-width: none; font-size: var(--text-base);
      font-family: Georgia, 'Times New Roman', serif; height: auto;
    }
  }
  /* The letter editor's "signed with… from Settings" note (workflow audit
     C2) is about the app, not part of the letter. */
  @media print { .letter-signature-source, .letter-signons, .letter-ai { display: none !important; } }
  /* Draft with AI (ai_letter.py): the "AI draft — review before sending"
     label over the text, in the stale-save banner's warning tint. */
  .letter-ai > p.sub { margin: 0 0 var(--space-3); }
  /* "Draft with AI is off." with its reason folded under it (declutter,
     Nov 13 2026): one gap below the pair, none inside it. */
  .letter-ai-off { margin: 0 0 var(--space-3); }
  .letter-ai-off p.sub { margin: 0; }
  .letter-ai-note {
    background: var(--warn-soft); border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4); margin: 0 0 var(--space-3);
  }
  .letter-ai-note p { margin: 0; font-size: var(--text-sm); }
  p.letter-ai-note { font-size: var(--text-sm); }   /* the AI bill-summary "check this" note */
  .letter-ai-note .linklike { margin-top: var(--space-2); }
  /* The client's reasons box Draft with AI reads (letter_reasons). */
  .letter-reasons { margin: 0 0 var(--space-4); }
  .letter-reasons label { display: block; font-weight: 600; font-size: var(--text-sm); }
  .letter-reasons p.sub { margin: var(--space-1) 0 var(--space-2); }
  .letter-reasons textarea { width: 100%; }
  /* Draft with AI's questions before it writes (beta review Nov 6). */
  .letter-ai-questions {
    border: 1px solid var(--rule); border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4); margin: 0 0 var(--space-4);
  }
  .letter-ai-questions[hidden] { display: none; }   /* a page rule makes forms flex */
  .letter-ai-questions-head { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
  .letter-ai-questions label { display: block; font-weight: 600; font-size: var(--text-sm); margin: var(--space-3) 0 var(--space-1); }
  .letter-ai-questions textarea { width: 100%; }
  .letter-ai-questions .card-actions { margin-top: var(--space-3); }
  /* An AI testimony script, talking points or one-pager (advocacy_drafts
     .py): its [blanks] left and a script's time read aloud under the
     text, and its "AI draft" tag on the Letters list. */
  .letter-doc-measure { margin: var(--space-2) 0 0; }
  @media print { .letter-doc-measure { display: none !important; } }
  .letter-kind-tag {
    display: inline-block; margin-left: var(--space-1); padding: 0 var(--space-1);
    border-radius: var(--radius-pill); background: var(--warn-soft); color: var(--warn);
    font-size: var(--text-xs); font-weight: 500; vertical-align: middle;
  }
  /* Coalition sign-ons (Oct 7 audit P6): the signed names print under the
     letter; the panel that records them doesn't. */
  .letter-signature-block {
    margin: var(--space-2) 0 0; white-space: pre-wrap;
    font-family: Georgia, 'Times New Roman', serif;
  }
  .signon-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
  .signon-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-1) 0; }
  .signon-name { flex: 1 1 12rem; }
  /* Coalition logos (beta review Nov 6): the list in Sign-ons, and the
     row that heads the letter (and its PDF) above the text. */
  .signon-logos { margin: 0 0 var(--space-4); }
  .signon-logos-title { font-size: var(--text-sm); font-weight: 600; margin: 0; }
  .signon-logos p.sub { margin: var(--space-1) 0 var(--space-2); }
  .signon-logo-list { list-style: none; margin: 0; padding: 0; }
  .signon-logo-item { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-1) 0; }
  .signon-logo-item img { height: 28px; max-width: 96px; object-fit: contain; }
  .letter-logo-row {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: var(--space-4); margin: 0 0 var(--space-3);
  }
  .letter-logo-row[hidden] { display: none; }
  .letter-logo-row img { height: 48px; max-width: 150px; object-fit: contain; }
  .signon-add { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
  .signon-add[hidden] { display: none; }   /* "Ask a colleague" at a one-person firm */
  .signon-add :is(select, input) { max-width: 100%; min-width: 0; }   /* a long option ran past a phone's edge */
  .signon-rep { flex: 1 1 10rem; min-width: 0; }
  /* Ready to submit (letter_packet.py): the committee's deadline rule,
     the pre-flight checks, the portal steps and the email. Each check
     carries its word (OK / Fix / Check) — colour is the second cue. Never
     printed: the printed page is the letter. */
  .letter-packet { margin-top: var(--space-4); }
  .letter-packet .panel-head .card-actions a { white-space: nowrap; }
  .letter-packet-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
  .letter-packet-body p { margin: 0; }
  .letter-packet [hidden] { display: none !important; }
  .packet-heading { font-size: var(--text-sm); font-weight: 700; margin: var(--space-2) 0 0; }
  .packet-deadline { font-size: var(--text-sm); }
  .packet-rule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
  .packet-rule-form {
    display: flex; flex-direction: column; gap: var(--space-2); max-width: 28rem;
    padding: var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  }
  .packet-rule-form .field-label { margin: 0; }
  .packet-rule-check { display: flex; align-items: center; gap: var(--space-2); }
  .packet-checks, .packet-sent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
  .packet-check { display: flex; gap: var(--space-3); align-items: baseline; font-size: var(--text-sm); }
  .packet-check-mark {
    flex: none; min-width: 3.25rem; text-align: center; font-size: var(--text-2xs); font-weight: 700;
    padding: var(--space-0) var(--space-2); border-radius: var(--radius-pill); background: var(--paper-250); color: var(--ink-2);
  }
  .packet-check.ok .packet-check-mark { background: var(--good-soft); color: var(--good); }
  .packet-check.fix .packet-check-mark { background: var(--error-soft); color: var(--error); }
  .packet-check.check .packet-check-mark { background: var(--warn-soft); color: var(--warn); }
  /* A Fix that jumps to its spot: still the tag, plainly clickable. */
  button.packet-check-mark.packet-check-go {
    border: 1px solid currentColor; cursor: pointer; font-family: inherit; line-height: inherit;
    text-decoration: underline; text-underline-offset: 2px; box-shadow: none; min-height: 0;
  }
  .packet-steps { margin: 0 0 var(--space-3); padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
  .packet-sent { font-size: var(--text-sm); }
  .email-confirm { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); font-size: var(--text-sm); }
  .email-confirm dt { color: var(--slate); }
  .email-confirm dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
  @media print { .letter-packet { display: none !important; } }

  /* ── Letters v5 (docs/design-system: Card, data, forms, actions) ──
     Laid over the rules above for the Letters list (.letters-page) and
     the letter editor (.letter-editor) only — the client page's Letters
     tab, the bill report's letter picker and the client report's
     "sent" pill keep theirs. Serif page and card titles; white 18px
     cards on a hairline with no shadow and no header rule; the list a
     flush card whose table has a tinted, rounded head band in sentence
     case and rows that tint on hover; bill numbers mono navy; a
     letter's status a borderless tinted chip. Buttons and fields keep
     the app's own shape for now (button shape is to change app-wide in
     one pass); the pills keep the one base shape; the --gold focus ring
     and 44px touch floor stay. The editor's rules are screen-only, so
     the printed letter is exactly what it was. */
  .letters-page .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--space-1); max-width: 46rem; text-wrap: pretty; }

  /* Start a letter: a card with a serif title. */
  .letters-page .card.letters-start { padding: var(--space-4); }
  /* Its title in the one card-heading voice, as the list's panel title under it is. */
  .letters-start .bill-title {
    margin: 0 0 var(--space-3); font-family: var(--font-sans); font-size: var(--text-md); font-weight: 500;
    line-height: 1.2; text-transform: none; letter-spacing: -0.01em; color: var(--ink);
  }
  .letters-start .sub { color: var(--ink-2); margin-bottom: 0; }
  .letters-start form { margin-bottom: 0; }
  .letters-start #letter-bill { flex: 1; min-width: 12rem; }
  .letters-start #letter-start-note { margin-top: var(--space-2); }

  /* Your letters: a flush Card around the table. */
  .letters-card { margin-top: var(--space-4); }
  .letters-card .panel-head { border-bottom: 0; padding: var(--space-4) var(--space-4) var(--space-3); }
  .letters-card .letters-table td.col-actions { text-align: right; }
  .letters-card .letters-table td > a { font-weight: 500; color: var(--ink); }
  @media (hover: hover) { .letters-card .letters-table td > a:hover { color: var(--link); } }
  .letters-card .letters-table .sub { color: var(--ink-2); margin: var(--space-0) 0 0; }
  .letters-card .letters-table .rereview-note { font-weight: 500; }
  /* BillNumber: mono navy, regular weight, as typed. */
  .letters-card td.col-bill {
    font-variant-numeric: tabular-nums; font-size: var(--text-xs); font-weight: 500; text-transform: none; color: var(--ink);
  }
  .letters-card td.date { color: var(--ink-2); }
  @media (min-width: 901px) {
    .letters-card .letters-table { border-collapse: separate; border-spacing: 0; }
    .letters-card .letters-table th {
      border-top: 0; border-bottom: 0; background: var(--paper-50); padding-top: var(--space-2); padding-bottom: var(--space-2);
      font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
    }
    .letters-card .letters-table th:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
    .letters-card .letters-table th:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
    .letters-card .letters-table th:first-child, .letters-card .letters-table td:first-child { padding-left: var(--space-3); }
    .letters-card .letters-table th:last-child, .letters-card .letters-table td:last-child { padding-right: var(--space-2); }
    .letters-card .letters-table tbody tr:last-child td { border-bottom: 0; }
    /* The letter's own column is the row's title: "Last edited" may
       wrap after its date, so the letter isn't squeezed to a word a line
       by the columns that can't. */
    .letters-card .letters-table td.col-edited { white-space: normal; min-width: 7rem; }
    @media (hover: hover) {
      .letters-card .letters-table tbody tr:hover { background: none; }
      .letters-card .letters-table tbody tr:hover td { background: var(--paper-50); }
    }
  }
  .letters-card div:has(> .letters-table) { padding: 0 var(--space-2) var(--space-2); }
  /* The phone card: a hairline between letters, the label in sentence case. */
  @media (max-width: 900px) {
    .letters-card div:has(> .letters-table) { padding: 0; }
    .letters-card .letters-table tr { border-bottom-color: var(--rule); }
    .letters-card .letters-table td.col-edited::before { color: var(--muted); }
  }

  /* A letter's status: a borderless tinted chip (the word carries it). */
  :is(.letters-page, .letter-editor) .letter-pill { border-color: transparent; }
  :is(.letters-page, .letter-editor) .letter-pill:not(.soon, .over, .submitted) { background: var(--paper-250); color: var(--ink-2); }

  @media screen {
    .letter-editor .page-head .sub { font-size: var(--text-sm); color: var(--ink-2); max-width: 46rem; text-wrap: pretty; }
    .letter-editor .page-head a.sub { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
    @media (hover: hover) { .letter-editor .page-head a.sub:hover { color: var(--ink); } }
    .letter-editor .letter-title-number {
      font-variant-numeric: tabular-nums; font-size: var(--text-xl); font-weight: 500; letter-spacing: 0; color: var(--ink);
    }
    /* The subject line's card lines its label up with the panels' titles. */
    .letter-editor .card { padding: var(--space-4); }
    .letter-editor .panel-head { border-bottom: 0; align-items: flex-start; }
    .letter-editor .panel-head .title {
      font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
    }
    .letter-editor .letter-due-strip .title {
      font-size: var(--text-md); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em;
    }
    .letter-editor .panel-head .sub { color: var(--ink-2); max-width: 40rem; text-wrap: pretty; }
    .letter-editor #letter-received { margin: var(--space-2) 0 0; }
    /* Field labels (TextInput / TextArea): 12px, medium, secondary ink. */
    .letter-editor label.sub { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
    .letter-editor .letter-portal-link { font-weight: 500; }
    .letter-editor textarea.letter-body { border-color: var(--rule); }
    /* Who handles this: field-label heads, medium names. */
    .letter-editor .routing-heading { font-weight: 500; color: var(--muted); }
    .letter-editor .routing-row strong { font-weight: 500; }
    .letter-editor .routing-other > summary { color: var(--ink-2); }
  }
  @media screen and (max-width: 640px) {
    .letter-editor .letter-title-number { font-size: var(--text-lg); }
  }

  /* ── Digest settings (P2-30) ──
     The one settings form in this app, so it gets a shape rather than a
     component library: a label column that lines up with the read-only
     rows already on Profile, and checkbox rows that stay one tap target
     each on a phone (the label wraps the input, so the caption is part
     of the hit area, not decoration next to it). */
  .pref-group { padding: var(--space-4) var(--space-4); border-bottom: 1px solid var(--rule); }
  .pref-group:last-of-type { border-bottom: 0; }
  .pref-group > .pref-label {
    font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--slate); margin-bottom: var(--space-2);
  }
  .pref-hint { font-size: var(--text-xs); color: var(--slate); margin-top: var(--space-2); }
  .pref-check {
    display: flex; align-items: baseline; gap: var(--space-2);
    padding: var(--space-2) 0; cursor: pointer;
  }
  .pref-check input { margin: 0; flex: none; accent-color: var(--accent-solid); }
  .pref-check .pref-check-text { font-size: var(--text-sm); }
  .pref-check .pref-check-sub { font-size: var(--text-xs); color: var(--slate); margin-top: var(--space-0); }
  /* iOS-style track+knob switch for boolean on/off settings (G5, mockup
     parity). It's a real <input type="checkbox"> restyled with
     appearance:none, so :checked, keyboard focus and every existing
     "input.checked" read in the page's JS keep working untouched — only
     the paint changes. The "on" colour is the app's gold accent
     (not --ink) to preserve the "on = gold" cue these checkboxes carried
     via accent-color, and because a saturated colour reads as enabled. */
  input.switch {
    -webkit-appearance: none; appearance: none; margin: 0; flex: none; cursor: pointer;
    position: relative; width: 1.9rem; height: 1.05rem;
    border-radius: var(--radius-pill); background: var(--rule-strong);
    box-shadow: inset 0 0 0 1px var(--rule-strong);  /* see .theme-choice-options */
    transition: background var(--dur-fast) var(--ease);
  }
  input.switch::after {
    content: ""; position: absolute; top: 0.1rem; left: 0.1rem;
    width: 0.85rem; height: 0.85rem; border-radius: 50%;
    /* Always white, like iOS: --surface went near-black in dark mode and
       the knob vanished into the track. */
    background: #fff; box-shadow: var(--shadow-rest);
    transition: transform var(--dur-fast) var(--ease);
  }
  input.switch:checked { background: var(--accent-solid); }
  input.switch:checked::after { transform: translateX(0.85rem); }
  input.switch:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 2px; }
  /* A settings row carrying a switch reads label-left, control-right (the
     iOS list convention); row-reverse trailing the DOM-first input. */
  .pref-check.pref-toggle { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  /* Radios laid out as a column of rows rather than a segmented control:
     each option needs a sentence of consequence under it ("Monday
     mornings, covering the previous week"), and a segmented control has
     nowhere to put one. */
  .pref-radios { display: flex; flex-direction: column; gap: 0; }
  .pref-checks { display: flex; flex-direction: column; gap: 0; }
  .pref-group input[type="text"], .pref-group textarea { width: 100%; max-width: 30rem; }
  /* "Saved" is stated where the change was made, not in a corner toast:
     this form saves on submit, and the sentence has to be next to the
     button that caused it. */
  .pref-saved { font-size: var(--text-xs); color: var(--good); margin-left: var(--space-3); }
