/*
  mohur, by denyfirst
  -------------------
  The Denyfirst family: one typeface served from this server, quiet surfaces in
  light and dark, one colour per product, and the denyfirst credit in its red.
  Surfaces and controls are neutral ink and paper, so long work does not tire
  the eyes. Mohur's seal gold is an accent only: the wordmark's stop, the
  current page's bar, the seal. The one ornament is ciphertext: random bytes,
  as an encrypted message looks to this server, drawn faintly behind the first
  pages and the overview (admin.mjs fills each .cipher). Green, orange and red
  only ever say whether something is verified, waiting or wrong; no control
  is drawn in a verdict colour.

  The scheme follows the system until the admin picks one in the rail. The
  choice is kept with the admin account; the server writes it on <html> as
  data-theme, so a page is drawn in it from its first paint.

  Fixed sizes:
    type     12 / 13 / 14 / 15 / 16 / 18 / 22 / 30 px
    space    4 / 8 / 12 / 16 / 20 / 24 / 32 / 40 / 48 / 64 px
    radius   8 / 10 / 14 / 20 px, and round
    controls 44 px high, 36 px small, icons 20 px (16 px in small controls)
    rail 264 px, page content up to 1040 px, first pages 520 px.
*/
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5f6f8;
  --rail: #eef0f3;
  --card: #ffffff;
  --well: #f4f5f7;
  --field: #ffffff;
  --ink: #14161b;
  --ink-soft: #454b56;
  --ink-faint: #656c78;
  --rule: #e2e5ea;
  --rule-strong: #cfd4db;
  --primary: #16181d;
  --primary-hover: #2c3039;
  --on-primary: #ffffff;
  --brand: #c42b3a;
  --gold: #b07a22;
  --seal: #1b1e25;
  --seal-ink: #e4b863;
  --cipher: rgba(20, 22, 27, 0.15);
  --good: #1f6a44;
  --warn: #b54708;
  --bad: #b3202e;
  --on-verdict: #ffffff;
  --qr: #ffffff;
  --sans: "Schibsted Grotesk", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.05), 0 4px 14px rgba(16, 20, 28, 0.04);
  --shadow-up: 0 2px 4px rgba(16, 20, 28, 0.05), 0 12px 28px rgba(16, 20, 28, 0.08);
  --shadow-lg: 0 24px 64px rgba(12, 16, 24, 0.18);
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --r-s: 8px;
  --r-m: 10px;
  --r-l: 14px;
  --r-xl: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c0e12;
    --rail: #101217;
    --card: #15181e;
    --well: #101217;
    --field: #101217;
    --ink: #eceef2;
    --ink-soft: #b3b9c4;
    --ink-faint: #8a919e;
    --rule: #23272f;
    --rule-strong: #323743;
    --primary: #eceef2;
    --primary-hover: #ffffff;
    --on-primary: #0e1014;
    --brand: #ed4552;
    --gold: #d6a24a;
    --seal: #22262e;
    --seal-ink: #e4b863;
    --cipher: rgba(236, 238, 242, 0.11);
    --good: #6fbf92;
    --warn: #f59e5b;
    --bad: #ff7c86;
    --on-verdict: #0b0c10;
    --qr: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-up: 0 2px 6px rgba(0, 0, 0, 0.5), 0 14px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.65);
    --lift: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c0e12;
  --rail: #101217;
  --card: #15181e;
  --well: #101217;
  --field: #101217;
  --ink: #eceef2;
  --ink-soft: #b3b9c4;
  --ink-faint: #8a919e;
  --rule: #23272f;
  --rule-strong: #323743;
  --primary: #eceef2;
  --primary-hover: #ffffff;
  --on-primary: #0e1014;
  --brand: #ed4552;
  --gold: #d6a24a;
  --seal: #22262e;
  --seal-ink: #e4b863;
  --cipher: rgba(236, 238, 242, 0.11);
  --good: #6fbf92;
  --warn: #f59e5b;
  --bad: #ff7c86;
  --on-verdict: #0b0c10;
  --qr: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-up: 0 2px 6px rgba(0, 0, 0, 0.5), 0 14px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.65);
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body[data-loading] > * { visibility: hidden; }
::selection { background: color-mix(in srgb, var(--ink) 16%, transparent); }
a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 3px; border-radius: 4px; }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
p { margin: 0 0 12px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.glyph { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hint { max-width: 42rem; font-size: 15px; color: var(--ink-soft); text-wrap: pretty; }
.help { max-width: 42rem; margin: 8px 0 0; font-size: 14px; color: var(--ink-faint); }
.hint code, .help code, .fine-print code { padding: 1px 6px; font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--well); border: 1px solid var(--rule); border-radius: 6px; overflow-wrap: anywhere; }
.sub { display: block; font-size: 14px; color: var(--ink-faint); }
.mono { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.lead { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.eyebrow::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--gold); border-radius: 50%; }
.fine-print { margin: 16px 0 0; max-width: 42rem; font-size: 13px; color: var(--ink-faint); }

.wordmark { font-size: 26px; font-weight: 750; letter-spacing: -0.04em; line-height: 1; color: var(--ink); text-decoration: none; }
.wordmark-stop { color: var(--gold); }
/* The denyfirst credit, as across the family: "deny" and the stop in red. */
.org { font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.org-deny, .brand-stop { color: var(--brand); }

/* ── Fields ───────────────────────────────────────────────────────────── */

label { display: block; margin: 20px 0 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
input {
  display: block; width: 100%; min-height: 44px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--field);
  border: 1px solid var(--rule-strong); border-radius: var(--r-m);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input:hover:not(:focus):not([readonly]) { border-color: color-mix(in srgb, var(--ink-faint) 55%, var(--rule-strong)); }
input:focus { outline: none; border-color: var(--ink-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 9%, transparent); }
input::placeholder { color: color-mix(in srgb, var(--ink-faint) 80%, transparent); }
input[readonly] { color: var(--ink-soft); background: var(--well); }
input.code-input { font-family: var(--mono); font-size: 18px; letter-spacing: 0.12em; }
input.code-input::placeholder { letter-spacing: 0; }
input[type="radio"], input[type="checkbox"] { display: inline-block; flex: none; width: 18px; height: 18px; min-height: 0; margin: 3px 0 0; padding: 0; accent-color: var(--primary); }

/* A switch is a checkbox drawn as a track and a knob. */
input.switch {
  appearance: none; position: relative; width: 40px; height: 24px; margin: 0; cursor: pointer;
  background: var(--rule-strong); border: 0; border-radius: 999px; transition: background-color 0.2s;
}
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
input.switch:checked { background: var(--good); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:disabled { cursor: default; opacity: 0.5; }
input.switch:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 3px; box-shadow: none; }

/*
  Six boxes, one field: the digits are spaced to sit in the boxes drawn
  behind them, so typing, pasting and autofill work as in any field. The box
  for the next digit is lit. As in Keybash.
*/
.code-boxes {
  --cell: 48px; --gap: 8px; --room: 4px; --tall: 56px;
  position: relative; display: flex; gap: var(--gap);
  width: calc(6 * var(--cell) + 5 * var(--gap) + 2 * var(--room)); max-width: 100%;
  margin: 0 0 0 calc(-1 * var(--room)); padding: var(--room);
  /* Clipped, never scrolled: a scrolled field would cut the first box. */
  overflow: clip;
}
.code-boxes > span {
  flex: none; width: var(--cell); height: var(--tall);
  background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--r-m);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.code-boxes > input {
  position: absolute; top: var(--room); left: var(--room); z-index: 1;
  width: calc(7 * var(--cell) + 7 * var(--gap)); height: var(--tall); min-height: 0; margin: 0; padding: 0;
  font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--ink);
  letter-spacing: calc(var(--cell) + var(--gap) - 1ch); text-indent: calc((var(--cell) - 1ch) / 2);
  caret-color: var(--gold); background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.code-boxes > input:hover, .code-boxes > input:focus { border: 0; box-shadow: none; }
.code-boxes:focus-within > span:nth-of-type(1),
.code-boxes:focus-within[data-filled="1"] > span:nth-of-type(2),
.code-boxes:focus-within[data-filled="2"] > span:nth-of-type(3),
.code-boxes:focus-within[data-filled="3"] > span:nth-of-type(4),
.code-boxes:focus-within[data-filled="4"] > span:nth-of-type(5),
.code-boxes:focus-within[data-filled="5"] > span:nth-of-type(6),
.code-boxes:focus-within[data-filled="6"] > span:nth-of-type(6) { border-color: var(--ink-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 9%, transparent); }
.code-boxes:focus-within:not([data-filled="0"]) > span:nth-of-type(1) { border-color: var(--rule-strong); box-shadow: none; }
/* A recovery code is typed into one plain field. */
[data-code="recovery"] .code-boxes { width: 100%; margin: 0; padding: 0; overflow: visible; }
[data-code="recovery"] .code-boxes > span { display: none; }
[data-code="recovery"] .code-boxes > input {
  position: static; width: 100%; height: auto; min-height: 48px; padding: 10px 14px;
  font-size: 18px; letter-spacing: 0.08em; text-indent: 0; text-transform: uppercase;
  background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--r-m);
}
[data-code="recovery"] .code-boxes > input:focus { border: 1px solid var(--ink-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 9%, transparent); }
[data-code="recovery"] .phone-words, [data-code="phone"] .recovery-words { display: none; }

/* ── Buttons ──────────────────────────────────────────────────────────── */

/* A plain button is the primary one: ink on paper, paper on ink in dark.
   Its states are in :where(), so every kind below overrides them. */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; margin: 0; padding: 0 20px;
  font: inherit; font-size: 15px; font-weight: 650; line-height: 1.2; letter-spacing: -0.005em;
  color: var(--on-primary); background: var(--primary);
  border: 1px solid var(--primary); border-radius: var(--r-m);
  box-shadow: 0 1px 2px rgba(10, 12, 16, 0.14);
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}
button:where(:hover:not(:disabled)) { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 2px 8px rgba(10, 12, 16, 0.16); }
button:where(:active:not(:disabled)) { transform: translateY(1px); box-shadow: none; }
button .glyph { width: 18px; height: 18px; stroke-width: 1.9; }
button.secondary { color: var(--ink); background: var(--card); border-color: var(--rule-strong); box-shadow: var(--lift), 0 1px 2px rgba(0, 0, 0, 0.05); }
button.secondary:hover:not(:disabled) { background: var(--well); border-color: color-mix(in srgb, var(--ink-faint) 55%, var(--rule-strong)); box-shadow: var(--lift), 0 1px 2px rgba(0, 0, 0, 0.05); }
button.danger { color: var(--on-verdict); background: var(--bad); border-color: var(--bad); }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 88%, #000); border-color: color-mix(in srgb, var(--bad) 88%, #000); }
button.ghost { color: var(--ink-soft); background: none; border-color: transparent; box-shadow: none; }
button.ghost:hover:not(:disabled) { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: transparent; box-shadow: none; }
button.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--r-s); }
button.small .glyph { width: 16px; height: 16px; }
button.icon { width: 40px; min-height: 40px; padding: 0; }
button:disabled { cursor: default; opacity: 0.45; box-shadow: none; }
body[data-busy] button { cursor: progress; }
.link-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; font-size: 14px; font-weight: 650; color: var(--ink-soft); background: none; border: 0; box-shadow: none; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.25em; }
button.link-button:hover:not(:disabled), a.link-button:hover { color: var(--ink); background: none; box-shadow: none; text-decoration-color: currentColor; }
button.link-button:active:not(:disabled) { transform: none; }
/* A link that looks like a small secondary button (Reports → People). */
a.button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 650; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-s); box-shadow: var(--lift), 0 1px 2px rgba(0, 0, 0, 0.05); transition: background-color 0.15s, border-color 0.15s; }
a.button:hover { background: var(--well); border-color: color-mix(in srgb, var(--ink-faint) 55%, var(--rule-strong)); }
button.copy[data-copied] { color: var(--good); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 28px; }

