/* Dark, understated, mostly monochrome. Semantic accents only: positive, caution, info. */
:root {
  --bg: #0d0e0f;
  --surface: #151719;
  --surface-2: #1b1e21;
  --surface-3: #23272b;
  --line: #2a2f34;
  --line-strong: #3a4147;
  --text: #ececea;
  --text-2: #c2c6ca;
  --muted: #959ca3;
  --pos: #8ccaa6;  --pos-bg: rgba(140, 202, 166, .10);  --pos-line: rgba(140, 202, 166, .35);
  --warn: #dcb673; --warn-bg: rgba(220, 182, 115, .10); --warn-line: rgba(220, 182, 115, .35);
  --info: #9bbbe0; --info-bg: rgba(155, 187, 224, .10); --info-line: rgba(155, 187, 224, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--text-2); }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 20px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; text-decoration: none; font-size: 17px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.top-meta { color: var(--muted); font-size: 13px; }
.layout { display: block; }
.sidebar { display: none; }
.main { min-width: 0; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(13, 14, 15, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; min-height: 48px; display: grid; place-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 12px; border-radius: 10px; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--text); }
@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
  .sidebar { display: block; position: sticky; top: 16px; align-self: start; }
  .side-nav { display: grid; gap: 4px; margin-top: 8px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; min-height: 44px; }
  .side-nav a svg { width: 20px; height: 20px; }
  .side-nav a:hover { color: var(--text); background: var(--surface); }
  .side-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
  .bottom-nav { display: none; }
  .shell { padding-bottom: 48px; }
}

