/*
  portal.css: the portal's one stylesheet. DESIGN.md is the source of truth, and
  tests/design/test_stylesheet.py checks every token against it. Letterpress, variation C "Two spots".
  Light by default. No gradients, glass or monospace; assets are local files only.
  Every transition uses the platen tokens, so the reduced-motion switch reaches it.
  A transform that travels further than var(--press-travel) is listed in MOTION_TRANSFORMS
  (tests/guards/allowlists.py) and stopped under both reduce paths. Every class a portal template
  uses is defined here (tests/design/test_template_classes.py).
*/

/* ---- Fonts: vendored OFL subsets built by tools/build_fonts.py ---- */
@font-face { font-family: "Besley"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/besley-600.98de5232e1a3.woff2") format("woff2"); }
@font-face { font-family: "Besley"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/besley-700.e963f4f9a2a2.woff2") format("woff2"); }
@font-face { font-family: "Besley"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/besley-italic-400.42ed76e9d309.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-400.a67f5d71e2a5.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-600.9e83e8a7a776.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-700.3d3af92d40fa.woff2") format("woff2"); }

/* ---- Tokens: light, the default ---- */
:root {
  --ink-band: #0B1024;                    /* V1: the Overview's horizon band; the night sky's own ink */
  --planet-keyline: var(--color-text-primary);
  --step-6: 3.814697265625rem;
  --dock-open-w: 248px;
  --dock-w: 248px;                        /* what the page keeps clear: 72px while the dock is folded */
  --row-h: 52px;
  --dock-bg: var(--ink-band);
  --dock-fg: #EAF0FA;
  --dock-fg2: #C9D3E9;
  --dock-pill: #EAF0FA;
  --dock-pill-fg: #0D1326;
  --dock-rule: #7A86A3;
  --dock-well: #070A16;
  --dock-focus: #6FE3FF;
  --dock-planet: #FFB55E;
  --dock-edge: transparent;                /* dark: the dock is darker than the page, so it gets a keyline */
  --block-ink-bg: var(--ink-band);
  --block-ink-fg: #EAF0FA;
  --block-ink-fg2: #C9D3E9;
  --block-info-bg: var(--color-info);
  --block-info-fg: #F6F8FB;
  --block-info-fg2: #E3F0F4;
  --block-accent-bg: var(--color-accent);
  --block-accent-fg: #F6F8FB;
  --block-accent-fg2: #FFF4E3;
  --block-link-bg: #EAF0FA;
  --block-link-fg: #0D1326;
  --block-link-hover: #F6F8FB;
  color-scheme: light;
  --color-surface-base: #ECEFF4;
  --color-surface-raised: #F6F8FB;
  --color-surface-sunken: #E1E6EE;
  --color-text-primary: #0D1326;
  --color-text-secondary: #3B4560;
  --color-rule: #97A1B6;
  --color-rule-strong: #6F7A92;
  --color-action-primary: #0D1326;
  --color-action-primary-hover: #1E2742;
  --color-on-action: #F2F5FA;
  --color-info: #00657C;
  --color-accent: #8F5100;
  --color-badge-bg: #FFC46F;
  --color-badge-text: #0D1326;
  --color-badge-ring: #0D1326;
  --color-status-danger: #74200F;
  --color-status-danger-tint: #F7E3DD;
  --color-status-success: #124F31;
  --color-status-success-tint: #E0F0E7;
  --color-status-warning: #6E4300;
  --color-status-warning-tint: #F6EAD4;
  --color-signal-danger: #C2452A;
  --color-signal-warning: #B0700F;
  --color-signal-success: #2E8A5C;

  --shadow-ink: 13 19 38;
  --paper-rgb: 246 248 251;
  --elev-sheet: 0 1px 0 rgb(var(--shadow-ink) / .06), 0 14px 28px -18px rgb(var(--shadow-ink) / .34);
  --elev-lifted: 0 2px 0 rgb(var(--shadow-ink) / .05), 0 30px 60px -28px rgb(var(--shadow-ink) / .42);
  --deboss: inset 0 1px 2px rgb(var(--shadow-ink) / .16), inset 0 -1px 0 rgb(var(--paper-rgb) / .75);
  --bite: 0 1px 0 rgb(var(--paper-rgb) / .8);
  --focus-ring: 0 0 0 2px var(--color-surface-base), 0 0 0 4px var(--color-info);
  /* Paper grain off (Cam, 28 Sep 2026): every layer that names var(--grain) now paints nothing. */
  --grain: none;

  --font-display: "Besley", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953125rem;
  --step-4: 2.44140625rem;
  --step-5: 3.0517578125rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;
  --radius-type: 2px;
  --radius-field: 4px;
  --radius-sheet: 6px;
  --radius-rail: 20px;
  --radius-round: 999px;

  --ease-press: cubic-bezier(.76,0,.24,1);
  --ease-press-out: cubic-bezier(.165,.84,.44,1);
  --ease-press-in: cubic-bezier(.895,.03,.685,.22);
  --dur-bite: 120ms;
  --dur-ink: 200ms;
  --dur-sheet: 350ms;
  --dur-plate: 480ms;
  --dur-signature: 900ms;
  --dur-shake: 360ms;
  --press-travel: 1px;
  --delay-pending: 300ms; /* IG-T18: a request must run this long before its button shows it is busy */
}

/* ---- Tokens: dark, the galaxy (chosen, or "Match my device" on a dark OS) ---- */
:root[data-theme="dark"] {
  --dock-bg: var(--color-surface-sunken);
  --dock-edge: #7A86A3;
  --block-ink-bg: var(--color-surface-raised);
  --block-info-bg: #6FE3FF;
  --block-info-fg: #0B1024;
  --block-info-fg2: #0B1024;
  --block-accent-bg: var(--color-badge-bg);
  --block-accent-fg: #0B1024;
  --block-accent-fg2: #0B1024;
  --ink-band: var(--color-surface-sunken);
  --planet-keyline: var(--color-surface-base);
  color-scheme: dark;
  --color-surface-base: #0B1024;
  --color-surface-raised: #131A33;
  --color-surface-sunken: #070A16;
  --color-text-primary: #EAF0FA;
  --color-text-secondary: #C9D3E9;
  --color-rule: #56617D;
  --color-rule-strong: #7A86A3;
  --color-action-primary: #EAF0FA;
  --color-action-primary-hover: #D2DBEA;
  --color-on-action: #0B1024;
  --color-info: #6FE3FF;
  --color-accent: #FFB55E;
  --color-badge-bg: #FFC46F;
  --color-badge-text: #0B1024;
  --color-badge-ring: #FFC46F;
  --color-status-danger: #FFD2C7;
  --color-status-danger-tint: #3A1A14;
  --color-status-success: #9FEFC0;
  --color-status-success-tint: #10291F;
  --color-status-warning: #FFD9A0;
  --color-status-warning-tint: #33260F;
  --color-signal-danger: #FF7A59;
  --color-signal-warning: #FFB55E;
  --color-signal-success: #7CE7A6;
  --shadow-ink: 2 3 10;
  --paper-rgb: 234 240 250;
  --elev-sheet: 0 1px 0 rgb(var(--shadow-ink) / .5), 0 16px 30px -18px rgb(var(--shadow-ink) / .8);
  --elev-lifted: 0 2px 0 rgb(var(--shadow-ink) / .5), 0 32px 64px -28px rgb(var(--shadow-ink) / .9);
  --deboss: inset 0 1px 2px rgb(var(--shadow-ink) / .7), inset 0 -1px 0 rgb(var(--paper-rgb) / .05);
  --bite: none;
  --grain: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --dock-bg: var(--color-surface-sunken);
    --dock-edge: #7A86A3;
    --block-ink-bg: var(--color-surface-raised);
    --block-info-bg: #6FE3FF;
    --block-info-fg: #0B1024;
    --block-info-fg2: #0B1024;
    --block-accent-bg: var(--color-badge-bg);
    --block-accent-fg: #0B1024;
    --block-accent-fg2: #0B1024;
    --ink-band: var(--color-surface-sunken);
    --planet-keyline: var(--color-surface-base);
    color-scheme: dark;
    --color-surface-base: #0B1024;
    --color-surface-raised: #131A33;
    --color-surface-sunken: #070A16;
    --color-text-primary: #EAF0FA;
    --color-text-secondary: #C9D3E9;
    --color-rule: #56617D;
    --color-rule-strong: #7A86A3;
    --color-action-primary: #EAF0FA;
    --color-action-primary-hover: #D2DBEA;
    --color-on-action: #0B1024;
    --color-info: #6FE3FF;
    --color-accent: #FFB55E;
    --color-badge-bg: #FFC46F;
    --color-badge-text: #0B1024;
    --color-badge-ring: #FFC46F;
    --color-status-danger: #FFD2C7;
    --color-status-danger-tint: #3A1A14;
    --color-status-success: #9FEFC0;
    --color-status-success-tint: #10291F;
    --color-status-warning: #FFD9A0;
    --color-status-warning-tint: #33260F;
    --color-signal-danger: #FF7A59;
    --color-signal-warning: #FFB55E;
    --color-signal-success: #7CE7A6;
    --shadow-ink: 2 3 10;
    --paper-rgb: 234 240 250;
    --elev-sheet: 0 1px 0 rgb(var(--shadow-ink) / .5), 0 16px 30px -18px rgb(var(--shadow-ink) / .8);
    --elev-lifted: 0 2px 0 rgb(var(--shadow-ink) / .5), 0 32px 64px -28px rgb(var(--shadow-ink) / .9);
    --deboss: inset 0 1px 2px rgb(var(--shadow-ink) / .7), inset 0 -1px 0 rgb(var(--paper-rgb) / .05);
    --bite: none;
    --grain: none;
  }
}

/* ---- Reduced motion, from the OS or the user's switch: nothing travels, colour steps take 120ms ---- */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-bite: 120ms; --dur-ink: 120ms; --dur-sheet: 0ms; --dur-plate: 0ms; --dur-signature: 0ms; --dur-shake: 0ms; --press-travel: 0px; }
}
html[data-motion="reduce"] { --dur-bite: 120ms; --dur-ink: 120ms; --dur-sheet: 0ms; --dur-plate: 0ms; --dur-signature: 0ms; --dur-shake: 0ms; --press-travel: 0px; }

@media (min-width: 768px) and (max-width: 1099px) {
  :root { --dock-w: 72px; }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--grain), var(--color-surface-base);
  color: var(--color-text-primary);
  font: 400 var(--step-0)/1.5 var(--font-body);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
p { max-width: 68ch; overflow-wrap: anywhere; }
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--color-info); outline-offset: 2px; }
::selection { background: var(--color-badge-bg); color: var(--color-badge-text); }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 20px; height: 20px; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: var(--space-3); left: var(--space-3); z-index: 10; display: inline-flex; align-items: center; min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-field); background: var(--color-action-primary); color: var(--color-on-action); font-weight: 600; }

/* ---- Layout ---- */
.page { max-width: 1200px; margin-inline: auto; padding: var(--space-5) var(--space-6) var(--space-7); }
.stack { display: grid; gap: var(--space-3); align-content: start; }
.sheet { padding: var(--space-5); border-radius: var(--radius-sheet); background: var(--grain), var(--color-surface-raised); box-shadow: var(--elev-sheet); }