/* ── Outputs, codes and notices ───────────────────────────────────────── */

output {
  display: block; min-width: 0; padding: 10px 14px;
  font-family: var(--mono); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap;
  background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-s);
}
/* A value with its Copy button inside the same box. */
.copy-field { display: flex; gap: 8px; align-items: center; min-width: 0; padding: 4px 4px 4px 0; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-m); }
.copy-field output { flex: 1; padding: 8px 4px 8px 14px; color: var(--ink); background: none; border: 0; }
.copy-field button { flex: none; align-self: flex-start; }
pre.command {
  margin: 16px 0 0; padding: 12px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 14px; user-select: all; color: var(--ink);
  background: var(--well); border: 1px solid var(--rule); border-left: 3px solid var(--ink-faint); border-radius: var(--r-s);
}
pre.command::before { content: "$ "; color: var(--ink-faint); user-select: none; }
output.invite { margin: 20px 0 0; padding: 20px 16px; font-size: 17px; letter-spacing: 0.02em; text-align: center; color: var(--ink); background: var(--well); border: 1.5px dashed var(--rule-strong); border-radius: var(--r-l); }
output.codes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 20px; padding: 14px 16px;
  font-size: 15px; line-height: 2.1; letter-spacing: 0.02em; text-align: center; white-space: normal;
  color: var(--ink); background: var(--well); border: 1.5px dashed var(--rule-strong); border-radius: var(--r-l);
}
output.codes span { white-space: nowrap; }
.seed { padding: 8px 10px; font-size: 13px; letter-spacing: 0.06em; color: var(--ink); }

