:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #fcfcfb;
  --border: #e3e2de;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #74736e;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --series-1: #2a78d6;
  --band: rgba(42, 120, 214, 0.14);
  --grid: #e8e7e3;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --radius: 14px;
  --tabs-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a19;
    --border: #2e2e2c;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #9a998f;
    --accent: #3987e5;
    --series-1: #3987e5;
    --band: rgba(57, 135, 229, 0.2);
    --grid: #2a2a28;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110;
  --surface: #1a1a19;
  --border: #2e2e2c;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --muted: #9a998f;
  --accent: #3987e5;
  --series-1: #3987e5;
  --band: rgba(57, 135, 229, 0.2);
  --grid: #2a2a28;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px);
}
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 18px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; margin-top: 16px; color: var(--text-2); }
p { margin: 0 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small, .small-stats .stat-label { font-size: 13px; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
main { max-width: 640px; margin: 0 auto; padding: 0 16px; outline: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.stack > * + * { margin-top: 0; }
.eyebrow { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--accent); }
.btn.block { width: 100%; margin-top: 12px; }
.btn.danger, .link.danger { color: var(--critical); border-color: var(--critical); }
.link { background: none; border: 0; padding: 4px; font: inherit; font-size: 13px; cursor: pointer; }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.actions > .btn { flex: 1; }
.actions.wrap { flex-wrap: wrap; }
.actions.wrap > .btn { flex: 1 1 140px; }

.field { display: block; margin: 12px 0; font-weight: 500; }
.field input, .field select, .field textarea {
  display: block; width: 100%; margin-top: 6px;
  min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit;
}
.row { display: flex; gap: 12px; }
.row > .field { flex: 1; min-width: 0; }

fieldset { border: 0; padding: 0; margin: 0; }
.scale { margin: 14px 0; }
.scale legend { font-weight: 500; margin-bottom: 6px; }
.scale-options { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.scale-options label { position: relative; }
.scale-options input { position: absolute; opacity: 0; inset: 0; }
.scale-options span {
  display: flex; align-items: center; justify-content: center; height: 44px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  font-weight: 600; cursor: pointer;
}
/* Red → green across the scale (7 is always best); the numbers carry the
   meaning, the colour just makes the scale quicker to read. */
.scale-options label:nth-child(1) { --tone: hsl(4 72% 50%); }
.scale-options label:nth-child(2) { --tone: hsl(18 80% 50%); }
.scale-options label:nth-child(3) { --tone: hsl(34 88% 48%); }
.scale-options label:nth-child(4) { --tone: hsl(48 85% 45%); }
.scale-options label:nth-child(5) { --tone: hsl(75 60% 42%); }
.scale-options label:nth-child(6) { --tone: hsl(105 50% 40%); }
.scale-options label:nth-child(7) { --tone: hsl(135 55% 36%); }
.scale-options span { background: color-mix(in srgb, var(--tone) 14%, var(--bg)); border-color: color-mix(in srgb, var(--tone) 45%, var(--border)); }
.scale-options input:checked + span { background: var(--tone); border-color: var(--tone); color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tone); }
.scale-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; }
.chips span {
  display: flex; align-items: center; justify-content: center; height: 44px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.chips label:last-child { grid-column: span 2; }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

.choice label { display: flex; gap: 10px; align-items: center; min-height: 40px; }
.choice input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.form-error { color: var(--critical); font-weight: 500; }

/* ---------- status (always icon + label, never colour alone) */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  padding: 3px 10px 3px 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--status) 16%, transparent);
  color: var(--text);
}
.status-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--status); color: #fff; font-size: 11px;
}
.status-good { --status: var(--good); }
.status-warning { --status: var(--warning); }
.status-warning .status-icon { color: #111; }
.status-serious { --status: var(--serious); }
.status-critical { --status: var(--critical); }
.status-note { --status: var(--muted); }

/* ---------- today */
.score-row { display: flex; gap: 20px; align-items: center; margin: 8px 0; }
.score { display: flex; align-items: baseline; }
.score-num { font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.score-max { color: var(--muted); font-size: 18px; margin-left: 2px; }
.advice { margin-top: 8px; color: var(--text-2); }
.flags { list-style: none; padding: 0; margin: 0; }
.flags li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.flags .status { flex-shrink: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 8px 0; }
.stat-num { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.small-stats .stat-num { font-size: 18px; }
.stat-label { color: var(--muted); font-size: 12px; }
.disclaimer { color: var(--muted); font-size: 12px; text-align: center; margin: 16px 0; }

/* ---------- measure */
.steps { padding-left: 20px; }
.steps li { margin-bottom: 6px; }
details { margin-top: 16px; }
summary { cursor: pointer; color: var(--accent); min-height: 32px; }
.live-head { display: flex; justify-content: space-between; align-items: center; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.live-main { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 16px 0 8px; }
.preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #000; }
.wave { width: 100%; height: 110px; display: block; }
.progress { height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; margin: 12px 0; }
#progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* ---------- charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .band { fill: var(--band); }
.chart .series-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .series-bar { fill: var(--series-1); }
.chart .series-bar.pos { fill: var(--good); }
.chart .series-bar.neg { fill: var(--serious); }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.chart .muted-bar { fill: color-mix(in srgb, var(--series-1) 45%, var(--surface)); }
.chart .panel-title { fill: var(--text-2); font-size: 12px; font-weight: 600; }
.chart .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%);
  background: var(--text); color: var(--surface);
  font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none;
}

/* ---------- table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500;
}
.tabs svg { width: 24px; height: 24px; fill: currentColor; }
.tabs a[aria-current] { color: var(--accent); }

/* ---------- team & coach */
.sync-line { font-size: 13px; color: var(--text-2); text-align: center; margin-top: 12px; }
.coach-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.coach-head h2 { margin: 0; text-align: center; flex: 1; }
.icon-btn { min-width: 44px; padding: 0; font-size: 22px; }
.small-btn { min-height: 32px; padding: 0 12px; font-size: 13px; margin-left: 4px; }
.group-table { font-size: 13px; }
.group-table th, .group-table td { padding: 8px 4px; }
.group-table td.who { white-space: normal; line-height: 1.6; }
.group-table td.who .status { font-size: 11px; }
.flag-row td { text-align: left; white-space: normal; font-size: 13px; color: var(--text-2); padding-top: 0; }
tr:has(+ .flag-row) td { border-bottom: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.copy-field {
  width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text);
}
code { font-size: 13px; background: var(--bg); padding: 1px 4px; border-radius: 4px; }
.tabs a { font-size: 11px; }

/* ---------- morning check-in */
.reading-bar {
  position: sticky; top: calc(env(safe-area-inset-top) + 52px); z-index: 4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.reading-bar[data-state="ok"] { border-color: var(--good); }
.reading-bar[data-state="warn"] { border-color: var(--warning); }
.reading-head { display: flex; align-items: center; gap: 12px; }
.reading-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reading-head .btn { flex-shrink: 0; }
.preview.small { width: 44px; height: 44px; flex-shrink: 0; }
.reading-bar .progress { margin: 10px 0 0; }
.done-list { list-style: none; padding: 0; margin: 12px 0 0; }
.done-list li { padding: 2px 0; }
.hero .actions + p { margin-top: 12px; }
.stats.two { grid-template-columns: repeat(2, 1fr); }
.stats.four { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stats.four .stat-num { font-size: 22px; }
.stats.four .stat-label { font-size: 12px; }
.compare-table { width: 100%; }
.compare-table th[scope=row] { text-align: left; font-weight: 600; white-space: normal; }
.compare-table td { white-space: nowrap; }
.compare-table .sub-row th { font-weight: 400; padding-left: 14px; color: var(--muted); }
.compare-table td, .compare-table thead th { text-align: right; }
.checkin-table td:nth-child(n+2) { white-space: nowrap; }
.actions > .btn { white-space: nowrap; padding: 0 12px; }
.qr { max-width: 280px; margin: 12px auto; border-radius: 12px; overflow: hidden; }
.qr svg { display: block; width: 100%; height: auto; }
.welcome { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.welcome p { margin: 0; }
.offer { border-color: var(--accent); }
.offer p { margin: 0 0 10px; }
#measure-result .offer { margin: 16px 0 0; }
.toggle-line { margin: 8px 0 0; }
.welcome a { white-space: nowrap; margin-left: 4px; }
.home-tip { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }

/* ---------- coach: watch list, reminders, team trends */
.watch { list-style: none; padding: 0; margin: 0; }
.watch > li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.watch > li:last-child { border-bottom: 0; }
.watch-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.watch-head a { font-weight: 600; }
.watch ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.missed { font-size: 12px; font-weight: 600; color: var(--serious); margin-left: 4px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg a { padding: 4px 12px; font-size: 13px; text-decoration: none; color: var(--text); }
.seg a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-head h3 { margin: 0; }
.trend-block { margin-top: 14px; }
.trend-block h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }

.streak { margin: 10px 0 0; font-size: 15px; }
.chips.days { gap: 4px; }
.chips.days label:last-child { grid-column: auto; } /* all seven days on one row */
.chips.days span { font-size: 13px; height: 40px; }
.diag { margin-top: 12px; }
.diag textarea { width: 100%; font: 12px/1.4 ui-monospace, monospace; }

/* Front-camera reading: the whole screen is the light source. Content sits
   at the bottom so the area around the camera stays bright white. */
.front-light {
  position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; border: 0;
  background: #fff !important; color: #222;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.front-light .muted { color: #555; }
.front-light .live-main { display: none; }
.front-light::before { content: '☝️ Lightly cover the front camera at the top'; position: absolute; top: 40%; left: 16px; right: 16px; text-align: center; font-weight: 600; }
body.lit .tabs, body.lit header { visibility: hidden; }
.days-note { margin-top: 6px; }
.hero .sync-line { text-align: left; margin-top: 14px; font-size: 14px; }
fieldset.missing, .field.missing { outline: 2px solid var(--critical); outline-offset: 6px; border-radius: 10px; }

/* Today, after checking in: neutral, never red or green. */
.usual { display: inline-block; margin: 6px 0 2px; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.injury-note { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); border-radius: 6px; }
.send-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; box-sizing: border-box; width: calc(100% - 32px); max-width: 608px; margin: 12px auto 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; background: color-mix(in srgb, var(--warning) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 50%, transparent); }
.send-banner[hidden] { display: none; }
.stuck-help { display: block; margin-top: 6px; font-size: 13px; color: var(--text-2); }

/* ---------- coach page */
.refresh-line { margin: 12px 0 0; }
.roster { list-style: none; padding: 0; margin: 0; }
.roster li { border-bottom: 1px solid var(--border); }
.roster li:last-child { border-bottom: 0; }
.roster a { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; text-decoration: none; color: var(--text); }
.roster-name { font-weight: 600; color: var(--accent); }
.roster-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checkin-grid { border-collapse: collapse; font-size: 13px; }
.checkin-grid th, .checkin-grid td { padding: 4px 2px; text-align: center; }
.checkin-grid th:first-child, .checkin-grid td.who { text-align: left; padding-right: 8px; white-space: nowrap; }
.checkin-grid .grid-miss { color: var(--muted); }
.checkin-grid .grid-in { font-weight: 700; border-radius: 6px; }
.grid-good { background: color-mix(in srgb, var(--good) 22%, transparent); }
.grid-warning { background: color-mix(in srgb, var(--warning) 30%, transparent); }
.grid-serious { background: color-mix(in srgb, var(--serious) 26%, transparent); }
.grid-critical { background: color-mix(in srgb, var(--critical) 26%, transparent); }
.notes-feed { list-style: none; padding: 0; margin: 0; }
.notes-feed li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.notes-feed li:last-child { border-bottom: 0; }
.note-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.note-head a { font-weight: 600; }
.note-injury, .note-text { margin: 6px 0; }
.note-text { color: var(--text-2); }
.settings-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 16px; }
.settings-list dt { font-weight: 600; }
.settings-list dd { margin: 0; word-break: break-all; }
.th-sub { font-weight: 400; font-size: 11px; color: var(--muted); white-space: nowrap; }
td.effort { white-space: nowrap; font-variant-numeric: tabular-nums; }
fieldset.session { border: 0; padding: 0; margin: 12px 0 4px; }
fieldset.session legend { font-weight: 600; padding: 0; margin-bottom: 2px; }

/* Training card: one row per question */
.field > .q { display: block; margin-bottom: 6px; }
.inline-q { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline-q .q { margin: 0; flex-shrink: 0; }
.inline-q select { width: auto; min-width: 150px; }
.effort-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-top: 4px; }
.effort-row label { position: relative; }
.effort-row input { position: absolute; opacity: 0; inset: 0; }
.effort-row span {
  display: flex; align-items: center; justify-content: center; height: 34px;
  border-radius: 7px; font-weight: 700; font-size: 14px; cursor: pointer;
  --tone: hsl(var(--hue) 55% 42%);
  background: color-mix(in srgb, var(--tone) 16%, var(--bg)); border: 1px solid color-mix(in srgb, var(--tone) 45%, var(--border));
}
.effort-row input:checked + span { background: var(--tone); border-color: var(--tone); color: #fff; }
.effort-row input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips.yn { grid-template-columns: repeat(2, 72px); }
.chips.yn label:last-child { grid-column: auto; }
.chips.yn span { height: 38px; }
.yes-no { margin-top: 10px; }
.chips.meet-level { grid-template-columns: repeat(3, 70px); gap: 4px; }
.chips.meet-level label:last-child { grid-column: auto; }
.chips.meet-level span { height: 38px; font-size: 12.5px; padding: 0 2px; }
[data-details$="meet"] { margin-top: 6px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; margin: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tag-meet { background: color-mix(in srgb, var(--warning) 25%, transparent); }
.asked-first [data-details] { margin-top: 4px; }

.delta { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.9em; }
.delta.down { color: var(--serious); }
.delta.up { color: var(--good); }
.delta.big { font-weight: 700; }
.stat-num .delta { font-size: inherit; }
.day-table td, .day-table th { white-space: nowrap; }
.day-table td.who { white-space: normal; }
.day-table td, .day-table th, .compare-table td, .compare-table th { padding-left: 4px; padding-right: 4px; }
.response-table { width: 100%; }

/* ---------- polish: header, cards, tiles, tabs, save bar */
:root {
  --radius: 16px;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --shadow: 0 1px 2px rgba(20, 20, 18, 0.04), 0 6px 18px rgba(20, 20, 18, 0.05);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); } }
:root[data-theme="dark"] { --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
body { -webkit-font-smoothing: antialiased; }
.topbar { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.topbar h1 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; }
main { padding-top: 14px; }
.card { box-shadow: var(--shadow); margin-bottom: 14px; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 10px; }
h3 { font-size: 16px; letter-spacing: -0.005em; }
.eyebrow { margin: 0 0 4px; font-weight: 600; }

/* Today: the hero card */
.hero { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 75%); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.hero h2 { font-size: 24px; letter-spacing: -0.02em; text-wrap: balance; }
.hero-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 2px 0 6px;
  border-radius: 50%; background: var(--good); color: #fff; font-weight: 700;
}
.done-list li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.done-list li:last-child { border-bottom: 0; }
.streak { display: inline-block; margin: 10px 0 0; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--warning) 20%, var(--surface)); font-size: 14px; }

/* Buttons */
.btn { transition: transform 0.08s ease, filter 0.15s ease; }
.btn:not(.secondary):not(.danger) { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .tabs a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn.block { min-height: 52px; font-size: 17px; }

/* Number tiles */
.stats > div { background: var(--bg); border-radius: 12px; padding: 10px 4px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stats.four > div { padding: 8px 2px; }
.stats.four .stat-label { font-size: 11px; line-height: 1.3; text-wrap: balance; }
.stat-label { line-height: 1.3; }

/* Bottom tabs: a pill behind the current section */
.tabs { box-shadow: 0 -4px 18px rgba(20, 20, 18, 0.05); }
.tabs a { position: relative; isolation: isolate; gap: 3px; transition: color 0.15s ease; }
.tabs a[aria-current]::before {
  content: ''; position: absolute; z-index: -1; top: 7px; width: 54px; height: 30px; border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.tabs a[aria-current] { font-weight: 700; }

/* Coach: day arrows */
.coach-head .icon-btn { min-width: 40px; min-height: 40px; font-size: 20px; }
.coach-head h2 { font-size: 21px; }

/* Check-in: the Save button stays in reach, with how many questions are left */
.save-bar {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 8px); z-index: 6;
  margin-top: 10px; padding: 10px 12px 12px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(20, 20, 18, 0.14);
}
.save-bar .btn.block { margin-top: 6px; }
.save-progress { display: block; text-align: center; font-size: 13px; color: var(--muted); }
.save-progress.done { color: var(--good); font-weight: 600; }

/* Workouts tab */
.workout-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workout-head h3 { margin: 0; }
.workout-day .btn.block { margin-top: 10px; }
.wk-status { flex-shrink: 0; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.wk-logged { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--text); }
.wk-partly, .wk-checkin { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.workout-list { list-style: none; padding: 0; margin: 0; }
.workout-list a { display: grid; grid-template-columns: 104px 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.workout-list li:last-child a { border-bottom: 0; }
.wl-date { font-weight: 600; font-size: 14px; white-space: nowrap; }
.wl-sum { line-height: 1.35; }
.other-day { align-items: flex-end; margin-top: 10px; }
.other-day .btn { margin-bottom: 12px; }
.session-card .field > .q { font-weight: 500; }
.chips.reasons { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.chips.reasons label:last-child { grid-column: auto; }
.chips.reasons span { height: 40px; font-size: 12.5px; text-align: center; line-height: 1.15; padding: 0 2px; }
.heart-link { text-align: center; margin: 12px 0 0; }

.doubles-later { text-align: center; margin: 0 0 12px; }