/* ---- Type ---- */
.display { font: 600 var(--step-4)/1.08 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; text-shadow: var(--bite); }
.sec-title { font: 600 var(--step-2)/1.2 var(--font-display); text-wrap: balance; }
.small-head { font: 600 var(--step-0)/1.3 var(--font-body); color: var(--color-text-secondary); }
.lede { max-width: 40ch; font-size: var(--step-1); line-height: 1.45; }
.display + .lede { margin-top: var(--space-4); }
/* An error page's links out: a step below the lede that explains them, closer than the lede sits to the heading. */
.way-forward { margin-top: var(--space-3); }
.hint { color: var(--color-text-secondary); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.num-code { font-variant-numeric: tabular-nums lining-nums slashed-zero; }
.link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--color-info); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: text-decoration-thickness var(--dur-ink) var(--ease-press-out); }
.link:hover { text-decoration-thickness: 3px; }
button.link { min-height: 24px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
/* UX law 3 (Fitts): a 22 px text link gets a 44 px target. Vertical padding on an inline box widens the hit area without moving the line. */
a.link, a.block__quiet { padding-block: 13px; }

/* ---- Actions: hover changes ink, a press debosses, nothing lifts ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-field); background: var(--color-action-primary); color: var(--color-on-action); font: 600 var(--step-0)/1.2 var(--font-body); text-decoration: none; cursor: pointer; box-shadow: 0 1px 0 rgb(var(--shadow-ink) / .25), 0 8px 16px -10px rgb(var(--shadow-ink) / .6); transition: background-color var(--dur-ink) var(--ease-press-out), box-shadow var(--dur-bite) var(--ease-press-out), transform var(--dur-bite) var(--ease-press-out); }
.btn:hover { background: var(--color-action-primary-hover); }
.btn:active { transform: translateY(var(--press-travel)); box-shadow: inset 0 2px 3px rgb(var(--shadow-ink) / .45); }
.btn .icon { transition: transform var(--dur-ink) var(--ease-press-out); }
.btn:hover .icon { transform: translateX(calc(var(--press-travel) * 3)); }
.btn-quiet { background: transparent; color: var(--color-text-primary); box-shadow: inset 0 0 0 1.5px var(--color-rule-strong); }
.btn-quiet:hover { background: var(--color-surface-sunken); }
.btn-quiet:active { box-shadow: inset 0 0 0 1.5px var(--color-rule-strong), var(--deboss); }

/* ---- Forms: debossed wells with a printed fill-in line ---- */
.field { display: grid; gap: var(--space-1); }
.field > label, .field-top > label { font-weight: 600; }
.field-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
/* A field's errors, in the one element its aria-describedby names: each ✕ verdict on its own line, as close as the field's own parts. */
.field-errors { display: grid; gap: var(--space-1); }
.well { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-2) 0 12px; border-radius: var(--radius-field) var(--radius-field) 0 0; background: var(--color-surface-sunken); box-shadow: var(--deboss), inset 0 -1.5px 0 var(--color-rule-strong); transition: box-shadow var(--dur-ink) var(--ease-press-out); }
.well:focus-within { box-shadow: var(--deboss), inset 0 -2px 0 var(--color-text-primary), var(--focus-ring); }
.well > .icon { color: var(--color-text-secondary); }
.well input { flex: 1; min-width: 0; padding: 12px 0; border: 0; background: transparent; color: inherit; font: inherit; }
.well input:focus-visible, .well textarea:focus-visible { outline: none; }  /* the well draws the focus ring */
.well input[readonly] { color: var(--color-text-secondary); }
.well input[type="password"] { letter-spacing: .12em; }
/* A well that holds a few lines (SP2-T23's details): the fill-in line stays at the foot. */
.well--text { align-items: stretch; }
.well textarea { flex: 1; min-width: 0; min-height: 96px; padding: 12px 0; border: 0; background: transparent; color: inherit; font: inherit; resize: vertical; }
.well-btn { min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-field); background: transparent; color: var(--color-text-primary); font: 600 var(--step-0)/1 var(--font-body); cursor: pointer; transition: background-color var(--dur-ink) var(--ease-press-out); }
.well-btn:hover { background: var(--color-surface-base); }
.check { display: flex; align-items: flex-start; gap: 12px; }
.check input { flex: none; width: 24px; height: 24px; accent-color: var(--color-action-primary); }

/* ---- Typographic furniture instead of boxes ---- */
.rule-oxford { height: 6px; margin: var(--space-3) 0 var(--space-6); border: 0; border-top: 2px solid var(--color-text-primary); border-bottom: 1px solid var(--color-text-primary); }
.leaders { display: grid; gap: var(--space-2); }
.leaders > div { display: flex; align-items: baseline; }
.leaders dt { display: flex; flex: 1; align-items: baseline; min-width: 0; white-space: nowrap; color: var(--color-text-secondary); }
.leaders dt::after { content: ""; position: relative; top: -0.3em; flex: 1; min-width: var(--space-3); margin: 0 var(--space-2); border-bottom: 2px dotted var(--color-rule-strong); }
.leaders dd { margin: 0; text-align: right; }
.crop { position: relative; }
.crop::before, .crop::after { content: ""; position: absolute; left: calc(-1 * var(--space-2)); right: calc(-1 * var(--space-2)); height: var(--space-3); border: 1.5px solid var(--color-rule-strong); pointer-events: none; }
.crop::before { top: calc(-1 * var(--space-2)); border-bottom: 0; clip-path: polygon(0 0, var(--space-3) 0, var(--space-3) 100%, calc(100% - var(--space-3)) 100%, calc(100% - var(--space-3)) 0, 100% 0, 100% 100%, 0 100%); }
.crop::after { bottom: calc(-1 * var(--space-2)); border-top: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - var(--space-3)) 100%, calc(100% - var(--space-3)) 0, var(--space-3) 0, var(--space-3) 100%, 0 100%); }
.slip { position: relative; padding: var(--space-5) var(--space-4) var(--space-4); border-radius: 0 0 var(--radius-sheet) var(--radius-sheet); background: var(--grain), var(--color-surface-raised); box-shadow: var(--elev-sheet); }
.stub { height: 0; margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-4)) var(--space-5); border: 0; border-top: 3px dotted var(--color-surface-sunken); }

/* ---- States: verdicts always carry a mark and words ---- */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 var(--space-1); border-radius: var(--radius-round); background: var(--color-badge-bg); color: var(--color-badge-text); font: 700 var(--step--1)/1 var(--font-body); box-shadow: 0 0 0 1.5px var(--color-badge-ring); }
.verdict { display: inline-flex; align-items: baseline; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-type); font-weight: 600; }
.verdict--danger { background: var(--color-status-danger-tint); color: var(--color-status-danger); }
.verdict--success { background: var(--color-status-success-tint); color: var(--color-status-success); }
.verdict--warning { background: var(--color-status-warning-tint); color: var(--color-status-warning); }
/* Flash messages (staff/_messages.html): the verdicts themselves, stacked, never boxed in a well. */
.flash { display: grid; justify-items: start; gap: var(--space-2); margin: 0 0 var(--space-4); padding: 0; list-style: none; }

/* ---- Vault meter: the engraving card, ink-only segments, the next lock as a dashed ghost ---- */
.vault { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-top: var(--space-2); padding: var(--space-4); border-radius: var(--radius-sheet); background: var(--grain), var(--color-surface-raised); box-shadow: var(--elev-sheet); }
.engraving { width: 104px; height: auto; color: var(--color-text-primary); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.engraving .hatch { stroke: var(--color-rule-strong); stroke-width: .75; }
.engraving .lock-body { fill: currentColor; }
.engraving .keyhole { fill: var(--color-surface-raised); stroke: none; }
.tier { font: 600 var(--step-2)/1.15 var(--font-display); }
.tier-copy { display: block; margin-top: var(--space-1); font: 400 var(--step-0)/1.5 var(--font-body); color: var(--color-text-secondary); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-1); margin: 12px 0 var(--space-2); }
.meter > i { height: 8px; border-radius: 1px; background: var(--color-surface-sunken); box-shadow: inset 0 0 0 1px var(--color-rule), inset 0 1px 2px rgb(var(--shadow-ink) / .12); }
.meter > i.on { background: var(--color-text-primary); box-shadow: none; }
.meter > i.next { box-shadow: none; outline: 1px dashed var(--color-rule-strong); outline-offset: -1px; }

/* ---- Invite accept (/welcome/) ---- */
.masthead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mark { width: 40px; height: 40px; flex: none; color: var(--color-text-primary); }
.mark-orbit { fill: none; stroke: currentColor; stroke-width: 1.5; }
.mark-planet { fill: var(--color-accent); }
.mark-text { fill: currentColor; font: italic 400 14.5px var(--font-display); }
.mast-name { display: flex; flex-direction: column; line-height: 1.2; }
.mast-name b { font: 600 var(--step-1)/1.2 var(--font-display); }
.mast-name span { color: var(--color-text-secondary); }
.mast-help { margin-left: auto; overflow-wrap: anywhere; }
.invite { display: grid; gap: var(--space-6); }
.note { position: relative; max-width: 46ch; margin-top: var(--space-4); padding-left: var(--space-4); font: italic 400 var(--step-1)/1.5 var(--font-display); color: var(--color-text-secondary); }
.note::before { content: "\201C"; position: absolute; top: -10px; left: -2px; font: 600 var(--step-4)/1 var(--font-display); color: var(--color-accent); }
.note footer { margin-top: var(--space-2); color: var(--color-text-primary); }
.note footer span { margin-left: var(--space-2); font: 400 var(--step-0)/1.5 var(--font-body); color: var(--color-text-secondary); }
.trader { display: grid; gap: var(--space-2); margin-top: var(--space-6); }
.trader address { font-style: normal; }
.forms { display: grid; gap: var(--space-6); align-content: start; }
.setup { display: grid; gap: var(--space-4); }
.next-hint { display: flex; align-items: flex-start; gap: 12px; color: var(--color-text-secondary); }
.fine { margin-top: var(--space-6); padding-top: var(--space-3); color: var(--color-text-secondary); box-shadow: inset 0 1px 0 var(--color-rule); }

/* ---- Staff back office: the "Ink desk" shell (Cam chose variation C, 2026-09-24) ----
   A full-height spine in the galaxy's dark tokens, scoped to .spine so every component inside it
   reads them; the work sits on paper to its right. The stars are an inline SVG of dots, not a
   gradient. Below 900px the spine becomes a bar across the top. */
.desk { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.spine {
  --color-surface-base: #0B1024;
  --color-surface-raised: #131A33;
  --color-surface-sunken: #070A16;
  --color-text-primary: #EAF0FA;
  --color-text-secondary: #C9D3E9;
  --color-rule: #56617D;
  --color-rule-strong: #7A86A3;
  --color-action-primary: #EAF0FA;
  --color-action-primary-hover: #D2DBEA;
  --color-on-action: #0B1024;
  --color-info: #6FE3FF;
  --color-accent: #FFB55E;
  --color-badge-ring: #FFC46F;
  --grain: none;
  color: var(--color-text-primary);
  background: var(--grain), var(--color-surface-base);
}
.spine-inner { position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--space-5); height: 100vh; padding: var(--space-5) var(--space-4); overflow: hidden; }
.spine-inner > * { position: relative; }
.spine-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.spine-sky .star { fill: var(--color-text-primary); opacity: .55; }
.spine-sky .star--bright { opacity: .85; }
.spine-sky .orbit { fill: none; stroke: var(--color-rule); stroke-width: 1; }
.spine-sky .orbit--near { stroke: var(--color-rule-strong); }
.spine-sky .planet-amber { fill: var(--color-accent); }
.spine-sky .planet-cyan { fill: var(--color-info); }
.spine-brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.spine-brand b { display: block; font: 600 var(--step-1)/1.1 var(--font-display); }
.spine-brand span { color: var(--color-text-secondary); }
.spine-nav ul { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.spine-nav a { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-field); color: var(--color-text-secondary); font-weight: 600; text-decoration: none; transition: color var(--dur-ink) var(--ease-press-out), background-color var(--dur-ink) var(--ease-press-out); }
.spine-nav a:hover { color: var(--color-text-primary); background: var(--color-surface-raised); }
.spine-nav a[aria-current="page"] { color: var(--color-text-primary); background: var(--color-surface-raised); box-shadow: inset 0 1px 2px rgb(7 10 22 / .6), inset 0 -1px 0 rgb(234 240 250 / .06); }
.spine-nav a[aria-current="page"] .icon { color: var(--color-info); }
.spine-nav .badge { margin-left: auto; }  /* SP2-T25: Requests waiting, at the end of its row */
.spine-foot { margin-top: auto; display: grid; gap: var(--space-3); }
.spine-foot p { color: var(--color-text-secondary); }
.spine-foot b { color: var(--color-text-primary); }
.spine .btn-quiet { width: 100%; color: var(--color-text-primary); box-shadow: inset 0 0 0 1.5px var(--color-rule-strong); }
.spine .btn-quiet:hover { background: var(--color-surface-raised); }

.work { min-width: 0; max-width: 1180px; padding: var(--space-6) var(--space-6) var(--space-7); }
.work-sheet { max-width: 920px; }
.work-sheet > * + *, .work-sheet section + section, .work-sheet form + form { margin-top: var(--space-4); }
.work-sheet h2, .work-sheet .sec-title { margin-top: var(--space-6); margin-bottom: var(--space-2); }
.work-sheet h1 + p, .work-sheet .display + p { margin-top: var(--space-3); }
.work-sheet form { display: grid; gap: var(--space-3); max-width: 560px; }
.work-sheet form > p:has(> button, > .btn) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.work-sheet label { font-weight: 600; }
.work-sheet form > button, .work-sheet form > .btn { justify-self: start; }
.work-sheet form .lede { max-width: 60ch; font-size: var(--step-0); color: var(--color-text-secondary); }
.work-sheet .field:has(> input[type="checkbox"]) { grid-template-columns: 24px minmax(0, 1fr); align-items: center; column-gap: var(--space-3); }
.work-sheet :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea):not(.well *) { width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: var(--radius-field) var(--radius-field) 0 0; background: var(--color-surface-sunken); color: inherit; font: inherit; box-shadow: var(--deboss), inset 0 -1.5px 0 var(--color-rule-strong); transition: box-shadow var(--dur-bite) var(--ease-press-out); }
.work-sheet :is(input, select, textarea):not(.well *):focus-visible { box-shadow: var(--deboss), inset 0 -2px 0 var(--color-text-primary); }
.work-sheet textarea { min-height: 96px; }
.work-sheet input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--color-action-primary); }
.work-sheet ul:not([class]) { padding-left: var(--space-4); }
.leaders:has(> dt) { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); }
.leaders:has(> dt) > dt { display: flex; align-items: baseline; min-width: 0; }
.topline { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-3); }
.topline .display { text-shadow: var(--bite); }
.dateline { color: var(--color-text-secondary); font-variant-numeric: tabular-nums lining-nums; }
.desk-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-top: var(--space-6); }
.desk-lower { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-top: var(--space-7); }
.desk-lower .sec-title { margin-bottom: var(--space-3); }