/* A notice says what just happened, in a verdict colour when it is one. */
.notice { display: flex; gap: 10px; align-items: baseline; margin: 0 0 20px; padding: 12px 16px; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-m); box-shadow: var(--shadow); text-wrap: pretty; }
.notice::before { content: ""; width: 8px; height: 8px; flex: none; transform: translateY(-1px); background: var(--ink-faint); border-radius: 50%; }
.notice:empty { display: none; }
.notice[data-kind="bad"] { color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--card)); border-color: color-mix(in srgb, var(--bad) 35%, var(--rule)); }
.notice[data-kind="warn"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--card)); border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); }
.notice[data-kind="good"] { color: var(--good); background: color-mix(in srgb, var(--good) 7%, var(--card)); border-color: color-mix(in srgb, var(--good) 35%, var(--rule)); }
.notice[data-kind]::before { background: currentColor; }
.lone .notice, dialog .notice { margin: 20px 0 0; box-shadow: none; }

/* Pills say a state in words and a verdict colour. */
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; font-size: 12px; font-weight: 650; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; border-radius: 999px; color: var(--ink-faint); background: color-mix(in srgb, currentColor 10%, transparent); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-kind="good"] { color: var(--good); }
.pill[data-kind="warn"] { color: var(--warn); }
.pill[data-kind="bad"] { color: var(--bad); }
.pill[data-kind="none"] { color: var(--ink-faint); }
.pill:empty { display: none; }

/* ── Ciphertext: the one ornament ─────────────────────────────────────── */

.cipher {
  position: absolute; z-index: -1; overflow: hidden; margin: 0;
  font-family: var(--mono); font-size: 12px; line-height: 20px; letter-spacing: 0.14em; word-break: break-all;
  color: var(--cipher); pointer-events: none; user-select: none;
}
/* Behind the wordmark of the first pages: the bytes thin out at the edges and
   clear around the name, the one thing in plain text. */
