/* ChartDeck auth pages (sign in, sign up, social / wallet sign-in). No inline styles anywhere (the pages run under a strict CSP). */
/* ---- TOKENS -------------------------------------------------------------------------------------------
   Every colour below comes from /brand/theme.css (--cd-* brand names, --a-* terminal names), which keys
   the palette on <html data-theme="light|dark"> (set pre-paint by /brand/theme.js). The page aliases
   resolve on :root, so a theme switch re-resolves them with no extra rules. Only tints theme.css has
   no token for live in the per-theme blocks further down (with their contrast notes). */
:root {
  --ink: var(--cd-bg);              /* page ground */
  --panel: var(--cd-surface);       /* cards */
  --raised: var(--cd-raised);
  --glass: var(--cd-glass);
  --ghost-hover: var(--cd-glass-2);
  --line: var(--cd-line);
  --line-2: var(--a-line-2);
  --text: var(--cd-text);           /* dark 16.9:1 on panel; light 18.5:1 on white */
  --dim: var(--cd-muted);           /* dark 6.2:1 on panel; light 5.9:1 on white */
  --primary: var(--cd-lilac);       /* links: dark 9.7:1; light #4C5BD4 5.6:1 */
  --primary-hover: var(--a-accent-hover);
  --holo: var(--cd-holo);           /* primary buttons: holo fill + DARK text on both themes */
  --holo-h: var(--cd-holo-h);
  --holo-text: var(--a-holo-h);     /* holo as TEXT / hairline: the light theme deepens the stops */
  --btn: var(--holo);
  --on-btn: var(--cd-on-holo);      /* >= 9.7:1 on every holo stop */
  --accent: var(--a-focus);         /* focus rings (non-text, >= 3:1 on both grounds) */
  --gain: var(--cd-gain);
  --warn: var(--cd-warn);
  --danger: var(--cd-loss);
  --danger-text: var(--a-down-soft);  /* loss text on a tinted alert: dark #FFA3B1 8.4:1, light #A8203F 6.4:1 */
  --danger-soft: var(--a-down-t1);
  --radius: 12px;
  --font: 'Sora', var(--a-script, system-ui), system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Sora', var(--a-script, system-ui), system-ui, -apple-system, 'Segoe UI', sans-serif;  /* numbers: Sora + tabular-nums */
}

