/* Landing and results pages.
   One look for the site and both apps (DECISIONS 10, 11): an editorial style — a serif
   display face for headings and big numbers, ink-coloured pill buttons, hairline borders,
   soft glows — with colour kept for data. The values are copied, not imported: the side
   app (side-profile/styles.css) and the front app (src/styles/global.css) keep their own
   copies, so a visual change goes into all three. Light is the default; dark applies via
   the OS setting or the theme toggle, shared through localStorage['rr-theme']. */

/* ─── FONTS ─────────────────────────────────────────────────────────────── */

/* Instrument Serif (SIL Open Font License, fonts/OFL.txt), served from this site. */
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
}

/* ─── TOKENS ────────────────────────────────────────────────────────────── */

:root {
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --bg: #f3f5f5;
  --surface: #ffffff;
  --surface-2: #f1f4f5;
  --surface-3: #e6eaec;
  --border: #e1e6e8;
  --border-strong: #c9d0d4;
  --text: #0d1011;
  --text-2: #464e54;
  --text-3: #626a71;
  /* Ink: primary buttons, the logo, the selected option. Colour is kept for data. */
  --ink: #0f1214;
  --ink-hover: #2a3035;
  --on-ink: #ffffff;
  --accent: #2f5bea;
  --accent-hover: #2449c9;
  --accent-soft: #e9eefd;
  --accent-text: #2449c9;
  --on-accent: #ffffff;
  --danger: #c93434;
  --accent-2: #7c4dff;
  --accent-3: #12b5d9;
  --glow-1: #c3eff6;
  --glow-2: #e0dafc;
  --glass: color-mix(in srgb, var(--surface) 74%, transparent);
  --panel-dark: #0c0e10;

  --good: #0ca30c;
  --fair: #fab219;
  --weak: #ec835a;
  --poor: #d03b3b;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.05);
  --shadow: 0 1px 2px rgba(15, 20, 25, 0.04), 0 12px 32px -14px rgba(15, 20, 25, 0.16);
  --shadow-lg: 0 28px 64px -24px rgba(15, 20, 25, 0.28);
  --shadow-float: 0 1px 2px rgba(15, 20, 25, 0.04), 0 36px 80px -32px rgba(15, 20, 25, 0.32);
  --focus: 0 0 0 3px rgba(47, 91, 234, 0.32);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.3);

  /* Each app's colour, used for its ring and art on the site pages. A colour names the
     app, not a grade: the two scales are not calibrated against each other. */
  --front: var(--accent);
  --side: var(--accent-2);

  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b0c;
    --surface: #121416;
    --surface-2: #181b1e;
    --surface-3: #22262a;
    --border: #23272b;
    --border-strong: #363c42;
    --text: #f1f3f4;
    --text-2: #adb4ba;
    --text-3: #858d95;
    --ink: #f1f3f4;
    --ink-hover: #ffffff;
    --on-ink: #0a0b0c;
    --accent: #7b97ff;
    --accent-hover: #9cb1ff;
    --accent-soft: rgba(123, 151, 255, 0.14);
    --accent-text: #a8baff;
    --on-accent: #0a0b0c;
    --danger: #ff6b6b;
    --accent-2: #a98bff;
    --accent-3: #4fd6f2;
    --glow-1: rgba(79, 214, 242, 0.13);
    --glow-2: rgba(169, 139, 255, 0.15);
    --panel-dark: #08090a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 28px 64px -24px rgba(0, 0, 0, 0.75);
    --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.5), 0 36px 80px -32px rgba(0, 0, 0, 0.8);
    --focus: 0 0 0 3px rgba(123, 151, 255, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0b0c;
  --surface: #121416;
  --surface-2: #181b1e;
  --surface-3: #22262a;
  --border: #23272b;
  --border-strong: #363c42;
  --text: #f1f3f4;
  --text-2: #adb4ba;
  --text-3: #858d95;
  --ink: #f1f3f4;
  --ink-hover: #ffffff;
  --on-ink: #0a0b0c;
  --accent: #7b97ff;
  --accent-hover: #9cb1ff;
  --accent-soft: rgba(123, 151, 255, 0.14);
  --accent-text: #a8baff;
  --on-accent: #0a0b0c;
  --danger: #ff6b6b;
  --accent-2: #a98bff;
  --accent-3: #4fd6f2;
  --glow-1: rgba(79, 214, 242, 0.13);
  --glow-2: rgba(169, 139, 255, 0.15);
  --panel-dark: #08090a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 64px -24px rgba(0, 0, 0, 0.75);
  --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.5), 0 36px 80px -32px rgba(0, 0, 0, 0.8);
  --focus: 0 0 0 3px rgba(123, 151, 255, 0.45);
  color-scheme: dark;
}