.lone > .cipher {
  top: -20px; left: 50%; width: 860px; height: 400px; transform: translateX(-50%);
  -webkit-mask-image: radial-gradient(ellipse 50% 48% at 50% 34%, #000 20%, transparent 74%), radial-gradient(ellipse 170px 62px at 50% 112px, transparent 55%, #000 100%);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(ellipse 50% 48% at 50% 34%, #000 20%, transparent 74%), radial-gradient(ellipse 170px 62px at 50% 112px, transparent 55%, #000 100%);
  mask-composite: intersect;
}

/* ── First pages: one card in the middle ──────────────────────────────── */

.lone { position: relative; isolation: isolate; width: min(100% - 32px, 520px); margin: 0 auto; padding: 72px 0 40px; }
.lone .mark { margin: 0 0 32px; text-align: center; }
.lone .mark .wordmark { font-size: 40px; }
.lone .card { position: relative; padding: 40px; border-radius: var(--r-xl); box-shadow: var(--lift), var(--shadow-up); }
.lone h1 { font-size: 26px; }
.lone .hint { font-size: 15px; }
.lone form button[type="submit"] { width: 100%; min-height: 48px; margin-top: 28px; font-size: 16px; }
.lone h2.step { display: flex; align-items: center; gap: 12px; margin: 36px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.lone h2.step::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.lone h2.step + label { margin-top: 16px; }
.lone h2.step + .help { margin-top: 12px; }
.below { margin: 20px 0 0; text-align: center; }
.below .link-button { font-size: 15px; }
.lone-foot { margin-top: 40px; text-align: center; }
.secure-note { margin: 0 0 10px; font-size: 13px; color: var(--ink-faint); text-wrap: balance; }
.secure-note .glyph { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; color: var(--gold); }
.lone-foot .colophon { margin: 0; }

/* The sign-in's second step: back to the name, then the code. */
.back-chip {
  min-height: 32px; margin: -8px 0 20px -4px; padding: 0 12px 0 8px; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  background: var(--well); border: 1px solid var(--rule); border-radius: 999px; box-shadow: none;
}
.back-chip .glyph { width: 16px; height: 16px; }
.back-chip:hover:not(:disabled) { color: var(--ink); background: var(--well); border-color: var(--rule-strong); box-shadow: none; }
.back-chip span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.step-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 0 16px; color: var(--seal-ink); background: var(--seal); border-radius: 14px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--seal-ink) 18%, transparent), var(--shadow); }
.step-icon .glyph { width: 24px; height: 24px; stroke-width: 1.6; }
#signin-step-2 .hint { margin-bottom: 20px; }
.code-foot { margin: 16px 0 0; font-size: 14px; text-align: center; color: var(--ink-faint); }
.code-foot .link-button { min-height: 24px; }

.stepper { display: flex; justify-content: center; gap: 8px; width: fit-content; max-width: 100%; margin: 0 auto 24px; padding: 6px 16px 6px 8px; list-style: none; background: var(--card); border: 1px solid var(--rule); border-radius: 999px; box-shadow: var(--shadow); }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.stepper li + li::before { content: ""; width: 24px; height: 1px; background: var(--rule-strong); }
.stepper-n { display: grid; place-items: center; width: 24px; height: 24px; font-size: 12px; font-weight: 700; border: 1.5px solid var(--rule-strong); border-radius: 50%; }
/* Which step shows, from which card shows: setup and reset each have three. */
#setup:has(#setup-code:not([hidden])) .stepper li:nth-child(1),
#setup:has(#setup-details:not([hidden])) .stepper li:nth-child(2),
#setup:has(#setup-recovery:not([hidden])) .stepper li:nth-child(3),
#reset:has(#reset-code:not([hidden])) .stepper li:nth-child(1),
#reset:has(#reset-details:not([hidden])) .stepper li:nth-child(2),
#reset:has(#reset-recovery:not([hidden])) .stepper li:nth-child(3) { color: var(--ink); }
#setup:has(#setup-code:not([hidden])) .stepper li:nth-child(1) .stepper-n,
#setup:has(#setup-details:not([hidden])) .stepper li:nth-child(2) .stepper-n,
#setup:has(#setup-recovery:not([hidden])) .stepper li:nth-child(3) .stepper-n,
#reset:has(#reset-code:not([hidden])) .stepper li:nth-child(1) .stepper-n,
#reset:has(#reset-details:not([hidden])) .stepper li:nth-child(2) .stepper-n,
#reset:has(#reset-recovery:not([hidden])) .stepper li:nth-child(3) .stepper-n { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
#setup:has(#setup-details:not([hidden])) .stepper li:nth-child(1) .stepper-n,
#setup:has(#setup-recovery:not([hidden])) .stepper li:nth-child(-n+2) .stepper-n,
#reset:has(#reset-details:not([hidden])) .stepper li:nth-child(1) .stepper-n,
#reset:has(#reset-recovery:not([hidden])) .stepper li:nth-child(-n+2) .stepper-n { color: var(--good); border-color: var(--good); }
#reset:has(#reset-recovery:not([hidden])) #reset-below { display: none; }

.qr-box { display: flex; gap: 20px; align-items: center; margin-top: 16px; padding: 16px; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-l); }
.qr { width: 152px; height: 152px; flex: none; padding: 10px; background: var(--qr); border-radius: var(--r-m); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.12); }
.qr rect { fill: #000; }
.seed-box { min-width: 0; }
.seed-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--ink-faint); }

/* ── Cards ────────────────────────────────────────────────────────────── */

.card { padding: 28px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); box-shadow: var(--lift), var(--shadow); }
.card + .card, .card + .notice + .card { margin-top: 20px; }
.card > h2:first-child { margin-bottom: 16px; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 16px; }
.card-head h2 { margin: 0; }

/* ── The workspace: a rail, and the page beside it ────────────────────── */

