/* R&R Profile — styles
   One look for the site and both apps (root DECISIONS.md, 10 and 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 site (site/site.css) and the front
   app (src/styles/global.css) keep their own copies, so a visual change goes into all three.
   Tokens first; light is the default, dark applies via the OS setting or the theme toggle
   (data-theme on <html>). */

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

/* Instrument Serif (SIL Open Font License, assets/fonts/OFL.txt), served from this site. */
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/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("assets/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;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --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;
  --stage-bg: #0b0d0f;

  /* Rating status colours — fixed across themes, always paired with a label. */
  --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);
  --focus: 0 0 0 3px rgba(47, 91, 234, 0.32);

  --header-h: 64px;
  --panel-w: 420px;

  /* Home-page accents and motion. */
  --accent-2: #7c4dff;
  --accent-3: #12b5d9;
  --glow-1: #c3eff6;
  --glow-2: #e0dafc;
  --panel-dark: #0c0e10;
  --glass: color-mix(in srgb, var(--surface) 74%, transparent);
  --shadow-float: 0 1px 2px rgba(15, 20, 25, 0.04), 0 36px 80px -32px rgba(15, 20, 25, 0.32);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.3);
  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;
    --stage-bg: #060708;
    --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);
    --focus: 0 0 0 3px rgba(123, 151, 255, 0.45);
    --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-float: 0 1px 2px rgba(0, 0, 0, 0.5), 0 36px 80px -32px rgba(0, 0, 0, 0.8);
    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;
  --stage-bg: #060708;
  --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);
  --focus: 0 0 0 3px rgba(123, 151, 255, 0.45);
  --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-float: 0 1px 2px rgba(0, 0, 0, 0.5), 0 36px 80px -32px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

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

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

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;
}

body.is-workspace { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-text); }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
code { font-family: var(--mono); font-size: 0.88em; }
kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
}

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* Views ease in when they open (the class is removed once it has played). */
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes panel-in { from { opacity: 0; transform: translateX(16px); } }
#main.view-enter > .page { animation: view-in .45s var(--ease-out) both; }
#main.view-enter > .workspace > .stage { animation: fade-in .4s ease both; }
#main.view-enter > .workspace > .panel { animation: panel-in .42s var(--ease-out) both; }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.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(--accent); color: var(--on-accent); border-radius: var(--radius); 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: 20px 0 8px;
}
/* The display face: headings and big numbers. <em> inside it is its italic. */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; }
.display 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-danger { background: var(--danger); color: #fff; }
.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; }
.link-btn.small { font-size: 12px; margin-left: 6px; }

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

.field { border: 0; padding: 0; display: grid; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-help { font-size: 12.5px; color: var(--text-3); }
.field-error { font-size: 13px; color: var(--danger); }

.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); }

.input-suffix {
  display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.input-suffix:focus-within { box-shadow: var(--focus); border-color: var(--accent); }
.input-suffix input { flex: 1; min-width: 0; border: 0; background: none; height: 40px; padding: 0 12px; font-size: 15px; outline: none; }
.input-suffix span { padding: 0 12px; color: var(--text-3); font-size: 14px; }
.input-suffix input[aria-invalid="true"] { color: var(--danger); }
.input-suffix:has(input:disabled) { opacity: 0.5; }

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

.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }

.kv { display: grid; gap: 10px; margin-top: 16px; }
.kv div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { font-weight: 600; text-align: right; }
.kv--compact { gap: 6px; margin: 14px 0; }
.kv--compact div { font-size: 13px; }
.kv--compact dd { font-weight: 500; }
.kv--compact code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.metric-body .kv--compact div { justify-content: flex-start; }
.metric-body .kv--compact dt { min-width: 84px; flex: none; }
.metric-body .kv--compact dd { text-align: left; }

.lm-chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; margin-left: 4px;
  border-radius: 5px; background: var(--surface-3); color: var(--text-2);
}

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

.app-header {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  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 { box-shadow: 0 10px 30px -22px rgba(15, 20, 25, 0.4); }
.brand .logo-mark { transition: transform .4s var(--ease-spring); }
.brand:hover .logo-mark { transform: rotate(-12deg) scale(1.05); }
.header-inner {
  height: 100%; 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); }
.logo-mark [stroke="#fff"] { stroke: var(--on-ink); }
.logo-mark [fill="#fff"] { fill: var(--on-ink); }
.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; }

.stepper { flex: 1; display: flex; justify-content: center; min-width: 0; }
.stepper ol { display: flex; align-items: center; gap: 6px; }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.stepper li + li::before { content: ""; width: 26px; height: 1px; background: var(--border-strong); margin-right: 2px; }
.step-dot {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 700; border: 1px solid var(--border-strong); background: transparent;
}
.step-dot .icon { width: 13px; height: 13px; }
.step-btn {
  display: flex; align-items: center; gap: 8px; margin: -4px -8px; padding: 4px 8px; border-radius: 99px;
  color: inherit; font: inherit; transition: background-color .15s, color .15s;
}
.step-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.step-btn:hover .step-dot { border-color: var(--ink); }
.step-btn:focus-visible { border-radius: 99px; }
.stepper li.current { color: var(--text); }
.stepper li.current .step-dot { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.stepper li.done .step-dot { background: var(--surface-3); border-color: transparent; color: var(--text); }

/* The combined site's flow strip, under the header when the app is opened from the
   site's start page (app.js, SITE FLOW; root DECISIONS.md, 10). The same strip as on the
   site's pages and in the front-profile app. */
:root.has-flow { --header-h: 105px; }
.has-flow .app-header { display: flex; flex-direction: column; }
.has-flow .header-inner { height: auto; flex: 1; min-height: 0; }
.flow-strip {
  display: flex; align-items: center; gap: 16px; height: 40px; flex: none; 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 .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;
}
.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-mode { flex: none; color: var(--text-3); font-weight: 600; }
/* Room for "Save & see results" in the results panel's footer: the other two buttons
   show their icons only (both have an aria-label). */
.has-flow .panel-foot #dlBtn span, .has-flow .panel-foot #newBtn span { display: none; }

/* ─── PAGES (home, methodology) ─────────────────────────────────────────── */

.page { max-width: 1180px; margin: 0 auto; padding: 48px 24px 0; }
.lead { font-size: 17px; color: var(--text-2); max-width: 56ch; }

.section { padding: 56px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-title { font-family: var(--font-display); font-size: 34px; font-weight: 400; letter-spacing: -0.015em; line-height: 1.05; margin-bottom: 20px; }
.section-title em { font-style: italic; }
.section-head .section-title { margin-bottom: 20px; }

.setup {
  padding: 26px; display: grid; gap: 20px; border-radius: var(--radius-xl); box-shadow: var(--shadow-float);
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
}

.dropzone {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius-lg); cursor: pointer;
  border: 1.5px dashed var(--border-strong); background: var(--surface);
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.dropzone:hover, body.is-dragging .dropzone { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.dropzone.has-file { border-style: solid; border-color: color-mix(in srgb, var(--good) 45%, var(--border-strong)); }
.dropzone.is-pop { animation: dz-pop .5s var(--ease-spring); }
@keyframes dz-pop { 35% { transform: scale(1.015); } }
.dz-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--on-ink);
  transition: transform .35s var(--ease-spring);
}
.dropzone:hover .dz-icon { transform: translateY(-3px); }
.dz-icon .icon { width: 20px; height: 20px; }
.dz-text { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.dz-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.dz-text span { color: var(--text-3); font-size: 13px; }
.dz-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; flex: none; }
.dz-check {
  margin-left: auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--good); color: #fff; animation: pop-in .35s var(--ease-spring);
}
.dz-check .icon { width: 15px; height: 15px; }

.setup-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 10px; }
.privacy { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.privacy .icon { width: 15px; height: 15px; }

.site-footer {
  margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--border);
  display: grid; gap: 6px; font-size: 13px; color: var(--text-2); max-width: 80ch;
}

/* ─── HOME ──────────────────────────────────────────────────────────────── */

.view-home { overflow-x: hidden; overflow-x: clip; }
.page--home { padding-top: 36px; }

.hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); grid-template-rows: auto 1fr;
  grid-template-areas: "copy visual" "setup visual";
  column-gap: 64px; row-gap: 28px; padding-bottom: 40px;
}
.hero-copy { grid-area: copy; }
.hero-visual { grid-area: visual; align-self: start; position: sticky; top: calc(var(--header-h) + 28px); margin: 8px 0 0; }
.hero .setup { grid-area: setup; align-self: start; }
.hero h1 { font-family: var(--font-display); font-size: clamp(46px, 5.6vw, 76px); font-weight: 400; letter-spacing: -0.03em; line-height: .98; margin: 20px 0 18px; text-wrap: balance; }

/* Soft, slowly drifting colour behind the hero. */
.hero-bg {
  position: absolute; inset: -150px -14vw -60px; z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 62% 42%, #000 35%, transparent 78%);
          mask-image: radial-gradient(ellipse 72% 70% at 62% 42%, #000 35%, transparent 78%);
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1.5px);
  background-size: 22px 22px; opacity: .55;
}
.orb { position: absolute; border-radius: 50%; will-change: transform; }
.orb--a { width: 620px; height: 620px; right: 4%; top: 6%; background: radial-gradient(closest-side, var(--glow-2), transparent); animation: orb-a 22s ease-in-out infinite alternate; }
.orb--b { width: 480px; height: 480px; right: 30%; top: 36%; background: radial-gradient(closest-side, var(--glow-1), transparent); animation: orb-b 27s ease-in-out infinite alternate; }
.orb--c { width: 420px; height: 420px; left: 8%; top: 4%; background: radial-gradient(closest-side, var(--glow-1), transparent); animation: orb-c 31s ease-in-out infinite alternate; }
@keyframes orb-a { to { transform: translate(-70px, 50px) scale(1.12); } }
@keyframes orb-b { to { transform: translate(90px, -40px) scale(0.92); } }
@keyframes orb-c { to { transform: translate(60px, 70px) scale(1.1); } }

.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 11px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--text-2);
  background: var(--glass); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ep-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: ep-pulse 2.4s ease-out infinite; }
@keyframes ep-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
/* The accented words of a headline: the display face's italic (the class name is kept). */
.grad-text { font-style: italic; }

.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 22px; }
.hero-facts li { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 560; color: var(--text-2); }
.hero-facts .icon { width: 16px; height: 16px; color: var(--text-3); }

/* Setup card */
.setup-step { display: grid; gap: 10px; }
.setup-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 650; letter-spacing: -0.005em; }
.setup-num {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  font-size: 11.5px; font-weight: 700; color: var(--text-2); border: 1px solid var(--border-strong);
  transition: background-color .25s, color .25s, border-color .25s;
}
.setup-num.is-done { background: var(--good); border-color: var(--good); color: #fff; animation: pop-in .35s var(--ease-spring); }
.setup-num .icon { width: 13px; height: 13px; }
.camera-open { margin-top: 2px; }
.more-opts summary {
  display: flex; align-items: center; gap: 6px; padding: 4px 0; cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
}
.more-opts summary::-webkit-details-marker { display: none; }
.more-opts summary:hover { color: var(--text); }
.mo-chev { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .2s var(--ease-out); }
.more-opts[open] .mo-chev { transform: none; }
.mo-val { margin-left: auto; font-size: 12.5px; font-weight: 550; color: var(--text-3); }
.more-opts .field { margin-top: 8px; }
.start-btn .icon { transition: transform .25s var(--ease-out); }
.start-btn:hover:not(:disabled) .icon { transform: translateX(3px); }
.start-hint {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 20px; margin-top: -10px;
  font-size: 13px; color: var(--text-3); text-align: center;
}
.start-hint.is-ready { color: color-mix(in srgb, var(--good) 72%, var(--text)); font-weight: 600; }
.start-hint .icon { width: 15px; height: 15px; }
.sample-btn { color: var(--accent-text); }
.sample-btn:hover:not(:disabled) { color: var(--accent-text); }
.history-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: 13.5px; font-weight: 600; color: var(--text-2); text-align: left;
}
.history-link span { flex: 1; }
.history-link:hover { border-color: var(--ink); color: var(--text); }

/* Hero visual: the live analysis */
.hero-visual { --tx: 0; --ty: 0; }
.hero-window {
  position: relative; padding: 0 6px 6px; border-radius: 22px;
  background: var(--glass); border: 1px solid color-mix(in srgb, var(--border-strong) 70%, transparent);
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 34px 80px -24px rgba(16, 24, 40, 0.34);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.hw-bar { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 4px 0 10px; }
.hw-lights { display: flex; gap: 6px; flex: none; }
.hw-lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.hw-lights i:nth-child(1) { background: #f26b60; }
.hw-lights i:nth-child(2) { background: #f5bd4f; }
.hw-lights i:nth-child(3) { background: #5dc26b; }
.hw-status { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.hw-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; animation: hw-pulse 1.8s ease-out infinite; }
@keyframes hw-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
.is-hero-paused .hw-pulse { animation: none; background: var(--text-3); }
.hw-dots { display: flex; margin-left: auto; }
.hw-dot { position: relative; width: 20px; height: 28px; display: grid; place-items: center; }
.hw-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--border-strong);
  transition: width .3s var(--ease-out), background-color .3s;
}
.hw-dot:hover::before { background: var(--text-3); }
.hw-dot[aria-pressed="true"]::before { width: 16px; background: var(--accent); }
.hw-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--text-2); flex: none; transition: background-color .15s, color .15s; }
.hw-btn:hover { background: var(--surface-2); color: var(--text); }
.hw-btn .icon { width: 15px; height: 15px; fill: currentColor; }