.slip-head { display: flex; align-items: baseline; gap: var(--space-3); }
.stack-lg { display: grid; gap: var(--space-6); align-content: start; }
.machine-foot { margin-top: var(--space-3); }
.tasks { display: grid; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.task { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: var(--space-3) 0; }
.task + .task { border-top: 1px solid var(--color-rule); }
.task-mark { width: 20px; height: 20px; margin-top: 2px; color: var(--color-status-warning); }
.task-mark--danger { color: var(--color-accent); stroke-width: 2; }
.task .link { font-weight: 600; }
.all-clear { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; color: var(--color-text-secondary); }
.all-clear .icon { color: var(--color-status-success); }

.statement { display: grid; gap: var(--space-4); }
.statement .figure { padding-bottom: var(--space-4); border-bottom: 2px solid var(--color-text-primary); }
.figure-label { color: var(--color-text-secondary); font-weight: 600; }
.amount { font: 600 var(--step-2)/1.15 var(--font-body); font-variant-numeric: tabular-nums lining-nums; }
.amount--xl { font-size: var(--step-5); line-height: 1.05; letter-spacing: -0.02em; }
.figure-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
.quick-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
/* The Billing section links (billing/staff/_billing_nav.html): 44 px targets, and the current page
   drops its underline, so it isn't marked by colour alone. */
nav.quick-links a { display: inline-flex; align-items: center; min-height: 44px; }
nav.quick-links a[aria-current="page"] { text-decoration: none; color: var(--color-text-primary); }

.machine { padding: var(--space-4); border-radius: var(--radius-sheet); background: var(--color-surface-sunken); }
.machine .leaders dd { overflow-wrap: anywhere; }

/* Tables inside the work area: rules under the head and between rows, figures right-aligned. */
table.ledger, .work table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; }
.ledger thead th, .work thead th { padding: 0 var(--space-3) var(--space-2) 0; border-bottom: 2px solid var(--color-text-primary); color: var(--color-text-secondary); font-weight: 600; text-align: left; }
.ledger tbody th, .ledger tbody td, .work tbody th, .work tbody td { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-bottom: 1px solid var(--color-rule); text-align: left; vertical-align: baseline; }
.ledger tbody th, .work tbody th { font-weight: 600; }
.ledger tbody tr:last-child th, .ledger tbody tr:last-child td, .work tbody tr:last-child th, .work tbody tr:last-child td { border-bottom: 0; }
.ledger td.num, .ledger th.num, .work td.num, .work th.num { text-align: right; white-space: nowrap; }
.ledger tfoot th, .ledger tfoot td { padding: var(--space-3) var(--space-3) 0 0; border-top: 2px solid var(--color-text-primary); font-weight: 600; text-align: left; }
.ledger tfoot td.num { text-align: right; }
/* Positioned, so a .visually-hidden label in a cell scrolls with the table instead of widening the page. */
.table-scroll { position: relative; overflow-x: auto; }

@media (max-width: 1100px) { .desk-row, .desk-lower { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 899px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .spine-inner { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3); }
  .leaders > div { flex-wrap: wrap; }
  .leaders dd { margin-left: auto; }
  .spine-sky { display: none; }
  .spine-nav { order: 3; flex-basis: 100%; }
  .spine-nav ul { grid-auto-flow: column; justify-content: start; overflow-x: auto; }
  .spine-foot { margin: 0 0 0 auto; }
  .spine-foot p { display: none; }
  .spine .btn-quiet { width: auto; min-height: 44px; }
  .work { padding: var(--space-4) var(--space-3) var(--space-6); }
  .amount--xl { font-size: var(--step-4); }
}

/* ---- Auth: the split card and the ink plate (V1, "Plate and headline") ----
   SP2-T11, restyled to V1 (DESIGN.md "Client portal sign-off"; Cam chose it on 28 Sep 2026; the
   prototypes are design/client/v1/). Every rule for the pages before sign-in lives in this section.
   The page is always light. One card holds the paper face (sign-in and request access open with a
   Besley headline and a short lede, then the form) and the ink plate, whose colours are the dark
   tokens scoped to .auth-plate (as .spine does). The plate's orbit art has settled into a horizon
   along its foot, with the amber planet on the limb; the planet climbs a step on the code pages and
   clears the horizon after a right code (top moves, nothing transforms, and the move takes
   --dur-signature, which both reduce paths zero). The sky is SVG dots, arcs and flat fills: no
   gradient, filter, blur or grain (Cam, 28 Sep). The plate slides between /sign-in/ and /join/ as a
   cross-document view transition, with no script, only when motion is welcome. Under 768px the card
   is one column: the plate is a band carrying only the horizon, a paper switch sits under it on
   sign-in and request access, and any way through the plate offered moves onto the paper. */
.auth-page { max-width: 1224px; margin-inline: auto; padding: var(--space-3) var(--space-6) var(--space-5); }
.auth-page > .rule-oxford { margin: 12px 0 var(--space-3); }
.auth-card {
  --inset: 8px;
  --hz-h: 360px;     /* the horizon layer along the plate's foot */
  --card-h: 792px;   /* holds the full request-access face; every page matches, so the plate never stretches mid-slide */
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  min-height: var(--card-h);
  border-radius: var(--radius-sheet);
  background: var(--color-surface-raised);
  box-shadow: var(--elev-lifted);
}
/* A plate on the left (request access, its code step) keeps the same width: the columns swap. */
.auth-card:has(> .auth-plate:first-child) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

/* The paper face: headline and lede first, then the form, then the footnote at the card's foot. */
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-5) var(--space-6) var(--space-4); }
.auth-head { display: grid; gap: 12px; min-width: 0; }
.auth-form .display { max-width: 15ch; font-size: var(--step-5); line-height: 1.02; }
.auth-form .display + .lede { margin-top: 0; }
.auth-form .lede { max-width: 46ch; color: var(--color-text-secondary); text-wrap: pretty; }
.auth-fact { max-width: 46ch; color: var(--color-text-secondary); text-wrap: pretty; }
.form-title { font: 600 var(--step-2)/1.2 var(--font-display); text-shadow: var(--bite); }
.auth-fields { display: grid; gap: var(--space-3); }
.auth-fields .btn { justify-content: space-between; width: 100%; margin-top: var(--space-2); padding: 0 var(--space-3) 0 var(--space-4); }
/* Sign in (the face with a form heading) is shorter than request access, whose face sets the card's
   height: its form takes a share of the spare room, so it sits between the headline and the footnote. */