.workspace { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--rail) 263px, var(--rule) 263px 264px, transparent 264px); }
.rail { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; height: 100vh; padding: 24px 16px 20px; overflow-y: auto; background: var(--rail); border-right: 1px solid var(--rule); }
.rail-top { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 20px; }
.rail-menu { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.menu-toggle { display: none; }

/* The organization's initial, stamped like a seal: gold on ink. */
.monogram { display: grid; place-items: center; width: 36px; height: 36px; flex: none; font-size: 15px; font-weight: 750; letter-spacing: -0.02em; color: var(--seal-ink); background: var(--seal); border-radius: 10px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--seal-ink) 18%, transparent), 0 1px 2px rgba(0, 0, 0, 0.2); }
.org-card { display: flex; gap: 12px; align-items: center; margin: 0 0 20px; padding: 12px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); box-shadow: var(--lift), var(--shadow); }
.org-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.org-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-text span { font-size: 13px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; font-size: 15px; font-weight: 550; color: var(--ink-soft); text-decoration: none; border: 1px solid transparent; border-radius: var(--r-m); transition: background-color 0.15s, color 0.15s; }
.rail-item .glyph { color: var(--ink-faint); transition: color 0.15s; }
.rail-item:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.rail-item:hover .glyph { color: var(--ink-soft); }
.rail-item[aria-current="page"] { color: var(--ink); font-weight: 650; background: var(--card); border-color: var(--rule); box-shadow: 0 1px 2px rgba(10, 12, 16, 0.06); }
.rail-item[aria-current="page"]::before { content: ""; position: absolute; left: -17px; top: 9px; bottom: 9px; width: 3px; background: var(--gold); border-radius: 0 3px 3px 0; }
.rail-item[aria-current="page"] .glyph { color: var(--ink); }
.count { margin-left: auto; min-width: 22px; padding: 0 7px; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; color: var(--on-primary); background: var(--primary); border-radius: 999px; }
.dot-warn { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }

/* The rail's foot: the scheme, the signed-in admin, the credit. */
.rail-foot { display: grid; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--rule); }
.look { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 0 8px; }
.look-label { font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.look-buttons { display: inline-flex; gap: 2px; padding: 3px; background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid var(--rule); border-radius: var(--r-m); }
button.look-button { width: 34px; min-height: 30px; padding: 0; color: var(--ink-faint); background: none; border: 1px solid transparent; border-radius: 7px; box-shadow: none; }
button.look-button .glyph { width: 16px; height: 16px; stroke-width: 1.8; }
button.look-button:hover:not(:disabled) { color: var(--ink); background: none; border-color: transparent; box-shadow: none; }
button.look-button[aria-pressed="true"], button.look-button[aria-pressed="true"]:hover:not(:disabled) { color: var(--ink); background: var(--card); border-color: var(--rule); box-shadow: 0 1px 2px rgba(10, 12, 16, 0.1); }
.account { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 10px 6px 10px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); box-shadow: var(--lift), var(--shadow); }
.account .avatar { width: 36px; height: 36px; font-size: 13px; }
.who-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.3; }
.who-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { font-size: 12px; color: var(--ink-faint); }
.account button.icon { width: 36px; min-height: 36px; }
.colophon { margin: 0; font-size: 12px; text-align: center; color: var(--ink-faint); }

.page { width: 100%; max-width: 1104px; padding: 48px 32px 72px 48px; }
.page:not([hidden]) { animation: rise 0.3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 28px; }
.page-head.with-action { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.page-head .hint { margin: 0; }

/* ── Overview ─────────────────────────────────────────────────────────── */

.hero {
  position: relative; overflow: hidden; isolation: isolate; margin-bottom: 24px; padding: 36px 40px;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--lift), var(--shadow);
}
/* The bytes fill the right of the header and clear around the seal. */
.hero > .cipher {
  inset: 0 0 0 46%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%), radial-gradient(circle at calc(100% - 112px) 50%, transparent 64px, #000 150px);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 55%), radial-gradient(circle at calc(100% - 112px) 50%, transparent 64px, #000 150px);
  mask-composite: intersect;
}
.hero-seal {
  position: absolute; top: 50%; right: 64px; display: grid; place-items: center; width: 96px; height: 96px; transform: translateY(-50%);
  color: var(--seal-ink); background: var(--seal); border-radius: 50%;
  box-shadow: 0 0 0 8px var(--card), 0 0 0 9px var(--rule), inset 0 0 0 1px color-mix(in srgb, var(--seal-ink) 22%, transparent), inset 0 0 0 7px var(--seal), inset 0 0 0 8px color-mix(in srgb, var(--seal-ink) 14%, transparent), var(--shadow-up);
}
.hero-seal .glyph { width: 36px; height: 36px; stroke-width: 1.5; }
.hero h1 { margin: 0 0 14px; font-size: 40px; letter-spacing: -0.035em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; font-family: var(--mono); font-size: 14px; color: var(--ink-soft); background: var(--well); border: 1px solid var(--rule); border-radius: 999px; }
.chip .glyph { width: 16px; height: 16px; color: var(--ink-faint); }
.secure-line { display: flex; gap: 8px; align-items: center; margin: 20px 0 0; font-size: 14px; color: var(--ink-soft); }
.secure-line .glyph { width: 18px; height: 18px; color: var(--gold); }