.hero-frame {
  position: relative; aspect-ratio: 1327 / 1185; border-radius: 16px; overflow: hidden; background: #fff;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); --scan: 108%;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-img--mono { filter: grayscale(1) contrast(.9) brightness(1.08); }
.hero-img--color {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(var(--scan) - 9%), transparent calc(var(--scan) + 1%));
          mask-image: linear-gradient(180deg, #000 calc(var(--scan) - 9%), transparent calc(var(--scan) + 1%));
  transition: opacity .6s ease;
}
.hero-frame.is-revealed .hero-img--color { -webkit-mask-image: none; mask-image: none; }
.hero-frame.is-fading .hero-img--color { opacity: 0; }

/* Scan beam: a fine grid fading in above a bright line. JS moves it. */
.hero-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;
}
.hero-beam::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 32%, transparent) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 32%, transparent) 0 1px, transparent 1px 24px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 85%);
          mask-image: linear-gradient(180deg, transparent, #000 85%);
}
.hero-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 16px 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.hero-frame.is-scanning .hero-beam { opacity: 1; }

/* Profile outline and the construction lines (sample-photo px). */
.hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hero-outline, .hero-outline-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.hero-outline { stroke: var(--accent); stroke-width: 5; }
.hero-outline-glow { stroke: color-mix(in srgb, var(--accent) 30%, transparent); stroke-width: 22; }
.hero-frame.is-traced .hero-outline, .hero-frame.is-traced .hero-outline-glow {
  stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s cubic-bezier(.45, .05, .25, 1), opacity .5s;
}
.hero-frame.is-measuring .hero-outline { opacity: .5; }
.hero-frame.is-measuring .hero-outline-glow { opacity: .35; }
.hero-frame.is-fading .hero-outline, .hero-frame.is-fading .hero-outline-glow, .hero-frame.is-fading .hx, .hero-frame.is-fading .hp { opacity: 0; transition: opacity .6s ease; }

.hx { opacity: 0; transition: opacity .35s ease; }
.hx.is-on { opacity: 1; }
.hx-line { fill: none; stroke: #ffc53d; stroke-width: 5.5; stroke-linecap: round; paint-order: stroke; }
.hx-arc { stroke-width: 4.5; }
.hx-draw { stroke-dasharray: 1 2; stroke-dashoffset: 1; transition: stroke-dashoffset 0s .4s; }
.hx.is-on .hx-draw { stroke-dashoffset: 0; transition: stroke-dashoffset .8s cubic-bezier(.45, .05, .25, 1) var(--d, 0s); }
.hx-dash { stroke-dasharray: 16 13; stroke-width: 4.5; opacity: 0; transition: opacity .3s; }
.hx.is-on .hx-dash { opacity: .95; transition: opacity .5s ease var(--d, 0s); }
.hx-foot { fill: #ffc53d; opacity: 0; transition: opacity .3s; }
.hx.is-on .hx-foot { opacity: 1; transition: opacity .4s ease var(--d, 0s); }
.hx-text { fill: #ffc53d; font-family: var(--font); font-size: 30px; font-weight: 750; opacity: 0; }
.hx.is-on .hx-text { opacity: 1; transition: opacity .4s ease var(--d, 0s); }
.hx-line, .hx-foot, .hx-text { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .55)); }

/* Landmarks (HTML, so they stay round and crisp at any size). */
.hero-points { position: absolute; inset: 0; pointer-events: none; }
.hp { position: absolute; width: 0; height: 0; }
.hp-dot {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: #2f6bff; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, .35);
  transform: scale(0); transition: transform .45s var(--ease-spring), opacity .35s ease, background-color .3s ease;
}
.hp.is-on .hp-dot { transform: scale(1); }
.hp-ring { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #2f6bff; opacity: 0; }
.hp.is-on .hp-ring { animation: hp-ripple .9s ease-out; }
@keyframes hp-ripple { from { opacity: .85; transform: scale(.25); } to { opacity: 0; transform: scale(1.35); } }
.hero-frame.is-measuring .hp.is-on:not(.is-hl) .hp-dot { opacity: .5; transform: scale(.72); }
.hp.is-hl .hp-dot { background: #ffb020; transform: scale(1.2); }
.hp.is-hl .hp-ring { border-color: #ffb020; animation: hp-ripple 1.6s ease-out .2s 2; }
.hp-label { display: none; }

.hero-spot {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
}
.hero-visual:hover .hero-spot { opacity: 1; }

/* Readout of the measurement being drawn. */
.hero-readout {
  position: absolute; right: 18px; bottom: 18px; z-index: 2; display: flex; align-items: center; gap: 11px;
  max-width: calc(100% - 36px); padding: 9px 16px 9px 9px; border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border);
  box-shadow: 0 12px 32px -10px rgba(16, 24, 40, .35);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .35s ease, transform .45s var(--ease-out);
}
.hero-readout.is-on { opacity: 1; transform: none; }
.hero-readout .ring-fill { animation: ring-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.hr-text { display: grid; gap: 2px; min-width: 0; }
.hr-name { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-val { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hr-val em { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--text-3); }
.hr-val em i { width: 7px; height: 7px; border-radius: 50%; background: var(--ring-color); }

/* Floating chips around the window, drifting with the pointer. */
.hero-chip {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 13px;
  font-size: 13px; color: var(--text-2); background: var(--glass); border: 1px solid var(--border); box-shadow: var(--shadow-float);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform: translate3d(calc(var(--tx) * 12px), calc(var(--ty) * 10px), 0); transition: transform .6s var(--ease-out);
}
.hero-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.hero-chip .icon { width: 16px; height: 16px; color: var(--accent-text); }
.hero-chip--pts { bottom: 74px; left: -34px; }

.hero-card {
  position: absolute; z-index: 3; left: -48px; top: 70px; width: min(292px, 78%); padding: 14px 16px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-float);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; translate: 0 16px;
  transform: translate3d(calc(var(--tx) * -14px), calc(var(--ty) * -12px), 0);
  transition: opacity .6s ease, translate .7s var(--ease-out), transform .6s var(--ease-out);
}
.hero-card.is-on { opacity: 1; translate: 0 0; }
.hero-card:not(.is-on) .ring-fill { stroke-dasharray: 0 100; }
.hero-card.is-on .ring-fill { animation: ring-in 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.hero-card-top { display: flex; align-items: center; gap: 14px; }
.hero-card-grade { font-weight: 750; font-size: 16px; letter-spacing: -0.01em; }
.hero-card-sub { font-size: 12.5px; color: var(--text-3); }
.hc-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; margin-top: 14px; }
.hc-cats li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 6px; font-size: 12px; }
.hc-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-cats b { font-weight: 700; font-variant-numeric: tabular-nums; }
.hc-bar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hc-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ring-color); transition: width 1.1s var(--ease-out); }
.hero-card.is-on .hc-bar > i { width: var(--w); }
.hero-card.is-on li:nth-child(2) .hc-bar > i { transition-delay: .08s; }
.hero-card.is-on li:nth-child(3) .hc-bar > i { transition-delay: .16s; }
.hero-card.is-on li:nth-child(4) .hc-bar > i { transition-delay: .24s; }
.hero-card.is-on li:nth-child(5) .hc-bar > i { transition-delay: .32s; }
.hero-card.is-on li:nth-child(6) .hc-bar > i { transition-delay: .4s; }

.hero-frame.no-anim, .hero-frame.no-anim * { transition: none !important; animation: none !important; }
.hero-frame.is-offscreen .hp-ring { animation: none; }

/* Changing the norms between female and the rest swaps the sample person (app.js,
   swapHeroPerson): the overlay, readout and sample card fade, the old photo pales, and the new
   one is wiped in from the left, grey as a pass starts, behind a glowing edge with a soft blue
   sheen. A copy of the site's (site/site.css, .scan-next); a change to one belongs in the
   others. Without @property the new photo appears at the end. */
@property --wipe { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.hero-visual.is-swapping .hp, .hero-visual.is-swapping .hx, .hero-visual.is-swapping .hero-beam,
.hero-visual.is-swapping .hero-outline, .hero-visual.is-swapping .hero-outline-glow,
.hero-visual.is-swapping .hero-readout, .hero-visual.is-swapping .hero-card { opacity: 0; transition: opacity .3s ease; }
.hero-visual.is-swapping .hero-img:not(.swap-next) { filter: grayscale(1) contrast(.9) brightness(1.12); transition: filter .5s ease; }
.swap-next {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--wipe) - 14%), transparent var(--wipe));
          mask-image: linear-gradient(90deg, #000 calc(var(--wipe) - 14%), transparent var(--wipe));
  animation: swap-wipe .95s cubic-bezier(.7, 0, .25, 1) .15s both;
}
.swap-edge {
  position: absolute; top: 0; bottom: 0; left: calc(var(--wipe) - 7%); width: 2px; margin-left: -1px; pointer-events: none;
  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);
  animation: swap-wipe .95s cubic-bezier(.7, 0, .25, 1) .15s both, swap-edge .95s linear .15s both;
}
.swap-edge::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: 1px; width: 90px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent));
}
@keyframes swap-wipe { from { --wipe: 0%; } to { --wipe: 114%; } }
@keyframes swap-edge { 0%, 100% { opacity: 0; } 10%, 88% { opacity: 1; } }

/* Home sections */
.page--home .section { padding-top: 92px; }
.section-intro { max-width: 680px; margin-bottom: 28px; }
.page--home .section-head { flex-wrap: wrap; align-items: flex-end; margin-bottom: 28px; }
.page--home .section-title { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.02; margin: 12px 0 0; }
.section-intro .eyebrow, .page--home .section-head .eyebrow { display: flex; align-items: center; gap: 12px; }
.section-intro .eyebrow::before, .page--home .section-head .eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .55; }

/* How it works: numbered columns between hairlines, as on the site's start page. */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); counter-reset: step; }
.step-card { position: relative; padding: 28px 28px 8px 0; counter-increment: step; }
.step-card + .step-card { padding-left: 28px; border-left: 1px solid var(--border); }
.step-card::before {
  content: "0" counter(step); display: block; font-family: var(--font-display); font-size: 60px; line-height: 1; letter-spacing: -0.03em; color: var(--text-3);
}
.step-icon { display: none; }
.step-card h3 { font-size: 17.5px; font-weight: 650; margin: 22px 0 8px; }
.step-card p { color: var(--text-2); font-size: 14.5px; max-width: 36ch; }

.measure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.measure-group { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.mg-head { display: flex; align-items: center; gap: 10px; }
.mg-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--surface-2); color: var(--text); }
.mg-icon .icon { width: 19px; height: 19px; }
.mg-head h3 { font-size: 16px; }
.measure-group .count { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--text-3); background: var(--surface-2); border-radius: 99px; padding: 1px 9px; }
.mg-desc { margin: 10px 0 14px; font-size: 13.5px; color: var(--text-2); }
.mg-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-pills a {
  display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 550; text-decoration: none;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  transition: color .15s, border-color .15s, background-color .15s;
}
.mg-pills a:hover { color: var(--text); border-color: var(--text-3); background: var(--surface); }
.mg-pills a:focus-visible { border-radius: 99px; }

.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tip { display: flex; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.tip-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--text); }
.tip h3 { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.tip p { font-size: 14px; color: var(--text-2); }

.faq-list { display: grid; gap: 0; max-width: 860px; 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-item p { padding: 0 4px 20px; max-width: 72ch; font-size: 14.5px; color: var(--text-2); animation: faq-in .3s ease; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } }

.cta-band {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 92px; padding: 48px 48px; border-radius: 32px; color: #f1f3f4; background: var(--panel-dark);
}
.cta-glow {
  position: absolute; inset: -40% -10%; z-index: -1; pointer-events: none;
  background: radial-gradient(30% 50% at 22% 60%, rgba(79, 214, 242, 0.22), transparent 70%), radial-gradient(30% 50% at 78% 40%, rgba(169, 139, 255, 0.26), transparent 70%);
  animation: cta-drift 18s ease-in-out infinite alternate;
}
@keyframes cta-drift { to { transform: translate(4%, -6%) rotate(4deg); } }
.cta-copy h2 { font-family: var(--font-display); font-size: clamp(34px, 4vw, 52px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; }
.cta-copy p { margin-top: 8px; color: rgba(241, 243, 244, 0.72); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
.cta-band .btn-primary { background: #f1f3f4; color: #0a0b0c; box-shadow: none; }
.cta-band .btn-primary:hover:not(:disabled) { background: #fff; color: #0a0b0c; }
.cta-band .btn-secondary { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.38); box-shadow: none; }
.cta-band .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.cta-band :focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7); }

/* App footer (home, methodology, compare, metric pages). */
.site-footer--app { max-width: none; grid-template-columns: auto 1fr; align-items: center; gap: 14px 32px; padding: 30px 0 44px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .logo-mark { width: 28px; height: 28px; color: var(--ink); }
.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 .link-btn { font-size: 13.5px; text-decoration: none; }
.footer-note { grid-column: 1 / -1; max-width: 92ch; font-size: 12.5px; color: var(--text-3); }

/* Drop a photo anywhere on the home page. */
.drop-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s;
}
body.is-dragging .drop-overlay { opacity: 1; visibility: visible; }
.drop-card {
  display: grid; justify-items: center; gap: 6px; padding: 38px 52px; border-radius: 24px; text-align: center;
  border: 2px dashed var(--accent); background: var(--surface); box-shadow: var(--shadow-lg);
  transform: scale(.95); transition: transform .3s var(--ease-spring);
}
body.is-dragging .drop-card { transform: none; }
.drop-card .icon { width: 36px; height: 36px; color: var(--accent-text); margin-bottom: 4px; }
.drop-card strong { font-size: 19px; }
.drop-card span { font-size: 13.5px; color: var(--text-3); }

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

/* ─── WORKSPACE ─────────────────────────────────────────────────────────── */

.is-workspace #main { height: calc(100dvh - var(--header-h)); }
#main:focus { outline: none; }

.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); height: 100%;
}
.stage {
  position: relative; overflow: hidden; min-height: 0; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse at 50% 40%, #191c22 0%, var(--stage-bg) 70%);
}
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