.auth-form:has(> .form-title) .auth-fields { margin-block: auto; }
.auth-foot { max-width: 60ch; margin-top: auto; text-wrap: pretty; }
/* /join/'s "What do you need?" (SP2-T23): a plain group of radio rows, no box round it. */
.auth-need { display: grid; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-need legend { margin-bottom: var(--space-1); padding: 0; font-weight: 600; }
/* Request access, compact (V1; IG-T20): who you are sets two across once the form is wide enough, the
   email under them; what you need is five type sorts, the chosen one pressed in and inked, set three then
   two with room; the details well is two lines and scrolls rather than stretching the card. */
.auth-fields:has(.auth-who) { container-type: inline-size; }
.auth-who { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.auth-who > .field { min-width: 0; grid-template-columns: minmax(0, 1fr); }  /* an input's own width never pushes a well past its column */
.auth-who > .hint { grid-column: 1 / -1; margin-top: calc(-1 * var(--space-2)); }  /* the email's note, under the whole row */
/* The one ink button with the privacy notice beside it (Art 13), wrapping under it on a narrow face. */
.auth-send { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-2); }
.auth-fields .auth-send .btn { flex: 1 1 232px; width: auto; margin-top: 0; }
.auth-send .hint { flex: 1 1 240px; }
@container (min-width: 340px) {
  .auth-who { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-who-wide { grid-column: 1 / -1; }
}
.auth-sorts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@container (min-width: 460px) {
  .auth-sorts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .auth-sorts > .sort { grid-column: span 2; }
  .auth-sorts > .sort:nth-child(n + 4) { grid-column: span 3; }
  .auth-sorts .sort span { display: flex; }
}
.sort { position: relative; }
.sort input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sort span { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 var(--space-3) 0 12px; border-radius: var(--radius-type); background: var(--color-surface-sunken); box-shadow: var(--deboss); cursor: pointer; transition: background-color var(--dur-ink) var(--ease-press-out), color var(--dur-ink) var(--ease-press-out), box-shadow var(--dur-bite) var(--ease-press-out); }
.sort span::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: var(--radius-round); box-shadow: inset 0 0 0 1.5px var(--color-rule-strong); transition: box-shadow var(--dur-bite) var(--ease-press-out); }
.sort:hover span { box-shadow: var(--deboss), inset 0 -2px 0 var(--color-text-primary); }
.sort input:checked + span { background: var(--color-action-primary); color: var(--color-on-action); box-shadow: none; font-weight: 600; }
.sort input:checked + span::before { box-shadow: inset 0 0 0 1.5px var(--color-on-action), inset 0 0 0 4px var(--color-action-primary), inset 0 0 0 7px var(--color-on-action); }
.sort input:focus-visible + span { outline: 2px solid var(--color-info); outline-offset: 2px; }
.well--short textarea { height: 64px; min-height: 64px; padding: 8px 0; }
/* The waiting room's request (SP2-T24) as dotted leaders. The label keeps its width; a long address
   or company name wraps inside the card instead. */
.auth-form .leaders dt { flex: 1 0 auto; }
.auth-form .leaders dd { min-width: 0; overflow-wrap: anywhere; }
/* Phones only: the plate's words are hidden there, so a way through it offered appears on the paper. */
.auth-alt { display: none; color: var(--color-text-secondary); }
/* Phones only: Sign in and Request access as two ordinary links with a paper thumb under the current one. */
.auth-way { display: none; }

/* The ink plate: the galaxy's dark tokens, scoped so everything inside reads them. */
.auth-plate {
  --color-surface-base: #0B1024;
  --color-surface-raised: #131A33;
  --color-surface-sunken: #070A16;
  --color-text-primary: #EAF0FA;
  --color-text-secondary: #C9D3E9;
  --color-rule: #56617D;
  --color-rule-strong: #7A86A3;
  --color-action-primary: #EAF0FA;
  --color-action-primary-hover: #D2DBEA;
  --color-on-action: #0B1024;
  --color-info: #6FE3FF;
  --color-accent: #FFB55E;
  --shadow-ink: 2 3 10;
  --paper-rgb: 234 240 250;
  --deboss: inset 0 1px 2px rgb(var(--shadow-ink) / .7), inset 0 -1px 0 rgb(var(--paper-rgb) / .05);
  --bite: none;
  --grain: none;
  --x: .3;           /* where the amber planet sits along the limb */
  --lift: 0px;       /* how far it has risen off the horizon */
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: var(--inset);
  border-radius: var(--radius-field);
  overflow: hidden;
  color: var(--color-text-primary);
  background: var(--color-surface-base);
}
.auth-card > .auth-plate:first-child { --x: .7; }
.auth-plate[data-stage="rise"] { --lift: 120px; }
.auth-plate[data-stage="clear"] { --lift: 224px; }

/* The stars: dots coloured by class. */
.auth-plate .plate-sky { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.auth-plate .plate-star { fill: var(--color-text-primary); opacity: .55; }
.auth-plate .plate-star--dim { opacity: .3; }
.auth-plate .plate-star--bright { opacity: .9; }

/* The horizon: one layer, --hz-h tall, stretched to the plate's width (strokes stay true through
   non-scaling-stroke), with the planets placed as fractions of that layer so they sit on the drawn
   curves at every width. In the layer's 1000 x 360 drawing the limb is M0 290 Q500 214 1000 290, so
   y(.3) = y(.7) = 258.08 (71.69%); the inner orbit's crest is (500, 170), the cyan planet (47.22%);
   the outer orbit at 115 degrees is (146.3, 118.7), a small ink moon (14.63%, 32.98%). */
.horizon { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: var(--hz-h); pointer-events: none; }
.horizon-art { display: block; width: 100%; height: 100%; max-width: none; overflow: visible; }
.auth-plate .hz-orbit { fill: none; stroke: var(--color-rule); stroke-width: 1; }
.auth-plate .hz-orbit--near { stroke: var(--color-rule-strong); }
.auth-plate .hz-orbit--far { opacity: .55; }
.auth-plate .hz-ground { fill: var(--color-surface-sunken); }
.auth-plate .hz-limb { fill: none; stroke: var(--color-rule-strong); stroke-width: 1.5; }
.auth-plate .hz-engrave { fill: none; stroke: var(--color-rule); stroke-width: .75; }
.auth-plate .hz-engrave--2 { opacity: .7; }
.auth-plate .hz-engrave--3 { opacity: .45; }
.planet { position: absolute; display: block; }
.planet svg { display: block; width: 100%; height: 100%; overflow: visible; }
.planet--cyan { left: 50%; top: 47.22%; width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.auth-plate .hz-cyan { fill: var(--color-info); }
.planet--moon { left: 14.63%; top: 32.98%; width: 6px; height: 6px; margin: -3px 0 0 -3px; }
.auth-plate .hz-moon { fill: var(--color-text-secondary); }
/* The amber planet sits on the limb: the disc's foot (34.5 of 44 units down) rests 1px above the curve.
   It climbs by its top, over --dur-signature, which both reduce paths zero, so it simply stands higher. */
.planet--amber {
  left: calc(var(--x) * 100%);
  top: calc(71.69% - var(--lift));
  width: 44px; height: 44px;
  margin: calc(-34.5px - 1px) 0 0 -22px;
  transition: top var(--dur-signature) var(--ease-press);
}
.auth-plate .amber-halo { fill: none; stroke: var(--color-accent); stroke-width: 1; opacity: .35; }
.auth-plate .amber-disc { fill: var(--color-accent); }
.auth-plate .amber-hatch { fill: none; stroke: var(--color-surface-base); stroke-width: .9; stroke-linecap: round; opacity: .55; }

/* The plate's words: a headline over a 48px cyan rule, a line of copy, a quiet button. Each block is
   printed on the plate's own ink with a 16px margin of it, as a star atlas clears the stars behind its
   labels, so no star sits between two letters. Flat colour, no blur. */
.auth-copy {
  --knock: 0 0 0 16px var(--color-surface-base);
  position: relative;
  display: grid; justify-items: start; align-content: start; gap: var(--space-4);
  padding: calc(var(--space-5) - var(--inset) + 7px) var(--space-6) 0;
}
.plate-title { font: 600 var(--step-4)/1.08 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.plate-title::after { content: ""; display: block; width: 48px; height: 2px; margin-top: var(--space-3); background: var(--color-info); }
.auth-copy p { max-width: 30ch; color: var(--color-text-secondary); font-size: var(--step-1); line-height: 1.45; text-wrap: pretty; }
.auth-copy > :is(h2, p) { background: var(--color-surface-base); box-shadow: var(--knock); }
.auth-plate .btn-quiet { background: var(--color-surface-base); color: var(--color-text-primary); box-shadow: inset 0 0 0 1.5px var(--color-text-secondary), var(--knock); }
.auth-plate .btn-quiet:hover { background: var(--color-surface-raised); }
.auth-plate .btn-quiet:active { box-shadow: inset 0 0 0 1.5px var(--color-text-secondary), var(--deboss), var(--knock); }

/* The slide. Both pages opt in; the plate travels across while the faces cross-fade. The words are
   not part of the plate: each page's copy has its own name, so the old words leave where they stood
   before the plate moves and the new ones arrive once it lands. The opt-in covers every portal page
   (an at-rule can't be scoped); the root timings are for these pages only. Reduced motion from the OS
   never gets here, and the user's own switch stops the plate too. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .auth-plate { view-transition-name: auth-plate; }
  .auth-copy--sign-in { view-transition-name: auth-copy-sign-in; }
  .auth-copy--join { view-transition-name: auth-copy-join; }
  .auth-copy--verify { view-transition-name: auth-copy-verify; }
  .auth-copy--enrol { view-transition-name: auth-copy-enrol; }
  .auth-copy--welcome { view-transition-name: auth-copy-welcome; }
  .auth-copy--account { view-transition-name: auth-copy-account; }
  .auth-copy--recovery { view-transition-name: auth-copy-recovery; }
  .auth-copy--codes { view-transition-name: auth-copy-codes; }
  .auth-copy--reset { view-transition-name: auth-copy-reset; }
  .auth-copy--confirm { view-transition-name: auth-copy-confirm; }
  .auth-copy--waiting { view-transition-name: auth-copy-waiting; }
  ::view-transition-group(auth-plate) { z-index: 2; animation-duration: var(--dur-plate); animation-timing-function: var(--ease-press); }
  /* The plate is one drawing on every page, so its two snapshots are held, not cross-faded. */
  ::view-transition-old(auth-plate) { animation: none; opacity: 0; }
  ::view-transition-new(auth-plate) { animation: none; }
  ::view-transition-old(auth-copy-sign-in), ::view-transition-old(auth-copy-join), ::view-transition-old(auth-copy-verify), ::view-transition-old(auth-copy-enrol), ::view-transition-old(auth-copy-welcome), ::view-transition-old(auth-copy-account), ::view-transition-old(auth-copy-recovery), ::view-transition-old(auth-copy-codes), ::view-transition-old(auth-copy-reset), ::view-transition-old(auth-copy-confirm), ::view-transition-old(auth-copy-waiting) { animation: var(--dur-bite) var(--ease-press-in) both auth-out; }
  ::view-transition-new(auth-copy-sign-in), ::view-transition-new(auth-copy-join), ::view-transition-new(auth-copy-verify), ::view-transition-new(auth-copy-enrol), ::view-transition-new(auth-copy-welcome), ::view-transition-new(auth-copy-account), ::view-transition-new(auth-copy-recovery), ::view-transition-new(auth-copy-codes), ::view-transition-new(auth-copy-reset), ::view-transition-new(auth-copy-confirm), ::view-transition-new(auth-copy-waiting) { animation: var(--dur-ink) var(--ease-press-out) var(--dur-plate) both auth-in; }
  html:has(.auth-card)::view-transition-old(root) { animation: var(--dur-ink) var(--ease-press-in) both auth-out; }
  html:has(.auth-card)::view-transition-new(root) { animation: var(--dur-sheet) var(--ease-press-out) var(--dur-bite) both auth-in; }
  html[data-motion="reduce"]::view-transition-group(auth-plate) { animation: none; }
}
@keyframes auth-out { to { opacity: 0; } }
@keyframes auth-in { from { opacity: 0; } }

/* The colophon under the card: who runs the portal, and the documents. */
.colophon { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-5); margin-top: var(--space-6); color: var(--color-text-secondary); }
.colophon p { max-width: none; }
.colophon b { color: var(--color-text-primary); font-weight: 600; }
.colophon ul { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }

/* Short desktop screens (a 1280 x 720 or 1366 x 768 laptop): the chrome, the type and the card tighten,
   so the horizon and request access's button stay on the first screen. */
@media (min-width: 1024px) and (max-height: 820px) {
  .auth-page { padding-top: 12px; }
  .auth-card { --card-h: 680px; --hz-h: 260px; }
  .auth-form { gap: var(--space-3); padding-top: var(--space-4); }
  .auth-fields:has(.auth-who) { gap: 12px; }
  /* The lede and the backups line run on as one paragraph, a line shorter. */
  .auth-head:has(.auth-fact) { display: block; }
  .auth-head:has(.auth-fact) > :is(.lede, .auth-fact) { display: inline; }
  .auth-head:has(.auth-fact) > .display { margin-bottom: 12px; }
  .auth-form .display { font-size: var(--step-4); }
  /* Who you are sets as one row of three, the email widest, with its note under the row. */
  @container (min-width: 540px) {
    .auth-who { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); }
    .auth-who-wide { grid-column: auto; }
  }
  .auth-form .lede { font-size: var(--step-0); line-height: 1.5; }
  .auth-copy { padding-top: calc(var(--space-4) - var(--inset) + 7px); }
  .auth-plate[data-stage="rise"] { --lift: 88px; }
  .auth-plate[data-stage="clear"] { --lift: 168px; }
}

/* Between tablet and desktop the type steps down, so the halves keep their measure. */
@media (max-width: 1099px) {
  .auth-page { padding-inline: var(--space-5); }
  .auth-form { padding: var(--space-5) var(--space-5) var(--space-4); }
  .auth-form .display { font-size: var(--step-4); }
  .auth-form .lede { font-size: var(--step-0); line-height: 1.5; }
  .auth-copy { padding-inline: var(--space-5); padding-top: calc(var(--space-5) - var(--inset) + 5px); }
  .plate-title { font-size: var(--step-3); }
  .auth-copy p { font-size: var(--step-0); line-height: 1.5; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .auth-card { --card-h: 920px; --hz-h: 300px; }
}

/* Phones: one column. The plate becomes a band along the top carrying only the horizon; the switch
   sits under it on paper; the face follows. */
@media (max-width: 767px) {
  .auth-page { padding: var(--space-3) var(--space-3) var(--space-5); }
  .auth-page .mast-name span { display: none; }
  .auth-page .mast-help { flex-basis: auto; margin-left: auto; }
  .auth-card { --hz-h: 112px; grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-card:has(> .auth-plate:first-child) { grid-template-columns: minmax(0, 1fr); }
  .auth-plate { order: -1; min-height: 112px; margin: var(--inset) var(--inset) 0; }
  .auth-plate[data-stage="rise"] { --lift: 24px; }
  .auth-plate[data-stage="clear"] { --lift: 48px; }
  .auth-copy { display: none; }
  .planet--amber { width: 28px; height: 28px; margin: calc(-22px - 1px) 0 0 -14px; }
  .planet--cyan { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
  .auth-form { gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-4); }  /* sign-in's Continue stays on the first screen at 390 x 844 (IG-T20) */
  .auth-form .display { max-width: 16ch; font-size: var(--step-3); }
  .auth-form .lede { font-size: var(--step-0); line-height: 1.5; }
  .auth-alt { display: block; }
  .auth-way {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 4px;
    border-radius: var(--radius-field);
    background: var(--color-surface-sunken);
    box-shadow: var(--deboss);
  }
  .auth-way a {
    position: relative; z-index: 1;
    display: grid; place-items: center;
    min-height: 44px;
    border-radius: var(--radius-type);
    color: var(--color-text-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--dur-ink) var(--ease-press-out);
  }
  .auth-way a:hover, .auth-way a[aria-current="page"] { color: var(--color-text-primary); }
  .auth-way a:focus-visible { outline-offset: -2px; }
  .auth-way-thumb {
    position: absolute; top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    border-radius: var(--radius-type);
    background: var(--color-surface-raised);
    box-shadow: 0 1px 0 rgb(var(--shadow-ink) / .1), 0 2px 6px -2px rgb(var(--shadow-ink) / .25);
  }
  .auth-way--join .auth-way-thumb { left: 50%; }
  .form-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }  /* the switch already says "Sign in" */
  .colophon { flex-direction: column; gap: var(--space-3); }
}

@media (forced-colors: active) {
  .auth-card { outline: 1px solid CanvasText; }
  .auth-plate { background: Canvas; border: 1px solid CanvasText; }
  .auth-plate .plate-sky, .auth-plate .hz-engrave, .planet--moon { display: none; }
  .horizon-art { forced-color-adjust: none; }
  .auth-plate .hz-ground { fill: Canvas; }
  .auth-plate .hz-limb, .auth-plate .hz-orbit { stroke: CanvasText; }
  .auth-way { border: 1px solid CanvasText; }
  .sort span { border: 1px solid CanvasText; }
  .sort input:checked + span { outline: 2px solid Highlight; }
  .auth-way a[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* ---- OTP ring: one real input over six debossed sorts, "the lock-up" ----
   SP2-T12 (spec §15 "OTP ring"; design 07 §8, §10; DESIGN.md "Signature interactions"). Every rule
   for the ring, its dial and the code pages' own furniture lives in this section, so the restyle to
   Cam's pick of direction A or E stays inside it.
   Without script the input is an ordinary debossed well, the sorts stay hidden and the page's
   button sends the code. auth.js's mountOtpRing() adds .is-live: the input, transparent, lies over
   six sorts (3 + 3) that take its digits, and the sort to fill next is lit; attention is only
   light. The states are classes auth.js sets: .is-busy (while the code is checked, a light passes
   along the sorts), .is-wrong (the shake and the strike, the only motion drawn here, stopped under
   both reduce paths), .is-clearing (the digits fade out together), .is-done and .is-sealed (the
   right code: auth.js curls the sorts into a ring, turns it and screws it down into the seal with
   WAAPI, only when motion is welcome; these classes hold the end, and under reduced motion they
   are the whole of it, one 120ms colour step). */
.otp-ring { display: grid; justify-items: start; gap: var(--space-2); min-width: 0; }
.otp-trust { display: grid; gap: var(--space-1); margin-bottom: var(--space-2); }
.otp-trust .check { font-weight: 600; cursor: pointer; }
.otp-trust .hint { padding-left: 36px; }
.otp-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); width: 100%; max-width: 320px; }
.otp-top > label { font-weight: 600; }

/* The dial: a wedge that empties over the 30-second step, beside "New code in 12 s". It stays
   hidden (its room kept) until auth.js counts it, since a figure that never moves is wrong a
   second later. */
.otp-dial { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-secondary); visibility: hidden; }
.otp-dial.is-live { visibility: visible; }
.otp-dial-face { flex: none; width: 20px; height: 20px; }
.otp-dial-track { fill: none; stroke: var(--color-rule-strong); stroke-width: 1.5; }
.otp-dial-left { fill: none; stroke: var(--color-info); stroke-width: 9; stroke-dasharray: 28.27; transition: stroke-dashoffset var(--dur-signature) linear; }
.otp-dial.is-wrap .otp-dial-left { transition: none; }

/* The bed: the input, and once live the sorts it fills. */
.otp-bed { position: relative; width: 320px; max-width: 100%; }
.otp-bed input { width: 100%; min-height: 56px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-field) var(--radius-field) 0 0; background: var(--color-surface-sunken); box-shadow: var(--deboss), inset 0 -1.5px 0 var(--color-rule-strong); color: var(--color-text-primary); font: 600 var(--step-3)/1 var(--font-body); font-variant-numeric: tabular-nums lining-nums slashed-zero; letter-spacing: .3em; }
.otp-bed input[aria-invalid="true"] { box-shadow: var(--deboss), inset 0 -2px 0 var(--color-signal-danger); }
.otp-sorts { display: none; gap: var(--space-1); transition: opacity var(--dur-bite) var(--ease-press-out); }
.otp-ring.is-live .otp-sorts { display: flex; }
.otp-ring.is-live .otp-bed input { position: absolute; inset: 0; z-index: 1; height: 100%; min-height: 0; padding: 0; background: transparent; box-shadow: none; color: transparent; caret-color: transparent; letter-spacing: 0; cursor: text; }
.otp-ring.is-live .otp-bed input::selection { background: transparent; }
.otp-sort { display: grid; place-items: center; flex: none; width: 48px; height: 56px; border-radius: var(--radius-type); background: var(--color-surface-sunken); box-shadow: var(--deboss), inset 0 -1.5px 0 var(--color-rule-strong); color: var(--color-text-primary); font: 600 var(--step-3)/1 var(--font-body); font-variant-numeric: tabular-nums lining-nums slashed-zero; transition: background-color var(--dur-bite) var(--ease-press-out), color var(--dur-bite) var(--ease-press-out), box-shadow var(--dur-bite) var(--ease-press-out); }
.otp-sort:nth-child(4) { margin-left: 12px; }
.otp-ring:focus-within .otp-sort.is-next { background: var(--color-surface-raised); box-shadow: var(--deboss), inset 0 -2px 0 var(--color-text-primary); }
/* A digit lands like a key: pressed a hair into the sort (press travel, so 0px under reduced motion). */
.otp-sort.is-landed { animation: otp-land var(--dur-bite) var(--ease-press-out); }
@keyframes otp-land { from { transform: translateY(calc(var(--press-travel) * -2)); } }