/* ─── BASE ──────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100dvh; overflow-x: hidden; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-text); }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
/* A count and a button on one line, wrapping on narrow screens (the friend view's paging). */
.more-row:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 16px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px;
  background: var(--ink); color: var(--on-ink); border-radius: var(--radius-pill); text-decoration: none;
}
.skip-link:focus { top: 12px; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.section-label {
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px;
}
/* The display face: headings and big numbers. <em> inside a heading is its italic. */
.display, .hero h1, .section-title, .results-head h1, .page-head h1, .cta h2, .empty-state h1, .empty-state h2 {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em;
}
.hero h1 em, .section-title em, .cta h2 em, .results-head h1 em, .page-head h1 em { font-style: italic; }

/* ─── CONTROLS ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; text-decoration: none; color: var(--text);
  border: 1px solid transparent;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .25s, transform .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:focus-visible { border-radius: var(--radius-pill); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--ink); color: var(--on-ink);
  box-shadow: 0 1px 2px rgba(15, 20, 25, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-primary:hover:not(:disabled) { background: var(--ink-hover); box-shadow: 0 14px 30px -14px rgba(15, 20, 25, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.btn:disabled { opacity: 0.4; box-shadow: none; cursor: not-allowed; }
.btn .go { transition: transform .25s var(--ease-out); }
.btn:hover:not(:disabled) .go { transform: translateX(3px); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: var(--text-2); transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.icon-btn:focus-visible { border-radius: 50%; }
.link-btn { color: var(--text); font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.link-btn:hover { text-decoration-color: currentColor; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

.field-help { font-size: 12.5px; color: var(--text-3); }

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill);
}
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt span {
  display: grid; place-items: center; height: 36px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  color: var(--text-2); transition: background-color .2s, color .2s, box-shadow .2s;
}
.seg-opt input:checked + span { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-sm); }
.seg-opt input:focus-visible + span { box-shadow: var(--focus); }
.seg-opt:hover input:not(:checked) + span { color: var(--text); }

.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  background: color-mix(in srgb, var(--weak) 14%, transparent);
}
.note .icon { width: 17px; height: 17px; margin-top: 1px; color: color-mix(in srgb, var(--weak) 80%, var(--text)); }
.note--info { background: var(--accent-soft); }
.note--info .icon { color: var(--accent-text); }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
  color: color-mix(in srgb, var(--fair) 55%, var(--text)); background: color-mix(in srgb, var(--fair) 18%, transparent);
}

/* ─── HEADER ────────────────────────────────────────────────────────────── */

.app-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease;
}
body.is-scrolled .app-header:not(.app-header--float) { box-shadow: 0 10px 30px -22px rgba(15, 20, 25, 0.4); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.logo-mark { width: 30px; height: 30px; color: var(--ink); transition: transform .4s var(--ease-spring); }
.logo-mark [stroke="#fff"] { stroke: var(--on-ink); }
.logo-mark [fill="#fff"] { fill: var(--on-ink); }
.brand:hover .logo-mark { transform: rotate(-12deg) scale(1.05); }
.brand-text { display: grid; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* The landing page's header floats as a glass pill. */
.app-header--float {
  top: 12px; margin: 12px auto 0; width: min(1180px, calc(100% - 24px)); border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--glass); box-shadow: var(--shadow);
}
.app-header--float .header-inner { height: 56px; padding: 0 10px 0 18px; }
.top-nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.top-nav a {
  padding: 7px 12px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 550;
  color: var(--text-2); text-decoration: none; transition: color .15s, background-color .15s;
}
.top-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }

/* Where the visitor is in the scans they chose: a quiet trail under the header. The apps
   draw the same strip when they are opened from the start page. */
.flow-strip {
  display: flex; align-items: center; gap: 16px; height: 40px; padding: 0 24px;
  border-top: 1px solid var(--border); font-size: 12.5px;
}
.flow-home { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; text-decoration: none; flex: none; }
.flow-home .icon { width: 15px; height: 15px; }
.flow-home:hover { color: var(--text); }
.flow-steps { flex: 1; display: flex; justify-content: center; align-items: center; gap: 4px; min-width: 0; }
.flow-steps li { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.flow-steps li + li::before { content: ""; width: 20px; height: 1px; background: var(--border-strong); margin: 0 6px 0 2px; }
.flow-steps a { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; padding: 3px 9px; margin: -3px -3px; border-radius: 99px; }
.flow-steps a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.flow-steps span.fs-step { display: inline-flex; align-items: center; gap: 7px; padding: 0 6px; }
.fs-dot {
  display: block; width: 8px; height: 8px; border-radius: 50%; font-size: 0; line-height: 0; overflow: hidden;
  border: 1.5px solid var(--border-strong); background: transparent;
}
.fs-dot .icon { display: none; }
.flow-steps .is-current { color: var(--text); }
.flow-steps .is-current .fs-dot { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.flow-steps .is-done .fs-dot { background: var(--good); border-color: var(--good); }
.flow-mode { flex: none; color: var(--text-3); font-weight: 600; }

/* ─── PAGE ──────────────────────────────────────────────────────────────── */

.page { max-width: 1180px; margin: 0 auto; padding: 44px 24px 0; }
.lead { font-size: 18px; color: var(--text-2); max-width: 54ch; line-height: 1.55; }
.section { padding-top: 120px; }
.section-intro { max-width: 760px; margin-bottom: 40px; }
.section-intro .eyebrow { display: flex; align-items: center; gap: 12px; }
.section-intro .eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .55; }
.section-title { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; margin-top: 14px; }
.section-sub { margin-top: 14px; color: var(--text-2); font-size: 16.5px; max-width: 60ch; }

/* ─── LANDING ───────────────────────────────────────────────────────────── */

.page--home { padding-top: 56px; }
.hero { position: relative; isolation: isolate; text-align: center; }
.hero-copy { padding: 24px 0 0; display: grid; justify-items: center; }
.hero .lead { margin-inline: auto; }
.hero h1 { font-size: clamp(54px, 8.2vw, 112px); line-height: .94; letter-spacing: -0.03em; margin: 22px 0 22px; text-wrap: balance; }
.hero h1 em { padding-right: .04em; }
.hero-bg {
  position: absolute; inset: -220px -18vw -120px; z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 60% 62% at 50% 46%, #000 45%, transparent 100%);
          mask-image: radial-gradient(ellipse 60% 62% at 50% 46%, #000 45%, transparent 100%);
}
.glow { position: absolute; border-radius: 50%; will-change: transform; }
.hero-bg.is-paused .glow, .cta.is-paused::before { animation-play-state: paused; }
.glow--a { width: 760px; height: 760px; left: -6%; top: -12%; background: radial-gradient(closest-side, var(--glow-1), transparent); animation: glow-a 24s ease-in-out infinite alternate; }
.glow--b { width: 680px; height: 680px; right: -4%; top: 6%; background: radial-gradient(closest-side, var(--glow-2), transparent); animation: glow-b 30s ease-in-out infinite alternate; }
@keyframes glow-a { to { transform: translate(80px, 60px) scale(1.08); } }
@keyframes glow-b { to { transform: translate(-90px, 40px) scale(.94); } }

/* Start: the norms, then one tap on a scan. Each tile is a submit button. */
.pick { display: grid; justify-items: center; gap: 18px; margin-top: 34px; }
.norms {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--radius-pill);
  background: var(--glass); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .25s;
}
.norms-label { padding: 0 10px 0 14px; font-size: 13px; color: var(--text-3); }
.norms .seg-opt span { height: 36px; padding: 0 16px; font-size: 13.5px; }
.norms.is-needed { border-color: var(--weak); animation: nudge .4s var(--ease-out); }
@keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.start-hint { min-height: 20px; margin-top: -8px; font-size: 13px; color: var(--text-3); text-align: center; }
.start-hint:empty { display: none; }

.tiles { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 380px;
  border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  text-align: left; color: var(--text);
  transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s;
}
.tile:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.tile:focus-visible { border-radius: var(--radius-xl); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.tile-tag { padding: 3px 9px; border-radius: 99px; background: var(--ink); color: var(--on-ink); letter-spacing: .08em; }
/* The example photos, with the scan animation (see SCAN DEMO). */
.tile-photos { flex: none; height: 250px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.tile-photo { border-radius: var(--radius-lg); border: 1px solid var(--border); }
.tile-photos .tile-photo:first-child:not(:last-child) { border-radius: var(--radius-lg) 6px 6px var(--radius-lg); }
.tile-photos .tile-photo:last-child:not(:first-child) { border-radius: 6px var(--radius-lg) var(--radius-lg) 6px; }
.tile:hover .scan-stage { transform: scale(1.06); }
.tile-photo.scan--front { --fx: .5; --fy: .38; }
.tile-photo.scan--side { --fx: .6; --fy: .25; }
.tile-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tile-name { display: block; font-family: var(--font-display); font-size: 36px; line-height: 1; letter-spacing: -0.01em; }
.tile-foot small { display: block; margin-top: 6px; font-size: 13.5px; color: var(--text-2); }
.tile-go {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; background: var(--surface-3); color: var(--text);
  transition: background-color .2s, color .2s;
}
.tile-go .icon { width: 16px; height: 16px; transition: transform .25s var(--ease-out); }
.tile:hover .tile-go, .tile--both .tile-go { background: var(--ink); color: var(--on-ink); }
.tile:hover .tile-go .icon { transform: translateX(3px); }

.pick-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 22px; font-size: 13px; color: var(--text-3); }
.pick-foot span { display: inline-flex; align-items: center; gap: 6px; }
.pick-foot .icon { width: 14px; height: 14px; }

/* A scan in progress: one bar under the tiles. */
.resume {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; padding: 12px 18px; border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); text-align: left;
}
.resume-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.resume-head .icon { color: var(--text-3); }
.resume-head small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.resume-scans { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--text-2); }
.resume-scans li { display: inline-flex; align-items: center; gap: 6px; }
.resume-scans .icon { width: 15px; height: 15px; }
.resume-scans .is-saved .icon { color: var(--good); }
.resume-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); }
.step { position: relative; padding: 30px 32px 8px 0; }
.step + .step { padding-left: 32px; border-left: 1px solid var(--border); }
.step-n { display: block; font-family: var(--font-display); font-size: 64px; line-height: 1; letter-spacing: -0.03em; color: var(--text-3); }
.step h3 { font-size: 18px; font-weight: 650; margin: 26px 0 8px; }
.step p { color: var(--text-2); font-size: 14.5px; max-width: 34ch; }