.stage-tools { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--radius-pill);
  background: rgba(20, 23, 29, 0.72); color: #e7eaf0; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background-color .15s, border-color .15s;
}
.tool-btn .icon { width: 16px; height: 16px; }
.tool-btn:hover:not(:disabled) { background: rgba(40, 45, 54, 0.9); border-color: rgba(255, 255, 255, 0.2); }
.tool-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* A toggle that is on: ringed in white on the dark glass, so it reads over a
   light photo too, but not the solid white of the Morph button. */
.tool-btn[aria-pressed="true"] { background: rgba(20, 23, 29, 0.88); border-color: rgba(255, 255, 255, 0.85); color: #fff; }
.tool-btn[aria-pressed="true"]:hover:not(:disabled) { background: rgba(40, 45, 54, 0.95); border-color: #fff; }

.stage-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; max-width: calc(100% - 24px);
  padding: 8px 16px; border-radius: 99px; font-size: 13px; color: #e7eaf0; text-align: center;
  background: rgba(20, 23, 29, 0.78); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none;
}
.stage-hint strong { color: #fff; }

.loupe {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 152px; height: 152px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none; opacity: 0; transform: scale(0.92); transition: opacity .12s, transform .12s;
}
.loupe.show { opacity: 1; transform: none; }

.panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--surface); border-left: 1px solid var(--border);
}
.panel-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 20px 24px; overscroll-behavior: contain; }
.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface);
}
.foot-right { display: flex; align-items: center; gap: 6px; }
.panel-title { font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: -0.015em; line-height: 1.05; margin: 6px 0 8px; }

/* Place panel */
.place-progress { display: grid; gap: 8px; margin-bottom: 16px; }
.place-progress .row { display: flex; justify-content: space-between; align-items: baseline; }

.lm-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.lm-ref { position: relative; background: var(--surface-2); aspect-ratio: 4 / 3; }

/* Landmark drawing (diagram.js). Strokes don't scale, so every view has the same line weights. */
.lmd { display: block; width: 100%; height: 100%; }
.lmd-skin { fill: var(--surface); }
.lmd-outline { fill: none; stroke: var(--text); stroke-width: 1.8px; stroke-linejoin: round; }
.lmd-line { fill: none; stroke: var(--text-2); stroke-width: 1.4px; stroke-linecap: round; }
.lmd-soft { opacity: 0.55; }
.lmd-dash { stroke-dasharray: 3 4; }
.lmd-brow { fill: var(--text-2); opacity: 0.28; }
.lmd-eye { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.4px; }
.lmd-iris { fill: var(--text-3); opacity: 0.5; }
.lmd-nostril { fill: var(--text-2); opacity: 0.45; }
.lmd-fade-a { stop-color: var(--surface-2); stop-opacity: 0; }
.lmd-fade-b { stop-color: var(--surface-2); stop-opacity: 1; }
.lmd-hilite { fill: none; stroke: var(--accent); stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round; }
.lmd-guide { fill: none; stroke: var(--accent); stroke-width: 1.6px; stroke-dasharray: 6 5; stroke-linecap: round; stroke-linejoin: round; }
.lmd-dot { stroke: var(--accent); stroke-width: 11px; stroke-linecap: round; }
.lmd-dot-ring { stroke: var(--surface); stroke-width: 16px; stroke-linecap: round; }
.lmd-pulse { stroke: var(--accent); stroke-width: 14px; stroke-linecap: round; opacity: 0; animation: lmd-pulse 1.8s ease-out infinite; }
@keyframes lmd-pulse {
  0% { stroke-width: 14px; opacity: 0.45; }
  100% { stroke-width: 40px; opacity: 0; }
}

.ref-caption {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--accent-text);
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--border); pointer-events: none;
}
/* Reference view picker: a segmented control, or one "next view" button on phones. */
.ref-seg {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; padding: 2px; border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.ref-seg button {
  height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: color .12s, background-color .12s;
}
.ref-seg button:hover { color: var(--text); }
.ref-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.ref-seg button[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.ref-seg button[aria-disabled="true"]:hover { color: var(--text-2); }
.ref-next {
  position: absolute; right: 6px; bottom: 6px; display: none; place-items: center; width: 28px; height: 28px;
  border-radius: 99px; color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.ref-next .icon { width: 14px; height: 14px; }
.lm-body { padding: 14px 16px 4px; display: grid; gap: 10px; font-size: 14px; color: var(--text-2); }
.lm-title { display: flex; align-items: center; gap: 10px; }
.lm-title h2 { font-size: 18px; color: var(--text); }
.abbr-badge {
  display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 7px; border-radius: 7px;
  background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 700;
}
.used-by { font-size: 12.5px; color: var(--text-3); }
.lm-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; }

.done-card {
  display: flex; gap: 14px; padding: 16px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--good) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.done-card .panel-title { margin-top: 0; font-size: 26px; }
.done-card p { font-size: 14px; }
.done-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--good); color: #fff; flex: none; }
.warn-text { color: var(--text-2); margin-top: 6px; }

.lm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.lm-list li { min-width: 0; }
.lm-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
  font-size: 13px; text-align: left; color: var(--text-2); transition: background-color .12s;
}
.lm-item:hover { background: var(--surface-2); }
.lm-item.is-current { background: var(--accent-soft); color: var(--text); }
.lm-state {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; flex: none;
  font-size: 10.5px; font-weight: 700; border: 1px solid var(--border-strong); color: var(--text-3);
}
.lm-state .icon { width: 12px; height: 12px; }
.is-placed .lm-state { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.is-skipped .lm-state { border-style: dashed; }
.is-current .lm-state { border-color: var(--accent); color: var(--accent-text); border-width: 2px; }
.lm-abbr { font-weight: 700; color: var(--text); min-width: 26px; }
.lm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd-hint { margin-top: 16px; font-size: 12px; color: var(--text-3); line-height: 2; }

/* ─── 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: var(--surface-3); stroke: color-mix(in srgb, var(--ring-color) 18%, transparent); stroke-width: 3.6; }
.ring-fill { fill: none; stroke: var(--ring-color); stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: var(--p) 100; }
.ring-num { grid-area: 1 / 1; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1; }
.ring-num small { font-size: 0.36em; font-weight: 600; color: var(--text-3); margin-left: 1px; letter-spacing: 0; }
.band-none .ring-fill { display: none; }
.band-none .ring-track { stroke: var(--surface-3); }
.band-none .ring-num { color: var(--text-3); }

.ring--sm { width: 30px; height: 30px; }
.ring--sm .ring-num { font-size: 10px; }
.ring--md { width: 44px; height: 44px; }
.ring--md .ring-num { font-size: 13px; }
.ring--lg { width: 60px; height: 60px; }
.ring--lg .ring-num { font-size: 18px; }
.ring--xl { width: 132px; height: 132px; }
.ring--xl .ring-track, .ring--xl .ring-fill { stroke-width: 2.2; }
.ring--xl .ring-num { display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-size: 54px; font-weight: 400; letter-spacing: -0.03em; }
.ring--xl .ring-num small { font-family: var(--font); font-size: 12px; font-weight: 600; margin: 6px 0 -10px; letter-spacing: 0.02em; }

.band-good { --ring-color: var(--good); }
.band-fair { --ring-color: var(--fair); }
.band-weak { --ring-color: var(--weak); }
.band-poor { --ring-color: var(--poor); }

.animate .ring-fill { animation: ring-in 0.9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ring-in { from { stroke-dasharray: 0 100; } }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ring-color); flex: none; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-3); margin-top: 18px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--ring-color); }
.legend--wide { margin: 8px 0 24px; font-size: 13px; }

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

.summary-hero { display: flex; align-items: center; gap: 20px; }
.summary-text { display: grid; gap: 4px; min-width: 0; }
.grade { font-family: var(--font-display); font-size: 40px; font-weight: 400; letter-spacing: -0.02em; line-height: 1; margin: 4px 0 2px; }
.scale-pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 4px 6px 4px 10px; border-radius: 99px; font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
}
.scale-pill .icon { width: 14px; height: 14px; }
.scale-pill:hover { border-color: var(--border-strong); }
.scale-pill.is-cal { color: var(--text); }
.pill-cta { font-weight: 600; color: var(--accent-text); background: var(--surface); padding: 1px 8px; border-radius: 99px; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.cat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border); text-align: left;
  transition: border-color .15s, background-color .15s;
}
.cat .ring { grid-row: span 2; }
.cat-name { font-size: 13px; font-weight: 600; line-height: 1.2; align-self: end; }
.cat-count { font-size: 11.5px; color: var(--text-3); align-self: start; }
.cat:hover { background: var(--surface-2); }
.cat[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.highlights .section-label { margin: 16px 0 6px; }
.highlights ul { display: grid; gap: 2px; }
.hl-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 8px;
  font-size: 13px; text-align: left; color: var(--text-2);
}
.hl-item:hover { background: var(--surface-2); color: var(--text); }
.hl-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-toolbar {
  position: sticky; top: -20px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 20px -20px 8px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.list-title { font-size: 15px; font-weight: 700; }
.sort select {
  height: 32px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); font-size: 13px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687182' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}

.metric-list { display: grid; gap: 8px; }
.metric { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.metric:hover { border-color: var(--border-strong); }
.metric.is-open { border-color: var(--border-strong); box-shadow: var(--shadow); }
.metric-head {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; text-align: left; border-radius: var(--radius-lg);
}
.metric-head:disabled { cursor: default; }
.metric-main { display: grid; gap: 3px; min-width: 0; }
.metric-name { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-sub { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; }
.metric-sub .ideal { color: var(--text-3); }
.metric-value { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { color: var(--text-3); transition: transform .2s; width: 16px; height: 16px; }
.is-open .chev { transform: rotate(180deg); }
.is-missing { background: var(--surface-2); border-style: dashed; }
.is-missing .metric-name { color: var(--text-2); }
.is-missing .metric-value { color: var(--text-3); }

.metric-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.metric-body .desc { color: var(--text-2); margin-top: 12px; }
.parts { display: grid; gap: 6px; margin-top: 12px; }
.part {
  display: grid; grid-template-columns: 76px auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px;
}
.part-label { color: var(--text-2); font-weight: 600; }
.part-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.part .chip { justify-self: end; }
.part-ideal { grid-column: 2 / -1; font-size: 12px; }
.info-line { margin-top: 10px; font-size: 13px; color: var(--text-2); }

.tier-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 12px; }
.tier-table caption { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 6px; }
.tier-table th { text-align: left; font-weight: 600; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tier-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.tier-table td:last-child, .tier-table th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tier-table tr:last-child td { border-bottom: 0; }
.tier-table tr.is-current td { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.tier-table tr.is-current td:first-child { border-radius: 6px 0 0 6px; }
.tier-table tr.is-current td:last-child { border-radius: 0 6px 6px 0; }
.tier-num { display: inline-block; min-width: 22px; font-weight: 700; color: var(--text); }
.rule { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }

.disclaimer { font-size: 12px; color: var(--text-3); margin-top: 14px; line-height: 1.5; }

/* Calibration */
.cal-panel .muted { font-size: 14px; }
.cal-steps { display: grid; gap: 8px; margin: 16px 0; counter-reset: cal; }
.cal-steps li {
  counter-increment: cal; display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--text-3);
}
.cal-steps li::before {
  content: counter(cal); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  font-size: 12px; font-weight: 700; border: 1px solid var(--border-strong);
}
.cal-steps li.current { color: var(--text); }
.cal-steps li.current::before { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cal-steps li.done { color: var(--text-2); }
.cal-steps li.done::before { content: "✓"; background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.cal-panel .field { margin-top: 4px; }
.cal-panel #calPreview { margin: 8px 0 16px; }
.cal-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.cal-panel .link-btn { display: block; margin-bottom: 14px; font-size: 13px; }

/* ─── METHODOLOGY ───────────────────────────────────────────────────────── */

.page-head { max-width: 760px; padding-bottom: 28px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(40px, 5vw, 60px); font-weight: 400; letter-spacing: -0.025em; line-height: 1; margin: 12px 0 14px; }
.back-link { margin: -12px 0 18px -12px; }

.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.method-card { padding: 20px; }
.method-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 8px; }
.method-card h3 .icon { color: var(--accent-text); }
.method-card p { font-size: 14px; color: var(--text-2); }

.method-toc { position: sticky; top: var(--header-h); z-index: 5; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--border); }
.method-toc ul { display: flex; flex-wrap: wrap; gap: 6px; }
.method-toc a {
  display: inline-block; padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
}
.method-toc a:hover { color: var(--text); border-color: var(--border-strong); }