.update-banner { display: flex; gap: 12px; align-items: center; margin: 0 0 24px; padding: 14px 18px; font-weight: 600; color: var(--ink); text-decoration: none; background: color-mix(in srgb, var(--warn) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 38%, var(--rule)); border-radius: var(--r-l); transition: border-color 0.15s; }
.update-banner > .glyph { color: var(--warn); }
.update-banner .go { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 14px; font-weight: 650; color: var(--ink-soft); white-space: nowrap; }
.update-banner .go .glyph { width: 16px; height: 16px; transition: transform 0.15s; }
.update-banner:hover { border-color: var(--warn); }
.update-banner:hover .go .glyph { transform: translateX(3px); }

.getting-started { margin-bottom: 24px; }
.section-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.progress { height: 4px; margin-bottom: 16px; overflow: hidden; background: var(--rule); border-radius: 999px; }
.progress span { display: block; width: 0; height: 100%; background: var(--ink-soft); border-radius: inherit; transition: width 0.6s ease, background-color 0.3s; }
[data-done="1"] .progress span { width: 33.34%; }
[data-done="2"] .progress span { width: 66.67%; }
[data-done="3"] .progress span { width: 100%; background: var(--good); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step-card { display: flex; flex-direction: column; gap: 4px; padding: 20px; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); box-shadow: var(--lift), var(--shadow); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.step-card:hover { border-color: var(--rule-strong); box-shadow: var(--lift), var(--shadow-up); transform: translateY(-2px); }
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.step-card strong { font-size: 16px; line-height: 1.35; }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; flex: none; font-size: 15px; font-weight: 700; color: var(--ink-soft); background: var(--well); border: 1.5px solid var(--rule-strong); border-radius: 50%; }
.step-n > * { grid-area: 1 / 1; }
.step-n .step-check { display: none; width: 20px; height: 20px; stroke-width: 2.6; }
.step-card[data-done] .step-n { color: var(--on-verdict); background: var(--good); border-color: var(--good); }
.step-card[data-done] .step-num { display: none; }
.step-card[data-done] .step-check { display: block; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fact { display: flex; flex-direction: column; min-width: 0; padding: 20px; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); box-shadow: var(--lift), var(--shadow); transition: border-color 0.15s; }
.fact:hover { border-color: var(--rule-strong); }
.fact .eyebrow { margin: 14px 0 4px; color: var(--ink-faint); }
.fact .eyebrow::before { display: none; }
.fact-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink-soft); background: var(--well); border: 1px solid var(--rule); border-radius: 12px; }
.fact .big { font-size: 36px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fact .mono { margin: 4px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.fact .sub { margin-top: 2px; }

/* ── Lists of people, partners and reports ────────────────────────────── */

.rows { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); box-shadow: var(--lift), var(--shadow); transition: border-color 0.15s; }
.row:hover { border-color: var(--rule-strong); }
.row[data-attention] { border-color: var(--rule-strong); }
.row[data-attention]::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; background: var(--gold); border-radius: 0 3px 3px 0; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-soft); background: var(--well); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.avatar.org { font-size: 17px; border-radius: 12px; }
.avatar.flag { font-size: 0; color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); }
.avatar.flag::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4'/%3E%3Cpath d='M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4'/%3E%3Cpath d='M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E") center / contain no-repeat; }
.row[data-closed] .avatar.flag { color: var(--ink-faint); background: var(--well); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.row-main { min-width: 0; }
.row-main strong { display: block; font-size: 16px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.row-main .sub { margin-top: 2px; font-size: 14px; }
.row-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.row-side .pill { margin-right: 4px; }
.row details { grid-column: 2 / -1; margin-top: -4px; font-size: 14px; color: var(--ink-soft); }
.row summary, .provider-help summary { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--ink-soft); cursor: pointer; list-style: none; }
.row summary:hover, .provider-help summary:hover { color: var(--ink); }
.row summary::-webkit-details-marker, .provider-help summary::-webkit-details-marker { display: none; }
.row summary::before, .provider-help summary::before { content: ""; width: 7px; height: 7px; margin: 0 3px 0 1px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
details[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }
.row details .help { margin-top: 8px; }
.access-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.access-line strong { display: inline; font-size: 14px; color: var(--ink); font-weight: 600; }
.access-line .link-button { min-height: 24px; }
.access-line[data-kind="none"] strong { color: var(--warn); }
.code-groups { display: inline-block; margin: 8px 0 4px; padding: 8px 12px; font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; color: var(--ink); background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-s); }
.report-note { margin: 10px 0 4px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--ink); background: var(--well); border-left: 3px solid color-mix(in srgb, var(--warn) 60%, var(--rule)); border-radius: 0 var(--r-s) var(--r-s) 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0; padding: 48px 32px; text-align: center; color: var(--ink-soft); background: color-mix(in srgb, var(--card) 60%, transparent); border: 1.5px dashed var(--rule-strong); border-radius: var(--r-l); }
.empty .glyph { width: 28px; height: 28px; color: var(--ink-faint); }

/* ── Domain ───────────────────────────────────────────────────────────── */