/* Checking: the digits go quiet and, from about 300ms, a light passes along the sorts every
   --dur-signature. Colour only. */
.otp-ring.is-busy .otp-sort { color: var(--color-text-secondary); animation: otp-sweep var(--dur-signature) var(--ease-press) calc(var(--dur-ink) + var(--dur-bite) * var(--sweep-step, 0)) infinite; }
.otp-ring.is-busy .otp-bed input { cursor: progress; }
.otp-sort:nth-child(2) { --sweep-step: .5; }
.otp-sort:nth-child(3) { --sweep-step: 1; }
.otp-sort:nth-child(4) { --sweep-step: 1.5; }
.otp-sort:nth-child(5) { --sweep-step: 2; }
.otp-sort:nth-child(6) { --sweep-step: 2.5; }
@keyframes otp-sweep { 30% { background-color: var(--color-surface-raised); } }

/* Wrong: the sorts shake (x 0 −6 6 −4 4 0 over --dur-shake) while a red strike draws across them
   and the digits turn danger; auth.js clears them together 600ms later. */
.otp-strike { position: absolute; left: 0; right: 0; top: 50%; z-index: 2; height: 2px; margin-top: -1px; background: var(--color-signal-danger); opacity: 0; transform-origin: left center; pointer-events: none; transition: opacity var(--dur-ink) var(--ease-press-out); }
.otp-ring.is-wrong .otp-strike { opacity: 1; animation: otp-strike var(--dur-ink) var(--ease-press-out) both; }
.otp-ring.is-wrong .otp-sorts { animation: otp-shake var(--dur-shake) var(--ease-press); }
.otp-ring.is-wrong .otp-sort { color: var(--color-status-danger); }
.otp-ring.is-clearing .otp-sort { color: transparent; }
@keyframes otp-strike { from { transform: scaleX(0); } }
@keyframes otp-shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Right: the embossed seal in signal-success, pressed in where the sorts went. */
.otp-seal { position: absolute; top: 50%; left: 50%; z-index: 2; width: 88px; height: 88px; margin: -44px 0 0 -44px; opacity: 0; pointer-events: none; transition: opacity var(--dur-bite) var(--ease-press-out); }
.otp-seal-edge { fill: var(--color-signal-success); }
.otp-seal-rim { fill: none; stroke: var(--color-surface-raised); stroke-width: 1.25; opacity: .5; }
.otp-seal-tick { fill: none; stroke: var(--color-surface-raised); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.otp-ring.is-sealed .otp-sorts { opacity: 0; }
.otp-ring.is-sealed .otp-seal { opacity: 1; }
/* Focus stays on the input for the words that follow, but its ring gives way to the seal. */
.otp-ring.is-done .otp-bed input:focus-visible { outline-color: transparent; }

/* A right code lifts the plate's amber planet clear of the horizon (V1), at each of the auth section's sizes. */
.auth-card:has(.otp-ring.is-sealed) .auth-plate { --lift: 224px; }
@media (min-width: 1024px) and (max-height: 820px) { .auth-card:has(.otp-ring.is-sealed) .auth-plate { --lift: 168px; } }
@media (max-width: 767px) { .auth-card:has(.otp-ring.is-sealed) .auth-plate { --lift: 48px; } }

/* The help line says what happens without script (the button) and with it (the sixth digit), and
   the verdict keeps its room, so words arriving never move the button below. */
.otp-help-live { display: none; }
.otp-ring.is-live .otp-help-live { display: inline; }
.otp-ring.is-live .otp-help-plain { display: none; }
.otp-verdict { width: 100%; min-height: var(--space-7); }

/* Enrolment: the QR code beside the key to type instead. */
.otp-key { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.otp-key svg { border-radius: var(--radius-field); }
.otp-key figcaption { color: var(--color-text-secondary); }
.otp-key .num-code { color: var(--color-text-primary); font-weight: 600; word-spacing: .2em; }
.otp-key .link { display: inline-block; margin-top: var(--space-1); color: var(--color-text-primary); }

/* Recovery codes (SP2-T21a): ten codes on a debossed bed, two columns of five read down each column,
   numbered in the secondary ink, in the body face's tabular figures. Download, Print and Copy stay
   hidden until auth.js shows them. Printed, the page is the codes and the account, nothing else. */
.recovery { display: grid; gap: var(--space-2); min-width: 0; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, max-content); grid-template-rows: repeat(5, auto); grid-auto-flow: column; justify-content: start; gap: var(--space-2) var(--space-5); padding: var(--space-3) var(--space-4); border-radius: var(--radius-field); background: var(--color-surface-sunken); box-shadow: var(--deboss); list-style: none; counter-reset: recovery-code; }
.recovery-codes li { display: flex; align-items: baseline; gap: var(--space-2); counter-increment: recovery-code; }
.recovery-codes li::before { content: counter(recovery-code) "."; min-width: 3ch; color: var(--color-text-secondary); text-align: right; }
.recovery-codes .num-code { font-weight: 600; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.recovery-actions[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .otp-ring.is-wrong .otp-sorts, .otp-ring.is-wrong .otp-strike { animation: none; }
}
html[data-motion="reduce"] .otp-ring.is-wrong .otp-sorts, html[data-motion="reduce"] .otp-ring.is-wrong .otp-strike { animation: none; }

@media (max-width: 767px) {
  .otp-key { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}
/* Up to 400px the card's column is under 320px: 40px sorts, so the six and the 3 + 3 gap fit in 272px. */
@media (max-width: 400px) {
  .otp-bed, .otp-top { width: 272px; }
  .otp-sort { width: 40px; }
}
/* On phones two columns of 16px codes don't fit the card's column (326px at 390): one column of ten. */
@media (max-width: 479px) {
  .recovery-codes { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; padding-inline: var(--space-3); }
}
@media (forced-colors: active) {
  .otp-sort { border: 1px solid CanvasText; }
  .otp-ring:focus-within .otp-sort.is-next { outline: 2px solid Highlight; outline-offset: 1px; }
  .otp-strike { background: CanvasText; }
  .otp-dial-left { stroke: Highlight; }
  .recovery-codes { border: 1px solid CanvasText; }
}
@media print {
  .auth-plate, .mast-help, .recovery-actions, .recovery-confirm, .auth-foot { display: none; }
  .auth-card, .recovery-codes { display: block; background: none; box-shadow: none; }
  .recovery-codes li { margin-top: var(--space-1); }
}

/* ---- Vault meter (live states): the engraving builds as the password gets harder to guess ----
   SP2-T13 (spec §15 "Vault meter"; design 07 §7, §10; DESIGN.md "Signature interactions"). The
   card itself (.vault, .engraving, .tier, .meter) is drawn in "Vault meter" above, as the SP1 hero
   signed it off; this section holds the live field, the drawing's layers and every state.
   Without script the field stands alone: Show and the card stay hidden, and the form's own post is
   checked. vault.js adds .is-live and moves everything: one GSAP timeline builds the drawing (the
   door swings shut, a paperclip draws in, a padlock drops, a deadbolt slides, the vault turns its
   wheel) and carries --vault-needle across the four segments, reading both reduce paths and seeking
   without travel when either asks. So nothing here transforms or animates; it colours and places.
   Lit segments are ink, the next lock a dashed ghost, and no green: the meter never says "saved".
   .is-rejected is the server's refusal: the card turns the danger tint until the next keystroke. */
.vault-field { display: grid; gap: var(--space-1); min-width: 0; }
.vault-show { display: none; }
.vault-field.is-live .vault-show { display: inline-flex; align-items: center; }
.vault-show[aria-pressed="true"] { background: var(--color-surface-base); box-shadow: var(--deboss); }
.vault-verdict:empty { display: none; }
.vault-verdict .verdict { margin-top: var(--space-1); }
.vault-field .vault { display: none; }
.vault-field.is-live .vault { display: grid; margin-top: var(--space-3); transition: background-color var(--dur-ink) var(--ease-press-out); }
.vault-read { min-width: 0; }
.vault-read .tier { transition: color var(--dur-ink) var(--ease-press-out); }

/* The drawing's layers: the doorway's shadow behind a door leaf of card stock, then each lock. */
.vault-art .v-gap { fill: var(--color-surface-sunken); stroke: none; }
.vault-art .v-leaf, .vault-art .v-plate { fill: var(--color-surface-raised); }
.vault-art .v-door { stroke-width: 1.25; }
.vault-art .v-clip { stroke-width: 1.5; stroke-dasharray: 120; }
.vault-art .v-padlock, .vault-art .v-bolt, .vault-art .v-wheel { stroke-width: 1.5; }
.vault-art .v-vault { stroke-width: 1.25; }
.vault-art .v-rivet { fill: currentColor; stroke: none; }

/* The meter: four segments, and the needle GSAP carries along them with the playhead. */
.vault-meter { position: relative; }
.vault-meter > i { transition: background-color var(--dur-ink) var(--ease-press-out), box-shadow var(--dur-ink) var(--ease-press-out); }
.vault-needle { position: absolute; top: -4px; bottom: -4px; left: calc(var(--vault-needle, 0) * 100%); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--color-text-primary); }
.vault-note:empty { display: none; }
.vault-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.vault-suggest { text-align: start; }  /* a button centres its words when they wrap */
.vault-actions .vault-copy { width: auto; min-height: 44px; margin-top: 0; padding: 0 var(--space-3); }  /* not the form's full-width button */
.vault-actions .vault-copy[hidden] { display: none; }  /* .btn's inline-flex would beat the attribute */
.vault-saved { margin-top: var(--space-1); }

/* The server said no: locked at the open door, the card in the danger tint, the words above it. */
.vault-field.is-rejected .vault { background: var(--color-status-danger-tint); }
.vault-field.is-rejected .vault .engraving, .vault-field.is-rejected .vault .tier { color: var(--color-status-danger); }
.vault-field.is-rejected .vault .tier-copy { color: var(--color-status-danger); }
.vault-field.is-rejected .vault-art .v-leaf, .vault-field.is-rejected .vault-art .keyhole { fill: var(--color-status-danger-tint); }
.vault-field .well:has(input[aria-invalid="true"]) { box-shadow: var(--deboss), inset 0 -2px 0 var(--color-signal-danger); }  /* a plain post's refusal too */

@media (forced-colors: active) {
  .vault-needle { background: CanvasText; }
  .vault-show[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .vault-field.is-rejected .vault { outline: 2px solid CanvasText; }
}

/* ---- Client shell: the ink dock and the bottom bar ----
   Dashboard overhaul, variation A (Cam, 2026-10-30; docs/design/dashboard-2026-10). Every rule for the
   client shell lives in this section, so a restyle stays inside it.
   From 1,100px an ink dock floats 24px in from the top, left and bottom, 248px wide, with a pill that
   rests on the current page and travels to the item the pointer or keyboard is on. From 768px to 1,099px
   it folds to 72px of icons and opens over the page after 80ms of hover intent (core.js adds .is-open) or
   at once when keyboard focus lands inside it. Rows are laid out at the open width and the dock clips them,
   so opening never re-flows a word. The dock moves by width and inset only, never a transform: the pill
   travels by `top` over --dur-sheet, which is 0ms under both reduce paths. Without script the current
   item wears the pill itself. Below 768px the dock gives way to a bottom bar in the same ink, whose More
   button opens the More sheet. Colours are the --dock-* roles, which are the palette's own. */
.dock {
  position: fixed;
  z-index: 20;
  inset: var(--space-4) auto var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: var(--dock-open-w);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-rail);
  background: var(--dock-bg);
  color: var(--dock-fg);
  box-shadow: var(--elev-lifted), inset 0 0 0 1px var(--dock-edge);
  overflow: hidden;
}
.dock-top, .dock-tabs, .dock-foot { flex: none; display: grid; gap: var(--space-1); width: 232px; margin: 0; padding: 0; list-style: none; }
.dock-tabs { position: relative; flex: 1 1 auto; align-content: start; gap: 0; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--dock-rule) transparent; }
.dock-foot { padding-top: var(--space-2); box-shadow: 0 -1px 0 var(--dock-rule); }
.dock-theme { min-width: 0; }

/* A row: a 56px icon column, then the label. Folded, a row is as wide as its icon column. */
.dock-row { position: relative; display: flex; align-items: center; width: 100%; min-height: var(--row-h); border-radius: var(--radius-round); }
.dock-icon { display: grid; place-items: center; flex: none; width: 56px; height: var(--row-h); }
.dock-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-lines { display: grid; line-height: 1.25; }
.dock-lines > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-lines b { font-weight: 600; }
.dock-lines span { color: var(--dock-fg2); font-size: var(--step--1); }
.dock-brand { color: inherit; text-decoration: none; }
.dock-brand .dock-lines b { font: 600 var(--step-0)/1.2 var(--font-display); }
.dock .mark { color: var(--dock-fg); }
.dock .mark-planet { fill: var(--dock-planet); }
.dock-who { min-height: 60px; box-shadow: inset 0 0 0 1px var(--dock-rule); }
.dock .avatar { background: var(--dock-pill); color: var(--dock-pill-fg); }
.avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-round); background: var(--color-action-primary); color: var(--color-on-action); font: 700 var(--step-0)/1 var(--font-body); }