.method-cat { padding-top: 36px; scroll-margin-top: calc(var(--header-h) + 60px); }
.method-cat > h2 { font-size: 22px; margin-bottom: 14px; }
.method-metric { padding: 20px 22px; margin-bottom: 12px; scroll-margin-top: calc(var(--header-h) + 60px); }
.method-metric header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.method-metric h3 { font-size: 17px; }
.method-metric > p { color: var(--text-2); font-size: 14.5px; max-width: 80ch; }
.method-metric .kv--compact div { justify-content: flex-start; }
.method-metric .kv--compact dt { min-width: 90px; }
.method-metric .kv--compact dd { text-align: left; }
.weight-badge { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.method-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 24px; }
.method-tables .tier-table { max-width: 520px; }
.plain-list { list-style: disc; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); font-size: 14.5px; max-width: 80ch; margin-bottom: 28px; }
.refs { list-style: decimal; padding-left: 22px; display: grid; gap: 6px; color: var(--text-2); font-size: 14px; max-width: 90ch; }
#references h2 { font-size: 22px; margin-bottom: 14px; }

/* ─── MODAL & TOAST ─────────────────────────────────────────────────────── */

.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; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@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); }

.morph-cta {
  width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; text-align: left;
  border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid transparent; transition: border-color .15s;
}
.morph-cta:hover { border-color: var(--accent); }
.morph-cta .icon { color: var(--accent-text); width: 20px; height: 20px; }
.morph-cta span { display: grid; gap: 1px; flex: 1; min-width: 0; }
.morph-cta strong { font-size: 14px; }
.morph-cta small { font-size: 12.5px; color: var(--text-2); }

/* ─── MORPH PANEL ───────────────────────────────────────────────────────── */

.morph-score { display: flex; align-items: center; gap: 10px; margin: 12px 0 18px; }
.ms-col { display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.ms-arrow { color: var(--text-3); margin-bottom: 20px; }
.ms-delta { margin-left: auto; display: grid; justify-items: end; text-align: right; padding-bottom: 20px; }
.ms-delta strong { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ms-delta span { font-size: 12px; color: var(--text-3); }
.is-up { color: color-mix(in srgb, var(--good) 72%, var(--text)); }
.is-down { color: color-mix(in srgb, var(--poor) 80%, var(--text)); }
.is-flat { color: var(--text-3); }

.segmented--2 { grid-template-columns: 1fr 1fr; }

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.preset {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: border-color .15s, color .15s, background-color .15s;
}
.preset:hover { border-color: var(--accent); color: var(--text); }
.preset--main { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.preset--main:hover { background: var(--accent-hover); color: var(--on-accent); }
.preset .icon { width: 15px; height: 15px; }

.mslider { padding: 4px 0 8px; }
.mslider-top { display: flex; align-items: center; gap: 6px; font-size: 13.5px; min-height: 24px; }
.mslider-top label { font-weight: 600; }
.mslider-top output { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mslider-reset { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); }
.mslider-reset[hidden] { display: none; }
.mslider-reset:hover { background: var(--surface-2); color: var(--text); }
.mslider-reset .icon { width: 14px; height: 14px; }
.mslider-hint { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.mslider.is-off label { color: var(--text-3); }

.mslider input[type="range"] {
  --lo: 50%; --hi: 50%;
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 24px; margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.mslider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--surface-3) var(--lo), var(--accent) var(--lo), var(--accent) var(--hi), var(--surface-3) var(--hi));
}
.mslider input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--surface-3) var(--lo), var(--accent) var(--lo), var(--accent) var(--hi), var(--surface-3) var(--hi));
}
.mslider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
}
.mslider input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
}
.mslider input[type="range"]:focus-visible { box-shadow: none; }
.mslider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
.mslider input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: var(--focus); }
.mslider input[type="range"]:disabled { cursor: not-allowed; opacity: 0.45; }

.brush-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.brush-tool {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2);
  transition: border-color .15s, background-color .15s, color .15s;
}
.brush-tool .icon { width: 22px; height: 22px; }
.brush-tool:hover { background: var(--surface-2); color: var(--text); }
.brush-tool[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.brush-tools--3 { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.brush-hint { margin: 8px 0 4px; }
.panel--morph .tip-box { margin: 14px 0 12px; }
.brush-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.brush-actions [hidden] { display: none; }

/* Score explorer (Morph → Scores) */
.ex-intro { margin: 14px 0 10px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.ex-what { margin-top: 12px; font-size: 13.5px; font-weight: 600; }
.ex-readout {
  display: flex; align-items: center; gap: 12px; min-height: 84px; margin: 10px 0 12px; padding: 12px;
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.ex-readout .ring { flex: none; }
.ex-read-main { display: grid; gap: 2px; min-width: 0; }
.ex-value { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.ex-value strong { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ex-verdict { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.ex-verdict.dir-in { color: color-mix(in srgb, var(--good) 70%, var(--text)); }
.ex-sub { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ex-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.ex-ends span { display: inline-flex; align-items: center; gap: 4px; }
.ex-ends .icon { width: 14px; height: 14px; color: var(--text-3); }
.ex-range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 2px 0 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.ex-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--ex-track, var(--surface-3)); }
.ex-range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--ex-track, var(--surface-3)); }
.ex-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--text); box-shadow: var(--shadow);
}
.ex-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--text); box-shadow: var(--shadow); }
.ex-range:focus-visible { box-shadow: none; }
.ex-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
.ex-range:focus-visible::-moz-range-thumb { box-shadow: var(--focus); }
.ex-marks { position: relative; height: 22px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.ex-mark { position: absolute; top: 0; display: grid; justify-items: center; line-height: 1.1; white-space: nowrap; transform: translateX(-50%); }
.ex-mark::before { content: ""; width: 2px; height: 5px; margin-bottom: 2px; border-radius: 1px; background: currentColor; }
.ex-mark--ideal { color: color-mix(in srgb, var(--good) 72%, var(--text)); }
.ex-mark--l { justify-items: end; transform: translateX(calc(-100% + 1px)); }
.ex-mark--r { justify-items: start; transform: translateX(-1px); }
.ex-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.ex-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 6px; }
.ex-thumb {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 3px;
  border: 1px solid transparent; border-radius: var(--radius); transition: border-color .15s, background-color .15s;
}
.ex-thumb:hover { background: var(--surface-2); }
.ex-thumb.is-current { border-color: var(--accent); background: var(--accent-soft); }
.ex-thumb canvas { width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); background: var(--surface-3); }
.ex-badge {
  position: absolute; top: 7px; left: 7px; min-width: 26px; padding: 0 5px; border-radius: 99px;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums;
  color: #101318; background: var(--ring-color); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.ex-badge.band-poor { color: #fff; }
.ex-cap { font-size: 11.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-thumb.is-ideal .ex-cap { color: color-mix(in srgb, var(--good) 72%, var(--text)); }
.ex-note, .ex-flat, .ex-missing { margin-top: 10px; line-height: 1.45; }

.chg-list { display: grid; }
.chg {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.chg:last-child { border-bottom: 0; }
.chg-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg-val { grid-column: 1; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chg-rate { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg-more { margin-top: 6px; }

.print-report { display: none; }

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

@media (max-width: 1180px) {
  :root { --panel-w: 380px; }
  .stepper .step-label { display: none; }
  .stepper li.current .step-label { display: inline; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "copy" "visual" "setup"; row-gap: 36px; }
  .hero-visual { position: relative; top: auto; width: 100%; max-width: 620px; margin: 0 auto; }
  .hero .setup { width: 100%; max-width: 620px; margin: 0 auto; }
  .hero-chip--pts { left: -12px; }
  .hero-card { left: -12px; }
  .steps-grid, .measure-grid, .tips-grid, .method-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card, .step-card + .step-card { padding: 24px 0 18px; border-left: 0; border-bottom: 1px solid var(--border); }
  .step-card::before { font-size: 48px; }
  .step-card h3 { margin-top: 12px; }
}

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 55%) minmax(0, 1fr); }
  .panel { border-left: 0; border-top: 1px solid var(--border); }
  .lm-card { display: grid; grid-template-columns: 132px 1fr; }
  .lm-ref { aspect-ratio: auto; grid-row: span 2; }
  .ref-caption, .ref-seg { display: none; }
  .ref-next { display: grid; }
  .lm-body { padding: 10px 12px 2px; gap: 6px; font-size: 13px; }
  .lm-body .tip-box { padding: 8px 10px; font-size: 12.5px; }
  .lm-title h2 { font-size: 15.5px; }
  .used-by { display: none; }
  .lm-actions { padding: 8px 12px 10px; }
  .loupe { width: 120px; height: 120px; }
}

/* 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; }
  .brand-text, .hide-sm { display: none; }
  .workspace { grid-template-rows: minmax(220px, 46%) minmax(0, 1fr); }
  .view-results .stage-hint, .view-morph .stage-hint { display: none; }
  .stepper li + li::before { width: 10px; }
  .page { padding: 28px 16px 0; }
  .page--home { padding-top: 22px; }
  .hero { row-gap: 26px; padding-bottom: 8px; }
  .hero h1 { margin-top: 12px; }
  .lead { font-size: 16px; }
  .hero-facts { gap: 8px 14px; margin-top: 16px; }
  .hero-facts li { font-size: 13px; }
  .setup { padding: 16px; gap: 18px; }
  .hero-visual { margin-bottom: 0; }
  .hero-window { padding: 0 4px 4px; border-radius: 18px; }
  .hw-lights { display: none; }
  .hw-bar { height: 40px; gap: 6px; padding-left: 8px; }
  .hero-frame { border-radius: 14px; }
  .hero-readout {
    position: relative; right: auto; bottom: auto; max-width: none; min-height: 62px; margin-top: 4px;
    border-radius: 12px; box-shadow: none; transform: none;
  }
  .hero-chip--pts { top: 52px; bottom: auto; left: 10px; padding: 6px 10px; font-size: 12px; }
  .hero-card { position: relative; left: auto; top: auto; width: auto; margin-top: 12px; }
  .steps-grid, .measure-grid, .tips-grid, .method-grid { grid-template-columns: 1fr; }
  .section { padding-top: 44px; }
  .page--home .section { padding-top: 64px; }
  .cta-band { flex-direction: column; align-items: stretch; margin-top: 64px; padding: 28px 22px; }
  .cta-actions .btn { flex: 1; }
  .site-footer--app { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .drop-card { padding: 28px 24px; }
  .panel-scroll { padding: 16px 16px 20px; }
  .list-toolbar { margin: 16px -16px 8px; padding: 10px 16px; top: -16px; }
  .lm-card { grid-template-columns: 104px 1fr; }
  .lm-list { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .highlights { grid-template-columns: 1fr; }
  .summary-hero { gap: 14px; }
  .ring--xl { width: 108px; height: 108px; }
  .ring--xl .ring-num { font-size: 44px; }
  .grade { font-size: 32px; }
  .tool-btn span { display: none; }
  .tool-btn { padding: 0 9px; }
  .tool-btn--accent { padding: 0 11px; }
  .tool-btn--accent span { display: inline; }
  .stage-hint { font-size: 12px; bottom: 10px; padding: 5px 12px; line-height: 1.35; }
  .panel-foot { padding: 10px 12px; }
  .panel-foot .btn { padding: 0 12px; }
  .panel-foot .btn span { display: none; }
  .panel-foot .btn-primary span, .panel-foot .btn-primary { display: inline-flex; }
  .part { grid-template-columns: 70px auto 1fr; }
  .kbd-hint { display: none; }
}

@media (hover: none) {
  .kbd-hint { display: none; }
}

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

@media (max-width: 640px) {
  :root.has-flow { --header-h: 97px; }
  .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; }
}

@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; }
}

/* ─── FORM BITS ─────────────────────────────────────────────────────────── */

.select {
  display: block; width: 100%; height: 40px; padding: 0 32px 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); font-size: 14px; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687182' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.select--sm { height: 30px; font-size: 13px; padding: 0 26px 0 9px; width: auto; background-position: right 8px center; }
.select:focus-visible { box-shadow: var(--focus); }
.text-input {
  display: block; width: 100%; height: 40px; margin-top: 12px; 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); }
.segmented--3 { grid-template-columns: repeat(3, 1fr); }
.info-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); vertical-align: middle; }
.info-btn:hover { color: var(--text); background: var(--surface-2); }
.info-btn .icon { width: 15px; height: 15px; }
.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); } }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── AUTO-PLACE ────────────────────────────────────────────────────────── */