/* The two scans */
.views { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.view { display: grid; grid-template-rows: auto 1fr; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.view-visual { aspect-ratio: 16 / 11; border-bottom: 1px solid var(--border); --dot: 9px; }
.view-visual.scan--front { --fy: .5; }
.view-visual.scan--side { --fy: .58; }
.view-visual .scan-chip { left: 16px; bottom: 16px; padding: 6px 12px 6px 9px; font-size: 12px; }
.view-tag {
  position: absolute; z-index: 2; top: 14px; left: 14px; padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase;
  color: #464e54; background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(15, 18, 20, 0.08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.view-body { display: grid; gap: 14px; align-content: start; padding: 26px 28px 28px; }
.view-kicker { font-size: 12.5px; color: var(--text-3); }
.view-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.015em; }
.view-body > p { color: var(--text-2); font-size: 14.5px; }
.tip-list { display: grid; gap: 8px; }
.tip-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.tip-list .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--good); }
.view-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 6px; }

/* Good to know */
.know { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.privacy-card { display: grid; gap: 12px; padding: 26px; border-radius: var(--radius-xl); }
.privacy-card > .icon-tile {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good);
}
.privacy-card h3 { font-size: 18px; font-weight: 650; }
.privacy-card p { font-size: 14.5px; color: var(--text-2); }
.faq-list { display: grid; gap: 0; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px;
  cursor: pointer; list-style: none; font-size: 16px; font-weight: 600; border-radius: var(--radius-sm);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--text-2); }
.faq-icon { width: 18px; height: 18px; flex: none; color: var(--text-3); transition: transform .3s var(--ease-out), color .2s; }
.faq-item[open] .faq-icon { transform: rotate(45deg); color: var(--text); }
.faq-body { padding: 0 4px 20px; max-width: 72ch; font-size: 14.5px; color: var(--text-2); display: grid; gap: 10px; animation: faq-in .3s ease; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } }

.cta {
  position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 14px; text-align: center;
  margin-top: 120px; padding: 72px 24px; border-radius: 32px; color: #f1f3f4; background: var(--panel-dark);
}
.cta::before {
  content: ""; position: absolute; inset: -40%; z-index: -1;
  background: radial-gradient(30% 40% at 30% 60%, rgba(79, 214, 242, 0.22), transparent 70%), radial-gradient(30% 40% at 70% 40%, rgba(169, 139, 255, 0.26), transparent 70%);
  animation: cta-drift 18s ease-in-out infinite alternate; will-change: transform;
}
@keyframes cta-drift { to { transform: translate(4%, -5%) rotate(6deg); } }
.cta h2 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1; }
.cta p { color: rgba(241, 243, 244, 0.72); font-size: 16px; }
.cta .btn-primary { margin-top: 10px; background: #f1f3f4; color: #0a0b0c; }
.cta .btn-primary:hover:not(:disabled) { background: #fff; }
.cta :focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6); }

.site-footer {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 32px;
  margin-top: 64px; padding: 30px 0 44px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2);
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .logo-mark { width: 28px; height: 28px; }
.footer-brand div { display: grid; line-height: 1.25; }
.footer-brand strong { font-family: var(--font-display); font-size: 19px; font-weight: 400; }
.footer-brand span { font-size: 12px; color: var(--text-3); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 22px; }
.footer-links a { font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-note { grid-column: 1 / -1; max-width: 92ch; font-size: 12.5px; color: var(--text-3); }

/* Scroll reveal: added by JS, so content shows without it. */
.will-reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .9s var(--ease-out); transition-delay: var(--rd, 0ms); }
.will-reveal.is-visible { opacity: 1; transform: none; }