/* Page-local tints, DARK (default). Values unchanged from the pre-theme dark look. */
:root, :root[data-theme="dark"] {
  --ink-2: #0B0E14;                          /* card gradient foot */
  --field: var(--cd-bg);                     /* inputs sit sunken in the card */
  --line-hover: #3D4760;
  --primary-soft: rgba(169, 184, 255, 0.14);
  --accent-soft: rgba(127, 255, 212, 0.18);  /* focus halo */
  --aqua-ink: var(--cd-aqua);                /* aqua as text / icon: #7FFFD4 15.5:1 */
  --gain-soft: rgba(61, 220, 151, 0.12);
  --gain-edge: rgba(61, 220, 151, 0.35);
  --danger-edge: rgba(255, 107, 129, 0.5);
  --danger-edge-soft: rgba(255, 107, 129, 0.4);
  --warn-soft: rgba(255, 217, 138, 0.14);
  --meter-good: #B8E68F;
  --alert-err-text: #FFC2C8;                 /* 10.8:1 on the tinted alert */
  --alert-ok-text: #B6F0D8;                  /* 11.7:1 */
  --placeholder: #7A8396;                    /* 5.2:1 on the field */
  --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --grid-opacity: 0.35;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: var(--a-fs-lg)/var(--a-lh-body) var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
:focus-visible { outline: var(--a-ring-w) solid var(--a-focus); outline-offset: var(--a-ring-off); }

/* Parked above the page, never far to one side: a right-to-left page would scroll there (regression 2026-10-04, S4). */
.skip { position: absolute; inset-inline-start: 16px; top: -200px; }
.skip:focus { top: 16px; background: var(--panel); padding: var(--a-sp-4) var(--a-sp-5); border-radius: var(--a-r-md); }

/* ---- SPLIT SCREEN (2026-10-04) ------------------------------------------------------------------------
   >= 1024 px: the visual (.auth-visual, /auth/auth-scene.css + .js) on the inline-start ~54 %, full bleed (edge to edge, full height);
   the form in a narrow centred column beside it. Below 1024 px: the visual is a short banner above the form.
   RTL mirrors by itself (grid + logical properties). */
.auth {
  height: 100vh; height: 100dvh; min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
  box-sizing: border-box;
}
/* Full bleed (operator 2026-10-04): the visual fills its half edge to edge, full height; one hairline to the form. */
.auth > .auth-visual { min-height: 0; border: 0; border-radius: 0; border-inline-end: 1px solid var(--a-line-1); }
/* the form column scrolls on its own (a long sign-up sheet); the visual stays put. Centred while it fits
   (the auto margins), top-aligned once it does not, so nothing is ever cut off above. */
.shell {
  min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: var(--a-sp-8) var(--a-sp-6);
  gap: var(--a-sp-7);
}
.shell > :first-child { margin-top: auto; }
.shell > :last-child { margin-bottom: auto; }
.shell > * { width: 100%; max-width: 400px; }

/* The form column waits for its language and its buttons (auth.js adds body.is-ready once the dictionary, the
   provider buttons and the plan sheet are in, capped): it appears once, translated, with nothing moving after.
   The visual panel paints at once. Without JavaScript the column shows after 2.5 s anyway. */
body:not(.is-ready) .shell, body:not(.is-ready) .auth-visual .cdv-copy { visibility: hidden; animation: auth-reveal 0s linear 2.5s forwards; }
@keyframes auth-reveal { to { visibility: visible; } }

.brand { display: inline-flex; align-items: center; gap: var(--a-sp-4); color: var(--text); font-weight: var(--a-fw-semibold); font-size: var(--a-fs-xl); letter-spacing: -0.01em; }
.brand > span { background: var(--holo-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.brand .badge { -webkit-text-fill-color: currentColor; margin-left: var(--a-sp-2); }
.brand:hover { text-decoration: none; }
.brand svg, .brand img { width: 32px; height: 32px; flex: none; display: block; }
/* The mark for the theme (sweep 2026-10-19 S6): the pastel mark all but vanishes on light, so the light theme shows the tile. */
.brand .lg-mark-l { display: none; border-radius: var(--a-r-md); }
:root[data-theme="light"] .brand .lg-mark-d { display: none; }
:root[data-theme="light"] .brand .lg-mark-l { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) .brand .lg-mark-d { display: none; }
  :root:not([data-theme="dark"]):not([data-theme="light"]) .brand .lg-mark-l { display: block; }
}

/* The form sits straight on the page: no card frame, one calm column. */
.card { width: 100%; max-width: 400px; position: relative; }
.card.wide { max-width: 640px; }

h1 { font-size: var(--a-fs-3xl); line-height: var(--a-lh-tight); margin: 0 0 var(--a-sp-7); letter-spacing: -0.02em; font-weight: var(--a-fw-semibold); }
h1 + .sub { margin-top: calc(-1 * var(--a-sp-5)); }
h2 { font-size: var(--a-fs-lg); margin: 0 0 var(--a-sp-5); }
.sub { color: var(--dim); margin: 0 0 var(--a-sp-7); }

form { display: grid; gap: var(--a-sp-6); }
.field { display: grid; gap: var(--a-sp-2); }
label { font-size: var(--a-fs-md); font-weight: var(--a-fw-semibold); color: var(--text); }
.hint { font-size: var(--a-fs-sm); color: var(--dim); }
.optional { color: var(--dim); font-weight: var(--a-fw-regular); }

input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%;
  height: 44px;
  padding: 0 var(--a-sp-6);
  background: var(--field);
  border: 1px solid var(--line-2);
  border-radius: var(--a-r-md);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--placeholder); }
input:hover, select:hover { border-color: var(--line-hover); }
input:focus, select:focus { outline: var(--a-ring-w) solid var(--a-focus); border-color: var(--accent); outline-offset: -1px; }
input[aria-invalid="true"] { border-color: var(--danger); }

.pw { position: relative; }
.pw input { padding-inline-end: 64px; }
.pw-toggle {
  position: absolute; inset-inline-end: 6px; top: 6px; height: 32px; padding: 0 var(--a-sp-5);
  background: transparent; border: 0; border-radius: var(--a-r-md); color: var(--dim); font: var(--a-fw-semibold) var(--a-fs-sm) var(--font); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--line); }