.auto-card { display: grid; gap: 8px; justify-items: start; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.auto-card p { font-size: 13px; line-height: 1.45; }
.auto-short { display: none; }
@media (max-width: 640px) {
  .auto-desc { display: none; }
  .auto-short { display: block; }
  .auto-card { padding: 10px 12px; gap: 6px; }
}
/* The photo doesn't look like a side profile: a warning, not guesses. */
.auto-card--doubt { background: color-mix(in srgb, #d97706 10%, var(--surface)); border-color: color-mix(in srgb, #d97706 35%, transparent); }
.auto-doubt-title { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.auto-doubt-title .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: #d97706; }
.auto-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-status { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.auto-phase { display: block; font-weight: 500; font-size: 12.5px; color: var(--text-2); }
.auto-progress { width: 100%; height: 4px; }

/* The guide's bar on the photo: what to do now, and the buttons to do it. */
.stage-bar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 5px 5px 5px 14px;
  border-radius: 99px; font-size: 13px; color: #e7eaf0; white-space: nowrap;
  background: rgba(20, 23, 29, 0.82); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stage-bar:not(.has-actions) { padding: 7px 14px; pointer-events: none; }
.stage-bar-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stage-bar-text strong { color: #fff; }
.stage-bar-actions { display: flex; gap: 6px; flex: none; }
.stage-bar-actions:empty { display: none; }
.stage-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 99px;
  font-size: 13px; font-weight: 650; color: #e7eaf0; background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14); transition: background-color .15s;
}
.stage-btn:hover { background: rgba(255, 255, 255, 0.18); }
.stage-btn .icon { width: 15px; height: 15px; }
.stage-btn--primary { background: #2f5bea; border-color: transparent; color: #fff; }
.stage-btn--primary:hover { background: #2449c9; }
@media (max-width: 640px) {
  .stage-bar { bottom: 10px; font-size: 12px; }
  .stage-bar.has-actions { padding: 4px; }
  .stage-bar.has-actions .stage-bar-text { display: none; }
  .stage-btn { height: 36px; padding: 0 15px; font-size: 14px; }
}

/* How an estimate was found (outline: likely close; the others: check closely). */
.est-note {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.45; color: var(--text); background: var(--surface-2);
}
.est-note .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--accent-text); }
.est-note--template, .est-note--rough, .est-note--guess, .est-note--doubt, .est-note--hair { background: color-mix(in srgb, #d97706 12%, var(--surface)); }
.est-note--template .icon, .est-note--rough .icon, .est-note--guess .icon, .est-note--doubt .icon, .est-note--hair .icon { color: #d97706; }
.accept-all { display: block; margin: 10px 2px 0; font-size: 12.5px; font-weight: 600; text-align: left; }

/* A landmark estimated but not checked yet: a dashed ring. */
.is-suggested .lm-state { border: 1.5px dashed var(--accent); color: var(--accent-text); }

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

.norms-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.spread { display: grid; gap: 6px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); font-size: 13.5px; }
.spread-range { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); }
.spread-range > .icon { color: var(--text-3); margin-top: 2px; }
.spread-range .info-btn { margin: -2px 0 0 2px; }
.spread-range strong { color: var(--text); font-variant-numeric: tabular-nums; }
.spread-points { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.spread-points .muted { margin-right: 2px; }
.lm-chip--btn { cursor: pointer; }
.lm-chip--btn:hover { border-color: var(--accent); color: var(--accent-text); }
.highlights--one { grid-template-columns: 1fr; }

.losses { margin-top: 16px; }
.losses .section-label { margin-bottom: 6px; }
.loss-list { display: grid; gap: 2px; }
.loss { display: flex; align-items: center; gap: 6px; }
.loss-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  padding: 6px 8px; border-radius: var(--radius-sm); text-align: left; font-size: 13.5px;
}
.loss-main .loss-bar { grid-column: 1 / -1; }
.loss-main:hover { background: var(--surface-2); }
.loss-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loss-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.loss-bar i { display: block; height: 100%; border-radius: 99px; background: var(--weak); }
.loss-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: right; }
.loss-show { flex: none; }
.losses > .muted { margin-top: 6px; }

/* Range bar: tier segments, likely range, value marker. */
.rbars { display: grid; gap: 3px; }
.rbars--sm { margin-top: 7px; max-width: 260px; }
.rbars--lg { gap: 18px; margin: 4px 0 20px; }
.rbar { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rb-label { flex: none; width: 10px; font-size: 10px; font-weight: 700; color: var(--text-3); line-height: 1; }
.rb-track { position: relative; flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); }
.rbars--lg .rb-track { height: 10px; }
.rb-seg { position: absolute; top: 0; bottom: 0; }
.rb-seg + .rb-seg { border-left: 2px solid var(--surface); }
.rb-seg:first-child { border-radius: 99px 0 0 99px; }
.rb-seg:nth-last-child(1 of .rb-seg) { border-radius: 0 99px 99px 0; }
.sev-good { background: color-mix(in srgb, var(--good) 55%, var(--surface)); }
.sev-fair { background: color-mix(in srgb, var(--fair) 55%, var(--surface)); }
.sev-weak { background: color-mix(in srgb, var(--weak) 55%, var(--surface)); }
.sev-poor { background: color-mix(in srgb, var(--poor) 50%, var(--surface)); }
.rb-likely { position: absolute; top: -3px; bottom: -3px; border-radius: 99px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.rb-mark {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--ring-color, var(--text-3)); box-shadow: 0 0 0 2px var(--surface), 0 1px 3px rgba(0,0,0,.25);
}
.rbars--lg .rb-mark { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.rb-mark.is-out { border-radius: 3px; }
.rb-tick { position: absolute; top: 14px; transform: translateX(-50%); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-tick::before { content: ""; position: absolute; left: 50%; top: -6px; height: 4px; border-left: 1px solid var(--text-3); }
.sens { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0; }
.sens .icon { width: 15px; height: 15px; margin-top: 2px; }

.metric-explain { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 16px; align-items: start; margin: 12px 0 8px; }
.metric-explain .desc { margin: 0; }
.metric-body .metric-explain { grid-template-columns: 1fr; }
.metric-body .mfig-wrap { width: 100%; max-width: 300px; margin: 0 auto; }
.mfig-wrap { margin: 0; border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.mfig-wrap figcaption { padding: 4px 8px 6px; font-size: 11px; color: var(--text-3); text-align: center; }
.mfig { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.mfig .lmd-skin { fill: var(--surface); }
.mfig-geo { fill: none; stroke: #e0a100; stroke-width: 2px; stroke-linecap: round; }
:root[data-theme="dark"] .mfig-geo { stroke: var(--fair); }
.mfig-dash { stroke-dasharray: 5 4; }
.mfig-arc { opacity: .85; }
.mfig-foot { fill: #e0a100; }
.mfig-text { fill: var(--text-2); font-weight: 600; font-family: var(--font); }
.mfig-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.mfig-label { fill: var(--text); font-weight: 700; font-family: var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.metric-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }

.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.result-actions .btn { flex: 1; justify-content: center; }

.focus-chip {
  display: inline-flex; align-items: center; gap: 4px; flex-basis: 100%; justify-content: center; margin-top: -8px; padding: 4px 10px;
  border-radius: 99px; background: color-mix(in srgb, var(--fair) 22%, var(--surface)); font-size: 12.5px; font-weight: 600; color: var(--text);
}
.focus-chip .icon { width: 13px; height: 13px; }
.morph-score { flex-wrap: wrap; }

/* ─── CAMERA ────────────────────────────────────────────────────────────── */

.cam-backdrop { padding: 0; background: rgba(5, 6, 8, 0.92); }
.cam { display: grid; grid-template-rows: auto 1fr auto; width: min(960px, 100%); height: min(100dvh, 860px); background: #0b0d11; color: #eef1f5; }
.cam-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.cam-title { font-size: 16px; }
.cam-head .icon-btn { color: #eef1f5; }
.cam-stage { position: relative; min-height: 0; overflow: hidden; background: #000; }
.cam-video, .cam-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-video.is-mirrored { transform: scaleX(-1); }
.cam-video[hidden], .cam-shot[hidden] { display: none; }
.cam-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(64px, 18vw, 140px); font-weight: 800; color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.6); pointer-events: none; }
.cam-status {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 7px 14px; border-radius: 99px; background: rgba(11,13,17,.78); font-size: 13.5px; text-align: center;
}
.cam-status.is-ok { color: #6ee7b7; }
.cam-bar { display: grid; gap: 10px; padding: 12px 14px 16px; }
.cam-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.cam-controls[hidden], .cam-zoom[hidden], .cam-levelopt[hidden] { display: none; }
.cam-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #c7cdd6; }
.cam-opt .select { background-color: #191d23; color: #eef1f5; border-color: #353c47; }
.cam-shutter { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.cam-shutter span { width: 48px; height: 48px; border-radius: 50%; background: #fff; transition: transform .1s; }
.cam-shutter:active span { transform: scale(.9); }
.cam .tool-btn { color: #eef1f5; background: #191d23; border-color: #353c47; }
.cam-zoom { display: flex; align-items: center; gap: 10px; justify-content: center; }
.cam-zoom input { width: min(320px, 70%); }
.cam-zoom .field-label { color: #c7cdd6; margin: 0; }
.cam-tips { text-align: center; color: #9aa3b1; }

/* ─── COMPARE ───────────────────────────────────────────────────────────── */

.compare-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.compare-layout > * { min-width: 0; }
.compare-controls .select { text-overflow: ellipsis; }
.compare-layout > .card { padding: 18px; }
.compare-controls { display: grid; gap: 12px; }
.compare-controls .field { margin: 0; }
.swap-btn { justify-self: start; }
.compare-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-figure { display: grid; gap: 10px; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-2); }
.cmp-key { display: inline-flex; align-items: center; gap: 8px; }
.cmp-key i { width: 22px; height: 0; border-top: 3px solid; }
.cmp-key--a i { border-color: #2f5bea; }
.cmp-key--b i { border-color: #d97706; border-top-style: dashed; }
:root[data-theme="dark"] .cmp-key--a i { border-color: #5b7cf0; }
:root[data-theme="dark"] .cmp-key--b i { border-color: #c47c12; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cmp-key--a i { border-color: #5b7cf0; }
  :root:not([data-theme="light"]) .cmp-key--b i { border-color: #c47c12; }
}
.cmp-canvas-wrap { position: relative; height: clamp(320px, 52vh, 560px); border-radius: var(--radius); background: var(--surface-2); }
.cmp-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.compare-table-card, .history-card { grid-column: 1 / -1; }
.cmp-overall { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.cmp-overall .ms-delta { padding-bottom: 0; }
.cmp-overall .ms-arrow { margin-bottom: 0; }
.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; }
.history-card .section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.trend { margin: 0 0 12px; }
.trend .section-label { margin-bottom: 4px; }
.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: #2f5bea; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-dot { fill: #2f5bea; stroke: var(--surface); stroke-width: 2; }
.sp-hit { fill: transparent; }
.sp-pt:hover .sp-dot { r: 6; }
:root[data-theme="dark"] .sp-line { stroke: #5b7cf0; }
:root[data-theme="dark"] .sp-dot { fill: #5b7cf0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sp-line { stroke: #5b7cf0; }
  :root:not([data-theme="light"]) .sp-dot { fill: #5b7cf0; }
}
.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; }

/* ─── SHARE CARD ────────────────────────────────────────────────────────── */

.modal--wide { width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.share-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.share-head .modal-title { margin: 0; }
.share-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.share-preview { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); max-height: 64dvh; aspect-ratio: 4 / 5; justify-self: center; width: 100%; }
.share-preview img { width: 100%; height: 100%; object-fit: contain; }
.share-opts { display: grid; gap: 14px; }
.share-opts .field { margin: 0; }
.share-actions { display: grid; gap: 8px; }

/* ─── METHODOLOGY ADDITIONS ─────────────────────────────────────────────── */

.method-metric .metric-explain { grid-template-columns: minmax(180px, 240px) 1fr; }
.method-metric .metric-explain p { color: var(--text-2); font-size: 14.5px; }
.pop-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0 8px; }
.pop-table th, .pop-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.pop-table thead th { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.pop-table td { font-variant-numeric: tabular-nums; color: var(--text-2); }
.page--method .plain-list li { max-width: 90ch; }

/* ─── METRIC PAGES (static) ─────────────────────────────────────────────── */

.page--doc { max-width: 960px; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); }
.doc-article > section { margin: 28px 0; }
.doc-article h2 { font-size: 20px; margin-bottom: 10px; }
.doc-article p { color: var(--text-2); max-width: 75ch; }
.doc-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.doc-figure { margin: 0; padding: 12px; }
.doc-figure .mfig { border-radius: var(--radius); background: var(--surface-2); }
.doc-figure figcaption { margin-top: 8px; }
.doc-facts { padding: 18px; }
.doc-facts h2 { font-size: 16px; }
.doc-landmarks { display: grid; gap: 8px; color: var(--text-2); }
.doc-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; margin: 28px 0; background: var(--accent-soft); border-color: transparent; }
.doc-cta h2 { font-size: 18px; margin-bottom: 4px; }
.doc-cta .btn { flex: none; }
.doc-related { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-related a { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-strong); text-decoration: none; color: var(--text-2); font-size: 13.5px; }
.doc-related a:hover { border-color: var(--accent); color: var(--text); }
.doc-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.doc-group { padding: 18px 20px; }
.doc-group h2 { font-size: 17px; margin-bottom: 8px; }
.doc-index { display: grid; gap: 10px; }
.doc-index li { display: grid; gap: 1px; }
.doc-index a { color: var(--text); text-decoration: none; }
.doc-index a:hover { color: var(--accent-text); text-decoration: underline; }
body.doc .header-actions { display: flex; gap: 6px; }
body.doc .header-actions a { text-decoration: none; }

/* ─── NEW FEATURES: SMALL SCREENS ───────────────────────────────────────── */

@media (max-width: 860px) {
  .compare-layout, .doc-grid, .doc-groups { grid-template-columns: minmax(0, 1fr); }
  .share-body { grid-template-columns: 1fr; }
  .share-preview { max-height: 48dvh; }
}

@media (max-width: 640px) {
  .metric-explain, .method-metric .metric-explain { grid-template-columns: 1fr; }
  .mfig-wrap { max-width: 320px; }
  .loss-show span, .loss-show { font-size: 12px; }
  .doc-cta { flex-direction: column; align-items: flex-start; }
  body.doc .header-actions .btn-ghost { display: none; }
  .cam { height: 100dvh; }
  .cam .tool-btn span { display: none; }
  .cmp-table { font-size: 12.5px; }
  .history-item { flex-wrap: wrap; }
  .hi-actions { margin-left: auto; }
}

/* ─── RESULTS (summary / measurements tabs) ─────────────────────────────── */

@media (min-width: 1280px) {
  .workspace--results { --panel-w: 460px; }
}

/* The photo's column is as wide as the face at full height (--stage-ar, set
   by app.js), so the photo fills it, and the ratings take the rest of the
   width: at least --panel-w, and no more than 1500px. Below 861px the two
   stack, as before. */
@media (min-width: 861px) {
  .workspace--results {
    grid-template-columns:
      clamp(300px, max(calc(var(--stage-ar, 0.8) * (100dvh - var(--header-h))), calc(100% - 1500px)), calc(100% - var(--panel-w)))
      minmax(0, 1fr);
  }
}
.workspace--results .stage-tools { flex-wrap: wrap; max-width: calc(100% - 24px); }
.workspace--results .stage-hint { width: max-content; }

.rtabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.rtabs[hidden] { display: none; }
.rtabs button {
  position: relative; height: 46px; font-size: 14px; font-weight: 650; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.rtabs button:hover { color: var(--text); }
.rtabs button[aria-selected="true"] { color: var(--text); }
.rtabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.rtab-count { min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); }

/* Summary */
.sum-hero { display: flex; align-items: center; gap: 18px; }
.sum-head { display: grid; gap: 2px; min-width: 0; }
.sum-verdict { color: var(--text-2); font-size: 14px; line-height: 1.45; margin-top: 4px; }

/* Where the overall score sits among the grades. */
.gscale { margin-top: 10px; }
.gs-track { position: relative; display: flex; gap: 2px; height: 6px; }
.gs-seg { border-radius: 2px; opacity: .55; }
.gs-seg:first-child { border-radius: 99px 2px 2px 99px; }
.gs-seg:last-child { border-radius: 2px 99px 99px 2px; }
.gs-seg.is-cur { opacity: 1; }
.gs-0 { background: var(--poor); }
.gs-1 { background: var(--weak); }
.gs-2 { background: var(--fair); }
.gs-3 { background: color-mix(in srgb, var(--good) 45%, var(--fair)); }
.gs-4 { background: var(--good); }
.gs-5 { background: color-mix(in srgb, var(--good) 75%, #005c3a); }
.gs-mark {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 2.5px var(--surface), 0 1px 4px rgba(0, 0, 0, 0.3);
}
.sum.animate .gs-mark { animation: gs-in .9s var(--ease-out) both; }
@keyframes gs-in { from { left: 0; opacity: 0; } }
.gs-cap { margin-top: 7px; font-size: 12px; color: var(--text-3); }
.gs-cap strong { color: var(--text-2); font-weight: 650; }
.sum.animate .sum-hero, .sum.animate .dist { animation: rise .35s ease both; }
.sum.animate .dist { animation-delay: .06s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.dist { margin-top: 18px; }
.dist-bar { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.dist-bar i { background: var(--ring-color); min-width: 6px; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.dist-legend li { display: inline-flex; align-items: center; gap: 5px; }
.dist-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--ring-color); }
.dist-legend strong { color: var(--text); font-variant-numeric: tabular-nums; }
.dist-legend .is-zero { opacity: .55; }

.sum-areas-line { margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.sum-areas-line .link-btn { font-size: inherit; font-weight: 650; }

.norms { margin-top: 14px; }
.norms-line { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.norms-line > .icon { width: 16px; height: 16px; color: var(--text-3); }
.norms-line > span { flex: 1; min-width: 0; }
.norms-line strong { color: var(--text); font-weight: 600; }
.norms-drawer { display: grid; gap: 12px; padding: 14px 12px 4px; }
.norms-drawer[hidden] { display: none; }
.norms-drawer .field { margin: 0; display: grid; gap: 4px; }
.norms-drawer .scale-pill { justify-self: start; }

.sum-sec { margin-top: 26px; }
.sum-sec > .section-label { margin-bottom: 8px; }

.area-list { display: grid; gap: 2px; }
.area-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 8px; border-radius: var(--radius); text-align: left;
}
.area-row:hover, .area-row:focus-visible { background: var(--surface-2); }
.area-main { display: grid; gap: 1px; min-width: 0; }
.area-name { font-size: 14.5px; font-weight: 650; }
.area-note { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.area-go { width: 16px; height: 16px; color: var(--text-3); }
.area-row:hover .area-go { color: var(--accent-text); }

.opp-list { display: grid; gap: 6px; }
.opp { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.opp-main { flex: 1; min-width: 0; display: grid; gap: 3px; padding: 8px 10px; border-radius: var(--radius); text-align: left; }
.opp-main:hover, .opp-main:focus-visible { background: var(--surface-2); }
.opp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.opp-name { font-size: 14.5px; font-weight: 650; }
.opp-loss { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--weak) 70%, var(--text)); }
.opp-note { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.opp-tech { font-size: 12px; color: var(--text-3); }
.opp .loss-bar { margin-top: 4px; }
.opp-show { flex: none; margin-top: 8px; }

.strength-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.strength {
  width: 100%; height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 2px 8px;
  padding: 9px 10px; border-radius: var(--radius); border: 1px solid var(--border); text-align: left; font-size: 13.5px; font-weight: 600;
}
.strength:hover { border-color: var(--border-strong); background: var(--surface-2); }
.strength .icon { width: 16px; height: 16px; color: var(--good); margin-top: 1px; }
.strength small { grid-column: 2; font-size: 12px; font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }

.precision { padding: 14px; border-radius: var(--radius-lg); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.precision .section-label { margin-bottom: 6px; }
.precision strong { color: var(--text); font-variant-numeric: tabular-nums; }
.precision-pts { margin-top: 10px; }
.pt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pt-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 6px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text);
}
.pt-chip:hover { border-color: var(--accent); }

.sum-sec .morph-cta { margin-top: 0; }
.all-link {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 14px; height: 42px;
  border-radius: var(--radius-pill); font-size: 14px; font-weight: 650; color: var(--text); border: 1px solid var(--border-strong);
}
.all-link:hover { background: var(--surface-2); }
.all-link .icon { width: 16px; height: 16px; }

.howto { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 12px; }
.howto summary { cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--text-2); list-style-position: inside; }
.howto summary:hover { color: var(--text); }
.howto ul { margin-top: 10px; display: grid; gap: 8px; color: var(--text-2); }
.howto .lg { margin-right: 8px; }
.sum .disclaimer { margin-top: 16px; }

.rtabs button .icon { width: 16px; height: 16px; color: var(--accent-text); }

/* Morph button on the photo: the way into Morph, so it stands out. */
.tool-btn--accent {
  background: #f1f3f4; border-color: transparent; color: #0a0b0c;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.7);
}
.tool-btn--accent:hover:not(:disabled) { background: #fff; border-color: transparent; }
.tool-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; margin-left: 2px;
  display: inline-grid; place-items: center; background: #ffb020; color: #1b1300; font-size: 11px; font-weight: 750;
}
.tool-badge[hidden] { display: none; }

/* Point check */
.check-card {
  margin-top: 14px; padding: 14px; border-radius: var(--radius-lg); font-size: 13.5px; color: var(--text-2);
  background: color-mix(in srgb, #ffb020 12%, var(--surface)); border: 1px solid color-mix(in srgb, #ffb020 45%, var(--border));
}
.check-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--text); }
.check-card h3 .icon { width: 18px; height: 18px; color: color-mix(in srgb, #ffb020 70%, var(--text)); }
.check-card ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; list-style: disc; line-height: 1.45; }
.check-card .pt-chips { margin-top: 10px; }
.check-foot { margin-top: 10px; font-size: 12.5px; line-height: 1.5; }
.check-foot .link-btn.small { margin-left: 0; font-size: inherit; }
.check-ok { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 12.5px; }
.check-ok .icon { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--good); }

/* Summary → Improve */
.pot-teaser {
  width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px 14px; text-align: left;
  border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, transparent));
  transition: border-color .15s, transform .15s;
}
.pot-teaser:hover { border-color: var(--accent); }
.pot-teaser:active { transform: scale(.995); }
.pot-teaser > .icon:first-child { flex: none; width: 22px; height: 22px; color: var(--accent-text); }
.pot-teaser > .icon:last-child { flex: none; width: 18px; height: 18px; color: var(--accent-text); }
.pot-teaser span { display: grid; gap: 1px; flex: 1; min-width: 0; }
.pot-teaser strong { font-size: 14.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pot-teaser small { font-size: 12.5px; color: var(--text-2); }

/* Improve tab */
.imp-wip {
  padding: 14px; margin-bottom: 22px; border-radius: var(--radius-lg); background: var(--surface-2); font-size: 13.5px; color: var(--text-2);
}
.imp-wip-score { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.imp-wip-score .ms-delta { padding: 0; }
.imp-wip-score .ms-delta strong { font-size: 22px; }
.imp-wip p strong { color: var(--text); }
.imp-wip-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pot-arrow { width: 18px; height: 18px; color: var(--text-3); flex: none; }

.imp-title { font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.imp-lead { margin-top: 4px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.imp-potential {
  margin-top: 14px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
}
.pot-row { display: flex; align-items: center; gap: 10px; }
.pot-text { display: grid; gap: 2px; min-width: 0; margin-left: 4px; }
.pot-text strong { font-size: 16px; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.pot-text span { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.pot-go { width: 100%; justify-content: center; margin-top: 12px; }
.pot-wait { border-radius: 50%; border: 3.5px solid var(--surface-3); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pot-wait { animation: none; } }

.imp-areas { display: grid; gap: 2px; }
.imp-area { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--radius); }
.imp-area:hover { background: var(--surface-2); }
.imp-area-ic {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.imp-area-ic .icon { width: 20px; height: 20px; }
.imp-area.is-none .imp-area-ic { background: var(--surface-2); color: var(--text-3); }
.imp-area-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.imp-area-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.imp-area-name { font-size: 14.5px; font-weight: 650; }
.imp-gain { font-size: 14px; font-weight: 750; color: color-mix(in srgb, var(--good) 72%, var(--text)); font-variant-numeric: tabular-nums; }
.imp-bar { display: block; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.imp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.imp-area-note { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.imp-area.is-wait .imp-area-note { color: var(--text-3); }
.imp-area .btn { flex: none; }

.imp-metrics { display: grid; gap: 4px; margin-bottom: 8px; }
.imp-metric { display: flex; align-items: center; gap: 8px; }
.imp-metric-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius); text-align: left; }
.imp-metric-main:hover, .imp-metric-main:focus-visible { background: var(--surface-2); }
.imp-metric-main > span:last-child { display: grid; gap: 1px; min-width: 0; }
.imp-metric-name { font-size: 14px; font-weight: 650; }
.imp-metric-name .opp-loss { font-size: 12.5px; margin-left: 4px; }
.imp-metric-sub { font-size: 12px; color: var(--text-3); }
.imp-metric-acts { flex: none; display: flex; gap: 4px; }

.imp-tools { display: grid; gap: 8px; }
.imp-tool {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, background-color .15s;
}
.imp-tool:hover { border-color: var(--accent); background: var(--accent-soft); }
.imp-tool > .icon:first-child { flex: none; width: 22px; height: 22px; color: var(--accent-text); }
.imp-tool span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.imp-tool strong { font-size: 14px; }
.imp-tool small { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.imp-tool-go { flex: none; width: 16px; height: 16px; color: var(--text-3); }
.imp .disclaimer { margin-top: 20px; }

/* Measurement importance */
.metric-weight { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.wdots { display: inline-flex; gap: 3px; }
.wdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); }
.wdots i.on { background: var(--accent); }

/* Morph panel header */
.back-link {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; margin: -6px 0 2px -6px; padding: 0 8px 0 4px;
  border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--accent-text);
}
.back-link:hover { background: var(--accent-soft); }
.back-link .icon { width: 16px; height: 16px; }
.panel-title-sub { font-family: var(--font); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-3); margin-left: 6px; }

/* Measurements tab */
.panel--results .list-toolbar { flex-direction: column; align-items: stretch; gap: 10px; margin-top: -20px; padding-top: 14px; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 2px; }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.fchip span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fchip:hover { color: var(--text); border-color: var(--text-3); }
.fchip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.fchip[aria-pressed="true"] span { color: inherit; opacity: .7; }
.list-row2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-hint { margin: 0; }
.filter-chips { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }

.panel--results .metric-head { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; padding: 12px; }
.metric-verdict { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.metric-verdict.dir-in { color: color-mix(in srgb, var(--good) 70%, var(--text)); }
.metric-side { display: grid; justify-items: end; gap: 1px; text-align: right; max-width: 9.5em; }
.metric-value { white-space: nowrap; }
.metric-ideal { font-size: 11.5px; line-height: 1.35; color: var(--text-3); font-variant-numeric: tabular-nums; }
.panel--results .metric { scroll-margin-top: 118px; }
.panel--results .metric-name { white-space: normal; }
.metric.is-flash { animation: flash-card 1.4s ease; }
@keyframes flash-card { 0%, 30% { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); border-color: var(--accent); } }
.is-missing .metric-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }

.metric-what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.metric-what strong { color: var(--text); }
.metric-what .chip { flex: none; margin-top: 1px; }
.tech { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.tech summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--text-2); }
.tech summary:hover { color: var(--text); }
.tech[open] summary { margin-bottom: 8px; }

/* Calmer bars: no gaps between tiers, softer colours, thin in the header. */
.rb-seg + .rb-seg { border-left: 0; }
.rbars--sm .rb-track { height: 4px; }
.rbars--sm .rb-mark { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.rbars--sm { max-width: none; margin-top: 6px; }
.sev-good { background: color-mix(in srgb, var(--good) 40%, var(--surface)); }
.sev-fair { background: color-mix(in srgb, var(--fair) 38%, var(--surface)); }
.sev-weak { background: color-mix(in srgb, var(--weak) 38%, var(--surface)); }
.sev-poor { background: color-mix(in srgb, var(--poor) 34%, var(--surface)); }
:root[data-theme="dark"] .sev-good { background: color-mix(in srgb, var(--good) 62%, var(--surface)); }
:root[data-theme="dark"] .sev-fair { background: color-mix(in srgb, var(--fair) 58%, var(--surface)); }
:root[data-theme="dark"] .sev-weak { background: color-mix(in srgb, var(--weak) 58%, var(--surface)); }
:root[data-theme="dark"] .sev-poor { background: color-mix(in srgb, var(--poor) 58%, var(--surface)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sev-good { background: color-mix(in srgb, var(--good) 62%, var(--surface)); }
  :root:not([data-theme="light"]) .sev-fair { background: color-mix(in srgb, var(--fair) 58%, var(--surface)); }
  :root:not([data-theme="light"]) .sev-weak { background: color-mix(in srgb, var(--weak) 58%, var(--surface)); }
  :root:not([data-theme="light"]) .sev-poor { background: color-mix(in srgb, var(--poor) 58%, var(--surface)); }
}

/* Download menu */
.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-item .icon { margin-top: 2px; color: var(--text-2); }
.menu-item span { display: grid; }
.menu-item strong { font-size: 14px; font-weight: 600; }
.menu-item small { font-size: 12px; color: var(--text-3); }
#dlBtn .chev { margin-left: -2px; transform: rotate(180deg); }
#dlBtn[aria-expanded="true"] .chev { transform: none; }

.photo-size { display: none; }
.print-report .pr-verdict { display: block; font-size: 8.5pt; color: #555; }

@media (max-width: 860px) {
  .workspace--results { grid-template-rows: minmax(190px, 36%) minmax(0, 1fr); }
  .workspace--results.is-photo-big { grid-template-rows: minmax(260px, 62%) minmax(0, 1fr); }
  .photo-size { display: inline-flex; }
  .rtabs button { height: 42px; }
}

@media (max-width: 640px) {
  .strength-list { grid-template-columns: 1fr; }
  .opp { flex-wrap: wrap; }
  .opp-show { margin: 0 0 0 10px; }
  .panel--results .metric-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .panel--results .metric-head .chev { display: none; }
  .panel-foot #dlBtn span { display: inline; }
  .metric-side { max-width: 7.5em; }
  .sum-hero { gap: 14px; }
}

/* A wide ratings panel: the overview across the top, the rest in two
   columns, and the rings and type bigger. */
.panel--results { container: results / inline-size; }

@container results (min-width: 720px) {
  .rtabs { grid-template-columns: repeat(3, minmax(0, 220px)); padding: 0 12px; }
  .rtabs button { height: 52px; font-size: 15px; }
  .panel--results .panel-scroll { padding: 28px 32px 32px; }
  .panel--results .section-label { font-size: 12px; }

  .sum-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 44px; align-items: center; }
  .sum-glance .dist { margin-top: 0; }
  .sum-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 44px; align-items: start; }
  .sum > .sum-cols { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--border); }
  .sum-col > :first-child { margin-top: 0; }
  .sum-sec { margin-top: 32px; }

  .sum-hero { gap: 28px; }
  .sum-hero .ring--xl { width: 172px; height: 172px; }
  .sum-hero .ring--xl .ring-num { font-size: 72px; }
  .sum-hero .ring--xl .ring-num small { font-size: 13px; margin: 8px 0 -12px; }
  .grade { font-size: 54px; }
  .sum-verdict { font-size: 15.5px; }
  .gs-track { height: 8px; }
  .gs-cap { font-size: 13px; }
  .dist-bar { height: 14px; }
  .dist-legend { gap: 6px 18px; margin-top: 12px; font-size: 14px; }
  .dist-legend i { width: 11px; height: 11px; }
  .sum-areas-line { margin-top: 16px; font-size: 15px; }
  .norms-line { padding: 11px 14px; font-size: 14px; }
  .pot-teaser strong { font-size: 16px; }
  .pot-teaser small { font-size: 13.5px; }

  .area-row { gap: 16px; padding: 10px; }
  .area-row .ring--md { width: 56px; height: 56px; }
  .area-row .ring--md .ring-num { font-size: 17px; }
  .area-name { font-size: 16px; }
  .area-note { font-size: 14px; }
  .opp-name { font-size: 16px; }
  .opp-loss { font-size: 15.5px; }
  .opp-note { font-size: 14px; }
  .opp-tech { font-size: 12.5px; }
  .strength { padding: 11px 12px; font-size: 14.5px; }
  .strength small { font-size: 12.5px; }
  .precision { padding: 18px; font-size: 14px; }

  /* Measurements: two columns of bigger cards. A card that opens keeps its
     column; its neighbour keeps its own height. */
  .metric-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .panel--results .metric-head { gap: 14px; padding: 14px; }
  .metric-head .ring--md { width: 54px; height: 54px; }
  .metric-head .ring--md .ring-num { font-size: 16px; }
  .panel--results .metric-name { font-size: 15.5px; }
  .metric-verdict { font-size: 14px; }
  .metric-value { font-size: 17px; }
  .metric-ideal { font-size: 12.5px; }
  .panel--results .list-toolbar { margin: -28px -32px 14px; padding: 14px 32px; top: -28px; }
  .panel--results .filter-chips { margin: 0 -32px; padding: 0 32px 2px; }

  /* Improve */
  .imp-title { font-size: 22px; }
  .imp-lead { font-size: 14.5px; }
  .imp-area-name, .imp-metric-name { font-size: 15.5px; }
  .imp-area-note { font-size: 13.5px; }
  .imp-metric-main .ring--sm { width: 40px; height: 40px; }
  .imp-metric-main .ring--sm .ring-num { font-size: 12.5px; }
  .imp-tool strong { font-size: 15px; }
  .imp-tool small { font-size: 13.5px; }

  .cal-panel { max-width: 560px; }
}

/* Wide enough for the filters and the sort on one line. */
@container results (min-width: 1000px) {
  .panel--results .list-toolbar { flex-direction: row; align-items: center; gap: 20px; }
  .panel--results .filter-chips { flex: 1; min-width: 0; margin: 0; padding: 0 0 2px; }
  .panel--results .list-row2 { flex: none; }
}

/* ─── BEFORE / AFTER (Morph) ────────────────────────────────────────────── */

/* While comparing, only the Before / After toggle stays on the photo; the
   hint moves to the top so the bar can sit at the bottom. */
.is-comparing .stage-tools .tool-btn:not(#mCompare) { display: none; }
.is-comparing .stage-hint { top: 12px; bottom: auto; max-width: calc(100% - 132px); }
.tool-btn--cmp { border-color: rgba(255, 255, 255, 0.22); }

.cmp-bar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 6px; max-width: calc(100% - 24px); padding: 5px;
  border-radius: 14px; background: rgba(20, 23, 29, 0.86); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #e7eaf0;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.cmp-bar[hidden] { display: none; }
.cmp-modes { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); }
.cmp-mode, .cmp-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 650; color: #cfd5df; white-space: nowrap; transition: background-color .15s, color .15s;
}
.cmp-mode .icon, .cmp-btn .icon { width: 15px; height: 15px; flex: none; }
.cmp-mode:hover, .cmp-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.cmp-mode[aria-checked="true"] { background: #fff; color: #14171d; }
.cmp-btn[aria-pressed="true"] { background: rgba(56, 189, 248, 0.24); color: #e0f2fe; }
.cmp-btn--icon { padding: 0 9px; }
.cmp-btn--done { background: #2f5bea; color: #fff; }
.cmp-btn--done:hover { background: #2449c9; }
@media (max-width: 640px) {
  .cmp-bar { bottom: 10px; gap: 3px; padding: 4px; }
  .cmp-mode, .cmp-btn { height: 36px; padding: 0 8px; font-size: 12.5px; gap: 5px; }
  .cmp-btn span { display: none; }
}
@media (forced-colors: active) {
  .cmp-mode[aria-checked="true"], .cmp-btn[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* ─── PRINT ─────────────────────────────────────────────────────────────── */

@media print {
  @page { margin: 14mm; }
  :root { color-scheme: light; --text: #000; --text-2: #333; --text-3: #555; --surface: #fff; --surface-2: #f3f4f6; --surface-3: #e5e7eb; --border: #d1d5db; --accent: #2f5bea; }
  body, body.is-workspace { background: #fff; overflow: visible; min-height: 0; }
  #app, .toast, .skip-link, .modal-backdrop { display: none !important; }
  .print-report { display: block !important; color: #000; font-size: 11pt; }
  .pr-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
  .pr-brand { display: flex; gap: 10px; align-items: center; }
  .pr-brand .logo-mark { width: 30px; height: 30px; color: #2f5bea; }
  .pr-brand div { display: grid; line-height: 1.2; }
  .pr-brand span { font-size: 9.5pt; color: #555; }
  .pr-meta { text-align: right; font-size: 9.5pt; color: #333; }
  .pr-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; margin-bottom: 14px; break-inside: avoid; }
  .pr-top img { width: 100%; max-height: 330px; object-fit: contain; border: 1px solid #ddd; border-radius: 6px; }
  .pr-summary { display: grid; justify-items: start; gap: 8px; }
  .pr-grade { font-size: 14pt; font-weight: 700; }
  .pr-likely { font-size: 9.5pt; color: #333; }
  .pr-cats { width: 100%; display: grid; gap: 4px; }
  .pr-cats li { display: flex; justify-content: space-between; border-bottom: 1px solid #e5e7eb; padding: 3px 0; font-size: 10pt; }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .pr-table th { text-align: left; border-bottom: 1.5px solid #000; padding: 4px 6px; }
  .pr-table td { border-bottom: 1px solid #e5e7eb; padding: 4px 6px; vertical-align: top; }
  .pr-table tr { break-inside: avoid; }
  .pr-table td:last-child, .pr-table th:last-child { text-align: right; }
  .pr-foot { margin-top: 12px; font-size: 8.5pt; color: #555; }
  .pr-verdict { display: block; font-size: 8.5pt; color: #555; }
  .ring-fill { animation: none !important; }
}

/* ─── FACEIQ PASS: FLOATING CARDS, PILL TABS, RATIO ROWS, MOTION ────────── */
/* Root DECISIONS.md, 32. After FaceIQ Labs' analysis screen: the photo and the
   panel float as rounded cards, the result views switch on a pill with a
   sliding thumb, and on a wide panel the measurements are one list of rows,
   each with a long band bar and a pill marker. The same block is in the front
   app's global.css, and its shared parts are in site/site.css. Layout and
   motion only: what each bar, ring and number shows is unchanged. */

/* The workspaces (crop, landmarks, results, morph): on a wide screen the photo
   and the panel are two cards on the page. */
@media (min-width: 861px) {
  .workspace { gap: 14px; padding: 14px; background: var(--bg); }
  .workspace > .stage { border-radius: var(--radius-xl); box-shadow: var(--shadow-float); isolation: isolate; }
  .workspace > .panel { border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); overflow: hidden; }
  /* The face-framed photo's column, less the page margin (entry 31's rule). */
  .workspace--results {
    grid-template-columns:
      clamp(300px, max(calc(var(--stage-ar, 0.8) * (100dvh - var(--header-h) - 28px)), calc(100% - 1500px)), calc(100% - var(--panel-w) - 14px))
      minmax(0, 1fr);
  }
}
/* A soft shade at the photo's top and bottom, under the tools and the hint. */
.workspace--results > .stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8, 10, 12, 0.32), transparent 16%),
    linear-gradient(to top, rgba(8, 10, 12, 0.36), transparent 22%);
}

/* Result views: a pill with a thumb that slides to the selected tab. */
.rtabs {
  --n: 3; --i: 0;
  position: relative; gap: 0; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  margin: 14px 16px 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2);
}
.rtabs::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n));
  border-radius: var(--radius-pill); background: var(--rtab-thumb, var(--surface));
  box-shadow: 0 1px 2px rgba(15, 20, 25, 0.08), 0 0 0 1px var(--border);
  transform: translateX(calc(var(--i) * 100%)); transition: transform .5s var(--ease-spring);
}
.rtabs:has(> [aria-selected="true"]:nth-child(2)) { --i: 1; }
.rtabs:has(> [aria-selected="true"]:nth-child(3)) { --i: 2; }
.rtabs button { z-index: 1; height: 38px; border-radius: var(--radius-pill); transition: color .2s; }
.rtabs button[aria-selected="true"]::after { content: none; }
.rtabs button[aria-selected="true"] .rtab-count { background: var(--ink); color: var(--on-ink); }
.rtab-count { transition: background-color .2s, color .2s; }
:root[data-theme="dark"] .rtabs { --rtab-thumb: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rtabs { --rtab-thumb: var(--surface-3); } }

/* Norms and mode 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 (the share card's Picture): the thumb is half the track, not a third. */
.segmented--2::before { width: calc((100% - 12px) / 2); }

/* Measurements: one list in one card, rows divided by hairlines. */
.metric-list { gap: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); overflow: clip; }
.metric-list > .metric { border: 0; border-radius: 0; box-shadow: none; transition: background-color .2s; }
.metric-list > .metric + .metric { border-top: 1px solid var(--border); }
.metric-list > .metric:hover, .metric-list > .metric.is-open { background: color-mix(in srgb, var(--text) 2.5%, var(--surface)); }
.metric-list > .metric.is-missing { background: var(--surface-2); }
.metric-list > .metric.is-flash { animation: fx-flash 1.4s ease; }
@keyframes fx-flash { 0%, 35% { background: var(--accent-soft); } }
.metric-list > p.muted { padding: 18px 20px; }

/* Band bars: a taller track and a white pill marker ringed in the band's colour. */
.rb-track { height: 8px; }
.rbars--sm .rb-track { height: 5px; }
.rbars--lg .rb-track { height: 12px; }
.rb-mark {
  width: 10px; height: 18px; margin: -9px 0 0 -5px; border-radius: 99px;
  background: #fff; border: 2.5px solid var(--ring-color, var(--text-3)); box-shadow: 0 1px 5px rgba(10, 12, 14, 0.3);
}
.rbars--sm .rb-mark { width: 8px; height: 14px; margin: -7px 0 0 -4px; border-width: 2px; }
.rbars--lg .rb-mark { width: 12px; height: 24px; margin: -12px 0 0 -6px; border-width: 3px; }
.rb-mark.is-out { border-radius: 3px; }

@container results (min-width: 720px) {
  .rtabs { grid-template-columns: repeat(var(--n), 168px); align-self: flex-start; margin: 20px 32px 0; padding: 4px; }
  .rtabs button { height: 40px; font-size: 14.5px; }

  /* A row: rating, name and verdict, the bar, the value, the chevron. The name
     block's children join the row's grid, so the bar gets its own column. */
  .metric-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .panel--results .metric-head {
    grid-template-columns: 54px minmax(0, 1.1fr) minmax(160px, 1fr) minmax(104px, auto) 16px;
    grid-template-areas: "ring name bar side chev" "ring verdict bar side chev";
    column-gap: 22px; row-gap: 3px; padding: 16px 22px; border-radius: 0;
  }
  .panel--results .metric-head > .ring { grid-area: ring; }
  .panel--results .metric-head .metric-main { display: contents; }
  .panel--results .metric-head .metric-name { grid-area: name; align-self: end; }
  .panel--results .metric-head .metric-verdict { grid-area: verdict; align-self: start; }
  .panel--results .metric-head .rbars--sm { grid-area: bar; align-self: center; margin: 0; gap: 8px; }
  .panel--results .metric-head .metric-side { grid-area: side; max-width: none; }
  .panel--results .metric-head > .chev { grid-area: chev; }
  .panel--results .is-missing .metric-head { grid-template-areas: "ring name name side chev" "ring verdict verdict side chev"; }
  .panel--results .is-missing .metric-head > .btn { grid-area: side; justify-self: end; }
  .metric-head .rbars--sm .rb-track { height: 8px; }
  .metric-head .rbars--sm .rb-mark { width: 10px; height: 18px; margin: -9px 0 0 -5px; border-width: 2.5px; }
  .metric-body { padding: 4px 22px 20px 98px; }
  .metric-value { font-size: 18px; letter-spacing: -0.01em; }
}

/* The overall ring sits on a soft glow of its own colour. */
.sum-hero .ring--xl { isolation: isolate; }
.sum-hero .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);
}

/* Entrance motion. .fx-enter is set on the results panel when its content is
   new to the eye (the first view, a tab, a filter, a sort) and cleared before
   a refresh from dragging a point (app.js, panelEnter), so nothing replays
   under the pointer. */
@keyframes fx-row { from { opacity: 0; transform: translateY(10px); } }
@keyframes fx-wipe { from { clip-path: inset(-40px 100% -40px -24px); } to { clip-path: inset(-40px -24px -40px -24px); } }
@keyframes fx-mark { from { left: 0; opacity: 0; } }
@keyframes fx-grow { from { transform: scaleX(0); } }
@keyframes fx-glow { from { opacity: 0; transform: scale(.6); } }

.fx-enter .metric-list > .metric,
.fx-enter .opp-list > li, .fx-enter .area-list > li, .fx-enter .strength-list > li,
.fx-enter .imp-areas > li, .fx-enter .imp-metrics > li, .fx-enter .imp-tools > li,
.fx-enter .sum-col > .sum-sec, .fx-enter .sum-col > .norms, .fx-enter .sum-col > .pot-teaser {
  animation: fx-row .55s var(--ease-out) both;
}
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(2) { animation-delay: .04s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(3) { animation-delay: .08s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(4) { animation-delay: .12s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(5) { animation-delay: .16s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(6) { animation-delay: .2s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(7) { animation-delay: .24s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(8) { animation-delay: .28s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(9) { animation-delay: .32s; }
.fx-enter :is(.metric-list, .opp-list, .area-list, .strength-list, .imp-areas, .imp-metrics, .imp-tools, .sum-col) > :nth-child(n+10) { animation-delay: .36s; }

/* Bars sweep in from the left; markers glide to their value. */
.fx-enter .rb-track { animation: fx-wipe .8s var(--ease-out) .12s backwards; }
.fx-enter .rb-mark { animation: fx-mark 1s var(--ease-spring) .2s backwards; }
.fx-enter :is(.loss-bar, .imp-bar, .dist-bar) > i { transform-origin: left; animation: fx-grow .9s var(--ease-out) .2s backwards; }
.fx-enter .sum-hero .ring--xl::before { animation: fx-glow 1.2s var(--ease-out) .1s backwards; }

/* Rows that are buttons lift a little under the pointer. */
.opp-main, .area-row, .strength, .imp-tool, .imp-metric-main { transition: background-color .15s, border-color .15s, transform .25s var(--ease-out); }
.opp-main:hover, .area-row:hover, .strength:hover, .imp-tool:hover { transform: translateY(-1px); }
.metric-head .chev { transition: transform .35s var(--ease-spring), color .15s; }
.metric:hover .metric-head .chev { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .fx-enter *, .rtabs::before, .segmented::before { animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .opp-main:hover, .area-row:hover, .strength:hover, .imp-tool:hover { transform: none; }
}

/* ─── A BIGGER RESULTS PHOTO ────────────────────────────────────────────── */
/* Root DECISIONS.md, 36. Once the results are shown the photo keeps a large share of the
   width, as it has while cropping and checking the points. From 861px its column is
   --photo-share of the workspace, held to the width the photo can fill at full height
   (--photo-ar, app.js) and never narrower than the face at full height (--stage-ar), so the
   line between the photo and the results sits further right. The results keep at least
   --panel-w. Where the stage is still wider than the photo (a phone, a tight crop), a blurred
   copy of the photo fills the sides (app.js sets it). The same block is in the front app's
   global.css. */
.workspace--results { --photo-share: 56%; --results-h: calc(100dvh - var(--header-h) - 28px); }
@media (min-width: 861px) {
  .workspace--results {
    grid-template-columns:
      clamp(300px, max(min(var(--photo-share), calc(var(--photo-ar, 9) * var(--results-h))), calc(var(--stage-ar, 0.8) * var(--results-h)), calc(100% - 1500px)), calc(100% - var(--panel-w) - 14px))
      minmax(0, 1fr);
  }
}
.stage-backdrop {
  position: absolute; inset: -48px; pointer-events: none;
  background: center / cover no-repeat; filter: blur(36px) saturate(1.05) brightness(var(--backdrop-dim, 0.95));
}
:root[data-theme="dark"] .stage-backdrop { --backdrop-dim: 0.7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stage-backdrop { --backdrop-dim: 0.7; } }

/* The results panel is narrower than before at a given window, so its summary stays in one
   column until the panel is 960px wide; the bigger type and rings still start at 720px. */
@container results (min-width: 720px) and (max-width: 959.98px) {
  .sum-top { grid-template-columns: minmax(0, 1fr); }
  .sum-cols { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
}
/* On a phone the photo gets about the share the front app gives it (48%), up from 36%; Bigger
   photo still makes it larger. */
@media (max-width: 860px) {
  .workspace--results { grid-template-rows: minmax(240px, 46%) minmax(0, 1fr); }
  .workspace--results.is-photo-big { grid-template-rows: minmax(300px, 64%) minmax(0, 1fr); }
}

/* ─── UPLOAD TO RESULTS: A REVIEW PASS ──────────────────────────────────── */
/* Root DECISIONS.md, 37. Fixes from a UI and a UX review of the path from the upload to the
   results. The same block is in the front app's global.css. */

/* The idle hint on the results photo fades (app.js), so it stops covering the chin. */
.stage-hint { transition: opacity .45s ease, transform .45s ease; }
.stage-hint.is-faded { opacity: 0; transform: translate(-50%, 8px); }

/* A photo tool that can't be used now reads as off, not as a see-through glitch. */
.tool-btn:disabled { opacity: 1; background: rgba(20, 23, 29, 0.6); color: rgba(231, 234, 240, 0.42); }

/* Landmark names wrap rather than lose the word that tells left from right. */
.lm-name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }

/* In the site's flow, a scan already saved (the front, ?done=front) has a filled dot, as on
   the site's pages. */
.flow-steps .is-done .fs-dot { background: var(--good); border-color: var(--good); }

/* The second bar in the summary says what it counts. */
.dist-kicker { margin: 0 0 8px; font-size: 12px; color: var(--text-3); }

/* Measurement rows in a narrow panel: the value column has one width, so the bars end at the
   same place in every row. */
@container results (max-width: 719.98px) {
  .panel--results .metric:not(.is-missing) .metric-head { grid-template-columns: auto minmax(0, 1fr) 9em auto; }
}
@media (max-width: 640px) {
  .panel--results .metric:not(.is-missing) .metric-head { grid-template-columns: auto minmax(0, 1fr) 7.5em; }
}

/* Dark: the selected result view stands out from its pill. */
:root[data-theme="dark"] .rtabs { --rtab-thumb: #30353b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rtabs { --rtab-thumb: #30353b; } }

/* New analysis keeps its name in the site's flow where the panel has room. */
@container results (min-width: 560px) {
  .has-flow .panel-foot #newBtn span { display: inline; }
}

/* In the site's flow, on a narrow screen, the photo card comes right after the title and the
   demo after it. */
@media (max-width: 960px) {
  .page--flow .hero { grid-template-areas: "copy" "setup" "visual"; }
}

/* Touch: bigger targets for the photo tools, the chips and the result views. */
@media (pointer: coarse) {
  .tool-btn { min-height: 40px; min-width: 40px; justify-content: center; }
  .fchip { height: 36px; }
  .rtabs button { height: 42px; }
}

@media (max-width: 860px) {
  /* Messages show above the footer, not over the photo tools and the points. */
  .toast {
    top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px;
    max-width: none; text-align: center; transform: translateY(12px);
  }
  .toast.show { transform: none; }
}

@media (max-width: 640px) {
  /* The photo tools show icons only; their names stay for screen readers. */
  .tool-btn span { display: inline; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tool-btn--accent span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  /* The crop's hint would cover the frame's bottom handles; the panel says the same. */
  #main.view-crop .stage-hint { display: none; }
  /* The list scrolls with its filters, so more rows show under the photo. */
  .panel--results .list-toolbar { position: static; }
  /* The three result views fit without touching. */
  .rtabs button { font-size: 13px; gap: 4px; }
}

/* ─── 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; }
}

/* The narrowest phones: the current step's name no longer fits beside the dots. */
@media (max-width: 359px) {
  .stepper li.current .step-label { display: none; }
}