/* Links and buttons. The pill is one list item that travels; without script the current item wears it. */
.dock-item { z-index: 1; padding: 0; border: 0; background: transparent; color: var(--dock-fg2); font: 600 var(--step-0)/1 var(--font-body); text-align: left; text-decoration: none; cursor: pointer; transition: color var(--dur-ink) var(--ease-press-out); }
.dock-item:hover { color: var(--dock-fg); }
.dock-item[aria-current="page"] { background: var(--dock-pill); color: var(--dock-pill-fg); }
.dock-item:focus-visible { outline: 2px solid var(--dock-focus); outline-offset: -2px; }
/* On the pill the ring is ink: cyan on the pale pill reads at Lc 13.5. */
.dock-item[aria-current="page"]:focus-visible, .dock-tabs[data-marker] .dock-item.is-target:focus-visible, .bar-item[aria-current="page"]:focus-visible { outline-color: var(--dock-pill-fg); }
.dock-marker { display: none; }
.dock-tabs[data-marker] .dock-marker { display: block; position: absolute; z-index: 0; top: calc(var(--i, 0) * var(--row-h)); left: 0; width: 100%; height: var(--row-h); border-radius: var(--radius-round); background: var(--dock-pill); pointer-events: none; transition: top var(--dur-sheet) var(--ease-press); }
.dock-tabs[data-marker] .dock-item[aria-current="page"] { background: transparent; color: var(--dock-fg2); }
.dock-tabs[data-marker] .dock-item.is-target { color: var(--dock-pill-fg); }
.dock-item .badge { position: static; margin: 0 var(--space-3) 0 var(--space-2); }

/* Theme: open, a track with the choice printed on it; folded, the current theme's icon. */
.theme-set { position: relative; min-width: 0; min-height: var(--row-h); margin: 0; padding: 0; border: 0; }
.theme-icon { display: none; }
:root[data-theme="light"] .theme-icon--light, :root[data-theme="dark"] .theme-icon--dark, :root[data-theme="system"] .theme-icon--system { display: block; }
.theme-now { color: var(--dock-fg2); opacity: 0; }
.theme-track { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-round); background: var(--color-surface-sunken); box-shadow: var(--deboss); }
.theme-choice { display: grid; place-items: center; flex: 1 1 auto; min-height: 44px; padding: 0 var(--space-2); border-radius: var(--radius-round); color: var(--color-text-secondary); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-ink) var(--ease-press-out), color var(--dur-ink) var(--ease-press-out); }
.theme-choice:hover { color: var(--color-text-primary); }
.theme-choice:has(input:checked) { background: var(--color-action-primary); color: var(--color-on-action); }
.theme-choice:has(input:focus-visible) { outline: 2px solid var(--color-info); outline-offset: 2px; }
.dock .theme-track { position: absolute; inset: 0; background: var(--dock-well); box-shadow: none; }
.dock .theme-choice { color: var(--dock-fg2); }
.dock .theme-choice:hover { color: var(--dock-fg); }
.dock .theme-choice:has(input:checked) { background: var(--dock-pill); color: var(--dock-pill-fg); }
.dock .theme-choice:has(input:focus-visible) { outline-color: var(--dock-focus); }

/* Folded (768 to 1,099px): icons only, opened by hover intent or keyboard focus. The labels fade but stay
   in the accessibility tree. */
@media (min-width: 768px) and (max-width: 1099px) {
  .dock { width: 72px; transition: width var(--dur-sheet) var(--ease-press) var(--dur-bite), box-shadow var(--dur-sheet) var(--ease-press) var(--dur-bite); }
  .dock .dock-row { width: 56px; }
  .dock .dock-label { opacity: 0; transition: opacity var(--dur-bite) var(--ease-press-in); }
  .dock .dock-item .badge { position: absolute; top: 6px; left: 32px; margin: 0; }
  .dock .dock-tabs[data-marker] .dock-marker { width: 56px; }
  .dock .theme-now { opacity: 1; }
  .dock .theme-track { opacity: 0; pointer-events: none; transition: opacity var(--dur-bite) var(--ease-press-in); }
  .dock:is(.is-open, :has(:focus-visible)) { width: var(--dock-open-w); transition: width var(--dur-sheet) var(--ease-press), box-shadow var(--dur-sheet) var(--ease-press); }
  .dock:is(.is-open, :has(:focus-visible)) .dock-row { width: 100%; }
  .dock:is(.is-open, :has(:focus-visible)) .dock-label { opacity: 1; transition: opacity var(--dur-ink) var(--ease-press-out) var(--dur-bite); }
  .dock:is(.is-open, :has(:focus-visible)) .dock-item .badge { position: static; margin: 0 var(--space-3) 0 var(--space-2); }
  .dock:is(.is-open, :has(:focus-visible)) .dock-tabs[data-marker] .dock-marker { width: 100%; }
  .dock:is(.is-open, :has(:focus-visible)) .theme-now { opacity: 0; }
  .dock:is(.is-open, :has(:focus-visible)) .theme-track { opacity: 1; pointer-events: auto; transition: opacity var(--dur-ink) var(--ease-press-out) var(--dur-bite); }
}

/* The page sits clear of the dock: 24px inset, the dock, 24px, then a step of room. */
.shell-main { min-width: 0; padding: var(--space-6) var(--space-6) var(--space-7); padding-left: calc(var(--dock-w) + var(--space-4) * 2 + var(--space-5)); }

/* A badge stamps on (1.15 → 1) only when its count changes after load; core.js adds .is-stamped. */
.badge.is-stamped { animation: badge-stamp var(--dur-ink) var(--ease-press-out); }
@keyframes badge-stamp { from { transform: scale(1.15); } to { transform: none; } }

/* The bottom bar: 56px targets in a 64px strip, fewer items rather than disabled ones. Same ink as the dock. */
.bar { display: none; }
.bar-items { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.bar-item { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; width: 100%; min-height: 56px; padding: var(--space-1) 2px; border: 0; border-radius: calc(var(--radius-rail) - var(--space-1)); background: transparent; color: var(--dock-fg2); font: 600 var(--step--1)/1.1 var(--font-body); text-align: center; text-decoration: none; cursor: pointer; transition: background-color var(--dur-ink) var(--ease-press-out), color var(--dur-ink) var(--ease-press-out); }
.bar-item[aria-current="page"] { background: var(--dock-pill); color: var(--dock-pill-fg); }
.bar-item:focus-visible { outline: 2px solid var(--dock-focus); outline-offset: -2px; }
.bar-label { max-width: 100%; overflow-wrap: anywhere; }
.bar-item .badge { position: absolute; top: var(--space-1); left: calc(50% + var(--space-1)); }
.bar-dot { position: absolute; top: var(--space-2); left: calc(50% + var(--space-2)); width: 8px; height: 8px; border-radius: var(--radius-round); background: var(--color-badge-bg); box-shadow: 0 0 0 1.5px var(--dock-bg); }

/* The More sheet: a modal dialog that rises from the bar. */
.more-sheet { width: calc(100% - var(--space-3)); max-width: 560px; max-height: calc(100dvh - var(--space-5)); margin: auto auto calc(var(--space-2) + env(safe-area-inset-bottom)); padding: var(--space-4) var(--space-3); border: 0; border-radius: var(--radius-rail); background: var(--color-surface-raised); color: var(--color-text-primary); box-shadow: var(--elev-lifted); overflow-y: auto; overscroll-behavior: contain; }
.more-sheet::backdrop { background: rgb(var(--shadow-ink) / .32); }
.more-sheet[open] { animation: sheet-rise var(--dur-sheet) var(--ease-press-out); }
@keyframes sheet-rise { from { opacity: 0; transform: translateY(var(--space-4)); } to { opacity: 1; transform: none; } }
.more-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.more-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.more-who .dock-lines span { color: var(--color-text-secondary); }
.more-links { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.more-links + .more-theme, .more-theme + .more-links { margin-top: var(--space-4); }
.more-theme { min-width: 0; }
.more-legend { margin-bottom: var(--space-2); padding: 0; color: var(--color-text-secondary); font-weight: 600; }
.more-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: var(--radius-round); background: transparent; color: var(--color-text-primary); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; transition: background-color var(--dur-ink) var(--ease-press-out); }
.more-item .icon { color: var(--color-text-secondary); }
.more-item:hover { background: var(--color-surface-base); }
.more-item[aria-current="page"] { background: var(--color-surface-sunken); box-shadow: var(--deboss); }
.more-item[aria-current="page"] .icon { color: var(--color-info); }
.more-item .badge { margin-left: auto; }

/* Toasts: an ink slip in the corner, above the bar on phones; the live region exists from load. */
.toasts { position: fixed; z-index: 30; right: var(--space-4); bottom: var(--space-4); display: grid; gap: var(--space-2); width: min(420px, calc(100vw - var(--space-5))); pointer-events: none; }
.toast { padding: 12px var(--space-3); border-radius: var(--radius-sheet); background: var(--color-action-primary); color: var(--color-on-action); box-shadow: var(--elev-lifted); pointer-events: auto; }

/* A theme switch cross-fades over --dur-ink through a same-document view transition (07 §6). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-ink); }

@media (max-width: 767px) {
  .dock { display: none; }
  .bar { display: block; position: fixed; z-index: 20; inset: auto var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom)); padding: var(--space-1); border-radius: var(--radius-rail); background: var(--dock-bg); box-shadow: var(--elev-lifted); }
  /* Focus never lands under the bar (WCAG 2.2 SC 2.4.11): the bar is up to 84px tall when a
     label takes two lines, plus its inset, and 112px clears it. */
  html:has(.bar) { scroll-padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .shell-main { padding: var(--space-4) var(--space-3); padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .toasts { right: var(--space-3); bottom: calc(112px + env(safe-area-inset-bottom)); }
}

/* Both reduce paths: the stamp and the sheet's rise stop; colour steps still take --dur-ink. */
@media (prefers-reduced-motion: reduce) {
  .badge.is-stamped { animation: none; }
  .more-sheet[open] { animation: none; }
}
html[data-motion="reduce"] .badge.is-stamped { animation: none; }
html[data-motion="reduce"] .more-sheet[open] { animation: none; }

@media (forced-colors: active) {
  .dock, .bar, .more-sheet, .toast { outline: 1px solid CanvasText; }
  .dock-marker { display: none; }
  .dock-item[aria-current="page"] .dock-label, .bar-item[aria-current="page"] .bar-label, .more-item[aria-current="page"] span, .theme-choice:has(input:checked) span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
}
@media print {
  .dock, .bar, .toasts { display: none; }
  .shell-main { padding: 0; }
}

/* ---- Client Overview (SP2-T26, restyled to V1): the greeting, the lead sheet, Needs you, Recently, the side column ----
   The first page after sign-in (DESIGN.md "Client portal sign-off"; prototype design/client/v1/overview-sp2.html).
   The italic greeting by the London hour over an Oxford rule that carries the amber planet, arrived: the
   planet that climbed the sign-in plate. The lead is on paper: the thing to do on a raised sheet, and the
   other way through as a paper flap pressed into it (for an invoice, the bank details). A slim horizon closes
   the page with the colophon on its ink band. No transforms and no animation, so nothing here needs the
   reduce paths. The planets' amber and the band's ink are the galaxy's own, scoped as tokens on
   .ov-rule and .ov-horizon, as the plate's are. */
.ov-wrap { max-width: 1100px; }
.ov-hello { display: grid; gap: var(--space-2); }
.ov-greeting { font: italic 400 var(--step-5)/1.06 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; text-shadow: var(--bite); }
.ov-greeting span { display: block; margin-top: var(--space-1); font: normal 600 var(--step-3)/1.15 var(--font-display); letter-spacing: -0.01em; }
.ov-last { margin-top: var(--space-1); color: var(--color-text-secondary); }

/* The Oxford rule under the greeting carries the amber planet, sitting on the rule's top line. */
.ov-rule { --planet-amber: #FFB55E; position: relative; margin: var(--space-4) 0 var(--space-5); }
.ov-rule > .rule-oxford { margin: 0; }
.ov-arrive { position: absolute; right: 14%; bottom: calc(100% - 1px); width: 40px; height: 31px; overflow: visible; }
.arrive-halo { fill: none; stroke: var(--color-accent); stroke-width: 1; opacity: .5; }
.arrive-disc { fill: var(--planet-amber); stroke: var(--planet-keyline); stroke-width: 1.5; }
.arrive-hatch { fill: none; stroke: var(--planet-keyline); stroke-width: .75; stroke-linecap: round; }

.bank-note { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3); border-radius: var(--radius-sheet); background: var(--color-status-danger-tint); color: var(--color-status-danger); }
.bank-note-mark { stroke-width: 2; }
.bank-note p { max-width: 72ch; color: inherit; }
.bank-note-title { font-weight: 600; }

/* Needs you: the lead, then the other rows as a ruled list. */
.needs-you { display: grid; gap: var(--space-3); margin-bottom: var(--space-6); }
.lead { --inset: 8px; display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--radius-sheet); background: var(--color-surface-raised); box-shadow: var(--elev-sheet); overflow: clip; }
.lead--sheet:has(> .flap) { grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); }
.lead-face { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); min-width: 0; padding: var(--space-5); }
.lead-kicker { font-weight: 600; color: var(--color-text-secondary); }
.lead-title { max-width: 22ch; font: 600 var(--step-4)/1.08 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; text-shadow: var(--bite); }
.lead-kicker + .lead-title { margin-top: calc(-1 * var(--space-2)); }
.lead-desc { max-width: 56ch; text-wrap: pretty; }
/* An invoice's figure sits on a 2px ink rule over a double rule, as on the slip. */
.lead-sum { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); width: min(100%, 460px); margin-top: var(--space-1); padding: var(--space-3) 0 12px; border-top: 2px solid var(--color-text-primary); border-bottom: 3px double var(--color-text-primary); }
.lead-figure { display: grid; gap: 2px; }
.figure-label { font-weight: 600; color: var(--color-text-secondary); }
.lead-figure .amount { font-size: var(--step-4); line-height: 1.05; letter-spacing: -0.01em; }
.stamp { display: inline-flex; align-items: center; gap: var(--space-1); margin-bottom: 6px; padding: 2px var(--space-2) 2px 6px; border-radius: var(--radius-type); font-weight: 600; }
.stamp--due { background: var(--color-status-warning-tint); color: var(--color-status-warning); }
.stamp--late { background: var(--color-status-danger-tint); color: var(--color-status-danger); }
.lead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); max-width: none; margin-top: var(--space-2); }
.btn-go { justify-content: space-between; min-width: 232px; gap: var(--space-5); padding: 0 var(--space-3) 0 var(--space-4); }