.row { display: flex; align-items: center; justify-content: space-between; gap: var(--a-sp-5); flex-wrap: wrap; }
.check { display: inline-flex; align-items: flex-start; gap: var(--a-sp-5); font-size: var(--a-fs-md); font-weight: var(--a-fw-regular); color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: var(--a-sp-1) 0 0; accent-color: var(--primary); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--a-sp-4);
  height: 46px; padding: 0 var(--a-sp-7); width: 100%;
  background: var(--btn); color: var(--on-btn);
  border: 0; border-radius: var(--a-r-md);
  font: var(--a-fw-semibold) var(--a-fs-lg) var(--font); cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.btn:hover { background: var(--btn); color: var(--on-btn); text-decoration: none; filter: brightness(1.07) saturate(1.05); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.ghost { background: var(--glass); color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--ghost-hover); color: var(--text); border-color: var(--dim); filter: none; }
.btn.danger { background: transparent; color: var(--danger-text); border: 1px solid var(--danger-edge); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger-text); filter: none; }
.btn.small { height: 34px; width: auto; padding: 0 var(--a-sp-5); font-size: var(--a-fs-md); }

.alert { border-radius: var(--a-r-md); padding: var(--a-sp-5) var(--a-sp-6); font-size: var(--a-fs-md); border: 1px solid; }
.alert[hidden] { display: none; }
.alert.error { background: var(--danger-soft); border-color: var(--danger-edge-soft); color: var(--alert-err-text); }
.alert.ok { background: var(--gain-soft); border-color: var(--gain-edge); color: var(--alert-ok-text); }
.alert .link-btn { background: none; border: 0; padding: 0; color: var(--primary-hover); font: inherit; text-decoration: underline; cursor: pointer; }

.meter { height: 4px; background: var(--line); border-radius: var(--a-r-sm); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width 0.2s, background 0.2s; }
.meter span.s1 { width: 25%; }
.meter span.s2 { width: 50%; background: var(--warn); }
.meter span.s3 { width: 75%; background: var(--meter-good); }
.meter span.s4 { width: 100%; background: var(--gain); }

.foot { text-align: center; color: var(--dim); font-size: var(--a-fs-md); margin: var(--a-sp-6) 0 0; }
.legal { text-align: center; color: var(--dim); font-size: var(--a-fs-sm); max-width: 400px; margin: 0; }
/* "No account? Sign up" / "Already have an account? Sign in" under the form */
.switch { text-align: center; color: var(--dim); font-size: var(--a-fs-md); margin: var(--a-sp-7) 0 0; }
.switch a { font-weight: var(--a-fw-semibold); }

.done { text-align: center; }
.done .icon { width: 56px; height: 56px; margin: 0 auto var(--a-sp-6); border-radius: var(--a-r-lg); display: grid; place-items: center; background: var(--primary-soft); color: var(--aqua-ink); }
.done .icon svg { width: 28px; height: 28px; }
/* sweep 2026-10-19 S25: the expired 2FA step uses the warn tone, not the success accent */
#step-expired .icon { background: var(--warn-soft); color: var(--warn); }

/* account page */
.topbar { width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--a-sp-4) var(--a-sp-7); margin: 0 0 var(--a-sp-4); }
.kv dt { color: var(--dim); font-size: var(--a-fs-md); }
.kv dd { margin: 0; font-weight: var(--a-fw-semibold); word-break: break-all; }
.badge { display: inline-block; padding: var(--a-sp-1) var(--a-sp-4); border-radius: var(--a-r-pill); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); text-transform: uppercase; letter-spacing: 0.04em; background: var(--line); color: var(--text); }
.badge.pro { background: var(--primary-soft); color: var(--primary-hover); }
.badge.elite { background: var(--holo); color: var(--on-btn); }
.badge.admin { background: var(--warn-soft); color: var(--warn); }
.section + .section { border-top: 1px solid var(--line); margin-top: var(--a-sp-7); padding-top: var(--a-sp-7); }
.actions { display: flex; gap: var(--a-sp-5); flex-wrap: wrap; }
.actions .btn { width: auto; }

