/* Fit Check prototype: local stylesheet. System fonts only, no external requests. */

:root {
  color-scheme: light;
  --bg: #f3f1ed;
  --bg-2: #e9e5de;
  --surface: #ffffff;
  --ink: #141414;
  --ink-2: #3f3e3b;
  --muted: #6b6863;
  --line: #dcd7cf;
  --line-strong: #bdb7ad;
  --accent: #cf4517;          /* signal orange: primary actions + recommended size only */
  --accent-hover: #b53a11;
  --accent-ink: #ffffff;
  --accent-soft: #fbe5da;
  --accent-line: #ef9f7f;
  --good: #1d7343;
  --good-soft: #e3f2e8;
  --warn: #8f5300;
  --warn-soft: #fbefd9;
  --bad: #b02a1c;
  --bad-soft: #fbe4e1;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 6px 24px rgba(20, 20, 20, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-cond: "SF Pro Display", "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
/* Headings receive focus programmatically on screen changes (for screen readers); no ring there. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* ------------------------------------------------------------------ type */
.eyebrow {
  font-family: var(--font-cond);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-stretch: condensed;
}
.h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -.02em; font-weight: 800; }
.h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; font-weight: 750; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 46ch; }
.small { font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 241, 237, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter);
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-cond); text-transform: uppercase; }
.wordmark-main { font-weight: 900; font-size: 18px; letter-spacing: .12em; white-space: nowrap; }
.wordmark-mark { width: 10px; height: 10px; background: var(--accent); transform: skewX(-18deg); display: inline-block; align-self: center; }
.wordmark-sub { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.dev-flag { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: var(--ink); color: #fff; }

/* ------------------------------------------------------------------ layout */
main { max-width: 1280px; margin: 0 auto; padding: 40px var(--gutter) 72px; }
.screen { animation: screen-in .28s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 16px; letter-spacing: .01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--bg-2); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c2b29; }
.btn-ghost { border-color: transparent; background: transparent; padding: 0 12px; min-height: 40px; }
.btn-ghost:hover { background: var(--bg-2); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary[disabled]:hover { background: var(--accent); }
.btn.is-busy { cursor: progress; }
.linklike {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font-weight: 650;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; color: var(--ink);
}
.linklike:hover { color: var(--accent-hover); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ chips / segmented */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chip-group legend, .field-label {
  font-family: var(--font-cond); font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; padding: 0;
}
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 58px; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-weight: 750; font-size: 17px; letter-spacing: .02em;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip input:hover + span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-2); border-radius: var(--radius-sm); border: 0; margin: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ------------------------------------------------------------------ tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-cond); font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 5px; border: 1.5px solid var(--ink); color: var(--ink); background: var(--surface);
  line-height: 1.2;
}
.tag-illustrative { border-style: dashed; }
.tag-synthetic { background: var(--ink); color: #fff; }
.tag-source { background: var(--bg-2); border-color: var(--bg-2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ setup / loading */
.center-screen { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.setup-box { max-width: 680px; padding: 40px; text-align: left; }
.setup-box h1 { margin: 10px 0 14px; }
.setup-box ul { margin: 16px 0; padding-left: 20px; color: var(--bad); font-weight: 600; }
.setup-box code, .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; background: var(--bg-2); padding: 2px 6px; border-radius: 4px; }
.loading-line { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------------ product */
.product-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.product-art {
  background: var(--bg-2); border-radius: 14px; aspect-ratio: 1 / 1.02;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.product-art svg { width: 84%; height: auto; }
.product-art .art-tag { position: absolute; left: 18px; top: 18px; }
.product-info { display: grid; gap: 26px; padding-top: 6px; }
.product-info .h1 { margin-top: 8px; }
.product-info .lede { margin-top: 12px; }
.size-chart-wrap { display: grid; gap: 10px; }
.size-chart-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
table.chart { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
table.chart th, table.chart td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.chart th { font-family: var(--font-cond); font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); vertical-align: bottom; }
table.chart th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; font-family: var(--font); }
table.chart td:first-child { font-weight: 800; }
table.chart tr.is-selected td { background: #faf8f5; }
table.chart tr.is-selected td:first-child { box-shadow: inset 4px 0 0 var(--ink); }
.data-note { font-size: 13px; color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-start; }
.cta-alt { display: grid; gap: 6px; }
.cta-alt .small { max-width: 30ch; font-size: 13px; }

/* ------------------------------------------------------------------ capture */
.screen-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.screen-head .h1 { margin-top: 6px; }
.screen-head .lede { margin-top: 10px; }
.capture-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.slot { padding: 20px; display: grid; gap: 14px; align-content: start; }
.slot-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.slot-title { display: flex; align-items: baseline; gap: 10px; }
.slot-num { font-family: var(--font-cond); font-weight: 900; font-size: 13px; color: var(--accent); letter-spacing: .1em; }
.slot-title h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.slot-body { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.pose { background: var(--bg); border-radius: var(--radius-sm); display: grid; place-items: center; padding: 8px 4px; }
.pose svg { width: 100%; height: auto; max-height: 220px; }
.frame {
  position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 3 / 4;
  background: repeating-linear-gradient(135deg, #f7f5f2 0 10px, #f1eee9 10px 20px);
  border: 1.5px dashed var(--line-strong); display: grid; place-items: center; text-align: center;
}
.frame.has-photo { border-style: solid; border-color: var(--line); background: #111; }
.frame img { width: 100%; height: 100%; object-fit: contain; }
.frame-empty { padding: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.frame-busy {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px;
  background: rgba(20, 20, 20, .55); color: #fff; font-weight: 700; font-size: 14px;
}
.frame-badge { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; }
.frame-badge .tag { font-size: 10px; padding: 3px 6px; border-color: #fff; }
.instructions { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); display: grid; gap: 4px; }
.instructions strong { color: var(--ink); }
.slot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-actions .btn { flex: 1 1 auto; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.status-pill .ico { font-size: 14px; line-height: 1; }
.st-empty { background: var(--bg); color: var(--muted); }
.st-busy { background: var(--bg-2); color: var(--ink-2); }
.st-ok { background: var(--good-soft); color: var(--good); }
.st-bad { background: var(--bad-soft); color: var(--bad); }
.st-warn { background: var(--warn-soft); color: var(--warn); }

.issues { margin: 0; padding: 12px 14px 12px 32px; border-radius: var(--radius-sm); background: var(--bad-soft); color: #5e170f; font-size: 14.5px; display: grid; gap: 6px; }
.issues.notes { background: var(--warn-soft); color: #4b2c00; }
.issues li::marker { font-weight: 800; }

.tips { margin-top: 20px; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: start; background: transparent; box-shadow: none; }
.tips ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14.5px; color: var(--ink-2); }
.tips li { display: flex; gap: 8px; align-items: baseline; }
.tips li::before { content: ""; width: 7px; height: 7px; background: var(--accent); transform: skewX(-18deg) translateY(-1px); flex: none; }
.privacy { margin-top: 12px; font-size: 13px; color: var(--muted); }

.details-panel { padding: 22px; display: grid; gap: 24px; position: sticky; top: 80px; }
.field { display: grid; gap: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field-head .field-label { margin: 0; }
.input-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input-unit { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
.num {
  width: 110px; min-height: 48px; padding: 0 12px; font-size: 20px; font-weight: 700;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.num.short { width: 76px; }
.num:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,20,20,.12); }
.num[aria-invalid="true"] { border-color: var(--bad); }
.convert { font-size: 14px; color: var(--muted); font-weight: 600; min-height: 21px; }
.fit-ctl { border: 0; padding: 0; margin: 0; min-width: 0; }
.fit-ctl legend { padding: 0; margin-bottom: 8px; }
.fit-hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.device-status { padding: 10px 16px; font-size: 14px; background: var(--accent-soft); color: var(--ink); text-align: center; }
.device-status[data-state="error"] { font-weight: 600; }
.prior-note { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.fit-summary { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.convert.err { color: var(--bad); }

.pref-cards { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.pref-card { position: relative; }
.pref-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pref-card .pc {
  display: grid; grid-template-columns: 20px 1fr; gap: 2px 10px; padding: 12px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, background-color .15s;
}
.pref-card .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); margin-top: 2px; grid-row: span 2; }
.pref-card .pc-title { font-weight: 800; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pref-card .pc-range { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.pref-card .pc-desc { font-size: 14px; color: var(--ink-2); grid-column: 2; }
.pref-card input:hover + .pc { border-color: var(--ink); }
.pref-card input:checked + .pc { border-color: var(--ink); background: #faf8f5; box-shadow: inset 0 0 0 1px var(--ink); }
.pref-card input:checked + .pc .dot { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4px, transparent 5px); }
.pref-card input:focus-visible + .pc { outline: 3px solid var(--accent); outline-offset: 2px; }

.go { display: grid; gap: 8px; }
.go .btn { width: 100%; }
.go-hint { font-size: 13.5px; color: var(--muted); }

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; margin-bottom: 18px; border: 1.5px solid;
}
.banner-warn { background: var(--warn-soft); border-color: #e9c98f; color: #4b2c00; }
.banner-err { background: var(--bad-soft); border-color: #eeb2aa; color: #5e170f; }
.banner-info { background: var(--surface); border-color: var(--line); color: var(--ink-2); }

/* ------------------------------------------------------------------ result */
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.answer { display: grid; gap: 22px; transition: opacity .18s; }
.answer.updating { opacity: .55; }
.kicker { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.verdict {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px;
  padding: 6px 12px; border-radius: 999px;
}
.verdict .ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 13px; line-height: 1; }
.v-good { background: var(--good-soft); color: var(--good); } .v-good .ico { background: var(--good); }
.v-warn { background: var(--warn-soft); color: var(--warn); } .v-warn .ico { background: var(--warn); }
.v-bad { background: var(--bad-soft); color: var(--bad); } .v-bad .ico { background: var(--bad); }
.headline { font-size: clamp(26px, 2.6vw, 37px); line-height: 1.14; letter-spacing: -.018em; font-weight: 750; max-width: 30ch; text-wrap: pretty; }
.fresh { animation: fresh .35s ease-out; }
@keyframes fresh { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.change-note {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border-left: 5px solid var(--accent); font-size: 18px; line-height: 1.4; font-weight: 600; color: #3a1505;
}
.change-note .eyebrow { color: var(--accent-hover); }

.sizes-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.size-badge {
  display: grid; align-content: center; gap: 2px; padding: 16px 26px 18px; border-radius: 12px; min-width: 190px;
  border: 2px solid var(--ink); background: var(--surface);
}
.size-badge .eyebrow { color: inherit; opacity: .85; }
.size-badge .sz { font-size: 64px; line-height: 1; font-weight: 900; letter-spacing: -.03em; }
.size-badge .sub { font-size: 14px; font-weight: 650; opacity: .9; }
.size-badge.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.size-badge.neutral { background: var(--ink); border-color: var(--ink); color: #fff; }
.size-badge.alt { min-width: 150px; padding: 14px 20px; }
.size-badge.alt .sz { font-size: 40px; }
.detail { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; }
.guidance { padding: 18px; display: grid; gap: 12px; background: var(--warn-soft); border-radius: var(--radius-sm); }
.guidance .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.garment-line { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }

/* ease strip */
.ease { padding: 20px 22px 16px; display: grid; gap: 12px; }
.ease-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.ease-head h3 { font-size: 16px; font-weight: 800; }
.ease-key { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.ease-key i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ease-plot { display: grid; grid-template-columns: 138px minmax(0, 1fr); row-gap: 0; position: relative; }
.ease-labels { display: grid; }
.ease-label { height: 34px; display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 15px; white-space: nowrap; }
.ease-label .role { font-family: var(--font-cond); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.ease-label.is-rec .role { color: var(--accent-hover); }
.ease-label.is-sel .sz-l { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ease-tracks { position: relative; }
.ease-band {
  position: absolute; top: 0; bottom: 0; background: var(--accent-soft);
  border-left: 1.5px dashed var(--accent-line); border-right: 1.5px dashed var(--accent-line);
  transition: left .45s cubic-bezier(.2,.7,.2,1), width .45s cubic-bezier(.2,.7,.2,1);
}
.ease-zero { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 1.5px solid var(--ink); }
.ease-gridline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--line); }
.ease-row { position: relative; height: 34px; }
.ease-bar {
  position: absolute; top: 12px; height: 10px; border-radius: 4px; background: #b9b3a9;
  transition: left .45s cubic-bezier(.2,.7,.2,1), width .45s cubic-bezier(.2,.7,.2,1), background-color .2s;
}
.ease-bar.r-alt { background: #7d786f; }
.ease-bar.r-sel { background: var(--ink); }
.ease-bar.r-rec { background: var(--accent); }
.ease-row:hover .ease-bar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line-strong); }
.ease-axis { grid-column: 2; position: relative; height: 22px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; border-top: 1px solid var(--line-strong); }
.ease-axis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.ease-band-label {
  position: absolute; top: -20px; transform: translateX(-50%); font-size: 11.5px; font-weight: 800; color: var(--accent-hover);
  white-space: nowrap; letter-spacing: .04em; transition: left .45s cubic-bezier(.2,.7,.2,1);
}
.ease-zero-label { position: absolute; top: -38px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; transform: translateX(-100%); padding-right: 6px; }
.ease-caption { font-size: 13px; color: var(--muted); }

/* controls column */
.controls { padding: 22px; display: grid; gap: 24px; position: sticky; top: 80px; }
.controls .seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.controls .seg span { width: 100%; min-height: 44px; font-size: 15px; }
.controls .chip-group { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.controls .chip-group legend { grid-column: 1 / -1; }
.controls .chip span { min-width: 0; width: 100%; padding: 0 4px; }
.pref-desc { font-size: 13.5px; color: var(--muted); margin-top: 8px; min-height: 20px; }
.height-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.height-summary strong { font-size: 18px; }
.height-edit { display: grid; gap: 10px; padding: 14px; background: var(--bg); border-radius: var(--radius-sm); }
.ctl-actions { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 18px; }
.ctl-actions .btn { width: 100%; }
.inline-err { font-size: 14px; color: var(--bad); font-weight: 650; }

.result-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rp { margin: 0; display: grid; gap: 6px; }
.rp img, .rp-empty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center top; border-radius: 6px; background: #111; }
.rp-empty { display: grid; place-items: center; color: #aaa; font-size: 13px; }
.rp figcaption { display: grid; justify-items: start; gap: 4px; font-size: 13px; font-weight: 700; }
.rp .status-pill { font-size: 11.5px; padding: 2px 8px; }

/* how we estimated */
.how { margin-top: 36px; }
.how > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; font-weight: 800; font-size: 18px;
}
.how > summary::-webkit-details-marker { display: none; }
.how > summary .chev { width: 22px; height: 22px; transition: transform .2s; flex: none; }
.how[open] > summary .chev { transform: rotate(180deg); }
.how > summary .summary-sub { font-weight: 600; font-size: 15px; color: var(--muted); margin-left: 10px; }
.how-body { padding: 0 22px 24px; display: grid; gap: 26px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { padding: 14px; background: var(--bg); border-radius: var(--radius-sm); display: grid; gap: 4px; }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .k { font-size: 13px; color: var(--muted); }
.how h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.method { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); max-width: 80ch; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px; }
.honest { padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); font-size: 14.5px; color: var(--ink-2); }
td.num-cell, th.num-cell { text-align: right !important; font-variant-numeric: tabular-nums; }
.rel { font-weight: 700; }
.rel-good { color: var(--good); } .rel-warn { color: var(--warn); } .rel-bad { color: var(--bad); }
.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------------ developer */
.dev { margin-top: 40px; padding: 20px; border: 2px dashed var(--ink); border-radius: var(--radius); background: #fbfaf8; }
.dev h2 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.dev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.dev-col { display: grid; gap: 10px; align-content: start; }
.dev img { width: 100%; max-height: 560px; object-fit: contain; background: #111; border-radius: 6px; }
.dev pre {
  margin: 0; padding: 12px; background: #161616; color: #e9e6df; border-radius: 6px; overflow: auto; max-height: 360px;
  font: 12px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------ camera dialog */
dialog.camera {
  border: 0; padding: 0; border-radius: 14px; width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: auto;
}
dialog.camera::backdrop { background: rgba(15, 15, 15, .72); }
.cam-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cam-head h2 { font-size: 19px; font-weight: 800; }
.cam-stage { position: relative; background: #0c0c0c; aspect-ratio: 16 / 9; max-height: 64vh; display: grid; place-items: center; overflow: hidden; }
.cam-stage video { width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 4% 0; pointer-events: none; display: grid; align-content: space-between; }
.cam-guide div { border-top: 2px dashed rgba(255,255,255,.55); margin: 0 8%; position: relative; }
.cam-guide div span { position: absolute; left: 0; top: 4px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cam-guide div.bottom span { top: -22px; }
.cam-count {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900;
  font-size: min(36vh, 260px); line-height: 1; text-shadow: 0 6px 40px rgba(0,0,0,.6); pointer-events: none;
}
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; padding: 24px; font-weight: 600; font-size: 17px; }
.cam-msg.err { background: #1a1a1a; }
.cam-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.cam-foot .tip { font-size: 14.5px; color: var(--ink-2); max-width: 50ch; }
.cam-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .35s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* single-column grids must not grow past their container */
.answer, .product-info, .slot, .controls, .how-body, .ease, .dev-col, .go, .manual-box, .manual-form, .field, .size-chart-wrap { grid-template-columns: minmax(0, 1fr); }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .capture-grid { grid-template-columns: minmax(0, 1fr); }
  .details-panel { position: static; }
  .details-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details-panel .go, .details-panel .manual-box { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .product-art { aspect-ratio: 16 / 11; }
  .product-art svg { width: 62%; }
  .result-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .controls { position: static; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .dev-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  main { padding-top: 24px; }
  .slots { grid-template-columns: minmax(0, 1fr); }
  .details-panel { grid-template-columns: minmax(0, 1fr); }
  .tips { grid-template-columns: minmax(0, 1fr); }
  .wordmark-sub { display: none; }
  .ease-plot { grid-template-columns: 96px minmax(0, 1fr); }
  .ease-label .role { display: none; }
  .size-badge { min-width: 0; flex: 1 1 140px; padding: 14px 18px; }
  .size-badge .sz { font-size: 52px; }
  .lede { font-size: 16.5px; }
  .detail { font-size: 17px; }
  .change-note { font-size: 16.5px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-body { padding: 0 16px 20px; }
  .how > summary { padding: 16px; }
}
@media (max-width: 440px) {
  .slot-body { grid-template-columns: 70px minmax(0, 1fr); }
  .btn-lg { padding: 0 18px; }
  .cta-row .btn { width: 100%; }
  .cta-alt { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Live capture (phone site): full screen, instruction readable from 2-3 m away. */
.livecap { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column; }
.livecap[hidden] { display: none; }
.livecap video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.livecap[data-facing="user"] video { transform: scaleX(-1); }
.live-top, .live-bottom { position: relative; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: rgba(0, 0, 0, .55); }
.live-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.live-actions { display: flex; gap: 8px; }
.live-view { font-weight: 700; font-size: 18px; }
.live-bottom { margin-top: auto; padding-bottom: max(16px, env(safe-area-inset-bottom)); text-align: center; }
.live-instruction { font-size: clamp(26px, 7vw, 44px); line-height: 1.15; font-weight: 800; margin: 0 0 12px; }
.live-progress { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; margin: 0 0 12px; }
.live-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.live-level { position: relative; align-self: center; margin-top: 18vh; padding: 10px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, .6); font-size: 28px; font-weight: 800; display: flex; gap: 12px; align-items: center; }
.live-level[hidden] { display: none; }
.live-level-dot { width: 22px; height: 22px; border-radius: 50%; background: #e5484d; }
.live-level[data-ok="true"] .live-level-dot { background: #30a46c; }
