/* The client portal's design system.
 *
 * Hand-written, and a single file, because the console it belongs to has no build step:
 * templates are Jinja, behaviour is HTMX, and a strict CSP drops anything inline. None of
 * that is what made the old screens look unfinished — that was a hundred lines of ad-hoc
 * CSS with no scale, no rhythm and no states. This is the scale.
 *
 * Read in four parts: tokens, then the shell, then components, then motion. Nothing here
 * is scoped to a page; a screen is assembled out of these and gets its polish for free.
 */

/* ─────────────────────────────────────────────────────────────── tokens */
:root {
  color-scheme: light dark;

  /* One accent, used sparingly. A client-facing page for an accountant should read as
     careful rather than lively, so colour is reserved for the thing you must act on. */
  --brand-500: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-soft: #eef2ff;
  --brand-ring: rgb(79 70 229 / 35%);

  --ok-500: #059669;
  --ok-soft: #ecfdf5;
  --ok-line: #a7f3d0;
  --warn-500: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --stop-500: #b42318;
  --stop-soft: #fef3f2;
  --stop-line: #fecdca;

  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e6eaf0;
  --line-strong: #cfd6e0;
  --surface: #ffffff;
  --surface-sunk: #f8fafc;
  --canvas: #f4f6fa;

  /* A modular scale, so nothing is sized by eye. */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.125rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;

  /* Layered rather than one blurry drop: a real edge, then the diffusion. */
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%), 0 1px 1px rgb(15 23 42 / 4%);
  --shadow: 0 1px 2px rgb(15 23 42 / 5%), 0 8px 24px -8px rgb(15 23 42 / 12%);
  --shadow-lg: 0 2px 4px rgb(15 23 42 / 5%), 0 24px 48px -16px rgb(15 23 42 / 22%);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fast: 140ms;
  --slow: 320ms;

  --shell: 68rem;
  --column: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-500: #818cf8;
    --brand-600: #a5b4fc;
    --brand-700: #c7d2fe;
    --brand-soft: #1e1b4b;
    --brand-ring: rgb(129 140 248 / 40%);

    --ok-500: #34d399;
    --ok-soft: #052e21;
    --ok-line: #065f46;
    --warn-500: #fbbf24;
    --warn-soft: #2c1e05;
    --warn-line: #78350f;
    --stop-500: #fca5a5;
    --stop-soft: #2d1213;
    --stop-line: #7f1d1d;

    --ink: #e8edf5;
    --ink-soft: #a3aec1;
    --ink-faint: #6b7688;
    --line: #222c3d;
    --line-strong: #33405a;
    --surface: #141b28;
    --surface-sunk: #101724;
    --canvas: #0b111c;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -8px rgb(0 0 0 / 60%);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 40%), 0 24px 48px -16px rgb(0 0 0 / 70%);
  }
}

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

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

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 640;
}
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-md); }
h3 { font-size: var(--text-base); }
p { margin: 0; }

a {
  color: var(--brand-600);
  text-decoration-color: color-mix(in srgb, var(--brand-600) 35%, transparent);
  text-underline-offset: 3px;
  transition: color var(--fast) var(--ease);
}
a:hover { color: var(--brand-700); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: var(--text-sm); }
.tabular { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────────── shell */
.shell {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.shell-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: 3.75rem;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }

/* The mark is drawn, not an image: one less asset to serve and it inherits the accent. */
.mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), var(--shadow-sm);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-2);
}
.nav a {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav a:hover { background: var(--surface-sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-700); }

.shell .spacer { margin-left: auto; }

/* The account menu. `popover` rather than a script, because the CSP drops inline
   handlers and a menu is not worth a stylesheet's worth of JavaScript. */
.account { position: relative; }
.account-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.account-button:hover { background: var(--surface-sunk); border-color: var(--line); }
/* Drawn rather than a glyph: `▾` renders as a dash in several system fonts at this size,
   which reads as a stray hyphen beside the avatar. */
.caret {
  width: 0; height: 0;
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
  border-top: 0.3rem solid currentColor;
  opacity: 0.7;
  transition: transform var(--fast) var(--ease);
}
.account-button:hover .caret { transform: translateY(1px); }

.avatar {
  width: 1.65rem; height: 1.65rem; border-radius: var(--radius-full);
  background: var(--brand-soft); color: var(--brand-700);
  display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 700;
}

.menu {
  position: absolute;
  inset: auto 0 auto auto;
  margin: 0;
  padding: var(--space-2);
  min-width: 13rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
.menu:popover-open { animation: pop var(--slow) var(--ease); }
.menu .who {
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.menu button,
.menu a {
  display: block; width: 100%; text-align: left;
  padding: 0.5rem var(--space-3);
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink);
  font: inherit; font-size: var(--text-sm);
  cursor: pointer; text-decoration: none;
  transition: background var(--fast) var(--ease);
}
.menu button:hover,
.menu a:hover { background: var(--surface-sunk); }

/* ─────────────────────────────────────────────────────────────── layout */
main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}
main.narrow { max-width: var(--column); }

.page-head { margin-bottom: var(--space-6); }
.page-head h1 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.page-head .lead { color: var(--ink-soft); max-width: 46ch; }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}

