/* ── Tokens ──────────────────────────────────────────────────────────────────
   Colours from the SiteMagpie brand sheet: cream paper, navy ink, the magpie blue, a pale-blue wash,
   the beak's orange for the draft. Buttons use a blue a shade deeper than the wordmark's (#0078e0),
   so white text on them passes contrast. Type, spacing and shapes from the design handoff
   (redesign/tend-tokens.css). Good, bad and review keep their own colours. */
:root {
  --paper: #fcfbf2; --surface: #ffffff; --sunk: #f3f1e4; --line: #e6e3d3; --line-strong: #d9d5c2; --wash: #e3f4ff;
  --ink: #0b2a50; --ink-2: #3b4f6b; --muted: #5e6f86;
  --accent: #006fd6; --accent-hover: #005cb3; --accent-ink: #ffffff;
  --brand-blue: #0078e0;
  --draft: #fab21d; --draft-soft: #fff1d1; --draft-ink: #6b4a00;
  --ok: #3d7a5a; --ok-soft: #e6f0ea; --ok-ink: #2c5c43;
  --bad: #b3261e; --bad-soft: #fbe7e4; --bad-ink: #8a1f17;
  --info-soft: #e3f1ff; --info-ink: #0b4a8a;
  --review-soft: #efe7f6; --review-ink: #4c2a73;
  --back-soft: #fde3c4; --back-ink: #7a4a0c;
  --font: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --t-xs: 0.8125rem; --t-sm: 0.875rem; --t-md: 0.9375rem; --t-lg: 1.0625rem; --t-xl: 1.25rem; --t-2xl: 1.625rem; --t-3xl: 2rem; --t-4xl: 2.75rem;
  --track-tight: -0.03em; --track-snug: -0.02em;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s11: 44px;
  --r-input: 12px; --r-row: 14px; --r-card: 22px; --r-pill: 999px;
  --ring: 0 0 0 1px var(--line); --ring-strong: 0 0 0 1px var(--line-strong);
  --lift: 0 1px 2px rgb(11 42 80 / 0.06), 0 0 0 1px var(--line);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
  --page-max: 60rem; --tap: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1726; --surface: #142236; --sunk: #1a2b42; --line: #24364f; --line-strong: #2c405c; --wash: #13253d;
    --ink: #eef3fa; --ink-2: #c9d5e6; --muted: #93a4bb;
    --accent: #5aa9f5; --accent-hover: #7bbaf7; --accent-ink: #06182e;
    --brand-blue: #5aa9f5;
    --draft-soft: #46290b; --draft-ink: #ffd98a;
    --ok-soft: #20352a; --ok-ink: #9fd6b5;
    --bad-soft: #3d1d1a; --bad-ink: #f4b4ab;
    --info-soft: #12304f; --info-ink: #b5d6f7;
    --review-soft: #2c2338; --review-ink: #d6c2f0;
    --back-soft: #3a2a14; --back-ink: #f0c98a;
    --lift: 0 1px 2px rgb(0 0 0 / 0.3), 0 0 0 1px var(--line);
  }
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-md)/1.5 var(--font); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: var(--track-snug); }
h1 { font-size: var(--t-3xl); font-weight: 800; letter-spacing: var(--track-tight); }
h2 { font-size: var(--t-xl); font-weight: 700; }
h3 { font-size: var(--t-lg); font-weight: 700; }
p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }
code { font: 500 0.95em var(--mono); }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.lead { font-size: var(--t-lg); color: var(--ink-2); max-width: 40rem; margin-bottom: var(--s5); }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s6); max-width: var(--page-max); margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-size: var(--t-sm); }
.brand .mark { position: relative; width: 22px; height: 22px; border-radius: 7px; background: var(--accent); flex: none; }
.brand .mark::after { content: ''; position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--paper); }
.brand .word { font-weight: 800; font-size: 21px; letter-spacing: var(--track-tight); line-height: 1; }
.brand .word b { font-weight: 800; color: var(--brand-blue); }
.brand .crumb-sep { color: var(--line-strong); margin: 0 2px; }
.brand .crumb { font-weight: 600; color: var(--muted); }
.top nav { display: flex; align-items: center; gap: var(--s3); font-size: var(--t-sm); }
.top nav a:first-child { padding: 7px 14px; border-radius: var(--r-pill); background: var(--wash); color: var(--ink); font-weight: 600; text-decoration: none; }
.top nav form { margin: 0; }
button.link { all: unset; cursor: pointer; color: var(--muted); font: inherit; }
button.link:hover { color: var(--ink); text-decoration: underline; }
button.link:focus-visible { box-shadow: var(--focus); border-radius: 4px; }