.verdict { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; padding: 20px 24px; }
.verdict + .notice { margin-top: -4px; }
.verdict-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; }
.verdict-icon .glyph { width: 26px; height: 26px; stroke-width: 1.6; }
.verdict-text { flex: 1; min-width: 0; }
.verdict-text strong { display: block; font-size: 18px; letter-spacing: -0.01em; }
.verdict[data-kind="good"] { border-color: color-mix(in srgb, var(--good) 35%, var(--rule)); background: linear-gradient(90deg, color-mix(in srgb, var(--good) 7%, var(--card)), var(--card) 60%); }
.verdict[data-kind="good"] .verdict-icon { color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.verdict[data-kind="good"] .verdict-text strong { color: var(--good); }
.verdict[data-kind="good"] .verdict-wait, .verdict:not([data-kind="good"]) .verdict-good { display: none; }
.verdict[data-kind="warn"] { border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 7%, var(--card)), var(--card) 60%); }
.verdict[data-kind="warn"] .verdict-icon { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.verdict[data-kind="warn"] .verdict-text strong { color: var(--warn); }

.record { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px 16px; align-items: center; margin: 0; }
.record dt { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.record dd { min-width: 0; margin: 0; }
.record dd > .mono { padding-left: 2px; font-weight: 600; }
.callout { display: flex; gap: 14px; margin-top: 24px; padding: 18px 20px; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-l); }
.callout > .glyph { margin-top: 1px; color: var(--ink-faint); }
.callout > div { flex: 1; min-width: 0; }
.callout p { margin: 0 0 12px; font-size: 15px; }
.callout p strong { font-weight: 600; }
.short-names { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; align-items: center; margin: 0; padding: 0; list-style: none; }
.short-names li { display: contents; }
.short-names li > span { font-size: 14px; color: var(--ink-soft); }
.short-names .copy-field { background: var(--card); }
.short-names output { font-weight: 600; }
.provider-help { margin-top: 20px; padding-top: 18px; font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--rule); }
.provider-help[open] summary { margin-bottom: 12px; }
.provider-help table { width: 100%; margin: 12px 0 16px; border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-m); }
.provider-help th, .provider-help td { padding: 10px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.provider-help th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); background: var(--card); }
.provider-help td:first-child { width: 36%; font-weight: 600; color: var(--ink); }
.provider-help tr:last-child td { border-bottom: 0; }
.provider-help p { max-width: 42rem; }

/* ── Server ───────────────────────────────────────────────────────────── */