/* Below 1024 px: one column, the visual a short banner above the form. */
@media (max-width: 1023px) {
  .auth { display: flex; flex-direction: column; gap: 0; padding: var(--a-sp-5); height: auto; min-height: 100vh; }
  .auth > .auth-visual { height: 132px; flex: none; border: 1px solid var(--a-line-1); border-radius: var(--a-r-lg); }
  .shell { overflow: visible; padding: var(--a-sp-7) var(--a-sp-2) var(--a-sp-6); }
  .shell > :first-child { margin-top: 0; }
  h1 { font-size: var(--a-fs-2xl); margin-bottom: var(--a-sp-6); }
}
@media (max-width: 480px) {
  .kv { grid-template-columns: 1fr; gap: var(--a-sp-1) 0; }
  .kv dd { margin-bottom: var(--a-sp-4); }
  /* a small logo that goes home (review 0.9.53: the phone page had no way back to the home page); the banner below keeps the name big */
  .shell > .brand { font-size: var(--a-fs-md); margin-bottom: var(--a-sp-4); }
  .shell > .brand img, .shell > .brand svg { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ---- Page-local tints, LIGHT. /brand/theme.js sets <html data-theme>; the media block is the no-JS case. ---- */
:root[data-theme="light"] {
  --ink-2: #FFFFFF; --field: #FFFFFF; --line-hover: #AEB6C6;
  --primary-soft: rgba(76, 91, 212, 0.10); --accent-soft: rgba(15, 163, 127, 0.18);
  --aqua-ink: #07765A;                     /* deeper aqua for text / icons: 5.6:1 on white, 4.9:1 on its tint (#0B9A76 is 3.6) */
  --gain-soft: rgba(8, 135, 90, 0.08); --gain-edge: rgba(8, 135, 90, 0.30);
  --danger-edge: rgba(212, 47, 82, 0.45); --danger-edge-soft: rgba(212, 47, 82, 0.35);
  --warn-soft: rgba(154, 101, 8, 0.10); --meter-good: #4E8A1F;
  --alert-err-text: #8F1C35;               /* 7.9:1 on the tinted alert */
  --alert-ok-text: #05603F;                /* 6.9:1 */
  --placeholder: #6B7488;                  /* 4.7:1 on white */
  --card-shadow: 0 24px 60px rgba(14, 19, 32, 0.08), 0 2px 6px rgba(14, 19, 32, 0.04);
  --grid-opacity: 0.9;
  --holo-text: linear-gradient(90deg, #07765A 0%, #4C5BD4 35%, #C8467F 65%, #9A6508 88%, #0A7FA8 100%);   /* deep holo stops for the wordmark on white (each stop >= 4.5:1) */
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --ink-2: #FFFFFF; --field: #FFFFFF; --line-hover: #AEB6C6;
    --primary-soft: rgba(76, 91, 212, 0.10); --accent-soft: rgba(15, 163, 127, 0.18);
    --aqua-ink: #07765A;                     /* deeper aqua for text / icons: 5.6:1 on white, 4.9:1 on its tint (#0B9A76 is 3.6) */
    --gain-soft: rgba(8, 135, 90, 0.08); --gain-edge: rgba(8, 135, 90, 0.30);
    --danger-edge: rgba(212, 47, 82, 0.45); --danger-edge-soft: rgba(212, 47, 82, 0.35);
    --warn-soft: rgba(154, 101, 8, 0.10); --meter-good: #4E8A1F;
    --alert-err-text: #8F1C35;               /* 7.9:1 on the tinted alert */
    --alert-ok-text: #05603F;                /* 6.9:1 */
    --placeholder: #6B7488;                  /* 4.7:1 on white */
    --card-shadow: 0 24px 60px rgba(14, 19, 32, 0.08), 0 2px 6px rgba(14, 19, 32, 0.04);
    --grid-opacity: 0.9;
    --holo-text: linear-gradient(90deg, #07765A 0%, #4C5BD4 35%, #C8467F 65%, #9A6508 88%, #0A7FA8 100%);
  }
}

/* ---- social + wallet sign-in ------------------------------------------------------------------------
   Brand colours follow each provider's button guidelines and switch with the theme:
   Google: dark #131314 / #8E918F edge / #E3E3E3 text; light #FFFFFF / #747775 edge / #1F1F1F text.
   Apple: white button on dark pages, black on light. Discord: blurple #5865F2 (white text 4.6:1). X: black. */
:root, :root[data-theme="dark"] {
  --g-bg: #131314; --g-edge: #8E918F; --g-text: #E3E3E3;
  --apple-bg: #FFFFFF; --apple-text: #000000; --apple-edge: #FFFFFF;
  --x-bg: #000000; --x-edge: #2F3336; --x-hover: #16181C; --x-text: #FFFFFF;
  --discord-bg: #5865F2; --discord-hover: #4752C4; --discord-text: #FFFFFF;
}
:root[data-theme="light"] {
  --g-bg: #FFFFFF; --g-edge: #747775; --g-text: #1F1F1F;
  --apple-bg: #000000; --apple-text: #FFFFFF; --apple-edge: #000000;
  --x-bg: #000000; --x-edge: #000000; --x-hover: #272C33;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --g-bg: #FFFFFF; --g-edge: #747775; --g-text: #1F1F1F;
    --apple-bg: #000000; --apple-text: #FFFFFF; --apple-edge: #000000;
    --x-bg: #000000; --x-edge: #000000; --x-hover: #272C33;
  }
}

.social { display: block; margin: 0; }
.social-list { display: block; }
.social-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--a-sp-5);
  height: 44px; padding: 0 var(--a-sp-6); min-width: 0;
  border-radius: var(--a-r-md); border: 1px solid var(--line-2);
  background: var(--glass); color: var(--text);
  font: var(--a-fw-semibold) var(--a-fs-md) var(--font); cursor: pointer; text-decoration: none;
  transition: filter 0.15s, border-color 0.15s, background 0.15s;
}
.social-btn.full { grid-column: 1 / -1; }
.social-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.social-btn svg { width: 18px; height: 18px; flex: none; display: block; }
.social-btn:hover { text-decoration: none; color: var(--text); border-color: var(--line-hover); background: var(--ghost-hover); }
.social-google { background: var(--g-bg); border-color: var(--g-edge); color: var(--g-text); }
.social-google:hover { background: var(--g-bg); color: var(--g-text); border-color: var(--g-edge); filter: brightness(1.08); }
:root[data-theme="light"] .social-google:hover { filter: brightness(0.97); }
.social-apple { background: var(--apple-bg); border-color: var(--apple-edge); color: var(--apple-text); }
.social-apple:hover { background: var(--apple-bg); border-color: var(--apple-edge); color: var(--apple-text); filter: brightness(0.92); }
.social-discord { background: var(--discord-bg); border-color: var(--discord-bg); color: var(--discord-text); }
.social-discord:hover { background: var(--discord-hover); border-color: var(--discord-hover); color: var(--discord-text); }
.social-x { background: var(--x-bg); border-color: var(--x-edge); color: var(--x-text); }
.social-x:hover { background: var(--x-hover); border-color: var(--x-edge); color: var(--x-text); }
.social-x svg { width: 16px; height: 16px; }