/* ─── SCAN DEMO ─────────────────────────────────────────────────────────── */

/* The example photos with the scan animation (shared/scan-demo.js), after the side app's home
   demo: a beam drops the landmarks, then measurements are drawn in turn. The stage is the
   photos' 1327 × 1185 frame scaled to cover the box, placed by --fx/--fy as an object-position
   would be, so the points stay on the photo. The photos have white backgrounds, so the plate
   is white in both themes. */
.scan { position: relative; display: block; overflow: hidden; background: #fff; container-type: size; }
.scan-stage {
  --sw: max(100cqw, 100cqh * 1327 / 1185);
  position: absolute; display: block; width: var(--sw); height: calc(var(--sw) * 1185 / 1327);
  left: calc((100cqw - var(--sw)) * var(--fx, .5));
  top: calc((100cqh - var(--sw) * 1185 / 1327) * var(--fy, .5));
  transform-origin: calc(var(--fx, .5) * 100%) calc(var(--fy, .5) * 100%);
  transition: transform .45s var(--ease-spring);
}
.scan-stage img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }

/* Scan beam: a fine grid fading in above a bright line. JS moves it. */
.scan-beam {
  position: absolute; left: 0; right: 0; top: -26%; height: 26%; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 10%, transparent) 65%, color-mix(in srgb, var(--accent) 26%, transparent));
  transition: opacity .35s ease;
}
.scan-beam::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 1px, transparent 1px 20px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 85%);
          mask-image: linear-gradient(180deg, transparent, #000 85%);
}
.scan-beam::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 12%, #fff 50%, var(--accent) 88%, transparent);
  box-shadow: 0 0 14px 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.scan.is-scanning .scan-beam { opacity: 1; }

/* Construction lines, in frame px; --u (frame px per screen px, set by JS) keeps their width
   in screen px. Solid lines draw themselves in (pathLength 1); dashed ones fade in. */
.scan-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .5)); }
.sx { opacity: 0; transition: opacity .35s ease; }
.sx.is-on { opacity: 1; }
.sx path { fill: none; stroke: #ffc53d; stroke-width: calc(var(--u, 4) * 1.8px); stroke-linecap: round; }
.sx-draw { stroke-dasharray: 1 2; stroke-dashoffset: 1; transition: stroke-dashoffset 0s .4s; }
.sx.is-on .sx-draw { stroke-dashoffset: 0; transition: stroke-dashoffset .8s cubic-bezier(.45, .05, .25, 1) var(--d, 0s); }
.sx .sx-dash { stroke-width: calc(var(--u, 4) * 1.5px); stroke-dasharray: calc(var(--u, 4) * 5px) calc(var(--u, 4) * 4px); opacity: 0; transition: opacity .3s; }
.sx.is-on .sx-dash { opacity: .9; transition: opacity .5s ease var(--d, 0s); }

/* Landmarks (HTML, so they stay round and crisp at any size). */
.scan-pts { position: absolute; inset: 0; pointer-events: none; }
.sp { position: absolute; width: 0; height: 0; }
.sp::before, .sp::after { content: ""; position: absolute; border-radius: 50%; }
.sp::before {
  left: calc(var(--dot, 7px) / -2); top: calc(var(--dot, 7px) / -2); width: var(--dot, 7px); height: var(--dot, 7px);
  background: #2f6bff; box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0, 0, 0, .35);
  transform: scale(0); transition: transform .4s var(--ease-spring), opacity .3s ease, background-color .3s ease;
}
.sp::after {
  left: calc(var(--dot, 7px) * -1.5); top: calc(var(--dot, 7px) * -1.5); width: calc(var(--dot, 7px) * 3); height: calc(var(--dot, 7px) * 3);
  border: 1.5px solid #2f6bff; opacity: 0;
}
.sp.is-on::before { transform: scale(1); }
.sp.is-on::after { animation: sp-ripple .9s ease-out; }
@keyframes sp-ripple { from { opacity: .85; transform: scale(.25); } to { opacity: 0; transform: scale(1.35); } }
.scan.is-measuring .sp.is-on:not(.is-hl)::before { opacity: .5; transform: scale(.72); }
.sp.is-hl::before { background: #ffb020; transform: scale(1.25); }
.sp.is-hl::after { border-color: #ffb020; animation: sp-ripple 1.6s ease-out .2s 2; }

/* What the demo is doing: placing landmarks, or the measurement drawn. */
.scan-chip {
  position: absolute; z-index: 2; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 7px;
  max-width: calc(100% - 20px); padding: 5px 11px 5px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; line-height: 1.3; letter-spacing: .01em; color: #f4f6f8; white-space: nowrap;
  background: rgba(13, 16, 18, 0.62); border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .3s ease;
}
.scan-chip span { overflow: hidden; text-overflow: ellipsis; }
.scan-chip i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #6f97ff; animation: chip-pulse 1.6s ease-out infinite; }
@keyframes chip-pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 151, 255, .6); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(111, 151, 255, 0); }
}
.scan.is-scanning .scan-chip, .scan.is-measuring .scan-chip { opacity: 1; }
@container (max-width: 200px) {
  .scan-chip { left: 7px; bottom: 7px; max-width: calc(100% - 14px); gap: 6px; padding: 4px 9px 4px 7px; font-size: 10.5px; }
}
.scan.is-measuring .scan-chip i { background: #ffc53d; box-shadow: 0 0 8px #ffc53d; animation: none; }

.scan.is-fading .sx, .scan.is-fading .sp, .scan.is-fading .scan-chip { opacity: 0; transition: opacity .5s ease; }

/* Changing the norms between female and the rest swaps the person (scan-demo.js, sweep): the
   overlay fades, the old photo pales, and the new one is wiped in from the left behind a
   glowing edge with a soft blue sheen. The reveal is a clip-path and the edge a transform, so
   no mask or shadow is re-rasterised every frame. */
.scan.is-swapping .sx, .scan.is-swapping .sp, .scan.is-swapping .scan-chip, .scan.is-swapping .scan-beam { opacity: 0; transition: opacity .25s ease; }
.scan.is-swapping .scan-stage img:not(.scan-next) { filter: saturate(.35) brightness(1.06); transition: filter .5s ease; }
.scan-next { animation: swap-reveal .95s cubic-bezier(.7, 0, .25, 1) .15s both; }
.scan-edge {
  position: absolute; inset: 0; pointer-events: none; will-change: transform;
  animation: swap-move .95s cubic-bezier(.7, 0, .25, 1) .15s both, swap-edge .95s linear .15s both;
}
.scan-edge::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, #fff 15%, #fff 85%, transparent);
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 42px 10px color-mix(in srgb, var(--accent) 28%, transparent);
}
.scan-edge::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -90px; width: 90px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent));
}
@keyframes swap-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes swap-move { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes swap-edge { 0%, 100% { opacity: 0; } 10%, 88% { opacity: 1; } }

.scan.no-anim *, .scan.no-anim *::before, .scan.no-anim *::after { transition: none !important; animation: none !important; }

/* Without container units the photo is placed by object-fit, and the overlay is left out. */
@supports not (width: 1cqw) {
  .scan-stage { inset: 0; width: auto; height: auto; }
  .scan-stage img { object-fit: cover; object-position: calc(var(--fx, .5) * 100%) calc(var(--fy, .5) * 100%); }
  .scan-beam, .scan-lines, .scan-pts, .scan-chip { display: none; }
}

/* ─── RATING RINGS ──────────────────────────────────────────────────────── */

.ring { --ring-color: var(--text-3); position: relative; display: inline-grid; place-items: center; flex: none; }
.ring > svg { grid-area: 1 / 1; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--ring-color) 16%, transparent); stroke-width: 2.2; }
.ring-fill { fill: none; stroke: var(--ring-color); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: var(--p) 100; }
.ring-num { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; color: var(--text); line-height: 1; }
.ring-num small { font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--text-3); margin: 6px 0 -10px; letter-spacing: 0.02em; }
.ring--xl { width: 156px; height: 156px; }
.ring--xl .ring-num { font-family: var(--font-display); font-weight: 400; font-size: 60px; letter-spacing: -0.03em; }
.ring--md { width: 52px; height: 52px; }
.ring--md .ring-track, .ring--md .ring-fill { stroke-width: 3.4; }
.ring--md .ring-num { font-size: 15px; font-weight: 700; }
.ring--md .ring-num small { display: none; }
.ring.is-front { --ring-color: var(--front); }
.ring.is-side { --ring-color: var(--side); }
.ring.is-none .ring-fill { display: none; }
.ring.is-none .ring-track { stroke: var(--surface-3); stroke-dasharray: 2 3; }
.ring.is-none .ring-num { color: var(--text-3); }
.animate .ring-fill { animation: ring-in 1.1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ring-in { from { stroke-dasharray: 0 100; } }

/* ─── RESULTS ───────────────────────────────────────────────────────────── */

.page--results { max-width: 1060px; padding-top: 56px; }
.results-head, .page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 32px; }
.results-head h1, .page-head h1 { font-size: clamp(44px, 6vw, 76px); line-height: .98; margin: 14px 0 14px; }
.results-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--text-2); }
.results-meta li { display: inline-flex; align-items: center; gap: 6px; }
.results-meta .icon { width: 15px; height: 15px; color: var(--text-3); }
.results-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.warnings { display: grid; gap: 8px; margin-bottom: 18px; }