/* ---------- typography ---------- */
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.02em; margin: 6px 0 4px; font-weight: 650; }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 6px; font-weight: 620; }
h3 { font-size: 16px; margin: 0 0 4px; font-weight: 620; }
p { margin: 0 0 10px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.page-head { margin: 8px 0 18px; }

/* ---------- cards & layout ---------- */
.grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } .grid-even { grid-template-columns: 1fr 1fr; } }
.stack { display: grid; gap: 14px; align-content: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head .eyebrow { margin-bottom: 4px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.bullets { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.bullets li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.kv strong { display: block; font-size: 18px; font-weight: 620; font-variant-numeric: tabular-nums; }
.kv span { font-size: 12px; color: var(--muted); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; }
.pill.pos { color: var(--pos); background: var(--pos-bg); border-color: var(--pos-line); }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #fff; }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--text-2); padding-left: 10px; padding-right: 10px; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: transparent; border-color: rgba(230, 140, 130, .45); color: #eaa59c; }
.btn-danger:hover { border-color: #eaa59c; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; outline: none; font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--text-2); }
input::placeholder, textarea::placeholder { color: #6f767c; }
.choice-grid { display: grid; gap: 8px; }
@media (min-width: 560px) { .choice-grid.two { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice .choice-body { border: 1px solid var(--line-strong); border-radius: 12px; padding: 13px 14px; background: var(--surface); min-height: 56px; }
.choice .choice-body strong { display: block; font-weight: 600; }
.choice .choice-body span { font-size: 14px; color: var(--muted); }
.choice input:checked + .choice-body { border-color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--text); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--info); outline-offset: 2px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 14px; min-height: 38px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg input:checked + span { background: var(--surface-3); color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--info); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-row .label-text { font-weight: 500; color: var(--text); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 99px; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch input:checked + span { background: var(--text-2); border-color: var(--text-2); }
.switch input:checked + span::after { left: 23px; background: var(--bg); }
.switch input:focus-visible + span { outline: 2px solid var(--info); outline-offset: 2px; }

/* ---------- disclosure ---------- */
details.disclosure { border-top: 1px solid var(--line); }
details.disclosure > summary { list-style: none; cursor: pointer; padding: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 15px; min-height: 44px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; transition: transform .15s; flex: none; }
details.disclosure[open] > summary::after { transform: rotate(-135deg); }
details.disclosure > .disclosure-body { padding: 0 0 14px; }
details.card-details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
details.card-details > summary { padding: 16px 0; }
details.card-details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }

/* ---------- coach ---------- */
.insight h2 { font-size: 20px; }
.insight .summary { color: var(--text-2); }
.facts-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.confidence { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 12px; font-size: 14px; color: var(--text-2); margin-top: 12px; }
.experiment { border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px; margin-top: 14px; background: var(--bg); }
.experiment dl { margin: 10px 0 0; display: grid; gap: 8px; }
.experiment dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.experiment dd { margin: 0; color: var(--text-2); font-size: 15px; }
.cite { font-size: 13px; color: var(--muted); }
.cite a { color: var(--text-2); }
.source { padding: 12px 0; border-top: 1px solid var(--line); }
.source:first-child { border-top: 0; }
.source .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.progress-bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress-bar > span { display: block; height: 100%; background: var(--text-2); border-radius: 99px; }

/* ---------- workout ---------- */
.ex-list .ex { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ex-list .ex:first-child { border-top: 0; }
.ex-name { font-weight: 600; }
.ex-target { font-size: 14px; color: var(--muted); }
.ex-last { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.log-ex { padding: 16px; }
.log-ex.complete { border-color: var(--pos-line); }
.prev { font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
.suggestion { font-size: 14px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; margin: 8px 0 10px; }
.exp-hint { font-size: 14px; color: var(--info); background: var(--info-bg); border: 1px solid var(--info-line); border-radius: var(--radius-sm); padding: 9px 11px; margin: 8px 0; }
.set-head, .set-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr) 48px; gap: 8px; align-items: center; }
.set-head { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 0 0 6px; }
.set-row { padding: 5px 0; }
.set-row .idx { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-size: 14px; }
.set-row input, .set-row select { min-height: 46px; text-align: center; padding: 6px 4px; font-variant-numeric: tabular-nums; }
.set-row.done input, .set-row.done select { border-color: var(--pos-line); background: rgba(140, 202, 166, .05); }
.check { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.check svg { width: 20px; height: 20px; }
.check[aria-pressed="true"] { background: var(--pos-bg); border-color: var(--pos-line); color: var(--pos); }
.sticky-finish { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 5; background: rgba(21, 23, 25, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line-strong); border-radius: 16px; padding: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 14px; }
@media (min-width: 900px) { .sticky-finish { bottom: 12px; } }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--text-2); stroke-width: 2; }
.chart .line.soft { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 1.5; }
.chart .pt { fill: var(--text); }
.chart .pt.raw { fill: var(--muted); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.spark { width: 100%; height: 44px; display: block; }

/* ---------- banners, toast, modal ---------- */
.banner { border-radius: 12px; padding: 11px 14px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.banner.demo { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--text); }
.banner.demo strong { color: var(--warn); }
.banner.error { background: rgba(230, 140, 130, .1); border: 1px solid rgba(230, 140, 130, .4); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 40; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: end center; z-index: 50; padding: 16px; }
@media (min-width: 600px) { .modal-backdrop { place-items: center; } }
.modal { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 20px; width: 100%; max-width: 440px; }
.footnote { font-size: 13px; color: var(--muted); margin: 22px 2px 0; line-height: 1.55; }

/* ---------- onboarding ---------- */
.onboard { max-width: 560px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps span { height: 4px; flex: 1; border-radius: 99px; background: var(--surface-3); }
.steps span.on { background: var(--text-2); }

@media (max-width: 420px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .card { padding: 15px; }
  .kv strong { font-size: 16px; }
  .set-head, .set-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr) 46px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- small-screen robustness ---------- */
.stack, .grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .grid-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.stack > *, .grid > * { min-width: 0; }
.cite, .source .meta, .experiment dd, .bullets li { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv > div:nth-child(3):last-child { grid-column: 1 / -1; }
  .card-head { flex-wrap: wrap; }
}

/* ---------- welcome (onboarding step 0) ---------- */
.welcome { max-width: 600px; padding-top: 4px; }
.wl-hero { margin: 10px 0 22px; }
.wl-title { font-size: clamp(32px, 8.4vw, 46px); line-height: 1.06; letter-spacing: -.03em; font-weight: 680; margin: 10px 0 14px; text-wrap: balance; }
.wl-lede { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 0; max-width: 34em; }

.wl-preview { margin: 0; position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-strong); border-radius: 20px; padding: 18px; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .04); }
.wl-preview-head, .wl-insight-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wl-ex { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 14px; }
.wl-ex-name { font-size: 18px; font-weight: 640; letter-spacing: -.01em; }
.wl-set { white-space: nowrap; padding-top: 3px; }
.wl-target { display: grid; gap: 2px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.wl-target strong { font-size: 24px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wl-chart { margin-top: 14px; }
.wl-line { display: block; width: 100%; height: auto; overflow: visible; }
.wl-band { fill: var(--surface-3); opacity: .7; }
.wl-path { fill: none; stroke: var(--text-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wl-dot { fill: var(--text); }
.wl-chart-cap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.wl-insight { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wl-insight p { margin: 8px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.wl-insight .wl-test { color: var(--text); }
.wl-insight .cite { margin-top: 8px; }
.wl-preview figcaption { margin-top: 14px; font-size: 12px; }

.wl-actions { display: grid; gap: 10px; margin-top: 22px; }
.btn-hero { min-height: 54px; font-size: 16px; border-radius: 14px; box-shadow: 0 10px 30px -12px rgba(236, 236, 234, .35); transition: background .15s, transform .15s, box-shadow .15s; }
.btn-hero svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.btn-hero:hover svg { transform: translateX(3px); }
.btn-hero:active { transform: translateY(1px); }
.btn-hero-2 { min-height: 50px; border-radius: 14px; }
.wl-note { margin: 12px 2px 0; font-size: 13px; text-align: center; }
@media (min-width: 560px) { .wl-actions { grid-template-columns: 1.3fr 1fr; } }

.wl-trust { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.wl-trust li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wl-trust strong { display: block; font-size: 15px; font-weight: 620; }
.wl-trust span:not(.wl-ico) { display: block; font-size: 14px; color: var(--muted); line-height: 1.45; }
.wl-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.wl-ico svg { width: 17px; height: 17px; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 640px) {
  .wl-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; border-top: 0; }
  .wl-trust li { grid-template-columns: minmax(0, 1fr); border-bottom: 0; padding: 0; gap: 10px; }
}
@media (max-width: 420px) {
  .wl-preview { padding: 15px; border-radius: 18px; }
  .wl-target strong { font-size: 22px; }
}

/* Restrained entrance motion, only when the user hasn't asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .wl-hero, .wl-preview, .wl-actions { animation: wl-rise .55s cubic-bezier(.2, .7, .2, 1) both; }
  .wl-preview { animation-delay: .08s; }
  .wl-actions { animation-delay: .16s; }
  .wl-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: wl-draw 1.3s .35s cubic-bezier(.4, 0, .2, 1) forwards; }
  .wl-dot { opacity: 0; animation: wl-fade .3s 1.55s forwards; }
}
@keyframes wl-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wl-draw { to { stroke-dashoffset: 0; } }
@keyframes wl-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .btn-hero, .btn-hero svg { transition: none; } .btn-hero:hover svg, .btn-hero:active { transform: none; } }

/* ---------- "Why this suggestion?" evidence card ---------- */
details.evcard { margin-top: 14px; }
.ev-sum { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-sum-meta { font-size: 13px; font-weight: 500; color: var(--muted); }
.ev-body { display: grid; gap: 10px; }
.ev-sec { border-radius: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); }
.ev-fold { padding: 0; overflow: clip; }
.ev-fold > summary { list-style: none; cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 10px 38px 10px 14px; position: relative; }
.ev-fold > summary::-webkit-details-marker { display: none; }
.ev-fold > summary::after { content: ''; position: absolute; right: 16px; top: 18px; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.ev-fold[open] > summary::after { transform: rotate(225deg); top: 22px; }
.ev-fold-title { font-size: 14px; font-weight: 640; }
.ev-fold-body { padding: 0 14px 13px; }
.ev-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ev-sec h4 { margin: 0; font-size: 14px; font-weight: 640; letter-spacing: .01em; }
.ev-tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ev-sec p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.ev-sec .bullets { font-size: 14.5px; }
.ev-sub { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ev-sub:first-of-type { margin-top: 4px; }
.ev-missing li { color: var(--muted); }
/* Your data: neutral, solid. */
.ev-data { background: var(--bg); }
/* App's reasoning: dashed border so it reads as interpretation, not fact or research. */
.ev-interp { background: transparent; border-style: dashed; border-color: var(--line-strong); }
/* Research: info accent. */
.ev-research { border-left: 3px solid var(--info-line); }
.ev-research .ev-tag { color: var(--info); }
.ev-study + .ev-study { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ev-study > p { color: var(--text); }
.ev-cite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
.ev-links { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--info-line); background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 600; text-decoration: none; }
.ev-link:hover { border-color: var(--info); }
.ev-full { margin-top: 6px; }
.ev-full > summary { cursor: pointer; font-size: 13px; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
.ev-full .cite { margin: 2px 0 0; }
.ev-none { border: 1px dashed var(--warn-line); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.ev-none strong { color: var(--warn); font-size: 14px; }
.ev-none p { margin-top: 4px; font-size: 14px; }
.ev-quiet { font-size: 13.5px !important; color: var(--muted) !important; }
/* Limits: caution accent. */
.ev-limits { border-left: 3px solid var(--warn-line); }
.ev-direct { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.ev-direct strong { color: var(--warn); }
.ev-conf p { color: var(--text-2); }
.ev-test { background: var(--bg); border-color: var(--line-strong); }
.ev-dl { margin: 6px 0 0; display: grid; gap: 8px; }
.ev-dl dt { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ev-dl dd { margin: 2px 0 0; color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }
.ev-note { font-size: 14px !important; color: var(--text) !important; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px !important; }
@media (max-width: 420px) { .ev-sec { padding: 11px 12px; } .ev-cite { flex-direction: column; align-items: flex-start; } }

/* Workout screen: reps-in-reserve help */
.rir-help p { margin: 0 0 10px; line-height: 1.55; }
.rir-help p:last-child { margin-bottom: 0; }
.rir-help a { color: var(--text); overflow-wrap: anywhere; }

/* ---------- active workout (one exercise at a time) ---------- */
.wo { max-width: 640px; margin: 0 auto; }
.wo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.wo-head h1 { margin: 2px 0 0; font-size: clamp(24px, 6vw, 30px); }
.wo-progress { margin-bottom: 12px; }
.wo-progress-text { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.wo-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.wo-bar span { display: block; height: 100%; background: var(--text-2); border-radius: inherit; transition: width .35s ease; }

.wo-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wo-strip::-webkit-scrollbar { display: none; }
.wo-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; max-width: 220px; min-height: 40px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 14px; cursor: pointer; scroll-snap-align: start; }
.wo-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-chip-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; }
.wo-chip-count svg { width: 14px; height: 14px; color: var(--pos); }
.wo-chip[aria-current="step"] { border-color: var(--text-2); color: var(--text); background: var(--surface-2); }
.wo-chip.complete { border-color: var(--pos-line); }

.wo-ex { padding: 18px; }
.wo-ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wo-ex h2 { font-size: 22px; letter-spacing: -.015em; margin: 0 0 4px; }
.wo-target { font-size: 14px; color: var(--muted); }
.wo-ex .prev { margin: 6px 0 4px; }
.wo-tip { margin: 2px 0 6px; }
.wo-tip > summary { cursor: pointer; font-size: 14px; color: var(--text-2); min-height: 40px; display: inline-flex; align-items: center; }
.wo-tip p { margin: 0 0 6px; font-size: 14px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; }

.wo-sets { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.wo-set { border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.wo-set-n { width: 28px; height: 28px; flex: none; border-radius: 99px; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.wo-set-sum { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.wo-set.is-done { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 12px; border-color: var(--pos-line); background: rgba(140, 202, 166, .05); }
.wo-set.is-done .wo-set-n { background: var(--pos-bg); color: var(--pos); }
.wo-set-ok { color: var(--pos); display: inline-flex; }
.wo-set-ok svg { width: 18px; height: 18px; }
.wo-set.is-next { border-style: dashed; }
.wo-set-btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 12px; background: none; border: 0; color: var(--text-2); text-align: left; cursor: pointer; border-radius: 14px; }
.wo-set.is-active { padding: 14px; border-color: var(--line-strong); background: var(--surface-2); }
.wo-set-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.wo-set-label { font-weight: 650; font-size: 16px; }
.wo-set-goal { font-size: 13px; color: var(--muted); }
.wo-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.wo-field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.wo-step { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); overflow: hidden; }
.wo-step input { border: 0; background: transparent; border-radius: 0; min-height: 56px; padding: 4px; text-align: center; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 0; }
.wo-step input:focus { outline: none; }
.wo-step:focus-within { border-color: var(--info); box-shadow: 0 0 0 1px var(--info); }
.wo-step-btn { border: 0; background: var(--surface-3); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.wo-step-btn:active { background: var(--line-strong); }
.wo-rir { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-top: 12px; }
.wo-rir-label { font-size: 13px; color: var(--text-2); }
.wo-rir-opts { display: flex; gap: 4px; }
.wo-rir-opt { min-width: 38px; min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.wo-rir-opt[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 650; }
.wo-done { margin-top: 14px; min-height: 54px; font-size: 17px; border-radius: 14px; }
.wo-ex-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.wo-rest-pick { margin-left: auto; }
.wo-rest-pick select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; font-size: 14px; }
.wo-ex-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wo-more { margin-top: 14px; }

/* Bottom dock: progress + finish, or the rest timer. */
.wo-dock { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 6; margin-top: 16px; }
@media (min-width: 900px) { .wo-dock { bottom: 14px; } }
.wo-dock-idle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; border: 1px solid var(--line-strong); background: rgba(21, 23, 25, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rest { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line-strong); background: rgba(27, 30, 33, .97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .9); }
.rest-ring { position: relative; width: 64px; height: 64px; }
.rest-ring > svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.rest-track { fill: none; stroke: var(--surface-3); stroke-width: 5; }
.rest-fill { fill: none; stroke: var(--text-2); stroke-width: 5; stroke-linecap: butt; stroke-dasharray: 100; transition: stroke-dashoffset .25s linear; }
.rest-ok { position: absolute; inset: 0; display: grid; place-items: center; color: var(--pos); opacity: 0; transform: scale(.6); }
.rest-ok svg { width: 26px; height: 26px; }
.rest-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rest-time { font-size: 34px; font-weight: 680; letter-spacing: -.02em; line-height: 1.05; }
.rest-next { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-ctl { display: flex; flex-direction: column; gap: 6px; }
.rest-ctl .btn { min-height: 40px; }
.rest.is-over { border-color: var(--pos-line); background: linear-gradient(180deg, rgba(140, 202, 166, .12), rgba(27, 30, 33, .97) 70%); }
.rest.is-over .rest-fill { stroke: var(--pos); }
.rest.is-over .rest-label { color: var(--pos); }
.rest.is-over .rest-ok { opacity: 1; transform: none; }
.rest.is-over .rest-time { color: var(--pos); }
@media (max-width: 380px) { .rest { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; } .rest-ring, .rest-ring > svg { width: 52px; height: 52px; } .rest-time { font-size: 28px; } }

/* Rest chip shown on other screens while resting. */
.rest-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); text-decoration: none; font-size: 14px; }
.rest-chip .muted { margin-left: auto; }

/* Completion cue: a single soft glow and ring pulse with a check; static under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .rest.is-over { animation: rest-glow 1.6s ease-out 1; }
  .rest.is-over .rest-ring { animation: rest-pulse .9s cubic-bezier(.2, .7, .2, 1) 2; }
  .rest.is-over .rest-ok { transition: opacity .25s ease, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
  .wo-set.is-done { animation: set-in .3s ease-out; }
}
@keyframes rest-glow { 0% { box-shadow: 0 0 0 0 rgba(140, 202, 166, .45); } 100% { box-shadow: 0 0 0 18px rgba(140, 202, 166, 0); } }
@keyframes rest-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes set-in { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wo-bar span, .rest-fill { transition: none; } }
@media (max-width: 420px) {
  .wo-ex { padding: 14px; }
  .wo-set.is-active { padding: 12px; }
  .wo-step { grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .wo-step input { font-size: 22px; }
  .wo-ex-nav .btn { flex: 1; }
}

/* ---------- beta: update bar, feedback ---------- */
.update-bar { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; border: 1px solid var(--info-line); background: rgba(21, 23, 25, .97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 14px; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .9); }
.fb textarea { min-height: 96px; }
.fb-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); margin: 0 0 10px; cursor: pointer; }
.fb-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--text); }
.fb-preview { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 var(--mono); color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; user-select: text; -webkit-user-select: text; }
/* iPhone Safari zooms into form fields under 16px; keep this one at 16px. */
.wo-rest-pick select { font-size: 16px; }

/* ---------- name: All in One Training ---------- */
.wl-kicker { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); font-weight: 500; }
/* Header: keep the full name on one line; shorten the privacy note on narrow screens.
   Below 360px the privacy note is hidden (it's repeated in Settings); the demo label stays. */
.brand > span:last-child { white-space: nowrap; }
.top-meta { white-space: nowrap; text-align: right; }
.tm-short { display: none; }
@media (max-width: 520px) { .tm-full { display: none; } .tm-short { display: inline; } }
@media (max-width: 359px) { .top-meta:not(.is-demo) { display: none; } }