.divider { display: flex; align-items: center; gap: var(--a-sp-5); margin: var(--a-sp-6) 0; color: var(--dim); font-size: var(--a-fs-sm); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.wallet-chooser { border: 1px solid var(--line-2); border-radius: var(--a-r-lg); padding: var(--a-sp-5); background: var(--raised); display: grid; gap: var(--a-sp-4); }
.wallet-title { font-size: var(--a-fs-md); font-weight: var(--a-fw-semibold); }
.wallet-list { display: grid; gap: var(--a-sp-4); }
.wallet-opt {
  display: flex; align-items: center; gap: var(--a-sp-5); width: 100%; height: 48px; padding: 0 var(--a-sp-5);
  border: 1px solid var(--line-2); border-radius: var(--a-r-md); background: var(--glass); color: var(--text);
  font: var(--a-fw-semibold) var(--a-fs-md) var(--font); cursor: pointer; text-align: left;
}
.wallet-opt:hover { border-color: var(--line-hover); background: var(--ghost-hover); }
.wallet-opt[disabled] { opacity: 0.6; cursor: progress; }
.wallet-opt svg { width: 26px; height: 26px; flex: none; }
.wallet-name { flex: 1; }
.wallet-tag { font-size: var(--a-fs-xs); font-weight: var(--a-fw-semibold); color: var(--dim); }
.wallet-tag.on { color: var(--gain); }
.wallet-chooser .hint { margin: 0; }
.wallet-chooser .hint:empty { display: none; }
.link-plain { background: none; border: 0; padding: var(--a-sp-2) var(--a-sp-4); color: var(--primary); font: var(--a-fw-semibold) var(--a-fs-md) var(--font); cursor: pointer; border-radius: var(--a-r-md); }
.link-plain:hover { color: var(--primary-hover); text-decoration: underline; }

@media (max-width: 360px) {
  .social-list { grid-template-columns: 1fr; }
}
.card .alert:not([hidden]) { margin-bottom: var(--a-sp-5); }

/* Security check (Cloudflare Turnstile, managed widget, size flexible = the form's width). Rendered
   only when the server has Turnstile keys; the box reserves the widget's height so the button does
   not jump when it appears. */
.cd-ts { min-height: 65px; margin: var(--a-sp-1) 0 var(--a-sp-5); width: 100%; }
.cd-ts[hidden] { display: none; }
.cd-ts.cd-ts-fail { min-height: 0; display: flex; align-items: center; gap: var(--a-sp-5); padding: var(--a-sp-4) var(--a-sp-6); border-radius: var(--a-r-md);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-left-width: 3px;
  background: color-mix(in srgb, var(--danger) 9%, transparent); font-size: var(--a-fs-md); line-height: var(--a-lh-body); color: var(--text); }
.cd-ts.cd-ts-fail > span { flex: 1 1 auto; min-width: 0; }
.cd-ts .cd-ts-retry { flex: none; height: 32px; padding: 0 var(--a-sp-6); border-radius: var(--a-r-md); border: 1px solid var(--line-2); background: var(--glass);
  color: var(--text); font: var(--a-fw-semibold) var(--a-fs-md)/1 var(--font); cursor: pointer; }
.cd-ts .cd-ts-retry:hover { background: var(--ghost-hover); border-color: var(--dim); }
.cd-ts .cd-ts-retry:focus-visible { outline: var(--a-ring-w) solid var(--a-focus); outline-offset: var(--a-ring-off); }
.btn[disabled]:not([data-busy]) { cursor: not-allowed; }

/* The language picker is in the site footer under the page (/brand/site-footer.css, src/web/site-footer.ts). */

/* ---- two-step verification + "keep your account" (2026-10-01) ---- */
.code-input { font: var(--a-fw-semibold) var(--a-fs-xl)/var(--a-lh-tight) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .28em; text-align: center; font-variant-numeric: tabular-nums; }
#rcode.code-input { font-size: var(--a-fs-lg); letter-spacing: .12em; }
.actions.stack { flex-direction: column; margin: var(--a-sp-6) 0 var(--a-sp-5); }
.actions.stack .btn { width: 100%; }
body[data-page="twofa"] .check, body[data-page="restore"] .check { margin: var(--a-sp-2) 0 var(--a-sp-6); }
body[data-page="twofa"] .foot { margin-top: var(--a-sp-4); }
body[data-page="twofa"] .foot + .foot { margin-top: var(--a-sp-1); }

/* ---- sign-in methods (/auth/auth-methods.js; the terminal dialog styles the same classes in cd-guest.css) ----
   Google's button follows its branding rules (theme-matched fill and edge, the four-colour G at 20 px, "Sign in with
   Google"); every other method is a quiet glass row with its own mark. The method used last carries a small holo
   "Last used" tag on its top edge. */
/* two buttons a row; an odd last one takes the whole row (operator 2026-10-16) */
.am-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a-sp-4); }
.am-list > .am-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.am-more { margin-top: var(--a-sp-4); }
.am-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-btn > .am-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.am-btn {
  position: relative; display: flex; justify-content: center; align-items: center; gap: var(--a-sp-4);
  width: 100%; height: 44px; padding: 0 var(--a-sp-5);
  border: 1px solid var(--line-2); border-radius: var(--a-r-md); background: var(--glass); color: var(--text);
  font: var(--a-fw-medium) var(--a-fs-md)/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.am-btn:hover { text-decoration: none; color: var(--text); border-color: var(--line-hover); background: var(--ghost-hover); }
.am-ico, .am-ico svg { width: 20px; height: 20px; display: block; }
.am-label { grid-column: 2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-btn.am-google { background: var(--g-bg); border-color: var(--g-edge); color: var(--g-text); }
.am-btn.am-google:hover { background: var(--g-bg); border-color: var(--g-edge); color: var(--g-text); filter: brightness(1.08); }
:root[data-theme="light"] .am-btn.am-google:hover { filter: brightness(0.97); }
.am-btn.am-apple { background: var(--apple-bg); border-color: var(--apple-edge); color: var(--apple-text); }
.am-tag {
  position: absolute; top: calc(-1 * var(--a-sp-4)); inset-inline-end: var(--a-sp-5);
  padding: var(--a-sp-1) var(--a-sp-4); border-radius: var(--a-r-pill); background: var(--holo); color: var(--on-btn);
  font: var(--a-fw-semibold) var(--a-fs-2xs)/var(--a-lh-2xs) var(--font); letter-spacing: .02em; white-space: nowrap; pointer-events: none;
}
.am-tag.am-tag-inline { position: static; }
.am-toggle {
  display: flex; align-items: center; justify-content: center; gap: var(--a-sp-4); width: 100%; margin: var(--a-sp-5) 0 0; padding: var(--a-sp-2);
  background: none; border: 0; border-radius: var(--a-r-md); color: var(--primary); font: var(--a-fw-semibold) var(--a-fs-md)/var(--a-lh-md) var(--font); cursor: pointer;
}
.am-toggle::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.am-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.am-toggle:hover { color: var(--primary-hover); }
.wallet-chooser { margin-top: var(--a-sp-5); }
body[data-page="twofa"] #step-code > .done .icon { margin-inline-start: 0; }

/* ---- sign-up in three steps (/auth/signup-steps.js, 2026-10-06) ---------------------------------------------
   One form, a <fieldset data-su-step> per step. Without JavaScript the steps stack (no bar, no Back / Continue, no
   summary); with it one step shows at a time under a "Step 1 of 3" bar whose visited segments are links. Each step
   fits a 900 px tall window. Tokens only; logical properties (RTL mirrors by itself). */
.su-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body[data-page="signup"] h1 { margin-bottom: var(--a-sp-5); }

.su-progress { margin: 0 0 var(--a-sp-5); }
.su-count { margin: 0 0 var(--a-sp-4); font-size: var(--a-fs-sm); font-weight: var(--a-fw-semibold); color: var(--dim); letter-spacing: .02em; }
.su-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--a-sp-4); }
.su-dots > li { flex: 1 1 0; min-width: 0; }
.su-dot {
  display: grid; gap: var(--a-sp-2); width: 100%; padding: 0 0 var(--a-sp-1); margin: 0;
  background: none; border: 0; border-radius: var(--a-r-sm); color: var(--dim); text-align: start;
  font: var(--a-fw-medium) var(--a-fs-sm)/var(--a-lh-body) var(--font); cursor: default;
}
.su-bar { display: block; height: 4px; border-radius: var(--a-r-pill); background: var(--line-2); transition: background .2s; }
.su-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-dots > li.is-on .su-bar { background: var(--holo); }
.su-dots > li.is-on .su-dot { color: var(--text); font-weight: var(--a-fw-semibold); }
.su-dots > li.is-done .su-bar { background: var(--primary); }
.su-dots > li.is-done .su-dot { color: var(--primary); cursor: pointer; }
.su-dots > li.is-done .su-dot:hover .su-name { text-decoration: underline; }
.su-dot:disabled { opacity: 1; }
.su-dot:focus-visible { outline: var(--a-ring-w) solid var(--a-focus); outline-offset: var(--a-ring-off); }