.update-card { border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); }
.update-card .card-head strong { font-size: 16px; }
.update-card .copy-field { margin: 4px 0 16px; }
.update-card .hint:last-child { margin: 0; }
.update-card a { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.update-card a .glyph { width: 15px; height: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 24px; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-l); }
.stats > div { min-width: 0; padding: 16px 20px; }
.stats > div + div { border-left: 1px solid var(--rule); }
.stats dt { margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.stats dd { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stats dd .sub { font-size: 14px; font-weight: 400; letter-spacing: 0; }
.status-line { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.backup-card .notice { box-shadow: none; }
.toggle { display: inline-flex; gap: 12px; align-items: center; margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }

/* ── Dialogs ──────────────────────────────────────────────────────────── */

dialog { width: min(100% - 32px, 520px); max-height: calc(100vh - 48px); padding: 32px; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
dialog[open] { animation: pop 0.2s ease-out; }
dialog::backdrop { background: rgba(8, 9, 12, 0.55); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
dialog h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; text-wrap: balance; }
dialog h2 + label { margin-top: 24px; }
dialog .hint { font-size: 15px; }
.suffix-field { display: flex; align-items: stretch; }
.suffix-field input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.suffix { display: flex; align-items: center; padding: 0 14px; font-size: 15px; color: var(--ink-faint); background: var(--well); border: 1px solid var(--rule-strong); border-left: 0; border-radius: 0 var(--r-m) var(--r-m) 0; white-space: nowrap; }
fieldset.picker { margin: 24px 0 0; padding: 0; border: 0; }
fieldset.picker legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.pick-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.pick-head .link-button { min-height: 24px; }
.pick { display: grid; gap: 0; max-height: 300px; overflow: auto; margin: 8px 0 0; padding: 4px; list-style: none; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-m); scrollbar-width: thin; }
.pick li + li { border-top: 1px solid var(--rule); }
.pick label { display: flex; gap: 12px; align-items: center; margin: 0; padding: 12px; font-size: 15px; font-weight: 500; color: var(--ink); border-radius: var(--r-s); cursor: pointer; transition: background-color 0.12s; }
.pick label:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.pick label:has(input:checked) { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pick input[type="checkbox"] { margin: 0; }
.pick label > span:first-of-type { flex: 1; min-width: 0; font-weight: 600; }
.pick label .sub { display: inline; text-align: right; font-size: 13px; }
.pick .none { padding: 12px; font-size: 14px; color: var(--ink-soft); }
.verified { display: flex; gap: 14px; align-items: center; margin-top: 20px; padding: 16px; background: color-mix(in srgb, var(--good) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--good) 40%, var(--rule)); border-radius: var(--r-m); }
.verified strong { font-size: 16px; }
.seal { width: 36px; height: 36px; flex: none; fill: none; stroke: var(--good); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }

/* ── Narrow screens ───────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .steps { grid-template-columns: 1fr; }
  .step-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; align-items: center; }
  .step-top { display: contents; }
  .step-top .step-n { grid-row: 1 / span 2; }
  .step-top .pill { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 6px; }
  .step-card strong { grid-column: 2; grid-row: 1; }
  .step-card .sub { grid-column: 2; grid-row: 2; }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; background: none; }
  .rail { position: sticky; z-index: 10; height: auto; max-height: 100vh; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .rail-top { margin: 0; min-height: 44px; }
  .menu-toggle { display: inline-flex; min-height: 40px; padding: 0 12px; }
  .rail-menu { display: none; padding: 16px 0 8px; }
  .rail[data-open] .rail-menu { display: flex; }
  .rail-item[aria-current="page"]::before { left: -1px; }
  .rail-foot { margin-top: 12px; }
  .page { padding: 28px 16px 56px; }
  h1 { font-size: 26px; }
  .hero { padding: 28px 24px; }
  .hero h1 { font-size: 32px; }
  .hero > .cipher { inset: 0 0 0 30%; }
  .facts { grid-template-columns: 1fr; }
  .row { grid-template-columns: 44px minmax(0, 1fr); padding: 16px; }
  .row > .avatar { align-self: start; }
  .row-side { grid-column: 1 / -1; justify-content: flex-start; row-gap: 4px; }
  .row-side::before { content: ""; order: 1; flex-basis: 100%; }
  .row-side > * { order: 2; }
  .row-side > .pill { order: 0; }
  .row details { grid-column: 1 / -1; }
  .card { padding: 20px; }
  .verdict { flex-wrap: wrap; padding: 18px; }
  .verdict button { width: 100%; }
  .record { grid-template-columns: 1fr; gap: 6px; }
  .record dd + dt { margin-top: 10px; }
  .short-names { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .short-names .copy-field { margin-bottom: 10px; }
  .callout { padding: 16px; }
  .callout > .glyph { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stats > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .update-banner { flex-wrap: wrap; }
  .update-banner .go { margin-left: 32px; }
}
@media (max-width: 640px) {
  .hero-seal { display: none; }
  /* Only the top corner, away from the text. */
  .hero > .cipher {
    inset: 0 0 0 40%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 90%), linear-gradient(180deg, #000, transparent 45%);
    mask-image: linear-gradient(90deg, transparent, #000 90%), linear-gradient(180deg, #000, transparent 45%);
  }
}
@media (max-width: 520px) {
  .lone { padding-top: 40px; }
  .lone .card { padding: 24px 20px; }
  .lone .mark .wordmark { font-size: 34px; }
  .lone > .cipher {
    width: 520px; height: 200px; top: -12px;
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 38%, #000 20%, transparent 78%), radial-gradient(ellipse 140px 50px at 50% 69px, transparent 55%, #000 100%);
    mask-image: radial-gradient(ellipse 50% 50% at 50% 38%, #000 20%, transparent 78%), radial-gradient(ellipse 140px 50px at 50% 69px, transparent 55%, #000 100%);
  }
  .stepper { padding: 6px 12px 6px 6px; }
  .code-boxes { --cell: 40px; --gap: 7px; --tall: 52px; }
  .code-boxes > input { font-size: 22px; }
  .stepper { gap: 6px; }
  .stepper li { font-size: 0; gap: 6px; }
  .stepper li .stepper-n { font-size: 12px; }
  .stepper li + li::before { width: 28px; }
  .qr-box { flex-direction: column; align-items: flex-start; }
  /* A value gets the width: its Copy button shows only the icon. */
  .copy-field button.copy { width: 36px; padding: 0; }
  .copy-field button.copy span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  output.codes { grid-template-columns: minmax(0, 1fr); }
  dialog { padding: 24px 20px; }
  .actions { flex-direction: column-reverse; }
  .actions button { width: 100%; }
  .page-head.with-action > button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* What follows from a change, listed in its confirm dialog. */
.consequences { display: grid; gap: 10px; margin: 4px 0 22px; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.consequences li { position: relative; padding-left: 22px; }
.consequences li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--rule-strong); }

/* People who left: below the people, quieter. */
.left-people { margin-top: 40px; }
.left-people > .hint { margin: 0 0 14px; }
.row[data-left] { box-shadow: none; background: transparent; }
.row[data-left] .avatar { color: var(--ink-faint); background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.row[data-left] strong { color: var(--ink-soft); font-weight: 600; }

/* What is kept: two choices, then what is kept for a fixed time. */
fieldset.keep-choice { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset.keep-choice + fieldset.keep-choice { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--rule); }
/* A floated legend leaves the fieldset's top line whole. */
fieldset.keep-choice legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
fieldset.keep-choice legend + * { clear: both; }
fieldset.keep-choice .hint { margin: 12px 0 0; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid var(--rule); border-radius: var(--r-m); }
.segmented label { margin: 0; padding: 7px 14px; font-size: 14px; font-weight: 600; text-align: center; white-space: nowrap; color: var(--ink-faint); border: 1px solid transparent; border-radius: 7px; cursor: pointer; transition: color 0.12s, background-color 0.12s; }
.segmented label:hover { color: var(--ink); }
.segmented label:has(input:checked) { color: var(--ink); background: var(--card); border-color: var(--rule); box-shadow: 0 1px 2px rgba(10, 12, 16, 0.1); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--ink-soft); outline-offset: 2px; }
.kept { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); margin: 28px 0 0; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-l); }
.kept > div { display: contents; }
.kept dt, .kept dd { margin: 0; padding: 13px 20px; }
.kept > div + div > dt, .kept > div + div > dd { border-top: 1px solid var(--rule); }
.kept dt { font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.kept dd { font-size: 14px; color: var(--ink); text-wrap: pretty; }
@media (max-width: 640px) {
  .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segmented label { padding: 8px 6px; }
  .kept { grid-template-columns: 1fr; }
  .kept dt { padding-bottom: 2px; }
  .kept dd { padding-top: 0; }
  .kept > div + div > dd { border-top: 0; }
}