main.wrap { max-width: var(--page-max); margin: 0 auto; padding: var(--s2) var(--s6) var(--s11); display: flex; flex-direction: column; gap: var(--s5); }
main.wrap > h1 { margin-top: var(--s3); }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-size: var(--t-3xl); }

/* ── Site header ────────────────────────────────────────────────────────────── */
.site-head { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s2); }
.site-head .row { display: flex; justify-content: space-between; align-items: center; gap: var(--s5); flex-wrap: wrap; }
.site-head .name { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.site-head h1 { font-size: 40px; line-height: 1; }
.site-head .back { font-size: var(--t-sm); color: var(--muted); text-decoration: none; display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-2); }
.pill--ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill--draft { background: var(--draft-soft); color: var(--draft-ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill--ok .dot { background: var(--ok); }
.tabs { display: flex; gap: var(--s1); font-size: var(--t-md); font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: var(--s3); overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: var(--r-pill); color: var(--ink); text-decoration: none; white-space: nowrap; }
.tabs a:hover { background: var(--sunk); }
.tabs a[aria-current='page'] { background: var(--ink); color: var(--paper); }
.tabs .count { margin-left: 6px; font-size: var(--t-xs); padding: 2px 8px; border-radius: var(--r-pill); background: var(--info-soft); color: var(--info-ink); }
.tabs a[aria-current='page'] .count { background: var(--paper); color: var(--ink); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: 700 var(--t-md)/1.2 var(--font); text-decoration: none; cursor: pointer; min-height: var(--tap); }
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn--strong { background: var(--ink); color: var(--paper); }
.btn--strong:hover { background: var(--ink-2); color: var(--paper); }
.btn--quiet { background: var(--surface); color: var(--ink); box-shadow: var(--ring-strong); font-weight: 600; }
.btn--quiet:hover { background: var(--sunk); color: var(--ink); }
.btn--small { padding: 9px 14px; font-size: var(--t-sm); min-height: 0; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-remove { all: unset; cursor: pointer; color: var(--bad); text-decoration: underline; font: 600 var(--t-sm) var(--font); }
.btn-remove:focus-visible { box-shadow: var(--focus); border-radius: 4px; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ── Cards, notices, tags ───────────────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--lift); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.card > h2 { margin-bottom: 2px; }
.card--narrow { max-width: 30rem; }
.card--dark { background: var(--ink); color: var(--paper); box-shadow: none; }
.card--dark .muted, .card--dark .small { color: #b9c6d8; }
.card--dark a { color: var(--draft); }
.card--sunk { background: var(--sunk); box-shadow: none; }
.notice { padding: 13px 16px; border-radius: var(--r-row); background: var(--ok-soft); color: var(--ok-ink); font-size: var(--t-md); display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice--error { background: var(--bad-soft); color: var(--bad-ink); }
.notice--warn { background: var(--draft-soft); color: var(--draft-ink); }
.notice--info { background: var(--info-soft); color: var(--info-ink); }
.notice form { margin: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-2); vertical-align: 0.1em; white-space: nowrap; }
.tag--live, .tag--publish, .tag--ok { background: var(--ok-soft); color: var(--ok-ink); }
.tag--rollback, .tag--back { background: var(--back-soft); color: var(--back-ink); }
.tag--access, .tag--new, .tag--info, .tag--buy, .tag--book, .tag--enquire, .tag--subscribe, .tag--download, .tag--login { background: var(--info-soft); color: var(--info-ink); }
.tag--review { background: var(--review-soft); color: var(--review-ink); }
.tag--owner, .tag--edit, .tag--draft, .tag--warn, .tag--support { background: var(--draft-soft); color: var(--draft-ink); }
.tag--bad, .tag--ended { background: var(--bad-soft); color: var(--bad-ink); }
.tag--strong { background: var(--draft); color: var(--ink); }
.dev { padding: 10px 14px; border-radius: var(--r-row); background: var(--draft-soft); color: var(--draft-ink); font-size: var(--t-sm); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
label { display: block; font-weight: 700; font-size: var(--t-md); margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border: 0; border-radius: var(--r-input); background: var(--surface); color: var(--ink); box-shadow: var(--ring-strong); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--ring-strong), var(--focus); }
input.mono, code.key { font-family: var(--mono); font-weight: 500; }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { min-height: 6rem; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { margin: 0; }
.field .help { font-size: var(--t-sm); color: var(--muted); }
.field--error input { box-shadow: 0 0 0 1px var(--bad); }
.field--error .help { color: var(--bad-ink); }
.fields { display: flex; flex-direction: column; gap: var(--s4); }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
label.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: var(--t-md); margin: 0; padding: 6px 0; cursor: pointer; }
label.choice input { width: auto; padding: 0; margin: 4px 0 0; box-shadow: none; accent-color: var(--ink); }
.choices { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.choice-card { display: block; padding: 14px 16px; border-radius: var(--r-row); background: var(--surface); box-shadow: var(--ring-strong); cursor: pointer; font-weight: 400; margin: 0; }
.choice-card:has(input:checked) { box-shadow: 0 0 0 2px var(--ink); }
.choice-card input { width: auto; padding: 0; margin: 0 8px 0 0; box-shadow: none; accent-color: var(--ink); vertical-align: -1px; }
.choice-card b { font-weight: 700; }
.choice-card span { display: block; color: var(--ink-2); font-size: var(--t-sm); margin-top: 4px; }
.switch { display: flex; gap: var(--s4); align-items: flex-start; }
.switch input { width: 44px; height: 26px; margin: 2px 0 0; padding: 0; appearance: none; border-radius: var(--r-pill); background: var(--line-strong); box-shadow: none; position: relative; cursor: pointer; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: left 0.15s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { left: 21px; }
.switch label { margin: 0; }
.switch .help { font-size: var(--t-sm); color: var(--ink-2); font-weight: 400; margin-top: 4px; }
form.row { display: flex; gap: var(--s3); align-items: end; flex-wrap: wrap; }
form.row label { width: 100%; }
form.row input { flex: 1; min-width: 14rem; }

/* ── Tables and lists ───────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th { text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--muted); padding: 0 var(--s3) var(--s2) 0; }
td { padding: 12px var(--s3) 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td:last-child, th:last-child { padding-right: 0; }
td form { margin: 0; }
td select, td input[type='date'] { width: auto; min-width: 9rem; padding: 9px 36px 9px 12px; font-size: var(--t-sm); }
td input[type='date'] { padding-right: 12px; }
tr.undone td { color: var(--muted); }
tr.undone .what, tr.undone strong:first-child { text-decoration: line-through; }
table.facts th { text-transform: none; letter-spacing: 0; font-size: var(--t-md); font-weight: 600; color: var(--ink); white-space: nowrap; width: 9rem; padding: 10px var(--s4) 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.facts td { vertical-align: top; padding: 10px 0; }
table.facts tr:first-child th, table.facts tr:first-child td { border-top: 0; }
dl.fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0; }
dl.fields dt { color: var(--muted); }
dl.fields dd { margin: 0; white-space: pre-wrap; }
.mail { padding: var(--s4) var(--s5); border-radius: var(--r-row); background: var(--surface); box-shadow: var(--ring); }
.mail--new { box-shadow: var(--ring), inset 4px 0 0 var(--info-ink); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s5); margin: 0; padding: var(--s4) var(--s5); list-style: none; background: var(--paper); color: var(--ink); border-radius: var(--r-row); font: 500 1.05rem/1.6 var(--mono); }

/* ── Your sites ─────────────────────────────────────────────────────────────── */
.hello { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
/* The magpie at its desk: drawn on the brand's cream, so it sits in a rounded card on either theme. */
.hello-art { width: 168px; height: auto; border-radius: 20px; flex: none; }
.hello h1 { font-size: var(--t-4xl); letter-spacing: var(--track-tight); line-height: 1; }
.hello p { font-size: var(--t-lg); color: var(--ink-2); margin-top: 6px; }
.site-main { display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--s6); }
.site-main .about { display: flex; flex-direction: column; gap: 14px; }
.site-main .about h2 { font-size: 28px; letter-spacing: var(--track-snug); }
.site-main .about .role { font-size: var(--t-sm); color: var(--muted); margin-top: -8px; }
.site-main .state { display: flex; flex-direction: column; gap: var(--s2); }
.site-main .state span { display: flex; gap: var(--s2); align-items: center; }
.site-main .state .dot { width: 8px; height: 8px; }
.state .dot--ok { background: var(--ok); }
.state .dot--draft { background: var(--draft); }
.state .dot--none { background: var(--line-strong); }
.site-main .actions { margin-top: auto; }
.waiting-for { display: flex; flex-direction: column; gap: var(--s2); }
.waiting-for h3 { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.wait { display: flex; align-items: center; gap: var(--s3); padding: 12px 16px; border-radius: var(--r-row); background: var(--sunk); text-decoration: none; color: var(--ink); font-size: var(--t-md); }
.wait span { flex: 1; }
.wait .go { font-weight: 700; white-space: nowrap; }
.wait--review { background: var(--review-soft); color: var(--review-ink); }
.wait--review .go { background: var(--ink); color: var(--paper); padding: 7px 14px; border-radius: var(--r-pill); }
.wait--info { background: var(--info-soft); color: var(--info-ink); }
.wait--bad { background: var(--bad-soft); color: var(--bad-ink); }
.wait:hover { filter: brightness(0.97); }
.sites-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.site-card h2 { font-size: 21px; }
.site-card .role { font-size: var(--t-sm); color: var(--muted); margin-top: -8px; }
.site-card .says { color: var(--ink-2); }

/* ── Sign-in and account ────────────────────────────────────────────────────── */
body.plain main.wrap { padding-top: var(--s8); }
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 0px); }
.split .promise { background: var(--wash); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s8); }
.split .promise h2 { font-size: 40px; font-weight: 800; letter-spacing: var(--track-tight); line-height: 1.05; }
.split .promise p { font-size: 1rem; color: var(--ink-2); }
.split .promise .help { font-size: var(--t-xs); color: var(--muted); }
.split .form { padding: 40px 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 34rem; }
.split .form h1 { font-size: var(--t-3xl); }
.split .form p { font-size: 1rem; color: var(--ink-2); }
.split .form .btn { font-size: 1rem; padding: 13px 20px; }
.centre { max-width: 26rem; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-top: var(--s6); }
.centre .glyph { width: 44px; height: 44px; border-radius: 50%; background: var(--draft-soft); color: var(--draft-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.centre h1 { font-size: var(--t-2xl); }
.centre .btn { font-size: 1rem; padding: 13px 20px; }
.centre .hint { padding: 12px 14px; border-radius: var(--r-row); background: var(--sunk); font-size: var(--t-sm); color: var(--ink-2); }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.account-grid .card--wide { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; gap: var(--s5); }
.account-grid .card--full { grid-column: 1 / -1; }
.or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--t-sm); margin: 0; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.instead summary { cursor: pointer; color: var(--ink-2); font-size: var(--t-sm); }
.instead[open] summary { margin-bottom: var(--s3); }
.card .title-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.codes-page { max-width: 30rem; }
.codes-page .btn { font-size: 1rem; }

/* ── Older pages still styled by these (redone in the next round) ──────────── */
.crumb { font-size: var(--t-sm); color: var(--muted); }
.waiting { font-size: var(--t-sm); color: var(--review-ink); }
.waiting--mail { color: var(--info-ink); }
.tm-strip { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s1) 0 var(--s2); }
.tm-version { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 5rem; padding: 8px; border-radius: 16px; background: var(--surface); box-shadow: var(--ring); text-decoration: none; color: var(--ink); font-size: var(--t-xs); line-height: 1.3; gap: 6px; }
.tm-version strong { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; min-width: 4.5rem; border-radius: 10px; background: var(--sunk); font-size: var(--t-xl); }
.tm-version span { color: var(--muted); }
.tm-version em { font-style: normal; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--ok-ink); }
.tm-version.is-current { box-shadow: 0 0 0 2px var(--ink); }
.tm-version.is-current strong { background: var(--ink); color: var(--paper); }
.tm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: var(--s2) 0; }
.tm-bar form { margin: 0; }
.tm-pages a { margin-right: 0.6rem; }
.tm-pages a.is-current { font-weight: 700; text-decoration: none; color: inherit; }
.tm-frame { width: 100%; height: 70vh; min-height: 24rem; border: 8px solid var(--ink); border-radius: 18px; background: #fff; }
.card--key { box-shadow: 0 0 0 2px var(--ok); }
code.key { font-size: 1rem; word-break: break-all; }

/* ── Phone ──────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .top { padding: var(--s3) var(--s4); }
  .brand .crumb, .brand .crumb-sep { display: none; }
  main.wrap { padding: var(--s2) var(--s4) var(--s8); gap: var(--s4); }
  h1 { font-size: var(--t-2xl); }
  .site-head h1 { font-size: 26px; }
  .site-head .back { display: block; }
  .site-head .row .btn { display: none; }
  .card { padding: var(--s5); border-radius: 18px; }
  .hello h1 { font-size: var(--t-3xl); }
  .site-main, .sites-grid, .account-grid, .fields-2, .split { grid-template-columns: 1fr; }
  .hello-art { width: 96px; border-radius: 14px; }
  .split { min-height: 0; }
  .split .promise { padding: var(--s6) var(--s4); gap: var(--s5); }
  .split .promise h2 { font-size: var(--t-2xl); }
  .split .form { padding: var(--s6) var(--s4); }
  .account-grid .card--wide { flex-direction: column; align-items: flex-start; }
  .actions .btn { flex: 1 1 auto; }
  .site-main .actions .btn:first-child { flex-basis: 100%; }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tr { padding: var(--s3) 0; border-top: 1px solid var(--line); }
  td { border: 0; padding: 4px 0; }
  .tm-frame { height: 60vh; }
}
@media print {
  .top, .btn, nav, form { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ── Per-site pages (round 2) ───────────────────────────────────────────────── */
.people-table td { vertical-align: middle; }
.avatar { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; background: var(--sunk); color: var(--ink-2); flex: none; }
.avatar--you { background: var(--accent); color: var(--accent-ink); }
.person { display: flex; gap: 12px; align-items: center; }
.person .who { display: flex; flex-direction: column; }
.person .who strong { font-size: var(--t-md); }
.person .who span { font-size: var(--t-xs); color: var(--muted); }
tr.ended td { color: var(--muted); }
tr.support-row { background: linear-gradient(90deg, var(--draft-soft), transparent 60%); }
.until-help { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 4px; }
.row-actions { display: flex; gap: var(--s3); align-items: center; }
.roles-explained { display: grid; gap: var(--s3); grid-template-columns: repeat(3, 1fr); }
.settings-grid { display: grid; grid-template-columns: 260px 1fr; gap: var(--s6); padding: var(--s5) 0; border-top: 1px solid var(--line); }
.settings-grid:first-of-type { border-top: 0; padding-top: 0; }
.settings-grid:last-of-type { padding-bottom: 0; }
.settings-grid h2 { font-size: var(--t-xl); }
.settings-grid .explain { font-size: var(--t-sm); color: var(--muted); margin-top: 6px; }
.settings-grid .controls { display: flex; flex-direction: column; gap: var(--s4); }
.save-row { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.save-row .muted { font-size: var(--t-sm); }
.tm-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); flex-wrap: wrap; }
.tm-head .muted { font-size: var(--t-sm); }
.tm-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(9rem, 1fr); gap: var(--s3); overflow-x: auto; padding: 2px 2px var(--s2); }
.tm-version { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 16px; background: var(--surface); box-shadow: var(--ring); text-decoration: none; color: var(--ink); min-width: 0; }
.tm-version .slot { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; border-radius: 10px; background: var(--sunk); font-size: var(--t-2xl); font-weight: 700; }
.tm-version .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 0 4px 2px; font-size: var(--t-xs); color: var(--muted); }
.tm-version .meta b { font-size: var(--t-sm); color: var(--ink); }
.tm-version.is-current { box-shadow: 0 0 0 2px var(--ink); }
.tm-version.is-current .slot { background: var(--ink); color: var(--paper); }
.tm-version.is-live { box-shadow: 0 0 0 2px var(--ok); }
.tm-version.is-live .slot { background: var(--ok-soft); color: var(--ok-ink); }
.tm-version.is-live.is-current { box-shadow: 0 0 0 2px var(--ink); }
.tm-frame-wrap { background: var(--ink); color: var(--paper); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.tm-frame-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 6px 10px 2px; font-size: var(--t-sm); }
.tm-frame-head a { color: var(--paper); }
.tm-frame-head form { display: flex; gap: 8px; align-items: center; margin: 0; }
.tm-frame-head select { width: auto; padding: 6px 32px 6px 12px; font-size: var(--t-sm); background-color: var(--sunk); color: var(--ink); border-radius: var(--r-pill); }
.tm-frame-head .btn { padding: 7px 14px; font-size: var(--t-sm); min-height: 0; }
.tm-frame { width: 100%; height: 70vh; min-height: 24rem; border: 0; border-radius: 12px; background: #fff; }
.tm-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.tm-foot p { font-size: var(--t-sm); color: var(--ink-2); max-width: 36rem; }
.history-grid { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s4); align-items: start; }
.versions-list { display: flex; flex-direction: column; }
.versions-list .v { display: grid; grid-template-columns: 2rem 1fr auto; gap: var(--s3); align-items: center; padding: 10px 8px; border-top: 1px solid var(--line); font-size: var(--t-sm); border-radius: 8px; }
.versions-list .v:first-child { border-top: 0; }
.versions-list .v.is-shown { background: var(--sunk); }
.versions-list .v b { font-size: var(--t-md); }
.timeline h3 { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: var(--s4) 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.timeline h3:first-child { margin-top: 0; }
.timeline .ev { display: grid; grid-template-columns: 4rem auto 1fr; gap: var(--s3); align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--t-md); }
.timeline .ev:first-of-type, .timeline h3 + .ev { border-top: 0; }
.timeline .ev time { color: var(--muted); font-size: var(--t-sm); }
.timeline .ev.undone .what { text-decoration: line-through; color: var(--muted); }
.timeline .ev .by-undo { display: block; font-size: var(--t-xs); color: var(--muted); text-decoration: none; }
.review-grid { display: grid; grid-template-columns: 1fr 300px; gap: var(--s5); align-items: start; }
.request { padding: var(--s5); border-radius: var(--r-card); background: var(--review-soft); color: var(--review-ink); display: flex; flex-direction: column; gap: 8px; }
.request .quote { font-size: var(--t-lg); }
.change { display: flex; flex-direction: column; gap: 8px; padding: var(--s4) 0; border-top: 1px solid var(--line); }
.change:first-child { border-top: 0; padding-top: 0; }
.change .head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.change .head .meta { font-size: var(--t-xs); color: var(--muted); }
.change .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.change .text { padding: 12px 14px; border-radius: var(--r-row); background: var(--sunk); line-height: 1.6; white-space: pre-wrap; }
.change .text del { background: var(--bad-soft); color: var(--bad-ink); text-decoration: line-through; padding: 1px 4px; border-radius: 4px; }
.change .text ins { background: var(--ok-soft); color: var(--ok-ink); text-decoration: none; font-weight: 700; padding: 1px 4px; border-radius: 4px; }
.change.held { box-shadow: 0 0 0 2px var(--draft); border-radius: var(--r-row); padding: var(--s4); }
.decide { display: flex; flex-direction: column; gap: var(--s4); }
.mail { display: flex; flex-direction: column; gap: 8px; }
.mail .head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; font-size: var(--t-sm); color: var(--muted); }
.mail .head a { font-weight: 600; }
.messages-grid { display: grid; grid-template-columns: 1fr 300px; gap: var(--s5); align-items: start; }
.messages-grid .list { display: flex; flex-direction: column; gap: var(--s3); }
.list-head { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bignum { font-size: var(--t-4xl); font-weight: 800; letter-spacing: var(--track-tight); line-height: 1; }
.subs { display: flex; flex-direction: column; }
.subs div { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.facts-rows { display: flex; flex-direction: column; gap: 10px; }
.facts-rows .fact { padding: 12px 16px; border-radius: var(--r-row); background: var(--sunk); font-size: var(--t-sm); }
.facts-rows .fact b { display: block; font-size: var(--t-md); }
.assist-intro { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: start; }
.assist-intro .lead { margin: 0; }
.keybox { display: grid; grid-template-columns: 10rem 1fr auto; gap: 10px var(--s3); align-items: center; }
.keybox code { display: block; padding: 10px 14px; border-radius: var(--r-input); background: rgb(255 255 255 / 0.08); color: inherit; word-break: break-all; }
.keybox .btn { min-height: 0; padding: 8px 14px; font-size: var(--t-sm); }
.how { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.how div { padding: 14px 16px; border-radius: var(--r-row); background: rgb(255 255 255 / 0.06); font-size: var(--t-sm); }
.how b { display: block; margin-bottom: 4px; }
.how code { font-size: var(--t-xs); word-break: break-all; }
.needs { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s5); border-radius: var(--r-card); flex-wrap: wrap; }
.needs--bad { background: var(--bad-soft); color: var(--bad-ink); }
.needs--ok { background: var(--ok-soft); color: var(--ok-ink); }
.needs h2 { font-size: var(--t-lg); }
.needs p { margin: 4px 0 0; }
.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); align-items: start; }
.ticks { display: flex; flex-direction: column; }
.ticks div { display: grid; grid-template-columns: 1.4rem 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); }
.ticks div:first-child { border-top: 0; }
.ticks .tick { color: var(--ok); font-weight: 700; }
.links-table td.state { white-space: nowrap; }
.links-table .since { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 4px; white-space: normal; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; padding: var(--s2) 0; }
details.more summary::-webkit-details-marker { display: none; }
.who-line { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
@media (max-width: 760px) {
  .settings-grid, .history-grid, .review-grid, .messages-grid, .assist-intro, .how, .record-grid, .roles-explained { grid-template-columns: 1fr; }
  .keybox { grid-template-columns: 1fr; }
  .tm-strip { grid-auto-columns: 8rem; }
  .people-table tr { display: block; padding: var(--s3) 0; border-top: 1px solid var(--line); }
  .people-table td { display: block; padding: 4px 0; border: 0; }
  .row-actions { flex-wrap: wrap; }
}
.tm-frame-head .btn--quiet { background: rgb(255 255 255 / 0.12); color: var(--paper); box-shadow: none; }
.tm-frame-head .btn--quiet:hover { background: rgb(255 255 255 / 0.2); color: var(--paper); }
.versions-list .v { text-decoration: none; color: inherit; }
.versions-list .v:hover { background: var(--sunk); }
.people-table { table-layout: fixed; }
.people-table th:nth-child(1), .people-table td:nth-child(1) { width: 32%; }
.people-table th:nth-child(2), .people-table td:nth-child(2) { width: 24%; }
.people-table th:nth-child(3), .people-table td:nth-child(3) { width: 24%; }
.people-table td select, .people-table td input[type='date'] { width: 100%; min-width: 0; }
.people-table .row-actions { white-space: nowrap; }
@media (max-width: 760px) { .people-table td:nth-child(n) { width: auto; } }
@media (max-width: 760px) {
  table.facts th { border-top: 1px solid var(--line); padding-bottom: 0; width: auto; }
  table.facts td { border-top: 0; padding-top: 4px; }
  table.facts tr:first-child th { border-top: 0; }
}