.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
/* A text box in a row takes the room the buttons leave. Without this the browser's
   default `size="20"` wins and the box a client is asked to type an answer into is the
   width of a postcode. */
.row > input[type="text"],
.row > input[type="email"],
.row > input[type="number"] { flex: 1 1 12rem; width: auto; min-width: 0; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
@media (max-width: 60rem) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ─────────────────────────────────────────────────────────────── card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition: box-shadow var(--slow) var(--ease), border-color var(--slow) var(--ease),
    transform var(--slow) var(--ease);
}
.card > * + * { margin-top: var(--space-4); }
.card-head { display: flex; align-items: flex-start; gap: var(--space-4); }
.card-head .grow { flex: 1; min-width: 0; }
.card.link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card.accent { border-color: var(--warn-line); background: var(--warn-soft); }
.card.quiet { background: var(--surface-sunk); box-shadow: none; }

/* ─────────────────────────────────────────────────────────────── controls */
button,
.button {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.65rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
button:hover,
.button:hover { background: var(--surface-sunk); border-color: var(--ink-faint); }
button:active,
.button:active { transform: translateY(1px); }
button[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.primary,
button.primary {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 12%), inset 0 1px 0 rgb(255 255 255 / 18%);
}
.primary:hover,
button.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
@media (prefers-color-scheme: dark) {
  .primary, button.primary { color: #10131f; }
  .primary:hover, button.primary:hover { color: #10131f; }
}

.ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.ghost:hover { background: var(--surface-sunk); color: var(--ink); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  font: inherit;
  font-size: var(--text-base);
  width: 100%;
  padding: 0.6rem 0.8rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input:hover,
select:hover,
textarea:hover { border-color: var(--ink-faint); }
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
::placeholder { color: var(--ink-faint); }

.field { display: block; }
.field > .label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.field > .hint { display: block; font-size: var(--text-sm); color: var(--ink-soft); margin-top: var(--space-2); }

/* A tick or a radio and its label as one click target. */
.choice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}
.choice + .choice { margin-top: var(--space-2); }
.choice:hover { border-color: var(--line-strong); background: var(--surface-sunk); }
.choice:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand-500) inset;
}
.choice input { margin: 0.25rem 0 0; width: 1.05rem; height: 1.05rem; accent-color: var(--brand-500); flex: none; }
.choice .body { min-width: 0; }
.choice em { display: block; font-style: normal; font-size: var(--text-sm); color: var(--ink-soft); }

/* Two documents side by side, with a "vs" between them. Each column is a choice, and the
   value is the loudest thing in it. */
.versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-3); align-items: stretch; }
.versus .reading { margin-top: 0; }
.versus .doc { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.versus .value { display: block; margin-top: var(--space-2); font-size: 1.15rem; overflow-wrap: anywhere; }
.versus .vs { align-self: center; font-size: var(--text-xs); font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 40rem) { .versus { grid-template-columns: 1fr; } .versus .vs { display: none; } }

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: var(--space-3); }
legend em { display: block; font-style: normal; font-weight: 400; font-size: var(--text-sm); color: var(--ink-soft); margin-top: var(--space-1); }

/* ─────────────────────────────────────────────────────────────── pieces */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  background: var(--surface-sunk);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-radius: var(--radius-full);
  background: currentColor;
  opacity: 0.75;
}
.pill.done { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-500); }
.pill.working { background: var(--brand-soft); border-color: var(--brand-500); color: var(--brand-700); }
.pill.waiting { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-500); }
.pill.bad { background: var(--stop-soft); border-color: var(--stop-line); color: var(--stop-500); }