/* The flap: a debossed impression in the sheet, in paper, not ink, with a page of the document lying in
   its corner, engraved. */
.flap { position: relative; display: grid; align-content: start; min-width: 0; margin: var(--inset); padding: var(--space-5) var(--space-4) var(--space-5) var(--space-5); border-radius: var(--radius-field); background: var(--color-surface-sunken); box-shadow: inset 0 1px 3px rgb(var(--shadow-ink) / .14), inset 0 -1px 0 rgb(var(--paper-rgb) / .75); overflow: clip; }
.flap-copy { position: relative; z-index: 1; display: grid; justify-items: start; align-content: start; gap: var(--space-3); }
.flap-copy h3 { font: 600 var(--step-2)/1.15 var(--font-display); text-wrap: balance; text-shadow: var(--bite); }
.flap-copy p { max-width: 28ch; color: var(--color-text-secondary); text-wrap: pretty; }
.flap-copy .flap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); max-width: none; margin-top: var(--space-1); color: var(--color-text-primary); }
.flap-doc { position: absolute; right: 18px; bottom: -84px; width: 128px; height: auto; pointer-events: none; }
.doc-page { fill: var(--color-surface-raised); stroke: var(--color-text-primary); stroke-width: 1.5; }
.doc-fold { fill: none; stroke: var(--color-text-primary); stroke-width: 1.5; stroke-linejoin: round; }
.doc-head { fill: none; stroke: var(--color-text-primary); stroke-width: 3; stroke-linecap: round; }
.doc-line { fill: none; stroke: var(--color-rule-strong); stroke-width: .9; stroke-linecap: round; }
.doc-dots { fill: none; stroke: var(--color-rule-strong); stroke-width: 1.5; stroke-dasharray: 1.5 3; }
.doc-total { fill: none; stroke: var(--color-text-primary); stroke-width: 7; }

.needs { display: grid; margin: 0; padding: 0; list-style: none; }
.needs li { padding: var(--space-3) 0; }
.needs li + li { box-shadow: inset 0 1px 0 var(--color-rule); }
.needs-more summary { cursor: pointer; padding: var(--space-2) 0; font-weight: 600; }
.all-clear { max-width: 52ch; color: var(--color-text-secondary); font-size: var(--step-1); line-height: 1.45; }

/* Below the lead: a 1.2 : 1 split. The side column is a tone shift. */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.events { display: grid; margin-top: var(--space-3); }
.events > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--space-3); padding: 10px 0; }
.events > div + div { box-shadow: inset 0 1px 0 var(--color-rule); }
.events dt { color: var(--color-text-secondary); font-variant-numeric: tabular-nums lining-nums; }
.events dd { margin: 0; }
.ov-recent { min-width: 0; }
.ov-side { padding: var(--space-4) var(--space-4) var(--space-5); border-radius: var(--radius-sheet); background: var(--color-surface-sunken); }
.bill-sum { margin: var(--space-2) 0 var(--space-4); }
.side-leaders { margin-bottom: var(--space-3); }
.side-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0; }
.fraud { max-width: 48ch; color: var(--color-text-secondary); }

/* The slim horizon along the foot: paper sky with the orbits rising out of an ink band, the amber planet at
   the crest, and the colophon on the band. It runs the full width, so the rail lies over it like a sheet on
   the galaxy; the words keep clear of the rail. */
.ov-horizon {
  --night-base: var(--ink-band);        /* in dark themes the band steps down to the sunken ink */
  --night-text: #EAF0FA;
  --night-text-2: #C9D3E9;
  --night-rule: #56617D;
  --night-rule-strong: #7A86A3;
  --night-accent: #FFB55E;
  --night-info: #6FE3FF;
  margin-top: var(--space-7);
}
.ov-sky { display: block; width: 100%; max-width: none; height: 104px; }
.ov-sky .sky-band { fill: var(--night-base); }
.ov-sky .sky-orbit { fill: none; stroke: var(--color-rule-strong); stroke-width: 1.25; }
.ov-sky .sky-orbit--inner { stroke: var(--color-rule); stroke-width: 1; }
.ov-sky .sky-engrave { fill: none; stroke: var(--night-rule); stroke-width: .75; }
.ov-sky .sky-engrave--2 { opacity: .6; }
.ov-sky .sky-star { fill: var(--night-text); opacity: .6; }
.ov-sky .sky-star--dim { opacity: .32; }
.ov-sky .sky-halo { fill: none; stroke: var(--color-accent); stroke-width: 1; opacity: .5; }
.ov-sky .sky-amber { fill: var(--night-accent); stroke: var(--planet-keyline); stroke-width: 1.5; }
.ov-sky .sky-hatch { fill: none; stroke: var(--planet-keyline); stroke-width: .75; stroke-linecap: round; }
.ov-sky .sky-cyan { fill: var(--night-info); stroke: var(--planet-keyline); stroke-width: 1.25; }
.ov-ground {
  --color-text-primary: var(--night-text);
  --color-text-secondary: var(--night-text-2);
  --color-info: var(--night-info);
  --color-surface-base: var(--night-base);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin-top: -1px;
  padding: var(--space-2) var(--space-6) var(--space-5) calc(var(--dock-w) + var(--space-4) * 2 + var(--space-5));
  background: var(--night-base);
  color: var(--color-text-secondary);
}
.ov-ground p { max-width: none; }
.ov-ground b { color: var(--color-text-primary); font-weight: 600; }
.ov-ground ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; }
.ov-ground a { color: var(--color-text-primary); }
/* The Overview's main ends at the horizon, so it keeps only a step of room below. */
.shell-main:has(.ov-wrap) { padding-bottom: 0; }
@media (max-width: 1279px) {
  .ov-greeting { font-size: var(--step-4); }
  .ov-greeting span { font-size: var(--step-2); }
}
/* Below 1,180px the lead stacks: the thing to do on the sheet, the flap as a band under it. */
@media (max-width: 1179px) {
  .lead--sheet:has(> .flap) { grid-template-columns: minmax(0, 1fr); }
  .flap { margin-top: 0; padding: var(--space-4); }
  .flap-copy { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-1) var(--space-4); }
  .flap-copy > :is(h3, p) { grid-column: 1; }
  .flap-copy > .flap-actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .flap-copy p { max-width: 46ch; }
  .flap-doc { display: none; }
}
@media (max-width: 1099px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .ov-greeting { font-size: var(--step-3); }
  .ov-greeting span { font-size: var(--step-1); line-height: 1.3; }
  .ov-rule { margin: var(--space-3) 0 var(--space-4); }
  .ov-arrive { right: 8px; }
  .lead-face { padding: var(--space-4) var(--space-3); }
  .lead-title { font-size: var(--step-3); }
  .lead-sum { width: 100%; }
  .btn-go { width: 100%; min-width: 0; }
  .flap { padding: var(--space-3); }
  .flap-copy { grid-template-columns: minmax(0, 1fr); }
  .flap-copy > .flap-actions { grid-column: 1; grid-row: auto; margin-top: var(--space-1); }
  .flap-copy h3 { font-size: var(--step-1); }
  .ov-side { padding: var(--space-4) var(--space-3); }
  .events > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ov-ground { flex-direction: column; gap: var(--space-3); padding: var(--space-2) var(--space-3) calc(112px + env(safe-area-inset-bottom)); }
}
@media (forced-colors: active) {
  .lead, .ov-side { border: 1px solid CanvasText; }
  .flap { border: 1px solid CanvasText; background: Canvas; }
  .ov-sky { forced-color-adjust: none; }
  .ov-sky .sky-band { fill: Canvas; }
  .ov-sky .sky-star, .ov-sky .sky-engrave { display: none; }
  .ov-ground { background: Canvas; color: CanvasText; outline: 1px solid CanvasText; }
  .bank-note { border: 1px solid CanvasText; }
}
@media print {
  .ov-horizon, .ov-arrive, .flap-doc { display: none; }
}

/* ---- Client Billing (SP2-T27): the invoice list, one invoice and the bank details ---- */
.bill-lede { max-width: 60ch; margin-bottom: var(--space-4); }
/* A client page's sections (invoice, people, account): a section step between them, a smaller one under each heading (IG-T20). */
.ov-wrap > section + section { margin-top: var(--space-6); }
.ov-wrap > section > .sec-title { margin-bottom: var(--space-3); }
.bank-slot { margin: var(--space-3) 0; }
.bank-title { font: 600 var(--step-1)/1.2 var(--font-display); margin-bottom: var(--space-3); }
.bank { max-width: 480px; }
.bank .ref { display: flex; align-items: center; gap: var(--space-3); }
.btn-copy { min-height: 44px; padding: 0 var(--space-3); }
@media (max-width: 899px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .ov-greeting { font-size: var(--step-4); }
  .ov-greeting span { font-size: var(--step-2); }
  .events > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lead { padding: var(--space-4); }
}

/* Phones (IG-T20): the list keeps its table, but Issued and Total (both on each invoice's page) step
   out, so the invoice, when it's due, what's left and its status fit the screen without sideways
   scrolling; an invoice number never breaks across lines. */
.ledger--client :is(th, td):first-child { white-space: nowrap; }
@media (max-width: 599px) {
  .ledger--client .col-wide { display: none; }
}

/* ---- Your services (v0.22): each service, and its milestones as a ruled tracker ----
   A mark and words for every state (✓ paid, ● invoiced, ✕ overdue, ○ upcoming), never colour alone; the
   meter's segments are the milestones, inked when paid. */
.service + .service, .lede + .service { margin-top: var(--space-6); }
.service-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.service-kind, .service-desc { color: var(--color-text-secondary); }
.service-desc { max-width: 60ch; margin-top: var(--space-1); }
.service-sum { margin-top: var(--space-3); }
.service-meter { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); max-width: 460px; }
.service-line { margin-bottom: var(--space-2); }
.ov-services { margin-bottom: var(--space-6); }
/* v0.23: "Your website" on the Overview (sites app). */
.ov-site { margin-bottom: var(--space-6); }
.site + .site { margin-top: var(--space-5); }
.site-status { color: var(--color-text-secondary); }
.site-notes { list-style: none; margin-top: var(--space-4); padding: 0; display: grid; gap: var(--space-2); max-width: 70ch; }
.site-note-date { display: block; color: var(--color-text-secondary); }
.site-note { overflow-wrap: anywhere; }
.site-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.site-password-form { display: inline; }
.site-password { font-size: 1.5rem; }
.ov-services .service + .service { margin-top: var(--space-4); }
.track { display: grid; margin: var(--space-2) 0 0; padding: 0; list-style: none; max-width: 640px; }
.track-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "mark name amount" ". state state"; column-gap: var(--space-2); padding: 10px 0; }
.track-step + .track-step { box-shadow: inset 0 1px 0 var(--color-rule); }
.track-mark { grid-area: mark; color: var(--color-text-secondary); font-weight: 600; }
.track-name { grid-area: name; font-weight: 600; }
.track-amount { grid-area: amount; text-align: right; }
.track-state { grid-area: state; color: var(--color-text-secondary); }
.track-step--paid .track-mark, .track-step--credited .track-mark { color: var(--color-status-success); }
.track-step--overdue .track-mark, .track-step--overdue .track-state { color: var(--color-status-danger); }
.track-step--invoiced .track-mark { color: var(--color-info); }
.track-step--upcoming .track-name { font-weight: 400; }
@media (min-width: 600px) {
  .track-step { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 14rem) auto; grid-template-areas: "mark name state amount"; }
}

