/* Base + components. Grow this file; do not start a second one.
   Every colour comes from a token — no literals below this line.
   Lifted from docs/prototypes; faces are scoped by body class:
   .face-public, .face-app (athlete), .face-admin, .face-auth. */

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--fa); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mark {
  display: block; background-color: currentColor;
  -webkit-mask: url(/static/img/logo.png) center / contain no-repeat;
  mask: url(/static/img/logo.png) center / contain no-repeat;
}

/* ── type ─────────────────────────────────────────────────────────────── */
.eyebrow { font-family: var(--lat); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.4; }
.h2 { font-size: 14px; font-weight: 600; margin: 0; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.tiny { font-size: 12px; line-height: 1.65; }
.num { font-variant-numeric: tabular-nums; }
.lat { font-family: var(--lat); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sectionhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sectionhead .link { margin-inline-start: auto; font-size: 12px; color: var(--accent); }
.back { align-self: flex-start; font-size: 12px; color: var(--ink-faint); }
.back:hover { color: var(--ink); }
.empty { padding: 26px var(--pad); text-align: center; color: var(--ink-faint); font-size: 13px; }

/* ── layout helpers ───────────────────────────────────────────────────── */
.col { display: flex; flex-direction: column; gap: 18px; }
.col--t { gap: 12px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.push { margin-inline-start: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.split { display: grid; gap: 16px; }
@media (min-width: 880px) { .split { grid-template-columns: 1.55fr 1fr; align-items: start; } }
.formgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.inline { display: inline; }
.stack-sm > * + * { margin-top: 8px; }

/* ── cards and lists ──────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.card--pad { padding: 16px; }
.card--a { border-color: var(--accent-dim); }
.card--bad { border-color: var(--bad-line); }
.cardhead { display: flex; align-items: center; gap: 10px; padding: 14px var(--pad); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.cardhead .act { margin-inline-start: auto; }
.cardbody { padding: 6px var(--pad) var(--pad); }
.cardbody--flat { padding: var(--pad); }
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line-soft); }
.item { display: flex; align-items: center; gap: 12px; padding: 14px var(--pad); width: 100%; text-align: start; }
a.item:hover, button.item:hover { background: var(--surface-2); }
.item__m { flex: 1; min-width: 0; }
.item__m b { display: block; font-weight: 600; font-size: 14px; }
.item__m span, .item__m .meta { font-size: 12px; color: var(--ink-faint); }
.item__act { display: flex; gap: 6px; flex-wrap: wrap; flex: none; align-items: center; }
.item__v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--ink-faint); }
.kv > b { font-weight: 600; text-align: end; }

/* ── buttons and pills ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; border: 1px solid transparent; white-space: nowrap; }
.btn--primary { background: var(--accent); color: var(--surface); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { border-color: var(--bad-line); color: var(--bad); background: var(--bad-tint); }
.btn--ok { border-color: var(--ok-line); color: var(--ok); background: var(--ok-tint); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 13px; font-size: 13px; }
.btn--xs { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-dim); position: relative; flex: none; }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn__dot { position: absolute; top: 5px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ground); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim); background: var(--surface); white-space: nowrap; flex: none; line-height: 1.6; }
.pill--ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-tint); }
.pill--warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-tint); }
.pill--bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-tint); }
.pill--a { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-tint); }
.pill--flat { background: var(--surface-2); border-color: var(--line-soft); }
.flags { display: flex; gap: 5px; flex-wrap: wrap; }
.avatar, .ava { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--ink-dim); }
.ava { width: 32px; height: 32px; font-size: 11px; }
.ava--lg { width: 56px; height: 56px; font-size: 17px; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { display: block; font-weight: 600; font-size: 13px; }
.who span { font-size: 11px; color: var(--ink-faint); }

/* ── forms ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 12px; color: var(--ink-dim); }
.field .err { font-size: 12px; color: var(--bad); }
.input { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; font-size: 15px; width: 100%; font-variant-numeric: tabular-nums; min-height: 44px; }
.input::placeholder { color: var(--ink-faint); }
.input:focus { border-color: var(--ink-faint); outline: none; }
.input[aria-invalid="true"] { border-color: var(--bad-line); }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.7; }
select.input { appearance: none; background-image: none; }
.input--sm { padding: 7px 10px; font-size: 13px; min-height: 36px; }
.input--num { max-width: 150px; }
.unit { position: relative; }
.unit > .input { padding-inline-end: 42px; }
.unit > span { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-faint); pointer-events: none; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts label { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink-dim); cursor: pointer; }
.opts input:checked + label { border-color: var(--accent); color: var(--accent); font-weight: 600; background: var(--accent-tint); }
.opts input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.agree { display: flex; gap: 12px; align-items: flex-start; }
.agree input { margin-top: 6px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.agree label { font-size: 13px; color: var(--ink-dim); line-height: 1.8; }
.checkline { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.checkline input { width: 17px; height: 17px; accent-color: var(--accent); }
.scale { display: flex; gap: 6px; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { flex: 1; text-align: center; padding: 8px 0; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; color: var(--ink-dim); background: var(--surface-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.scale input:checked + label { background: var(--accent); color: var(--surface); border-color: var(--accent); font-weight: 600; }
.scale input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.scalerow { display: flex; flex-direction: column; gap: 8px; }
.scalerow__ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); }
.drop { position: relative; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2); padding: 16px; display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; color: var(--ink-dim); font-size: 13px; cursor: pointer; }
.drop[data-filled="1"] { border-style: solid; border-color: var(--ok-line); background: var(--ok-tint); color: var(--ok); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.errors { border: 1px solid var(--bad-line); background: var(--bad-tint); color: var(--bad); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; }
.errors ul { margin: 0; padding-inline-start: 18px; }
.notice { border: 1px solid var(--accent-dim); background: var(--accent-tint); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; line-height: 1.8; }
.notice--warn { border-color: var(--warn-line); background: var(--warn-tint); }

/* option cards (program type, variants) */
.opt { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 15px; background: var(--surface); cursor: pointer; }
.opt + .opt { margin-top: 10px; }
.opt > input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(> input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.opt:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt:has(> input:disabled) { opacity: .45; cursor: default; }
.opt__radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.opt:has(> input:checked) .opt__radio { border-color: var(--accent); }
.opt:has(> input:checked) .opt__radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.opt__m { flex: 1; min-width: 0; }
.opt__m b { display: block; font-size: 14px; font-weight: 600; }
.opt__m span { font-size: 12px; color: var(--ink-faint); }
.opt__p { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* segmented control built from radios */
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label, .seg a { flex: 1; padding: 8px; border-radius: 5px; font-size: 13px; color: var(--ink-dim); font-weight: 500; text-align: center; cursor: pointer; }
.seg input:checked + label, .seg a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 13px; color: var(--ink-dim); display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-current="true"], .chip[data-on="1"] { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.chips input[type="radio"], .chips input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.chips input:checked + label.chip { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.chips input:focus-visible + label.chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips label.chip { cursor: pointer; }

/* ── data display ─────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.stats--4 { grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); }
@media (min-width: 640px) { .stats--4 { grid-template-columns: repeat(4, 1fr); } }
.stats--4 .stat { background: var(--surface); }
.stats--4 .stat + .stat { border-inline-start: 0; }
.stat { padding: 13px 10px; text-align: center; }
.stat + .stat { border-inline-start: 1px solid var(--line-soft); }
.stat__v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.35; }
.stat__l { font-size: 11px; color: var(--ink-faint); }
.meter { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; width: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 16px; text-align: start; display: block; }
.kpi b { display: block; font-size: 25px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--ink-faint); }
.kpi[data-tone="warn"] b { color: var(--warn); }
.kpi[data-tone="bad"] b { color: var(--bad); }
.kpi[data-tone="a"] b { color: var(--accent); }
.kpi[data-tone="ok"] b { color: var(--ok); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: start; font-size: 11px; font-weight: 600; color: var(--ink-faint); padding: 11px var(--pad); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td { padding: 13px var(--pad); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: end; }
.tablefoot { display: flex; align-items: center; gap: 12px; padding: 13px var(--pad); border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-dim); flex-wrap: wrap; }
.tablefoot .num { margin-inline-start: auto; font-weight: 600; color: var(--ink); font-size: 13px; }
.tablefoot .input, .item .input, .chips .input { width: auto; min-width: 0; }
.tablefoot .input.grow, .item .input.grow { flex: 1 1 160px; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; border: 1px solid var(--line); color: var(--ink-faint); background: var(--surface); }
.tick[data-s="ok"] { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.tick[data-s="wait"] { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.tick[data-s="no"] { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; }
.ctx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ctx span { font-size: 11px; color: var(--ink-faint); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }
.feedback { border-inline-start: 2px solid var(--accent-dim); padding: 8px 12px; background: var(--accent-tint); border-start-start-radius: 0; border-end-start-radius: 0; border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); font-size: 13px; line-height: 1.8; white-space: pre-line; }
.feedback__who { font-size: 11px; color: var(--accent); margin-bottom: 2px; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; align-items: stretch; }
.step__i { display: flex; flex-direction: column; align-items: center; flex: none; }
.step__d { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); margin-top: 6px; flex: none; }
.step__l { width: 2px; flex: 1; background: var(--line-soft); min-height: 16px; }
.step:last-child .step__l { display: none; }
.step__m { padding-bottom: 14px; }
.step__m b { font-size: 13.5px; font-weight: 600; display: block; }
.step__m span { font-size: 12px; color: var(--ink-faint); }
.step[data-s="done"] .step__d { border-color: var(--ok); background: var(--ok); }
.step[data-s="now"] .step__d { border-color: var(--accent); background: var(--accent); }
.step[data-s="todo"] .step__m b { color: var(--ink-faint); font-weight: 500; }
.check { display: flex; align-items: center; gap: 12px; padding: 13px var(--pad); width: 100%; text-align: start; }
.check__box { width: 20px; height: 20px; border-radius: 6px; flex: none; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: transparent; background: var(--surface); }
.check[data-state="done"] .check__box { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.check[data-state="wait"] .check__box { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.check[data-state="bad"] .check__box { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.check[data-state="pick"] .check__box { background: var(--accent); border-color: var(--accent); color: var(--surface); }
label.check { cursor: pointer; }
label.check input { position: absolute; opacity: 0; pointer-events: none; }
label.check:has(input:checked) .check__box { background: var(--accent); border-color: var(--accent); color: var(--surface); }
label.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.macros { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.macros .stat + .stat { border-inline-start: 1px solid var(--line-soft); }

/* photos */
.poses { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 0 8px; scrollbar-width: thin; }
.pose { flex: 0 0 106px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; }
.slot { position: relative; aspect-ratio: 3 / 4; width: 100%; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 16px; overflow: hidden; cursor: pointer; }
.slot[data-filled="1"] { border-style: solid; border-color: var(--ok-line); background: var(--ok-tint); color: var(--ok); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.slot:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pose__cap { font-size: 11px; color: var(--ink-dim); text-align: center; line-height: 1.45; }
.compare { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; padding-bottom: 6px; }
.compare--2 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.shot { display: flex; flex-direction: column; gap: 6px; }
.shot__img { aspect-ratio: 3 / 4; border-radius: var(--r-sm); border: 1px solid var(--line-soft); background: repeating-linear-gradient(135deg, var(--ph1) 0 9px, var(--ph2) 9px 18px); display: grid; place-items: center; color: var(--ink-faint); font-size: 11px; overflow: hidden; }
.shot__img img { width: 100%; height: 100%; object-fit: cover; }
.shot__cap { font-size: 11px; color: var(--ink-dim); display: flex; gap: 6px; align-items: baseline; }
.shot--now .shot__img { border-color: var(--accent-dim); }
video.player { width: 100%; max-height: 70vh; border-radius: var(--r-sm); background: var(--ink); }

/* chart */
.chartbox { padding: var(--pad); }
.chartbox svg { width: 100%; height: auto; display: block; overflow: visible; }
.charthead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.charthead b { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart__grid { stroke: var(--grid); stroke-width: 1; }
.chart__line { stroke: var(--accent); stroke-width: 2; fill: none; }
.chart__area { fill: var(--accent-tint); stroke: none; }
.chart__dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart__lbl { fill: var(--ink-faint); font-size: 11px; font-family: var(--fa); }

/* calendar */
.calhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.calhead b { font-size: 14px; font-weight: 600; flex: 1; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal__h { font-size: 10px; color: var(--ink-faint); text-align: center; padding-bottom: 2px; }
.cal__d { aspect-ratio: 1; border: 1px solid transparent; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
a.cal__d, .cal__d[data-free="1"] { color: var(--ink); background: var(--surface-2); border-color: var(--line); font-weight: 600; }
.cal__d[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.cal__d[data-pad="1"] { visibility: hidden; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }

/* messages */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.msg--them { background: var(--surface); border: 1px solid var(--line-soft); border-start-start-radius: 4px; align-self: flex-start; }
.msg--me { background: var(--bubble); border: 1px solid var(--accent-dim); border-start-end-radius: 4px; align-self: flex-end; }
.msg__t { font-size: 10px; color: var(--ink-faint); margin-top: 3px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 46px; }

/* sub-tabs */
.subtabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line-soft); scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtab { padding: 10px 14px; font-size: 13px; color: var(--ink-dim); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab[aria-current="true"] { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }

/* toast */
.toast { position: fixed; inset-inline: 16px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 420px; margin-inline: auto; background: var(--ink); color: var(--ground); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; box-shadow: 0 12px 30px -12px var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.toast[data-on="1"] { opacity: 1; transform: translateY(0); }
.face-admin .toast, .face-public .toast, .face-auth .toast { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

details.more > summary { cursor: pointer; list-style: none; font-size: 13px; color: var(--accent); }
details.more > summary::-webkit-details-marker { display: none; }

/* ── athlete app ──────────────────────────────────────────────────────── */
.face-app { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: var(--ground); }
.appbar .mark { width: 30px; height: 30px; flex: none; }
.appbar__name { font-family: var(--lat); font-weight: 700; letter-spacing: .14em; font-size: 11px; line-height: 1.2; }
.appbar__sub { font-size: 11px; color: var(--ink-faint); }
.appbar__spacer { margin-inline-start: auto; }
.appmain { padding: 18px 16px 30px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line-soft); background: var(--tabbar); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 9px; color: var(--ink-faint); font-size: 10px; position: relative; }
.tab svg { width: 20px; height: 20px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; inset-inline: 24%; height: 2px; background: var(--accent); }
.rail { display: none; }
.submitbar { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); padding: 14px 0 6px; background: linear-gradient(180deg, transparent 0%, var(--ground) 40%); display: flex; gap: 10px; z-index: 5; }
.acc { border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: 10px; }
.acc > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc__t { font-size: 14px; font-weight: 600; flex: 1; }
.acc__chev { color: var(--ink-faint); flex: none; }
.acc[open] .acc__chev { transform: rotate(180deg); }
.acc__body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.dot[data-on="1"] { background: var(--ok); }
.face-app .card { overflow: hidden; }
.face-app .item { padding-inline: 16px; }

@media (min-width: 900px) {
  .face-app { padding-bottom: 0; }
  .face-app .appshell { display: grid; grid-template-columns: 220px minmax(0, 640px); gap: 40px; justify-content: center; padding: 28px 24px; align-items: start; }
  .face-app .appmain { padding: 0; margin: 0; }
  .face-app .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 90px; }
  .rail a { padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-dim); font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
  .rail a svg { width: 17px; height: 17px; }
  .rail a:hover { background: var(--surface); color: var(--ink); }
  .rail a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
  .rail hr { border: 0; border-top: 1px solid var(--line-soft); margin: 8px 0; width: 100%; }
  .submitbar { bottom: 0; }
  .face-app .toast { bottom: 24px; }
  .appbar { padding-inline: max(16px, calc(50vw - 460px)); }
}

/* ── admin ────────────────────────────────────────────────────────────── */
.face-admin { font-size: 14px; line-height: 1.7; }
.face-admin .btn { padding: 9px 15px; font-size: 13px; gap: 7px; }
.face-admin .btn--sm { padding: 6px 11px; font-size: 12px; }
.face-admin .input { padding: 9px 12px; font-size: 13px; min-height: 38px; background: var(--surface); }
.face-admin textarea.input { background: var(--surface-2); min-height: 88px; }
.face-admin .input--sm { padding: 6px 9px; min-height: 32px; }
.face-admin .item__m b { font-size: 13px; }
.shell { display: flex; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.topbar .mark { width: 26px; height: 26px; flex: none; }
.burger { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); }
.topbar__t { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; }
.scrim { position: fixed; inset: 0; z-index: 45; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s ease; border: 0; width: 100%; }
.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: 272px; max-width: 84vw; background: var(--side); border-inline-end: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 14px; padding: 18px 12px calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; visibility: hidden; }
.drawer-open .side { transform: translateX(0); visibility: visible; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; }
.side .mark { width: 30px; height: 30px; flex: none; }
.brandname { font-family: var(--lat); font-weight: 700; letter-spacing: .14em; font-size: 11px; line-height: 1.3; }
.brandsub { font-size: 10px; color: var(--ink-faint); }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-dim); font-size: 13.5px; text-align: start; width: 100%; }
.nav__item:hover { background: var(--surface-2); color: var(--ink); }
.nav__item[aria-current="true"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.nav__item svg { width: 17px; height: 17px; flex: none; }
.nav__item span { flex: 1; min-width: 0; }
.nav__b { font-size: 11px; font-weight: 600; color: var(--ink-faint); font-variant-numeric: tabular-nums; flex: none; line-height: 1; }
.nav__item[aria-current="true"] .nav__b { color: var(--accent); }
.side__foot { display: flex; gap: 8px; padding-inline: 4px; align-items: center; }
.main { flex: 1; min-width: 0; padding: 20px 16px 72px; }
.inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
h1.h { font-size: 24px; font-weight: 600; letter-spacing: -.015em; margin: 4px 0 0; line-height: 1.35; }
.head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.head__act { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; }
.input--search { min-width: 190px; }
.face-admin .chip { padding: 6px 12px; font-size: 12px; }
.face-admin .card { overflow: hidden; }
@media (min-width: 1040px) {
  .topbar, .scrim { display: none; }
  .side { position: sticky; top: 0; z-index: 1; height: 100vh; width: 252px; max-width: none; transform: none; visibility: visible; flex: none; padding: 24px 12px; }
  .main { padding: 34px 36px 90px; }
}
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  th, td { padding: 12px; }
  .filters .input, .filters .btn { flex: 1 1 140px; }
  .input--search { flex: 1 1 100%; min-width: 0; }
  .head__act { width: 100%; }
  .head__act .btn { flex: 1 1 auto; }
  .kpi { padding: 13px; }
  .kpi b { font-size: 21px; }
  .face-admin .item { flex-wrap: wrap; }
  .face-admin .item__act { width: 100%; }
  .face-admin .item__act .btn, .face-admin .item__act form { flex: 1; }
  .face-admin .item__act form .btn { width: 100%; }
  .subtabs { margin-inline: -16px; padding-inline: 16px; }
  .grid3 { grid-template-columns: 1fr; }
}

/* ── public site ──────────────────────────────────────────────────────── */
.face-public { font-size: 16px; line-height: 1.85; }
.face-public a.link { color: var(--accent); }
.face-public .wrap { max-width: 1040px; margin: 0 auto; padding-inline: 20px; }
.face-public section { padding-block: 64px; }
.face-public .eyebrow { font-size: 11px; letter-spacing: .22em; color: var(--accent); }
h2.sec { font-size: clamp(23px, 4.6vw, 31px); font-weight: 600; letter-spacing: -.015em; margin: 10px 0 0; line-height: 1.35; text-wrap: balance; }
.lede { color: var(--ink-dim); max-width: 62ch; margin: 14px 0 0; }
header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.top__in { display: flex; align-items: center; gap: 14px; padding-block: 12px; }
.top .mark { width: 34px; height: 34px; flex: none; }
.face-public .brandname { font-weight: 900; letter-spacing: .16em; font-size: 13px; line-height: 1; }
.top nav { margin-inline-start: auto; display: none; gap: 22px; }
.top nav a { color: var(--ink-dim); font-size: 14px; }
.top nav a:hover { color: var(--ink); }
.top__cta { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
@media (min-width: 820px) { .top nav { display: flex; } .top__cta { margin-inline-start: 0; } }
.hero { padding-block: 52px 56px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero .mark { width: clamp(150px, 34vw, 210px); height: clamp(150px, 34vw, 210px); }
.hero h1 { font-size: clamp(29px, 6.2vw, 46px); line-height: 1.3; margin: 0; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.hero p { margin: 0; color: var(--ink-dim); max-width: 54ch; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.motto { background: var(--band); color: var(--band-ink); border-block: 1px solid var(--line); }
.motto__in { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; padding-block: 15px; font-family: var(--lat); font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; }
.motto__in span { opacity: .55; }
.motto__in span:first-child { opacity: 1; color: var(--accent); }
.pstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
@media (min-width: 640px) { .pstats { grid-template-columns: repeat(4, 1fr); } }
.pstat { background: var(--surface); padding: 20px 12px; text-align: center; }
.pstat b { display: block; font-family: var(--lat); font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pstat span { font-size: 12px; color: var(--ink-faint); }
.pgrid { display: grid; gap: 16px; }
@media (min-width: 760px) { .pgrid--3 { grid-template-columns: repeat(3, 1fr); } }
.value { padding: 22px; }
.value h3 { margin: 0 0 6px; font-size: 17px; }
.value p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.8; }
.value .k { font-family: var(--lat); font-size: 11px; letter-spacing: .2em; color: var(--accent); font-weight: 700; }
.staff { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 760px) { .staff { flex-direction: row; } .staff > * { flex: 1; } }
.person { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.person__top { padding: 22px; display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.person__ph { width: 74px; height: 74px; border-radius: 50%; flex: none; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-faint); font-family: var(--lat); font-weight: 900; font-size: 22px; }
.person__role { font-family: var(--lat); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.person h3 { margin: 4px 0 0; font-size: 20px; }
.person__sub { font-size: 13px; color: var(--ink-faint); }
.person ul { margin: 0; padding: 18px 22px; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.person li { display: flex; gap: 10px; font-size: 14px; line-height: 1.7; color: var(--ink-dim); }
.person li::before { content: "◆"; color: var(--accent); font-size: 9px; line-height: 2.2; flex: none; }
.roster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .roster { grid-template-columns: repeat(3, 1fr); } }
.athlete { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.athlete b { font-size: 15px; font-weight: 600; }
.athlete .cat { font-size: 12px; color: var(--ink-faint); }
.athlete .res { font-size: 12px; color: var(--accent); margin-top: 6px; }
.show { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.show:last-child { border-bottom: 0; }
.show__d { font-family: var(--lat); font-weight: 900; font-size: 13px; color: var(--accent); width: 88px; flex: none; font-variant-numeric: tabular-nums; line-height: 1.6; }
.show__m { flex: 1; min-width: 0; }
.show__m b { display: block; font-size: 15px; font-weight: 600; }
.show__m span { font-size: 12px; color: var(--ink-faint); }
.trophy__year { margin-top: 30px; }
.trophy__year h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
.place { font-family: var(--lat); font-weight: 900; font-size: 18px; width: 32px; text-align: center; color: var(--ink-faint); flex: none; }
.place[data-p="1"] { color: var(--accent); }
.form { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.form__step { border-bottom: 1px solid var(--line-soft); }
.form__step:last-child { border-bottom: 0; }
.form__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.form__n { font-family: var(--lat); font-size: 11px; font-weight: 700; color: var(--ink-faint); width: 16px; flex: none; font-variant-numeric: tabular-nums; }
.form__t { font-weight: 600; font-size: 15px; flex: 1; }
.form__body { padding: 0 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.callout { border: 1px solid var(--accent-dim); background: var(--accent-tint); border-radius: var(--r-md); padding: 18px 20px; display: flex; gap: 14px; }
.callout p { margin: 0; font-size: 14px; line-height: 1.8; }
footer.foot { border-top: 1px solid var(--line-soft); padding-block: 34px 44px; }
.foot__in { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.foot__in .mark { width: 40px; height: 40px; }
.foot__links { margin-inline-start: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.foot__links a { color: var(--ink-dim); font-size: 14px; }

/* ── auth pages ───────────────────────────────────────────────────────── */
.face-auth main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.authbox { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.authbox .mark { width: 96px; height: 96px; align-self: center; }
.authbox h1 { text-align: center; }

.errorpage { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 30px 16px; }
.errorpage b { font-family: var(--lat); font-size: 48px; color: var(--ink-faint); display: block; }

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

/* SVG meter (widths live in SVG attributes, not style) */
.meterbar { display: block; width: 100%; height: 4px; }
.meterbar__bg { fill: var(--surface-2); }
.meterbar__fg { fill: var(--accent); }
.mt { margin-top: 28px; }
.mt-sm { margin-top: 12px; }
.seg > a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; }
fieldset.scalerow { border: 0; padding: 0; margin: 0; }
fieldset.scalerow legend { padding: 0; margin-bottom: 8px; }
.compare--2 { max-width: 460px; }
.delta { direction: ltr; unicode-bidi: isolate; display: inline-block; }