/* the steps: plain fieldsets (the legend holds the step's heading) */
.su-step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--a-sp-5); }
.su-step + .su-step { margin-top: var(--a-sp-7); }               /* stacked (no JavaScript) */
form.is-stepped .su-step + .su-step { margin-top: 0; }
.su-legend { padding: 0; margin: 0 0 var(--a-sp-1); float: left; width: 100%; }   /* float: the legend joins the grid flow */
.su-legend + * { clear: both; }
.su-co-lead { margin: 0 0 var(--a-sp-5); }   /* the Account step's "straight to checkout for ..." line (G-U 2026-10-19) */
.su-title { margin: 0; font-size: var(--a-fs-xl); line-height: var(--a-lh-tight); font-weight: var(--a-fw-semibold); letter-spacing: -0.01em; }
.su-title:focus { outline: none; }
.su-title:focus-visible { outline: var(--a-ring-w) solid var(--a-focus); outline-offset: var(--a-ring-off); border-radius: var(--a-r-sm); }
.su-fields { display: grid; gap: var(--a-sp-5); }
.su-step .social, .su-step .divider { margin: 0; }
.su-step .meter { margin-top: var(--a-sp-1); }
.su-step #pw-hint { margin: var(--a-sp-1) 0 0; }
.su-step .field:has(#password-err:not([hidden])) #pw-hint { display: none; }   /* the error says the same, louder */

.su-nav { display: flex; gap: var(--a-sp-5); margin-top: var(--a-sp-2); }
.su-nav .btn { flex: 1 1 auto; }
.su-nav .su-back { flex: 0 0 auto; width: auto; min-width: 104px; }

/* inline messages under a field */
.su-err { margin: 0; font-size: var(--a-fs-sm); line-height: var(--a-lh-body); color: var(--danger-text); display: flex; gap: var(--a-sp-2); align-items: baseline; }
.su-err::before { content: '!'; flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: var(--ink);
  font: var(--a-fw-semibold) var(--a-fs-2xs)/1 var(--font); transform: translateY(2px); }
input[type="checkbox"][aria-invalid="true"] { outline: var(--a-ring-w) solid var(--danger); outline-offset: 2px; }

/* step 3: what was chosen */
.su-sum { margin: 0; padding: var(--a-sp-2) var(--a-sp-6); border: 1px solid var(--line-2); border-radius: var(--a-r-md); background: var(--glass); display: grid; }
.su-row { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: var(--a-sp-5); align-items: center; padding: var(--a-sp-4) 0; }
.su-row + .su-row { border-top: 1px solid var(--line); }
.su-row[hidden] { display: none; }
.su-row dt { font-size: var(--a-fs-sm); color: var(--dim); }
.su-row dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--a-sp-4); min-width: 0; }
.su-val { font-size: var(--a-fs-md); font-weight: var(--a-fw-semibold); color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.su-edit { flex: none; background: none; border: 0; padding: var(--a-sp-2) var(--a-sp-4); margin-inline-end: calc(-1 * var(--a-sp-4)); border-radius: var(--a-r-md);
  color: var(--primary); font: var(--a-fw-semibold) var(--a-fs-sm)/1 var(--font); cursor: pointer; }
.su-edit:hover { color: var(--primary-hover); text-decoration: underline; }
.su-edit:focus-visible { outline: var(--a-ring-w) solid var(--a-focus); outline-offset: 0; }
.su-step .check + .su-err { margin-top: calc(-1 * var(--a-sp-4)); }
.su-step .cd-ts { margin: 0; }

/* the social-sign-up legal line belongs to the Account step */
body[data-su-step="plan"] .legal, body[data-su-step="confirm"] .legal { display: none; }
/* ... and not to the "Check your email" screen (sweep 2026-10-19 S24) */
body[data-su-done] .legal { display: none; }
form.is-stepped ~ .switch { margin-top: var(--a-sp-6); }

/* a calm entrance, never with reduced motion */
.su-step.su-enter { animation: su-in .18s ease-out; }
@keyframes su-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .su-step.su-enter { animation: none; }
  .su-bar { transition: none; }
}

/* desktop: the column starts at a steady height, so the heading and the bar do not jump between steps */
@media (min-width: 1024px) {
  body[data-page="signup"] .shell { gap: var(--a-sp-5); padding-top: var(--a-sp-6); padding-bottom: var(--a-sp-6); }
  body[data-page="signup"] .shell > :first-child { margin-top: clamp(0px, calc((100dvh - 900px) / 2), 120px); }
}
@media (max-width: 1023px) {
  .su-title { font-size: var(--a-fs-lg); }
}
/* High contrast: the bar's segments are solid lines, not tints */
:root[data-contrast="high"] .su-bar { background: var(--a-fg-3); }
:root[data-contrast="high"] .su-dots > li.is-on .su-bar { background: var(--a-fg-1); }
:root[data-contrast="high"] .su-dots > li.is-done .su-bar { background: var(--a-accent); }
:root[data-contrast="high"] .su-sum { border-color: var(--a-fg-3); }