.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.score-grid.is-single { grid-template-columns: minmax(0, 640px); }
.score-card { display: grid; gap: 22px; align-content: start; padding: 26px; border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.sc-head { display: flex; align-items: center; gap: 12px; }
.sc-head .art { width: 40px; height: 40px; flex: none; }
.sc-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; line-height: 1; }
.sc-head p { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.sc-main { display: flex; align-items: center; gap: 26px; }
.sc-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; min-width: 0; }
.sc-facts dt { color: var(--text-3); }
.sc-facts dd { margin: 0; color: var(--text); font-weight: 550; }
.sc-note { font-size: 13.5px; color: var(--text-2); }
.sc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.score-card.is-missing { border-style: dashed; box-shadow: none; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.sc-empty { display: flex; align-items: center; gap: 24px; }
.sc-empty strong { display: block; font-size: 17px; margin-bottom: 4px; }
.sc-empty p { font-size: 14px; color: var(--text-2); }

/* The combined score stays small and below the two scores (DECISIONS 7). */
.combined { margin-top: 20px; padding: 16px 20px; border-style: dashed; box-shadow: none; border-radius: var(--radius-lg); }
.combined-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.combined-row h2 { font-size: 15px; font-weight: 650; }
.combined-value { margin-left: auto; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.combined-value small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.combined p { color: var(--text-3); font-size: 13.5px; margin-top: 6px; max-width: 75ch; }

.more-card {
  display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 20px 22px; border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.more-card .art { width: 48px; height: 48px; flex: none; }
.more-card div { flex: 1; min-width: 0; }
.more-card strong { display: block; font-size: 16px; font-weight: 650; }
.more-card p { font-size: 13.5px; color: var(--text-2); }

.empty-state { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 64px 24px; border-radius: var(--radius-xl); }
.empty-state .art { width: 72px; height: 72px; margin-bottom: 6px; }
.empty-state h1, .empty-state h2 { font-size: 44px; line-height: 1; }
.empty-state p { max-width: 46ch; color: var(--text-2); }
.empty-state .btn { margin-top: 8px; }

.about { margin-top: 36px; }

/* ─── MOTION ────────────────────────────────────────────────────────────── */

@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes view-in { from { opacity: 0; transform: translateY(12px); } }
.page--results > * { animation: view-in .5s var(--ease-out) both; }
.page--results > *:nth-child(2) { animation-delay: .06s; }
.page--results > *:nth-child(3) { animation-delay: .12s; }
.hero-copy > * { animation: view-in .7s var(--ease-out) both; }
.hero-copy > *:nth-child(2) { animation-delay: .06s; }
.hero-copy > *:nth-child(3) { animation-delay: .12s; }
.hero-copy > *:nth-child(4) { animation-delay: .18s; }
.hero .pick { animation: view-in .8s var(--ease-out) .14s both; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */

/* ─── ACCOUNTS ──────────────────────────────────────────────────────────── */
/* Copied from side-profile/styles.css (forms, danger button, dialogs, toast, menu, spinner);
   the side app doesn't change. The header's menu opens downwards here (menu--down). */

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 86%, #000); }

.field { border: 0; padding: 0; display: grid; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-error { font-size: 13px; color: var(--danger); }
.field-error:empty { display: none; }
.text-input {
  display: block; width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14.5px;
}
.text-input:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.text-input[aria-invalid="true"] { border-color: var(--danger); }
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 14, 0.55); animation: fade-in .15s ease;
}
.modal {
  width: min(420px, 100%); padding: 24px; border-radius: var(--radius-xl); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop-in .18s cubic-bezier(.2, .8, .2, 1);
}
.modal-title { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: -0.015em; line-height: 1.1; margin-bottom: 8px; }
.modal-body { color: var(--text-2); font-size: 14.5px; display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.toast {
  position: fixed; left: 50%; top: calc(var(--header-h) + 14px); z-index: 60; transform: translate(-50%, -12px);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--radius);
  background: #14171c; color: #eef1f5; font-size: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; width: 260px; padding: 6px; display: grid; gap: 2px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: pop-in .14s ease;
}
.menu[hidden] { display: none; }
.menu-item { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; padding: 9px 10px; border-radius: 8px; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu--down { bottom: auto; top: calc(100% + 8px); width: 200px; }
.menu--down .menu-item { grid-template-columns: 1fr; width: 100%; font-size: 14px; color: var(--text); text-decoration: none; }

/* Site only */
.account-slot { display: contents; }
.account-handle { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page--auth { max-width: 480px; padding-top: 56px; }
.page--account { max-width: 1060px; padding-top: 56px; }
.page--legal { max-width: 760px; padding-top: 56px; }
.page-head { margin-bottom: 24px; }
.page--auth .page-head h1 { font-size: clamp(40px, 8vw, 56px); }
.auth-card { display: grid; gap: 18px; padding: 24px; }
.auth-card form { display: grid; gap: 16px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-google .g-mark { width: 18px; height: 18px; flex: none; }
.check-field { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--text); cursor: pointer; }
.check-field input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
.check-field a, .auth-foot a, .legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.auth-foot { margin-top: 20px; font-size: 12.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.auth-status { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.account-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-grid .card { padding: 24px; display: grid; gap: 14px; align-content: start; }
.account-grid h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { overflow-wrap: anywhere; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.page--auth .danger-zone { margin-top: 16px; }
.legal { display: grid; gap: 14px; font-size: 15px; color: var(--text-2); }
.legal h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--text); margin-top: 18px; }
.legal ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }


/* ─── HISTORY ───────────────────────────────────────────────────────────── */
/* Copied from side-profile/styles.css (history list, compare table, sparkline, table scroll);
   the side app doesn't change. The line takes the app's colour, as the rings do. */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.history-list { display: grid; gap: 2px; }
.history-item { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: 0; }
.hi-name { flex: 1; min-width: 0; display: grid; font-size: 14px; font-weight: 600; }
.hi-name small { font-size: 12.5px; font-weight: 400; }
.hi-actions { display: flex; align-items: center; gap: 2px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.cmp-table th, .cmp-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.cmp-table thead th { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.cmp-table tbody th { font-weight: 600; }
.cmp-table td { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.cmp-table td.chg-rate { font-weight: 700; text-align: right; }
.cmp-table td.wrap { white-space: normal; min-width: 240px; }
.sparkline { display: block; width: 100%; height: auto; max-width: 640px; }
.sp-grid { stroke: var(--border); stroke-width: 1; }
.sp-axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.sp-line { fill: none; stroke: var(--front); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-dot { fill: var(--front); stroke: var(--surface); stroke-width: 2; }
.sp-hit { fill: transparent; }
.sp-pt:hover .sp-dot { r: 6; }

/* Site only */
.sparkline.is-side .sp-line { stroke: var(--side); }
.sparkline.is-side .sp-dot { fill: var(--side); }
.page--history { max-width: 1060px; padding-top: 56px; }
.page--history .page-head { align-items: flex-end; }
.page--history > #view { display: grid; gap: 16px; }
.history-list.card { padding: 8px 16px; }
.hi-pick { display: grid; place-items: center; padding: 6px; cursor: pointer; }
.hi-pick input { width: 18px; height: 18px; accent-color: var(--ink); }
.hi-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge--info { color: var(--accent-text); background: var(--accent-soft); }
.badge--warn { color: color-mix(in srgb, var(--weak) 70%, var(--text)); background: color-mix(in srgb, var(--weak) 16%, transparent); }
.compare-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.trend-card, .scan-detail, .compare-card { padding: 24px; display: grid; gap: 14px; }
.trend-card h2, .compare-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; }
.cmp-scans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cmp-scan { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.cmp-overall { font-size: 16px; }
.cmp-delta { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cmp-table tbody th small { display: block; font-weight: 400; font-size: 12px; }
.cmp-table tr.is-excluded th { color: var(--text-3); }
.save-slot { display: contents; }
.sc-save-note { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.sc-save-note.is-error { color: var(--danger); }

/* ─── FRIENDS ───────────────────────────────────────────────────────────── */
.page--friends { max-width: 1060px; padding-top: 56px; }
.page--friends .page-head { align-items: flex-end; }
.friends-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.friends-wide { grid-column: 1 / -1; }
.friends-card { padding: 24px; display: grid; gap: 12px; align-content: start; }
.friends-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; }
.page--friends > .friends-card + .friends-card { margin-top: 16px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .text-input { flex: 1; min-width: 0; }
.friend-list { display: grid; }
.friend-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.friend-item:last-child { border-bottom: 0; }
.friend-item--wide { align-items: flex-start; }
.friend-name { flex: 1 1 160px; min-width: 0; display: grid; font-size: 14px; overflow-wrap: anywhere; }
.friend-name strong { font-weight: 600; }
.friend-share { flex: 2 1 280px; display: grid; gap: 6px; justify-items: start; font-size: 13px; }
/* Equal columns, so the sliding thumb (a third of the track) sits on the chosen level. */
.friend-share .segmented { grid-template-columns: repeat(3, 1fr); }
.friend-share .seg-opt span { padding: 0 14px; height: 32px; font-size: 13px; white-space: nowrap; }
.page-head + .page-head, .page > p + .page-head { margin-top: 12px; }
.friend-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
@media (max-width: 1060px) {
  .top-nav { display: none; }
}

@media (max-width: 960px) {
  .tiles { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .tile { min-height: 0; }
  .tile-photos { height: 240px; }
  .views, .know { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 26px 0 20px; border-left: 0; border-bottom: 1px solid var(--border); }
  .step-n { font-size: 52px; }
  .step h3 { margin-top: 14px; }
}

@media (max-width: 760px) {
  .flow-mode { display: none; }
}

/* A flow-strip name shown only on a phone, where its .fs-long twin is hidden. */
.fs-short { display: none; }

@media (max-width: 640px) {
  :root { --header-h: 56px; }
  body { font-size: 14.5px; }
  .header-inner { padding: 0 12px; gap: 8px; }
  .app-header--float { top: 8px; margin-top: 8px; width: calc(100% - 16px); }
  .app-header--float .header-inner { padding: 0 6px 0 14px; }
  .brand-sub, .hide-sm { display: none; }
  .flow-strip { padding: 0 8px; gap: 4px; }
  .flow-steps { justify-content: flex-start; }
  .flow-steps li + li::before { width: 8px; margin: 0 2px; }
  .fs-long { display: none; }
  .fs-short { display: inline; }
  .page { padding: 28px 16px 0; }
  .page--home { padding-top: 36px; }
  .hero h1 { margin-top: 16px; }
  .lead { font-size: 16.5px; }
  .tile { padding: 14px; }
  .tile-photos { height: 200px; }
  .tile-name { font-size: 30px; }
  .resume { border-radius: var(--radius-lg); }
  .section { padding-top: 84px; }
  .view-body { padding: 20px; }
  .view-body h3 { font-size: 30px; }
  .cta { margin-top: 84px; padding: 56px 20px; border-radius: 24px; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .score-card { padding: 20px; }
  .sc-main, .sc-empty { gap: 18px; }
  .ring--xl { width: 120px; height: 120px; }
  .ring--xl .ring-num { font-size: 46px; }
  .more-card { flex-wrap: wrap; }
  .more-card .btn { width: 100%; }
  .combined-value { margin-left: 0; }
  .account-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 20px; }
  .cmp-scans { grid-template-columns: 1fr; }
  .trend-card, .scan-detail, .compare-card { padding: 18px; }
  .history-item { flex-wrap: wrap; }
  .history-item .hi-name { flex: 1 1 150px; }
  .history-item .hi-actions { width: 100%; justify-content: flex-end; }
  .friends-grid { grid-template-columns: 1fr; }
  .friends-card { padding: 18px; }
  .inline-form { flex-direction: column; }
}

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

/* ─── FACEIQ PASS: SLIDING SWITCHES, CARD MOTION ────────────────────────── */
/* DECISIONS.md, 32. The parts of the apps' FACEIQ PASS block that apply to these pages: the
   switch thumb that slides, the score ring's glow, cards that lift. Motion only. */

/* Equal-width switches: the selected option is a thumb that slides. */
.segmented { position: relative; isolation: isolate; }
.segmented::before {
  content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 16px) / 3);
  border-radius: var(--radius-pill); background: var(--ink); box-shadow: var(--shadow-sm); opacity: 0;
  transform: translateX(calc(var(--seg-i, 0) * (100% + 4px))); transition: transform .5s var(--ease-spring), opacity .2s;
}
.segmented:has(> .seg-opt:nth-child(1) input:checked)::before { --seg-i: 0; opacity: 1; }
.segmented:has(> .seg-opt:nth-child(2) input:checked)::before { --seg-i: 1; opacity: 1; }
.segmented:has(> .seg-opt:nth-child(3) input:checked)::before { --seg-i: 2; opacity: 1; }
.segmented:has(> .seg-opt input:checked) .seg-opt input:checked + span { background: transparent; box-shadow: none; }
/* Two options (sign in or create an account): the thumb is half the track, not a third. */
.segmented--2 { grid-template-columns: repeat(2, 1fr); }
.segmented--2::before { width: calc((100% - 12px) / 2); }

/* The start page's norms (options of different widths): the chosen one pops in. */
@keyframes fx-pick { from { transform: scale(.86); opacity: .6; } }
.norms .seg-opt input:checked + span { animation: fx-pick .4s var(--ease-spring); }

/* Results: the score cards rise in turn, lift under the pointer, and each ring sits on a glow
   of its app's colour. */
.score-grid > .score-card { animation: view-in .6s var(--ease-out) .08s both; transition: transform .3s var(--ease-out), box-shadow .3s, border-color .2s; }
.score-grid > .score-card:nth-child(2) { animation-delay: .18s; }
.score-grid > .score-card:not(.is-missing):hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.more-card { transition: transform .3s var(--ease-out), box-shadow .3s, border-color .2s; }
.more-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.sc-main .ring--xl { isolation: isolate; }
.sc-main .ring--xl::before {
  content: ""; position: absolute; inset: 10%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--ring-color) 34%, transparent), transparent 70%);
  filter: blur(16px); animation: fx-glow 1.2s var(--ease-out) .2s backwards;
}
@keyframes fx-glow { from { opacity: 0; transform: scale(.6); } }

@media (prefers-reduced-motion: reduce) {
  .segmented::before, .score-grid > .score-card { animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .score-grid > .score-card:hover, .more-card:hover { transform: none; }
}

/* ─── USABILITY PASS ────────────────────────────────────────────────────── */
/* Root DECISIONS.md, 38. The same block ends site/site.css, side-profile/styles.css and the
   front app's global.css; a change goes into all three. */

/* Keyboard focus as an outline, which no element's own shadow can replace. The soft ring
   above stayed hidden on primary buttons and the start page's tiles, whose shadows won. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cta :focus-visible, .cta-band :focus-visible { outline-color: #fff; }

/* Form fields: a border with at least 3:1 contrast against the card (WCAG 1.4.11). */
:root { --field-border: #8a949b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --field-border: #69727a; } }
:root[data-theme="dark"] { --field-border: #69727a; }
.text-input { border-color: var(--field-border); }
.text-input[aria-invalid="true"] { border-color: var(--danger); }

/* Small uppercase labels no smaller than 12px. */
.eyebrow, .section-label { font-size: 12px; }

/* The flow strip's links fill most of its height, so they are easy to hit. */
.flow-home { min-height: 34px; padding: 0 8px; margin-left: -8px; border-radius: 99px; }
.flow-home:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.flow-steps a { min-height: 34px; padding: 0 9px; margin: 0 -3px; }

@media (max-width: 640px) {
  /* 16px text in fields, so phones don't zoom the page when one is focused. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea { font-size: 16px; }
}

/* Touch: controls of at least 40–44px. */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .btn-sm { min-height: 40px; }
  .seg-opt span { min-height: 40px; }
  .footer-links a, .auth-foot a { display: inline-block; padding-block: 10px; }
  .pw-row .text-input { height: 44px; }
  .pw-toggle { height: 38px; }
}

/* ─── SITE PAGES: USABILITY PASS ────────────────────────────────────────── */
/* Root DECISIONS.md, 38. Site-only parts: the start page's two numbered steps, the sample
   result, grouped history tables, the friends page's folded lists and the legal pages'
   contents lists. */

/* Start: "1 Compare against which norms?", then "2 Choose a scan". */
.pick-q { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; color: var(--text); }
.pick-q + .tiles { margin-top: -4px; }
.pick-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  font-size: 12.5px; font-weight: 700; background: var(--ink); color: var(--on-ink);
}
.norms + .pick-help { margin-top: -8px; }
.pick-help { font-size: 13.5px; color: var(--text-2); max-width: 52ch; }
.start-hint { color: var(--text); font-weight: 600; }
.tile--both .tile-top { justify-content: flex-end; }
.pick-foot { gap: 8px 24px; font-size: 14px; color: var(--text-2); }
.pick-foot li { display: inline-flex; align-items: center; gap: 7px; }
.pick-foot .icon { width: 16px; height: 16px; color: var(--text-3); }
.step p + p { margin-top: 10px; }

/* The two scans: the rating's details folded, the photo tips in their own box. */
.view-more { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.view-more summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px;
  cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm);
}
.view-more summary::-webkit-details-marker { display: none; }
.view-more[open] .faq-icon { transform: rotate(45deg); color: var(--text); }
.view-more p { padding: 0 2px 14px; font-size: 14px; color: var(--text-2); }
.tip-box { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); }
.tip-title { font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* Private by design: four points instead of four paragraphs. */
.privacy-points { display: grid; gap: 12px; }
.privacy-points li { font-size: 14.5px; color: var(--text-2); padding-left: 14px; border-left: 2px solid var(--border); }
.privacy-points strong { display: block; color: var(--text); font-weight: 650; margin-bottom: 2px; }

/* The hero's glow stays inside the screen on narrow widths, so the page never grows wider. */
@media (max-width: 960px) { .hero-bg { left: 0; right: 0; } }

/* On a tablet the three tiles fit side by side. */
@media (min-width: 700px) and (max-width: 960px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; gap: 12px; }
  .tile { padding: 12px; gap: 10px; }
  .tile-photos { height: 190px; }
  .tile-foot { flex-direction: column; align-items: flex-start; }
  .tile-name { font-size: 30px; }
}

/* Sample result: marked as an example, figures in the same cards as the real page. */
.sample-banner { margin-bottom: 20px; }
.sample-list { display: grid; gap: 2px; }
.sample-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sample-list li:last-child { border-bottom: 0; }
.sample-list span { color: var(--text-3); font-size: 12.5px; grid-column: 1; }
.sample-list b { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; }
.sample-get { margin-top: 36px; }
.sample-get h2 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.05; margin-bottom: 16px; }
.sample-get ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sample-get li { padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.sample-get li strong { display: block; color: var(--text); margin-bottom: 4px; }
.sample-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.sample-cta p { color: var(--text-2); font-size: 14px; }

/* Sign-in: what the visitor was about to do, and a way back. */
.auth-context { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; color: var(--text-2); }
.auth-context strong { color: var(--text); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.auth-back:hover { color: var(--text); }
.auth-back .icon { width: 16px; height: 16px; }
.pw-row { position: relative; }
.pw-row .text-input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-2); }
.pw-toggle:hover { background: var(--surface-2); color: var(--text); }

/* History: a scan's measurements in their groups, a legend, and the compare view's summary. */
.cmp-table tr.group-row th { padding-top: 18px; font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); border-bottom-color: var(--border-strong); }
.cmp-table tr.group-row th small { display: inline; margin-left: 8px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.table-legend { font-size: 13px; color: var(--text-2); }
.cmp-movers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cmp-movers section { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.cmp-movers h3 { font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.cmp-movers li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.cmp-movers li b { font-variant-numeric: tabular-nums; }
.caveats summary, .all-rows summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 8px 2px; border-radius: var(--radius-sm); }
.caveats[open] summary, .all-rows[open] summary { margin-bottom: 8px; }
.caveats > div { display: grid; gap: 8px; }

/* Friends: the lists that are often empty fold away with a count. */
.friends-fold { padding: 0; }
.friends-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: 26px; line-height: 1.05; border-radius: var(--radius-lg);
}
.friends-fold > summary::-webkit-details-marker { display: none; }
.friends-fold > summary .count { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 8px; }
.friends-fold[open] .faq-icon { transform: rotate(45deg); }
.friends-fold > div { display: grid; gap: 12px; padding: 0 24px 20px; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; margin-left: 8px; border-radius: 99px; font-family: var(--font); font-size: 12px; font-weight: 700; vertical-align: middle; background: var(--ink); color: var(--on-ink); }

/* Legal pages: a contents list and the key points first. */
.legal-toc { padding: 18px 20px; }
.legal-toc h2 { font-size: 13px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; font-family: var(--font); }
.legal-toc ol { list-style: decimal; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.legal-toc a { color: var(--text); }
.legal .key-points { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.legal .key-points h2 { margin-top: 0; }
.legal h2 { scroll-margin-top: 80px; }
.legal details { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; background: var(--surface); }
.legal details > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text); }
.legal details[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.legal details > :last-child { margin-bottom: 14px; }
.legal-part { font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Not found */
.page--notfound { max-width: 640px; padding-top: 80px; }

@media (max-width: 640px) {
  .cmp-movers { grid-template-columns: 1fr; }
  .friends-fold > summary { padding: 16px 18px; font-size: 24px; }
  .friends-fold > div { padding: 0 18px 18px; }
}