/* A document being read says so by moving. The word alone is indistinguishable from a
   page that has stopped updating, which is exactly what a client suspects when a document
   has said the same thing for ten minutes — so the one state that is genuinely temporary
   is the one that looks temporary.

   CSS only, because the portal's CSP has no `script-src 'unsafe-inline'` and a spinner is
   not worth a stylesheet's worth of JavaScript. The pill's own dot is dropped where one
   of these appears: a dot and a ring side by side is two status lights for one status. */
.pill:has(.spinner)::before { content: none; }
.spinner {
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  border-radius: var(--radius-full);
  border: 2px solid currentColor;
  /* The gap in the ring is what makes the rotation visible at all. */
  border-top-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* Honoured explicitly rather than left to the blanket rule below. That rule caps the
   duration and the iteration count, which freezes this at a random angle — a ring stopped
   mid-turn reads as broken. Still a ring, and still not the same as the settled states,
   because it is the only pill with one. */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: currentColor;
    opacity: 0.6;
  }
}

/* The one moving part on the page, and it earns it: it is the answer to "how far
   through are we", which is the question every client actually opens this to ask. */
.meter { display: flex; align-items: center; gap: var(--space-3); }
.meter .track {
  flex: 1;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter .fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
  transition: width 900ms var(--ease);
}
.meter .count { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list > li:first-child { padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
/* Name on its own line, detail under it. Inline they read as one run of text and a
   filename stops being scannable, which is the whole job of this list. */
.list .name { display: block; font-weight: 550; overflow-wrap: anywhere; }
.list .meta { display: block; font-size: var(--text-sm); color: var(--ink-soft); }
.list .picked-name { display: block; overflow-wrap: anywhere; }

.tick {
  width: 1.4rem; height: 1.4rem; flex: none;
  border-radius: var(--radius-full);
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 800;
  border: 1px solid var(--line-strong);
  color: var(--ink-faint);
  background: var(--surface);
}
.tick.on { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-500); }
.tick.off { background: var(--stop-soft); border-color: var(--stop-line); color: var(--stop-500); }

/* A row that carries a control under its text rather than beside it. The default list row
   centres everything on one line, which puts a disclosure and its form in the middle of
   the row it belongs to. */
.list > li.stacked { align-items: flex-start; }

/* "I don't have this", folded away until somebody needs it. Closed by default because the
   normal thing to do with a request is answer it, and a page that offers both equally
   invites a client to dismiss a document they could have found in a drawer. */
.aside { margin-top: var(--space-2); }
.aside > summary {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.1rem 0;
}
.aside > summary:hover { color: var(--brand-700); }
.aside[open] > summary { margin-bottom: var(--space-2); }

.note {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-sunk);
  font-size: var(--text-base);
}
.note.good { background: var(--ok-soft); border-color: var(--ok-line); }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.note.bad { background: var(--stop-soft); border-color: var(--stop-line); color: var(--stop-500); }

.empty {
  padding: var(--space-6) var(--space-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface-sunk);
}

/* ─────────────────────────────────────────────────────────────── dropzone */
.drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-sunk);
  text-align: center;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.drop:hover { border-color: var(--brand-500); }
.drop.over {
  border-color: var(--brand-500);
  background: var(--brand-soft);
  transform: scale(1.005);
}
.drop input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}
.drop .icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
}
.picked { margin-top: var(--space-3); }
.picked:empty { display: none; }
.picked li { justify-content: space-between; gap: var(--space-4); }
.picked .name { display: inline; }

/* ─────────────────────────────────────────────────────────────── motion */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Entrance, staggered down the page. Cheap, and it is the difference between a page that
   appears and a page that arrives. */
.enter > * { animation: rise var(--slow) var(--ease) both; }
.enter > :nth-child(1) { animation-delay: 20ms; }
.enter > :nth-child(2) { animation-delay: 70ms; }
.enter > :nth-child(3) { animation-delay: 120ms; }
.enter > :nth-child(4) { animation-delay: 170ms; }
.enter > :nth-child(n + 5) { animation-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────── sign-in */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background:
    radial-gradient(60rem 40rem at 50% -10%, var(--brand-soft), transparent 70%),
    var(--canvas);
}
.gate .card { width: min(24rem, 100%); padding: var(--space-6); }
.gate .brand { justify-content: center; font-size: var(--text-md); }

@media (max-width: 40rem) {
  .shell-inner { padding: 0 var(--space-4); gap: var(--space-3); }
  .nav { display: none; }
  main { padding: var(--space-5) var(--space-4) var(--space-7); }
  .page-head h1 { font-size: var(--text-xl); }
}