/* ---- Client Company & people (SP2-T29c): the facts, the people list and the admin's controls ---- */
.people-facts { max-width: 560px; margin-top: var(--space-5); }
.people-address { text-align: right; }
.people-sec { margin-top: var(--space-7); }
.people-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0 var(--space-4); padding: 0; list-style: none; }
.people-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-field); background: var(--color-surface-sunken); }
.people-who { min-width: 0; }
.people-who p { margin: 0; overflow-wrap: anywhere; }
.people-name { font-weight: 600; }
.people-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.btn-small { min-height: 44px; padding: 0 var(--space-3); }
.people-remove { color: var(--color-status-danger); }
.people-leave { margin-top: var(--space-6); }

/* ---- Account & security and the idle dialog (SP2-T30) ---- */
.acct-sec { margin-top: var(--space-7); }
.acct-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0; padding: 0; list-style: none; }
.acct-row { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-radius: var(--radius-field); background: var(--color-surface-sunken); }
.acct-row p { margin: 0; overflow-wrap: anywhere; }
.acct-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.acct-facts { max-width: 640px; margin-top: var(--space-3); }
.acct-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); max-width: 420px; margin: var(--space-4) 0; padding: 0; list-style: none; }
.acct-qr { width: 220px; max-width: 100%; margin: var(--space-4) 0; }
.acct-qr svg { display: block; width: 100%; height: auto; }
.idle-dialog { max-width: min(92vw, 420px); margin: auto; padding: 0; border: 0; border-radius: var(--radius-sheet); background: var(--color-surface-raised, var(--color-surface)); color: var(--color-text-primary); box-shadow: 0 24px 60px -24px rgb(var(--shadow-ink) / .6); }
.idle-dialog::backdrop { background: rgb(var(--shadow-ink) / .45); }
.idle-card { display: grid; gap: var(--space-3); padding: var(--space-5); }
.idle-card p { margin: 0; }
.idle-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---- Pending requests (IG-T18): shown only after the pending delay, so a fast request never flickers. No spinner. ---- */
.htmx-request.btn, .htmx-request .btn { transition: color var(--dur-ink) var(--ease-press-out) var(--delay-pending), box-shadow var(--dur-ink) var(--ease-press-out) var(--delay-pending); color: var(--color-text-secondary); box-shadow: var(--deboss); cursor: progress; }
[aria-busy="true"] { cursor: progress; }

/* ---- Client dashboard (variation A): page head, colour-blocked cards, panels, notices, meters ----
   Cam picked A on 2026-10-30. Layout idea from his reference (LinkedInCam overview A): a big title with
   pill actions that carry counts, colour-blocked cards (one wide, two narrow), a soft notices panel and a
   panel of segmented meters. Every colour, font, space and radius is the portal's own token: the --block-*
   roles are existing palette colours used as flat fills (no gradients, no new hue). Milestone state is
   always a mark and words, never colour alone. */
.dhead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-5); }
.dhead__text { display: grid; gap: var(--space-1); min-width: 0; }
.dtitle { font: 700 var(--step-5)/1.02 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.dtitle em { font-style: italic; font-weight: 400; }
.dsub { max-width: 52ch; color: var(--color-text-secondary); font-size: var(--step-1); line-height: 1.4; }
.dlast { color: var(--color-text-secondary); }
.dback { display: inline-block; margin-bottom: var(--space-2); }
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-2); }
.pill { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-round); background: transparent; color: var(--color-text-primary); box-shadow: inset 0 0 0 1.5px var(--color-rule-strong); font: 600 var(--step-0)/1 var(--font-body); text-decoration: none; cursor: pointer; transition: background-color var(--dur-ink) var(--ease-press-out), box-shadow var(--dur-bite) var(--ease-press-out); }
.pill:has(.pill__count) { padding-right: var(--space-2); }
.pill:hover { background: var(--color-surface-sunken); }
.pill:active { box-shadow: inset 0 0 0 1.5px var(--color-rule-strong), var(--deboss); }
.pill--ink { background: var(--color-action-primary); color: var(--color-on-action); box-shadow: none; }
.pill--ink:hover { background: var(--color-action-primary-hover); }
.pill__count { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-round); background: var(--color-action-primary); color: var(--color-on-action); font: 700 var(--step--1)/1 var(--font-body); font-variant-numeric: tabular-nums lining-nums; }
.pill--ink .pill__count { background: var(--color-badge-bg); color: var(--color-badge-text); }

/* Colour-blocked cards: one wide, two narrow. */
.blocks { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-3); }
.blocks--pair { grid-template-columns: 2fr 1fr; }
.block { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); min-width: 0; min-height: 248px; padding: var(--space-4); border-radius: var(--radius-rail); }
.block--ink { background: var(--block-ink-bg); color: var(--block-ink-fg); }
.block--info { background: var(--block-info-bg); color: var(--block-info-fg); }
.block--accent { background: var(--block-accent-bg); color: var(--block-accent-fg); }
.block__label { font: 600 var(--step-1)/1.2 var(--font-display); }
.block__figure { font: 700 var(--step-6)/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.block__text { max-width: 34ch; font-size: var(--step-0); line-height: 1.45; }
.block--ink .block__text { color: var(--block-ink-fg2); }
.block--info .block__text { color: var(--block-info-fg2); }
.block--accent .block__text { color: var(--block-accent-fg2); }
.block__text b { color: inherit; font-weight: 700; }
.block__body > * + * { margin-top: var(--space-3); }
.nb { white-space: nowrap; }
.block__big { max-width: 24ch; font: 600 var(--step-3)/1.1 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.block__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.block__link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3) 0 var(--space-4); border-radius: var(--radius-round); background: var(--block-link-bg); color: var(--block-link-fg); font-weight: 700; text-decoration: none; transition: background-color var(--dur-ink) var(--ease-press-out); }
.block__link:hover { background: var(--block-link-hover); }
.block__quiet { color: var(--block-ink-fg); font-weight: 600; text-decoration-color: var(--dock-focus); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.block a:focus-visible { outline: 2px solid var(--dock-focus); outline-offset: 2px; }
.block__stamp { display: inline-flex; align-items: center; gap: var(--space-1); padding: 4px 12px 4px 8px; border-radius: var(--radius-round); background: var(--color-status-danger-tint); color: var(--color-status-danger); font-weight: 600; }
.block__stamp--due { background: var(--color-status-warning-tint); color: var(--color-status-warning); }

/* Panels: paper sheets. The soft one is a tone shift with no shadow. */
.panel { margin-bottom: var(--space-3); padding: var(--space-4); border-radius: var(--radius-rail); background: var(--color-surface-raised); box-shadow: var(--elev-sheet); }
.panel--soft { background: var(--color-surface-sunken); box-shadow: none; }
.panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); margin-bottom: var(--space-3); }
.panel__title { font: 600 var(--step-2)/1.15 var(--font-display); text-wrap: balance; }
.panel__note { color: var(--color-text-secondary); }
.ov-wrap > section.panel + section.panel { margin-top: 0; }
.ov-wrap > section.panel > .panel__title { margin-bottom: var(--space-3); }
.panel > p + p, .panel > p + .panel__actions { margin-top: var(--space-3); }
.panel__actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }

.notices { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.notice { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.notice .icon { margin-top: 2px; }
.notice b { font-weight: 700; }
.notice p { max-width: 72ch; }
.notice--late .icon { color: var(--color-status-danger); }

/* Meters: one segment per milestone, each with a mark and words. */
.meters { display: grid; gap: var(--space-5); }
.meter-row { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: var(--space-2) var(--space-5); align-items: start; }
.meter-name { display: grid; gap: 2px; }
.meter-name b { font: 600 var(--step-1)/1.2 var(--font-display); }
.meter-name span { color: var(--color-text-secondary); }
.meter-name .num { color: var(--color-text-primary); font-weight: 600; }
.segs { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.seg { display: grid; flex: 1 1 0; align-content: start; gap: var(--space-2); min-width: 0; }
.seg__bar { height: 16px; border-radius: var(--radius-type); box-shadow: inset 0 0 0 1.5px var(--color-rule-strong); }
.seg--paid .seg__bar { background: var(--color-text-primary); box-shadow: none; }
.seg--invoiced .seg__bar { box-shadow: inset 0 0 0 2px var(--color-text-primary); background: var(--color-surface-sunken); }
.seg--overdue .seg__bar { box-shadow: inset 0 0 0 2px var(--color-status-danger); background: var(--color-status-danger-tint); }
.seg__text { display: grid; gap: 1px; font-size: var(--step--1); line-height: 1.35; color: var(--color-text-secondary); }
.seg__text b { color: var(--color-text-primary); font-weight: 700; font-size: var(--step-0); }
.seg--overdue .seg__text b { color: var(--color-status-danger); }
.meter-flat { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-height: 48px; }
.meter-flat .tag { display: inline-flex; align-items: center; gap: var(--space-1); padding: 4px 12px; border-radius: var(--radius-round); background: var(--color-surface-sunken); font-weight: 600; }

.events { display: grid; margin-top: 0; }
.events > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--space-3); padding: 10px 0; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; margin-bottom: var(--space-3); }
.duo > .panel { margin-bottom: 0; }

/* The website block uses the same paper panel. */
.ov-site, .ov-services { padding: var(--space-4); margin-bottom: var(--space-3); border-radius: var(--radius-rail); background: var(--color-surface-raised); box-shadow: var(--elev-sheet); }
.ov-site .sec-title { margin-bottom: var(--space-3); }

@media (max-width: 1099px) {
  .blocks, .blocks--pair { grid-template-columns: 1fr 1fr; }
  .blocks > .block:first-child { grid-column: 1 / -1; }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .duo > .panel { margin-bottom: var(--space-3); }
  .meter-row { grid-template-columns: minmax(0, 1fr); }
  .shell-main { padding-right: var(--space-4); }
}
@media (max-width: 767px) {
  .dtitle { font-size: var(--step-4); }
  .blocks, .blocks--pair { grid-template-columns: 1fr; }
  .block { min-height: 0; }
  .block__figure { font-size: var(--step-5); }
  .segs { flex-direction: column; }
  .events > div { grid-template-columns: 1fr; gap: 2px; }
  .panel, .ov-site, .ov-services { padding: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  .pill, .block__link { transition: none; }
}


/* Dashboard additions: the Needs you card's list, the single-card row, the service panel on its own page. */
.blocks--one { grid-template-columns: 1fr; }
/* The old Needs you section's grid and margin must not reach the card. */
.block.needs-you { display: flex; gap: var(--space-4); margin-bottom: 0; }
.block .needs { margin-top: 0; }
.block .needs li { padding: var(--space-2) 0; }
.block .needs li + li { box-shadow: inset 0 1px 0 var(--dock-rule); }
.block .needs-more summary { padding: var(--space-2) 0; color: var(--block-ink-fg); }
.block .all-clear { color: var(--block-ink-fg); font-size: var(--step-3); }
.seg--upcoming .seg__text { color: var(--color-text-secondary); }
.seg--credited .seg__bar { background: var(--color-text-primary); box-shadow: none; }
.duo:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.service.panel, .service + .service.panel { margin-top: 0; }

/* ---- Legal pages: /privacy/, /legal/, /terms/ and /accessibility/ as one reading sheet ----
   A centred sheet at reading width. Space alone sets the rhythm: 16 between paragraphs, 48 above a
   section title and 8 below it, so each heading sits with the text it names. (SP2-T14) */
.legal-doc { max-width: 48rem; margin-inline: auto; }
.legal-doc > * + * { margin-top: var(--space-3); }
.legal-doc > .sec-title { margin-top: var(--space-6); }
.legal-doc > .sec-title + * { margin-top: var(--space-2); }
.legal-doc ul { max-width: 68ch; padding-left: var(--space-4); }
.legal-doc li + li { margin-top: var(--space-2); }
.legal-doc address { font-style: normal; }
.legal-doc dt { font-weight: 600; }
.legal-doc dd { max-width: 68ch; margin: 0; }
.legal-doc dd + dt { margin-top: var(--space-3); }

/* ---- Widths: 16px gutters on phones, two columns for the invite from 960px ---- */
@media (max-width: 599px) {
  .page { padding: var(--space-4) var(--space-3) var(--space-6); }
  .display { font-size: var(--step-3); }
  .mast-help { flex-basis: 100%; margin-left: 0; }
  .sheet { padding: var(--space-4) var(--space-3); }
  .vault { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3); }
  .engraving { width: 72px; }
}
@media (min-width: 960px) {
  .invite { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-7); }
  .invite .display { font-size: var(--step-5); }
}
@media (forced-colors: active) {
  body, .sheet, .slip, .vault { background: Canvas; }
  .meter > i.on { background: CanvasText; }
}
@media print {
  body, .sheet, .slip, .vault { background: none; box-shadow: none; }
}

/* v0.25: the price list picker (Add services, approve page) */
.pick-table .pick-inputs { min-width: 11rem; }
.pick-table .pick-inputs input { width: 100%; margin-block: var(--space-1); }
