/* Colours come from app/theme.py: base.html writes the colour tokens into the page head
   (--bg --surface --surface-2 --ink --ink-2 --line --accent --on-accent --accent-text,
   --ok --warn --bad and their --on-* inks). The app is always light, whatever the phone's setting.
   This file has no colour values of its own: it uses those tokens, transparent and currentColor. */

/* Spacing, radius, type and motion scales, and the two type stacks. The display face (Barlow Condensed)
   is declared by base.html (font_faces) and falls back to the body stack while it loads. A gym may pick
   other faces (app/theme.py): theme_css then sets --font-body, --font-display and how display text is set
   (--display-transform, --display-tracking: a face not drawn for capitals keeps its case).
   Type: member rules take their font-size from these seven tokens and from nothing else; none is under 13px.
   The body face has three sizes (a label, a second line, the main text); the display face has four.
   Rhythm: a card pads 16 and sits 12 from the next; a title sits 4 or 8 from its line; groups sit 24 apart.
   Motion: an entrance is quick (240ms, 8px) and cards stagger by 40ms for at most four steps, so no card waits
   more than 160ms. A sheet opens in 300ms. The PR number counts up in 600ms (app.js reads --dur-count). */
:root {
  --font-body:-apple-system,system-ui,"Segoe UI",Roboto,sans-serif;
  --font-display:"Barlow Condensed",var(--font-body);
  --display-transform:uppercase; --display-tracking:.5px;
  --text-caption:13px; --text-secondary:15px; --text-body:17px;
  --display-s:22px; --display-m:28px; --display-l:34px; --display-xl:48px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px; --space-7:48px;
  --radius-control:10px; --radius-card:14px; --radius-sheet:20px;
  --ease:cubic-bezier(.16,1,.3,1);
  --dur-enter:240ms; --rise:8px; --stagger:40ms; --dur-sheet:300ms;
  --dur-press-down:200ms; --dur-press-up:280ms; --press-scale:.965;
  --dur-state:300ms; --dur-shimmer:1.6s; --dur-count:600ms;
  --tab-bar:69px; /* the tab bar's height (12 + 24 icon + 4 + a 13 px label line + 12, and its 1 px line); a pinned bar above it sits here */
}

* { box-sizing:border-box; }
body { margin:0; font-family:var(--font-body); font-variant-numeric:tabular-nums; background:var(--bg); color:var(--ink); padding-bottom:var(--space-7); }
/* With the fixed tab bar, the page ends above it: the last button never slides under the bar (96 px > --tab-bar). */
body:has(> nav.tabs) { padding-bottom:calc(var(--space-7)*2); }
a { color:var(--accent-text); }
header.top { display:flex; justify-content:space-between; align-items:center; padding:var(--space-3) var(--space-4); background:var(--surface); color:var(--ink); border-bottom:1px solid var(--line); }
header.top a.brand { display:inline-flex; align-items:center; gap:var(--space-2); min-height:44px; color:var(--accent-text); text-decoration:none; font-size:var(--text-secondary); font-weight:800; letter-spacing:1.5px; text-transform:uppercase; }
header.top a.brand .brand-logo { height:28px; width:auto; max-width:160px; object-fit:contain; object-position:left center; display:block; }
header.top .brand-block { display:flex; flex-direction:column; align-items:flex-start; min-width:0; }
header.top .powered { font-size:var(--text-caption); color:var(--ink-2); line-height:1.2; padding-bottom:var(--space-1); }
header.top .brand-user { font-size:var(--text-secondary); color:var(--ink-2); }
main { padding:var(--space-4); max-width:640px; margin:0 auto; }
/* Member pages: text nobody sized (a plain line in a card) is the body size, not the browser's 16px. */
main.member { font-size:var(--text-body); }
main.wide { max-width:1180px; }
h1 { font-size:var(--display-s); margin:0 0 var(--space-3); }
/* Display face: titles and the big numbers. Everything else stays in the body stack. */
main h1, .page-title h1 { font-family:var(--font-display); font-weight:700; text-transform:var(--display-transform); letter-spacing:var(--display-tracking); }
.num, .class-name, .list-row .value { font-family:var(--font-display); font-weight:600; }
h2 { margin:var(--space-5) 0 var(--space-2); }
.card { background:var(--surface); border-radius:var(--radius-card); padding:var(--space-4); margin-bottom:var(--space-3); }
.row { display:flex; gap:var(--space-3); align-items:center; justify-content:space-between; }
.muted { color:var(--ink-2); }
.error { color:var(--bad); margin:var(--space-2) 0; }
.badge { display:inline-block; padding:var(--space-1) var(--space-2); border-radius:999px; background:var(--surface-2); margin-right:var(--space-2); }
/* Status chips (badges here, pills below): a 16% tint of the status colour, with text in the status
   colour taken 15% toward --ink. That text reads at 5:1 or more on the tint in both schemes;
   the plain light --ok would be 4.3:1. */
.badge.ok { background:color-mix(in srgb, var(--ok) 16%, var(--surface)); color:color-mix(in srgb, var(--ok) 85%, var(--ink)); }
.badge.warn { background:color-mix(in srgb, var(--warn) 16%, var(--surface)); color:color-mix(in srgb, var(--warn) 85%, var(--ink)); }
.badge.bad { background:color-mix(in srgb, var(--bad) 16%, var(--surface)); color:color-mix(in srgb, var(--bad) 85%, var(--ink)); }
a.badge { text-decoration:none; }
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:var(--space-2); }
.dot.green { background:var(--ok); } .dot.amber { background:var(--warn); } .dot.red { background:var(--bad); } .dot.insufficient_data { background:var(--ink-2); }
label { display:block; margin:var(--space-3) 0 var(--space-1); }
input, select, textarea { width:100%; padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-control); background:var(--bg); color:var(--ink); }
input::placeholder, textarea::placeholder { color:var(--ink-2); }
button { padding:var(--space-3) var(--space-4); border:0; border-radius:var(--radius-control); background:var(--accent); color:var(--on-accent); margin-top:var(--space-2); font-weight:600; }
button.secondary { background:var(--surface-2); color:var(--ink); }
/* Sizes of the shared elements. Staff and coaching-mode pages (no main.member) keep the sizes in the staff block as they
   were. Member pages take the type scale from the :where(main.member) rules after it. :where() adds no specificity, so a
   class rule (.scale button, .override input, .sheet-title) still wins over both; the member rules come second, so they
   win over the staff size on a member page. h2 is the kicker on a member page: see the .kicker rule. */
/* staff-start: the sizes staff and coaching-mode pages keep. A new selector here must be added to the guard on purpose. */
h2 { color:var(--ink-2); font-size:16px; text-transform:uppercase; letter-spacing:.5px; }
.muted, .error, label, td, th { font-size:14px; }
.badge, .status-tag { font-size:12px; }
input, select, textarea { font-size:16px; }
button { font-size:15px; }
.chips .chip { font-size:16px; }
/* staff-end */
:where(main.member) .muted, :where(main.member) .error, :where(main.member) label, :where(main.member) td, :where(main.member) th { font-size:var(--text-secondary); }
:where(main.member) .badge, :where(main.member) .status-tag { font-size:var(--text-caption); }
:where(main.member) input, :where(main.member) select, :where(main.member) textarea, :where(main.member) button { font-size:var(--text-body); }
:where(main.member) .chips .chip { font-size:var(--text-body); }
.scale { display:flex; gap:var(--space-2); margin:var(--space-2) 0; }
.scale button { flex:1; font-size:var(--display-s); background:var(--surface-2); color:var(--ink); margin:0; padding:var(--space-2) 0; }
/* On a wide screen the tabs sit in the main column's 640 px, centred and evenly spaced (four tabs of at most 160 px);
   the bar's fill still spans the window. */
nav.tabs { position:fixed; bottom:0; left:0; right:0; min-height:var(--tab-bar); display:flex; justify-content:center; background:var(--surface); border-top:1px solid var(--line); }
nav.tabs > * { max-width:160px; }
nav.tabs a { flex:1; text-align:center; padding:var(--space-3) 0; font-size:var(--text-caption); color:var(--ink); text-decoration:none; }
nav.tabs form.logout { flex:1; margin:0; }
nav.tabs form.logout button { width:100%; margin:0; padding:var(--space-3) 0; font-size:var(--text-caption); color:var(--ink); background:transparent; border-radius:0; font-family:inherit; }
/* Member tab bar (_member_tabs.html): an icon over each label. The current tab is in the accent and bold. */
nav.tabs a .icon { display:block; margin:0 auto var(--space-1); }
nav.tabs a.on { color:var(--accent-text); font-weight:600; }
table { width:100%; border-collapse:collapse; background:transparent; }
td, th { padding:var(--space-2); border-bottom:1px solid var(--line); text-align:left; }
svg.spark { width:120px; height:32px; }
svg.readiness-bars { display:block; width:100%; height:90px; }
.bar-ok { fill:var(--ok); } .bar-warn { fill:var(--warn); } .bar-bad { fill:var(--bad); } .bar-none { fill:var(--ink-2); }
.spark-line { fill:none; stroke:var(--accent-text); stroke-width:2; }
.bill-bar { flex:1; min-height:2px; border-radius:3px 3px 0 0; background:var(--accent); }
.board-row { display:flex; align-items:center; gap:var(--space-2); padding:var(--space-2) 0; border-top:1px solid var(--line); font-size:var(--text-secondary); }
.board-row:first-of-type { border-top:0; }
.board-row .rank { width:24px; color:var(--ink-2); }
.board-row .name { flex:1; }
.board-row .score { font-variant-numeric:tabular-nums; }
.board-row.top .rank { color:var(--ink); font-weight:700; }
/* The top row bleeds to the card edge: -16px undoes the card's --space-4 padding. */
.board-row.top { background:var(--surface-2); margin:0 -16px; padding-left:var(--space-4); padding-right:var(--space-4); }
.board-row.me { font-weight:700; }
.checkin-extras { display:grid; grid-template-columns:1fr 1fr; gap:0 var(--space-3); }
.checkin-extras label { margin-top:var(--space-2); }
.override { display:flex; gap:var(--space-2); align-items:center; margin:0; }
.override select, .override input { width:auto; padding:var(--space-2); font-size:var(--text-caption); }
.override input { max-width:110px; }
.override button { margin:0; padding:var(--space-2) var(--space-3); font-size:var(--text-caption); }
.status-tag { text-transform:capitalize; color:var(--ink-2); }
.status-tag.attended { color:var(--ok); font-weight:600; }

/* staff-start: coach and admin screens only. Their font sizes are their own: the member type scale does not apply here. */
/* Readiness pill: coloured chip with the score, used on coach screens. */
.pill { display:inline-flex; align-items:center; gap:var(--space-2); font-variant-numeric:tabular-nums; font-weight:700;
  font-size:14px; padding:var(--space-1) var(--space-3); border-radius:999px; background:var(--surface-2); color:var(--ink); }
.pill::before { content:""; width:8px; height:8px; border-radius:50%; background:currentColor; opacity:.9; }
.pill.green { background:color-mix(in srgb, var(--ok) 16%, var(--surface)); color:color-mix(in srgb, var(--ok) 85%, var(--ink)); }
.pill.amber { background:color-mix(in srgb, var(--warn) 16%, var(--surface)); color:color-mix(in srgb, var(--warn) 85%, var(--ink)); }
.pill.red { background:color-mix(in srgb, var(--bad) 16%, var(--surface)); color:color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.pill.insufficient_data { background:var(--surface-2); color:var(--ink-2); }
.pill.plain { color:var(--ink-2); font-weight:600; } .pill.plain::before { display:none; }

/* Coach session-detail table: fixed column widths so the plan and reasons get
   room; the wrapper scrolls sideways on narrow screens instead of crushing.
   The -16px margin undoes main's --space-4 padding. */
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -16px; padding:0 var(--space-4); }
.session-table { table-layout:fixed; min-width:1080px; }
.session-table th, .session-table td { vertical-align:top; }
.session-table col.c-member { width:150px; } .session-table col.c-ready { width:172px; }
.session-table col.c-effort { width:70px; } .session-table col.c-flags { width:186px; }
.session-table col.c-plan { width:176px; } .session-table col.c-status { width:98px; }
.session-table col.c-override { width:190px; } .session-table col.c-action { width:78px; }
.session-table .member { display:flex; align-items:center; gap:var(--space-2); font-weight:600; }
.session-table .reason { margin-top:var(--space-1); font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
.session-table .override { flex-wrap:wrap; }
.plan-lines { display:flex; flex-direction:column; gap:var(--space-1); }
.plan-line { font-size:13px; line-height:1.35; }
.flag-line { display:flex; align-items:baseline; gap:var(--space-2); margin-bottom:var(--space-1); }
.flag-line:last-child { margin-bottom:0; }

/* Settings: accent colour picker row. */
.accent-field { display:flex; align-items:center; gap:var(--space-3); }
.accent-field input[type=color] { width:48px; height:36px; padding:var(--space-1); flex:0 0 auto; cursor:pointer; }
/* staff-end */

/* Login: a calmer, branded landing card. */
.login-hero { text-align:center; margin:var(--space-2) 0 var(--space-1); }
.login-hero .login-logo { height:56px; width:auto; margin:0 auto var(--space-3); display:block; }
.login-hero .login-mark { font-size:var(--display-m); font-weight:800; letter-spacing:1.5px; text-transform:uppercase; color:var(--accent-text); }
.login-sub { margin:var(--space-1) 0 0; text-align:center; }
.btn.auth-link { display:flex; width:100%; margin-top:var(--space-3); }
.btn.auth-submit { width:100%; margin-top:var(--space-4); }
.login-hero .powered { font-size:var(--text-caption); color:var(--ink-2); }
.login-hero:first-child { margin-top:var(--space-6); }

/* staff-start: coaching mode and coach screens only. Their font sizes are their own: the member type scale does not apply here. */
/* Coaching: member plan and set logging. Every tap target is at least 44px. */
a.session-link { display:block; min-height:44px; color:var(--ink); text-decoration:none; }
.ex-name { font-size:17px; margin:0 0 var(--space-1); }
.rx { margin:var(--space-2) 0 var(--space-1); font-size:16px; font-weight:600; white-space:pre-wrap; font-variant-numeric:tabular-nums; }
.coach-note { margin:var(--space-2) 0; font-size:14px; }
details.last-week { margin:var(--space-2) 0; border-top:1px solid var(--line); }
details.last-week summary { min-height:44px; display:flex; align-items:center; color:var(--ink-2); font-size:14px; cursor:pointer; }
.set-line { margin:var(--space-1) 0; font-size:14px; font-variant-numeric:tabular-nums; }
ul.sets { list-style:none; margin:var(--space-2) 0; padding:0; }
.set-row { display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); min-height:44px; border-top:1px solid var(--line); font-variant-numeric:tabular-nums; }
.set-row form { margin:0; }
.set-row button { margin:0; }
.set-form, .note-form { margin-top:var(--space-3); padding-top:var(--space-1); border-top:1px solid var(--line); }
.set-fields { display:grid; grid-template-columns:repeat(auto-fit, minmax(84px, 1fr)); gap:0 var(--space-3); }
.ex-card button, .ex-card input, .ex-card textarea { min-height:44px; }
.ex-card textarea { resize:vertical; font-family:inherit; }
.ex-card button.block { width:100%; }

/* staff-end */

/* Coaching: coach member review (coach_review.html). One card per exercise; the forms live in sheets. A conflict box
   (409) shows the other writer's text above the box that holds the writer's own. */
.member-tags { margin:0 0 var(--space-3); }
.member-tools { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:var(--space-2); margin:0 0 var(--space-3); }
.member-tools .btn { padding:var(--space-2) var(--space-1); font-size:var(--text-secondary); white-space:nowrap; }
/* The staff member page has five buttons: three over two on a phone, one row from 480 px. */
.member-tools.five { grid-template-columns:repeat(3, minmax(0, 1fr)); }
/* A tool with something behind it (a note, an open case, a tag, away) is tinted; .btn.secondary comes later, so say it here. */
.member-tools .btn.has-note { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
@media (min-width:480px) { .member-tools.five { grid-template-columns:repeat(5, minmax(0, 1fr)); } }
/* What a coach reads before planning, inline on the staff member page: away, injuries, tags, the staff note. */
.member-facts .list-row:first-of-type { border-top:0; }
.member-facts .list-row .label { min-width:0; overflow-wrap:anywhere; }
.member-facts .tag-fact .label { display:flex; flex-direction:column; align-items:flex-start; gap:var(--space-1); }
.member-facts .tag-fact .sub { margin:0; }
.member-facts .fact-text { margin:0; line-height:1.4; overflow-wrap:anywhere; white-space:pre-line; }
button.badge-button { min-height:32px; border:0; font:inherit; font-size:var(--text-caption); font-weight:600; cursor:pointer; }
.btn.has-note { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
.ex-row.quote { cursor:default; }
.ex-row.quote .value { font-style:italic; }
.sheet .plan-form, .sheet .note-form { margin:var(--space-2) 0 0; padding:0; border:0; }
.sheet textarea { width:100%; min-height:88px; resize:vertical; font-family:inherit; }
.sheet .plan-form .btn, .sheet .note-form .btn { margin-top:var(--space-2); }
.sheet .set-chips { margin:0 0 var(--space-3); }
.sheet .sheet-close { margin-top:var(--space-5); }
.sheet input[name="question"], .sheet input[name="note"] { width:100%; min-height:44px; margin-top:var(--space-3); }
.conflict { margin:0 0 var(--space-3); padding:var(--space-3); border:1px solid var(--warn); border-radius:var(--radius-control); background:color-mix(in srgb, var(--warn) 16%, var(--surface)); }
.conflict p { margin:var(--space-1) 0; }
.conflict-text, .rev-text { margin:var(--space-1) 0 var(--space-2); white-space:pre-wrap; overflow-wrap:anywhere; }
.rev + .rev { border-top:1px solid var(--line); padding-top:var(--space-2); }
.rev-head { display:flex; justify-content:space-between; gap:var(--space-3); margin:0; color:var(--ink-2); font-size:var(--text-secondary); font-weight:600; }
/* Coaching: member tag chips. Small pills on the tag colour; on the review page each one opens a sheet with its detail. */
.tag-chips { display:inline-flex; flex-wrap:wrap; gap:var(--space-1); }
.tag-chip { display:inline-flex; align-items:center; min-height:24px; margin:0; padding:0 var(--space-2); border:0; border-radius:999px; font:inherit; font-size:var(--text-caption); font-weight:600; line-height:1.2; }
button.tag-chip { min-height:32px; padding:0 var(--space-3); cursor:pointer; }

/* Member UI components (app/templates/_ui.html). Tokens and the spacing scale only. Every tap target is at least 44px. */
.page-title { margin:var(--space-2) 0 var(--space-4); }
.page-title h1 { margin:0; font-size:var(--display-l); line-height:1.1; }
.page-title .sub { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
:where(main.member) h2, .kicker { color:var(--ink-2); font-size:var(--text-caption); font-weight:600; text-transform:uppercase; letter-spacing:.5px; }
.kicker { margin:0 0 var(--space-2); }
.num { font-size:var(--display-xl); line-height:1; }
.big-score { font-family:var(--font-display); font-size:var(--display-s); font-weight:600; }
.unit { margin-left:var(--space-1); color:var(--ink-2); font-size:var(--text-body); font-weight:600; }
.icon { flex:none; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2); min-height:44px; margin:0; padding:var(--space-3) var(--space-5); border:0; border-radius:var(--radius-control); font:inherit; font-size:var(--text-body); font-weight:600; line-height:1.2; text-decoration:none; cursor:pointer; }
.btn.primary { background:var(--accent); color:var(--on-accent); }
.btn.secondary { background:var(--surface-2); color:var(--ink); }
.btn.quiet { background:transparent; color:var(--accent-text); }
/* A running request disables the button (hx-disabled-elt). It keeps its colour and shows a small spinner: no opacity fade. */
.btn:disabled { cursor:progress; }
.btn:disabled::after { content:""; flex:none; width:16px; height:16px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin calc(var(--dur-shimmer) / 2) linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.btn:focus-visible, .chip:focus-visible, .list-row:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.chip:has(input:focus-visible) { outline:2px solid var(--accent-text); outline-offset:2px; }

.chips { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:var(--space-2) 0 0; }
.chips .chip { margin:0; min-width:44px; padding:var(--space-2) var(--space-4); background:var(--surface-2); color:var(--ink); }
.chip { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; border-radius:var(--radius-control); font-weight:600; cursor:pointer; }
.chip:disabled { cursor:progress; }
.chips .chip[aria-pressed="true"] { background:var(--accent); color:var(--on-accent); }
.chips .chip:has(input:checked) { background:var(--accent); color:var(--on-accent); }
.chip input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }

.list-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); min-height:44px; padding:var(--space-2) 0; border-top:1px solid var(--line); color:var(--ink); font-size:var(--text-body); text-decoration:none; }
.list-row:first-child, .kicker + .list-row { border-top:0; }
.list-row .label { flex:1; }
.list-row .value { font-size:var(--display-s); }
a.list-row::after { content:""; flex:none; width:8px; height:8px; border-top:2px solid var(--ink-2); border-right:2px solid var(--ink-2); transform:rotate(45deg); }

.confirm { display:flex; align-items:center; gap:var(--space-2); min-height:44px; margin:0; color:var(--ok); font-weight:600; }
.skeleton { display:flex; flex-direction:column; gap:var(--space-3); }
.skeleton-line { height:16px; border-radius:var(--radius-control); }
.skeleton-line:last-child { width:60%; }
.empty-state { display:flex; flex-direction:column; align-items:center; gap:var(--space-3); padding:var(--space-6) var(--space-4); text-align:center; }
.empty-state .title { margin:0; font-family:var(--font-display); font-size:var(--display-s); font-weight:600; }
.empty-state .muted { margin:0; }
fieldset.bare { min-width:0; margin:0; padding:0; border:0; }

/* Readiness card (_readiness_card.html). Before the check-in: one question and the 1-5 scale. After it: the ring, the band
   word in the display face, one line, and two buttons that open the "Why?" and "I'm sore" sheets. No score, no small print. */
.readiness .ask { margin:0; font-family:var(--font-display); font-size:var(--display-m); font-weight:700; line-height:1.1; text-transform:var(--display-transform); letter-spacing:var(--display-tracking); }
.readiness .error { margin:var(--space-2) 0 0; }
.readiness .scale { margin:var(--space-3) 0 var(--space-1); }
.readiness .scale button { min-height:44px; font-family:var(--font-display); }
.scale-ends { display:flex; justify-content:space-between; margin:0; color:var(--ink-2); font-size:var(--text-caption); }
.readiness .confirm { margin-top:var(--space-2); }
/* A list row's second line (a date, a reason, what to avoid), under its label. */
.list-row .sub { display:block; margin-top:var(--space-1); color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; }
.list-row form { flex:none; margin:0; }

/* /readiness (readiness.html): the ring and three buttons in one row, the 30-day bars with one caption, today's numbers
   with the "What these mean" sheet, and the recent days (a word each). */
.readiness-head .actions .btn { flex:1 1 auto; }
.readiness-days .caption { margin:var(--space-2) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
.readiness-numbers > .btn { margin-top:var(--space-3); }
.readiness-recent .list-row .value { font-size:var(--text-body); }
.sheet.meanings .meaning + .meaning { margin-top:var(--space-3); }
.sheet.meanings .meaning-text { margin:0; color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; }

/* The Me pages (injuries, wearables, maxes) and History and PRs. A form card: its fields, then a full-width button. */
.me-form form { margin:0; }
.me-form label:first-child { margin-top:0; }
.me-form legend { margin:var(--space-3) 0 var(--space-1); padding:0; font-size:var(--text-secondary); }
.me-form .muted { margin:var(--space-3) 0 0; }
.me-form .btn { width:100%; margin-top:var(--space-4); }
.card.error { margin:0 0 var(--space-3); }
.flash { margin:0; line-height:1.4; }
.provider p { margin:0 0 var(--space-2); }
.provider .actions { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3); }
.provider .actions form { flex:1 1 auto; margin:0; }
.provider .actions .btn, .provider form .btn { width:100%; }
.result-head { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-3); }
.result-head .kicker { margin:0 0 var(--space-1); }
.result-head p { margin:0; }
.result-title { font-weight:600; overflow-wrap:anywhere; }
.result-score { flex:none; text-align:right; }
.result .muted { margin:var(--space-1) 0 0; }
.readiness .actions { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-4); }
.readiness .actions .btn { padding:var(--space-2) var(--space-4); }
/* The ring (ui.readiness_ring): a calm picture of the band, not a score. Red takes the warn colour, never the bad one. */
.readiness-ring { display:flex; align-items:center; gap:var(--space-4); }
.ring { flex:none; }
.ring circle { fill:none; stroke-width:7; }
.ring-track { stroke:var(--surface-2); }
.ring-fill { stroke-linecap:round; }
.readiness-ring.ok .ring-fill { stroke:var(--ok); }
.readiness-ring.warn .ring-fill { stroke:var(--warn); }
.ring-text { min-width:0; }
.band-word { margin:0; font-family:var(--font-display); font-size:var(--display-m); font-weight:700; line-height:1.1; text-transform:var(--display-transform); letter-spacing:var(--display-tracking); overflow-wrap:anywhere; }
.band-line { margin:var(--space-1) 0 0; font-size:var(--text-secondary); line-height:1.4; }
/* The "Why?" sheet: the band word as its title, the main reason, up to three rows with one number each, one tip. */
.sheet.why .sheet-title { margin-bottom:var(--space-1); }
.sheet.why .why-reason { margin:0 0 var(--space-3); line-height:1.4; }
.sheet.why .why-tip { margin-top:var(--space-5); }
.sheet.why .why-tip .tip { margin:0; line-height:1.4; }
.sheet.why > .btn { margin-top:var(--space-5); }
/* The "I'm sore" sheet: "No" and the area chips are two forms that read as one row of chips. "Other" opens on a row of its own. */
.sore-chips { display:flex; flex-wrap:wrap; align-items:flex-start; gap:var(--space-2); margin-top:var(--space-2); }
.sore-chips > form, .sore-chips > form > fieldset, .sore-chips > form > fieldset > .chips { display:contents; }
.more-areas[open] { flex-basis:100%; }
.more-areas > summary.chip { padding:var(--space-2) var(--space-4); background:var(--surface-2); color:var(--ink); list-style:none; }
.more-areas > summary.chip::-webkit-details-marker { display:none; }
.more-areas[open] > summary.chip { background:var(--accent); color:var(--on-accent); }
.sheet.sore .error { margin:0 0 var(--space-2); }
/* /checkin: sleep and stress in a card of their own under the readiness card. */
.checkin-more .btn { width:100%; margin-top:var(--space-4); }

/* Today (today.html, _next_class.html). The next class time is the display value; the date line only for a later day. */
.card-title { margin:0; font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.1; }
.card-title + p { margin:var(--space-2) 0 0; }
.next-class .when { margin:0; }
.next-class .day { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
.next-class .class-name { margin:var(--space-2) 0 0; font-size:var(--display-s); }
.next-class .status { margin:var(--space-2) 0 0; }
.next-class .btn, .still-coming .note-for-coach .btn { margin-top:var(--space-3); }
/* Workout and Note for coach share a row (mockup) and wrap on a narrow phone, each growing to fill its line. The note
   block is the second item: its own top margin goes, so its button lines up with Workout. A saved note is wider than
   the row, so it wraps under Workout. */
.next-class .actions { display:flex; flex-wrap:wrap; column-gap:var(--space-2); }
.next-class .actions > .btn, .next-class .actions > .note-for-coach { flex:1 1 auto; }
.next-class .actions > .btn, .next-class .actions > .note-for-coach > .btn { padding:var(--space-3); }
.next-class .actions > .note-for-coach { margin-top:0; }
.next-class .actions > .note-for-coach > .btn { width:100%; }
/* The note for the coach (_note_for_coach.html): the saved note under the card's status, its sheet's text box under the
   chips. The same note in "You're in" (_booked_note.html) reads the same way. */
.note-for-coach { margin-top:var(--space-3); }
.note-for-coach .note-tags, .booked-note .note-tags { margin:var(--space-2) 0 0; }
.note-for-coach .note-text, .booked-note .note-text { margin:var(--space-2) 0 0; overflow-wrap:anywhere; }
.note-for-coach input[type=text], .booked-note input[type=text] { margin-top:var(--space-3); }
/* "Still coming?" (_still_coming.html): the two answers share a row and wrap on a narrow phone; the notes sit under them. */
.still-coming .actions { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3); }
.still-coming .actions .btn { flex:1 1 auto; }
.still-coming .note { margin:var(--space-2) 0 0; }
.still-coming > .btn { margin-top:var(--space-3); } /* the note button under "See you at" */
/* After class (_after_class.html) and Today's effort (_rpe_card.html): one line each, no fields on the card. The plan's
   one number in the display face on the left and the log button on the right; a lone button takes the whole row. The
   fields, the effort chips and Save live in a sheet (.log-sheet). After a save: "Saved", the result, one full-width button. */
.log-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); }
.log-head .planned { margin:0; min-width:0; overflow-wrap:anywhere; }
.log-head .planned .num { font-size:var(--display-l); }
.log-head .btn { flex:none; }
.log-head .btn:only-child { flex:1; }
.after-class .result, .rpe .result { margin:var(--space-2) 0 0; font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.1; }
.after-class > .btn, .rpe > .btn { width:100%; margin-top:var(--space-4); }
/* The log sheet: the fields as on /wod (the unit beside each), then the effort chips, Save at the foot. Like the goal chips,
   every effort chip is at least 44 px wide and tall on a 320 px phone (288 px inside the sheet): after class 4 to 10 go
   four to a row (4 to 7, then 8 to 10), (288 - 3 x 8) / 4 = 66 px; the day's effort 1 to 10 goes five to a row,
   (288 - 4 x 8) / 5 = 51 px, with the minutes under them. The chip keeps the 44 px floor of .chips .chip. */
.log-sheet .note { margin:0 0 var(--space-2); }
.log-sheet .error { margin:0 0 var(--space-3); }
.log-sheet .ask { margin:var(--space-5) 0 0; font-weight:600; }
.effort-chips .chips { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:var(--space-2); }
.sheet.effort .effort-chips .chips { grid-template-columns:repeat(5, minmax(0, 1fr)); }
.effort-chips .chips .chip { padding:var(--space-2) 0; font-family:var(--font-display); font-size:var(--display-s); }
.sheet.effort .fields { margin-top:var(--space-4); }
.log-sheet fieldset > .btn { margin-top:var(--space-5); }
/* Workout log card (_wod_log.html): one input row, the unit beside each field, one full-width Save. */
.wod-log .fields, .log-sheet .fields { display:flex; gap:var(--space-3); }
.wod-log .field, .log-sheet .field { flex:1; display:flex; align-items:baseline; gap:var(--space-2); min-width:0; margin:0; }
.wod-log .field input, .log-sheet .field input { min-width:0; font-family:var(--font-display); font-size:var(--display-s); text-align:center; }
.wod-log .result { margin:0; font-family:var(--font-display); font-size:var(--display-l); font-weight:700; }
.wod-log .btn { width:100%; margin-top:var(--space-3); }
/* Workout (wod.html, wod_archive.html): day buttons, one display number per movement row, the sheet buttons. */
/* The day buttons stay on one line each; on a very narrow phone (or a label with a year) the last one wraps under, never off the page. */
.day-nav { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-bottom:var(--space-3); }
.day-nav .btn { flex:1; padding:var(--space-2); font-size:var(--text-secondary); white-space:nowrap; }
/* W1: readiness is one small amber line under the title, in the amber chip's ink; the title gives up its gap for it. */
.page-title:has(+ .take-it-easy) { margin-bottom:var(--space-2); }
.take-it-easy { margin:0 0 var(--space-4); color:color-mix(in srgb, var(--warn) 85%, var(--ink)); font-size:var(--text-secondary); font-weight:600; }
.wod-target { display:flex; align-items:center; justify-content:space-between; }
.wod-target .kicker { margin:0; }
.move { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); min-height:44px; padding:var(--space-2) 0; border-top:1px solid var(--line); }
.move:first-child, .sheet-title + .move { border-top:0; }
.move .name, .move .value { margin:0; }
.move .name { font-weight:600; }
/* A long scheme (a 10-9-8-...-1 ladder) wraps at its hyphens inside the card, right-aligned; it never pushes the row wider. */
.move .value { text-align:right; }
.move .sub { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
.move .num { font-size:var(--display-l); }
.move .badge { margin:0; }
.wod-actions { display:flex; flex-wrap:wrap; gap:var(--space-2); }
/* Three buttons share the row on a 320 px phone with a smaller side padding than a lone button. At 17 px the row has no
   room to spare, so a button that does not fit wraps under the others and grows to fill its line; it never pushes the page sideways. */
.wod-actions .btn { flex:1 1 auto; padding:var(--space-3) var(--space-2); }
.wod-description { white-space:pre-line; }
/* The Details sheet: a display-face title, then up to three parts under kickers. The workout is the coach's lines in
   the display face with the shape and the cap as pills; your numbers are movement rows; the tip has an accent bar. */
.sheet.details .sheet-title, .sheet.why .sheet-title, .sheet.class-sheet .sheet-title, .sheet.booked .sheet-title { font-family:var(--font-display); font-size:var(--display-m); font-weight:700; line-height:1.1; text-transform:var(--display-transform); letter-spacing:var(--display-tracking); }
.details-part + .details-part { margin-top:var(--space-5); }
.details-part .kicker + .move { border-top:0; }
.details-part > .btn { margin-top:var(--space-2); }
.injury-message { display:flex; flex-direction:column; gap:var(--space-2); }
.injury-message textarea { width:100%; }
.details-lines p { margin:0; font-family:var(--font-display); font-size:var(--display-s); font-weight:600; line-height:1.15; text-transform:var(--display-transform); overflow-wrap:anywhere; }
/* PD12: a long line is the coach's prose: the body face at normal size, with room above and below it. */
.details-lines p.long { margin:var(--space-1) 0; font-family:var(--font-body); font-size:var(--text-body); font-weight:400; line-height:1.4; text-transform:none; }
.details-pills { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3); }
.details-pills .badge { margin:0; padding:var(--space-1) var(--space-3); color:var(--ink); font-weight:600; }
.kicker + .details-pills { margin-top:0; }
.details .tip { margin:0; padding:var(--space-1) 0 var(--space-1) var(--space-3); border-left:3px solid var(--accent); color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; }
.sheet.details form { margin-top:var(--space-5); }
/* This week (_week_card.html, RD2): the count toward the member's goal on the left, the ring on the right, one line
   under them. The ring (ui.progress_ring) shares the readiness ring's track and round cap, in the accent colour. */
.week-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); }
.week-head .kicker { margin:0; }
.week-card .count { margin:var(--space-1) 0 0; }
.week-card .count .num { font-size:var(--display-l); }
.week-card .count .unit { margin-left:0; } /* the space in the markup is the gap */
.week-line { margin:var(--space-2) 0 0; font-size:var(--text-secondary); line-height:1.4; }
.week-card > .btn { margin-top:var(--space-3); }
.week-ring circle { stroke-width:6; }
.week-ring .ring-fill { stroke:var(--accent); }
/* The goal sheet: the seven chips four to a row (1 to 4, then 5 to 7), so each is at least 44 px wide and tall on a 320 px
   phone: (288 - 3 x 8) / 4 = 66 px. The chip keeps the 44 px floor of .chips .chip. */
.goal-chips .chips { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:var(--space-2); }
.goal-chips .chips .chip { padding:var(--space-2) 0; font-family:var(--font-display); font-size:var(--display-s); }
.sheet.goal .error { margin:0 0 var(--space-2); }
.sheet.goal form .btn { margin-top:var(--space-4); }
/* Progress (progress.html): a grid of tiles, two to a row under the wide Today's workout tile. Each whole tile is one
   link. A small label with a ›, then one big number in the display face, or a word in it when there is no number yet. */
.tiles { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:var(--space-3); }
.tile { display:flex; flex-direction:column; justify-content:space-between; gap:var(--space-2); min-width:0; min-height:calc(var(--space-7) * 2); padding:var(--space-4); border-radius:var(--radius-card); background:var(--surface); color:var(--ink); text-decoration:none; transition:transform var(--dur-press-up) var(--ease); }
:is(a, button).tile:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); }
.tile:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.tile.wide { grid-column:1 / -1; min-height:0; }
.tile .kicker { display:flex; justify-content:space-between; gap:var(--space-2); margin:0; }
.tile .go { font-size:var(--text-body); line-height:1; color:var(--ink-2); }
.tile .big { margin:0; font-family:var(--font-display); font-size:var(--display-l); font-weight:600; line-height:1; }
.tile .mid { display:flex; align-items:center; margin:0; font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.1; text-transform:var(--display-transform); overflow-wrap:anywhere; }
.tile .mid .dot { flex:none; }
.tile .sub { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-caption); overflow-wrap:anywhere; }
.tile.wide .tile-body { display:flex; align-items:flex-end; justify-content:space-between; gap:var(--space-3); }
/* The number takes at most half the row: a long one (a 10-9-8-...-1 ladder) wraps at its hyphens on the right, as on
   /wod, and never pushes the page sideways. The title takes the rest, so it always keeps half and wraps by words. */
.tile.wide .tile-body > div { flex:1 1 0; min-width:0; }
.tile.wide .big { flex:0 1 auto; max-width:50%; min-width:0; text-align:right; overflow-wrap:anywhere; }
/* This week: a bar a day, Monday first. A day with a class is a tall accent bar; the others stay low and neutral. */
.week { margin-top:var(--space-2); }
.week .bars { display:flex; align-items:flex-end; gap:var(--space-1); height:var(--space-6); }
.week .bars span { flex:1; height:var(--space-2); border-radius:var(--space-1); background:var(--surface-2); }
.week .bars span.on { height:100%; background:var(--accent); }
.week .days { display:flex; gap:var(--space-1); margin-top:var(--space-1); color:var(--ink-2); font-size:var(--text-caption); text-align:center; }
.week .days span { flex:1; }
/* Me (me.html): the same tiles, then a full-width Log out button. The Weekly goal tile is a button that opens the goal
   sheet: it drops the button look and takes the tile's, and its spans stack like the link tile's paragraphs. Its
   wrapper (_goal_tile.html) holds the tile and the sheet only, so the tile stays a cell of the grid. */
button.tile { width:100%; margin:0; font:inherit; text-align:left; cursor:pointer; }
button.tile .tile-body, button.tile .big, button.tile .sub { display:block; }
.goal-tile { display:contents; }
.me-logout { margin-top:var(--space-5); }
.me-logout .btn { width:100%; }
/* Coaching member home (plan_week.html): the hero is the next class with the time in the display face and the day
   beside it, the class, one line for place and coach, then Open and Message as the big two-button row. */
.plan-hero .when { display:flex; align-items:baseline; gap:var(--space-3); margin:0; }
.plan-hero .hero-day { color:var(--accent-text); font-size:var(--text-body); font-weight:600; }
.plan-hero .class-name { margin:var(--space-2) 0 0; font-size:var(--display-m); line-height:1.1; overflow-wrap:anywhere; }
.plan-hero .hero-place { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-body); }
.plan-hero .plan-buttons { margin:var(--space-4) 0 0; }
.plan-hero .plan-buttons .btn { min-height:48px; padding:var(--space-3) var(--space-2); white-space:nowrap; }
/* This week: one row per class from today on (day on the first row of a day, the time, the class, a Done pill, a chevron).
   An earlier day and a day with no class have no row; today's day word is in the accent colour. Today's class that is
   over is quiet, like the coach side's done class cards. */
.week-row { display:grid; grid-template-columns:3.25rem 5.5rem minmax(0, 1fr) auto; align-items:center; gap:var(--space-2); min-height:48px; padding:var(--space-2) 0; border-top:1px solid var(--line); color:var(--ink); text-decoration:none; }
.kicker + .week-row { border-top:0; }
.week-row:not(.first) { border-top-color:transparent; }
.week-row .wk-day { color:var(--ink-2); font-size:var(--text-secondary); font-weight:600; }
.week-row.today .wk-day { color:var(--accent-text); }
.week-row .wk-time { font-family:var(--font-display); font-size:var(--display-s); font-weight:600; white-space:nowrap; }
.week-row .wk-time .unit { margin-left:var(--space-1); font-family:var(--font-body); font-size:var(--text-caption); }
.week-row .label { font-weight:600; overflow-wrap:anywhere; }
.week-row .label .sub { display:block; color:var(--ink-2); font-size:var(--text-secondary); font-weight:400; }
.week-row.over .wk-day, .week-row.over .wk-time, .week-row.over .label { opacity:.6; }
.week-row .wk-end { display:flex; align-items:center; gap:var(--space-2); }
.week-row .badge { margin:0; }
.week-row:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
/* The injury card (_injury_card.html): one row per case, a button that opens the case sheet. The red bar says "injury". */
.injury-card { border-left:4px solid var(--bad); }
.case-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); width:100%; min-height:48px; margin:0; padding:var(--space-2) 0; border:0; border-top:1px solid var(--line); background:none; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.kicker + .case-row { border-top:0; }
.case-row .label { font-weight:600; overflow-wrap:anywhere; }
.case-row .sub { display:block; margin-top:var(--space-1); color:color-mix(in srgb, var(--bad) 85%, var(--ink)); font-size:var(--text-secondary); font-weight:600; }
.sheet-text { margin:0; line-height:1.4; white-space:pre-line; overflow-wrap:anywhere; }
.injury-sheet .details-pills .badge { color:color-mix(in srgb, var(--bad) 85%, var(--ink)); }
/* Coaching Me: her tags as colour chips (the colour is the gym's tag colour), each a button that opens its detail. */
.member-tags { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.my-tags .tag-chips { gap:var(--space-2); }
.my-tags button.tag-chip { min-height:44px; padding:0 var(--space-4); font-size:var(--text-secondary); }
button.tag-chip:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.me-tiles { margin-bottom:var(--space-3); }
.me-tiles .tile { justify-content:flex-start; } /* both numbers sit right under their label, at the same height */
/* Coaching: the member's class page (plan_session.html, _exercise_card.html). The class name and one line (the day and
   time, the cycle week as a pill); then one card per exercise: the name with Note and Watch, the plan as one chip per
   set in the display face (her sets once she logged), the cue codes as small pills, a Coach and a Last time row that
   open sheets, and Done as planned beside Log different. About two cards fill a phone screen. */
.session-title .sub .badge { margin:0 0 0 var(--space-2); vertical-align:middle; }
.ex-head { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); }
.ex-title { flex:1 1 0; min-width:0; margin:0; font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.1; text-transform:var(--display-transform); letter-spacing:var(--display-tracking); overflow-wrap:anywhere; }
.ex-head .badge { margin:0; }
.ex-tools { display:flex; gap:var(--space-2); }
.ex-tools .btn { padding:var(--space-2) var(--space-3); font-size:var(--text-secondary); }
.ex-tools .btn.has-note { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
.set-chips { display:flex; flex-wrap:wrap; align-items:stretch; gap:var(--space-2); margin:var(--space-3) 0 0; padding:0; list-style:none; }
.set-chip { display:inline-flex; align-items:baseline; gap:var(--space-1); padding:var(--space-2) var(--space-3); border-radius:var(--radius-control); background:var(--surface-2); }
.set-chip .num { font-size:var(--display-s); line-height:1.1; white-space:nowrap; }
.set-chip .unit { margin:0; font-size:var(--text-caption); }
.set-chip .mark { color:var(--accent-text); font-size:var(--text-secondary); font-weight:700; }
.ex-card.done > .set-chips .set-chip { background:color-mix(in srgb, var(--ok) 16%, var(--surface)); }
.rx-text { margin:var(--space-3) 0 0; font-family:var(--font-display); font-size:var(--display-s); font-weight:600; line-height:1.2; overflow-wrap:anywhere; }
.no-plan { margin:var(--space-2) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
.cue-chips { display:flex; flex-wrap:wrap; gap:var(--space-1); margin:var(--space-2) 0 0; }
.cue-chips .badge, .set-chips .cue .badge { margin:0; font-weight:600; }
.set-chips .cue { display:flex; align-items:center; }
.ex-rows { margin:var(--space-2) 0 0; }
.ex-row { display:flex; align-items:center; gap:var(--space-3); width:100%; min-height:44px; margin:0; padding:var(--space-2) 0; border:0; border-top:1px solid var(--line); border-radius:0; background:none; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.ex-row .label { flex:none; color:var(--ink-2); font-size:var(--text-secondary); font-weight:600; }
.ex-row .value { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:var(--text-secondary); }
.ex-row:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.ex-actions { display:flex; gap:var(--space-2); margin:var(--space-3) 0 0; }
.ex-actions > .btn, .ex-actions > form { flex:1 1 0; min-width:0; }
.ex-actions > form { margin:0; }
.ex-actions .btn { width:100%; min-height:48px; padding:var(--space-3) var(--space-2); white-space:nowrap; }
.ex-card .confirm { margin-top:var(--space-2); }
/* A coach's feedback request on one exercise (_feedback_ui.html), on the member's workout and the coach's review:
   a tinted box with the question, the pain areas, the answer or her answer box. Open ones carry an accent edge. */
.ask-box { margin:var(--space-3) 0 0; padding:var(--space-3); border-radius:var(--radius-control); background:var(--surface-2); }
.ask-box.open { background:color-mix(in srgb, var(--accent) 12%, var(--surface)); border-left:3px solid var(--accent); }
.ask-box .kicker { margin:0 0 var(--space-1); }
.ask-q { margin:0; font-weight:600; line-height:1.4; white-space:pre-line; overflow-wrap:anywhere; }
.ask-areas, .ask-meta { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
.ask-areas-label { font-weight:600; }
.ask-a { margin:var(--space-2) 0 0; line-height:1.4; white-space:pre-line; overflow-wrap:anywhere; }
.ask-a .label { color:var(--ink-2); font-weight:600; }
.ask-form { margin:var(--space-2) 0 0; }
.ask-form textarea { width:100%; box-sizing:border-box; }
.ask-form .btn { width:100%; min-height:48px; margin-top:var(--space-2); }
.ask-link { margin-top:var(--space-2); }
.ask-button { width:100%; min-height:48px; margin-top:var(--space-2); }
.ask-sheet .ask-areas-kicker { margin-top:var(--space-3); }
.bubble-link { margin-top:var(--space-2); padding:var(--space-1) var(--space-3); font-size:var(--text-caption); }
.ex-row.note-row:not(.has-note) .value { color:var(--ink-2); }
/* Coaching: member messages (member_messages.html) as a chat. Oldest at the top; her bubbles on the right in the accent,
   the staff's on the left on the surface; the time small under each. A check-in carries its exercise as a label, and
   its reply box sits under the question while it is open. The composer is pinned just above the tab bar. */
.chat-older { width:100%; margin:0 0 var(--space-3); }
.chat { display:flex; flex-direction:column; gap:var(--space-3); padding-bottom:var(--space-4); }
.bubble-row { display:flex; flex-direction:column; max-width:85%; }
.bubble-row.mine { align-self:flex-end; align-items:flex-end; }
.bubble-row.theirs { align-self:flex-start; align-items:flex-start; }
.bubble { padding:var(--space-2) var(--space-3); border-radius:var(--radius-card); background:var(--surface); color:var(--ink); }
.bubble-row.mine .bubble { background:var(--accent); color:var(--on-accent); border-bottom-right-radius:var(--space-1); }
.bubble-row.theirs .bubble { border-bottom-left-radius:var(--space-1); }
.bubble-label { margin:0 0 var(--space-1); font-size:var(--text-caption); font-weight:700; opacity:.8; }
.bubble-text { margin:0; line-height:1.4; white-space:pre-line; overflow-wrap:anywhere; }
.bubble-meta { margin:var(--space-1) var(--space-1) 0; color:var(--ink-2); font-size:var(--text-caption); }
.bubble-row.has-reply { width:85%; align-items:stretch; } /* the reply box is as wide as the question above it */
.chat-reply { margin:var(--space-2) 0 0; }
.chat-reply .error { margin:0 0 var(--space-2); }
.chat-reply textarea, .composer textarea { background:var(--surface); }
/* Fixed right on top of the tab bar (--tab-bar, the same token sizes the bar). */
.composer { position:fixed; bottom:var(--tab-bar); left:0; right:0; z-index:1; max-width:640px; margin:0 auto; padding:var(--space-3) var(--space-4); background:var(--bg); border-top:1px solid var(--line); }
main:has(> .composer) { padding-bottom:calc(var(--space-7)*3); }
.composer .chips { margin:0 0 var(--space-2); }
.composer .chips .chip { padding:var(--space-1) var(--space-4); font-size:var(--text-secondary); }
.composer .error { margin:0 0 var(--space-2); }
.composer-row { display:flex; align-items:flex-end; gap:var(--space-2); }
.composer-row textarea { flex:1; min-height:44px; margin:0; font-family:inherit; resize:none; }
.composer-row .btn { flex:none; }
/* The log sheet: one block per set, "Set 1" with the mark chips on one line, then a stepper per number (weight and
   reps side by side), Add set, then Cancel beside Save. The steppers are the coach stepper made smaller to share a row. */
.log-set { padding:var(--space-3) 0; border-top:1px solid var(--line); }
.log-set:first-of-type { border-top:0; padding-top:0; }
.log-set .kicker { margin:0; }
/* The marks (|| / and the gym's cue codes) are small tinted toggles in one row under the steppers: the numbers stay
   the main thing. Pressed: the accent. */
.log-set .marks, .plan-picks .marks { display:flex; flex-wrap:wrap; gap:var(--space-1); margin-top:var(--space-2); }
.plan-picks .mark-chip,
.log-set .mark-chip { min-width:var(--space-6); min-height:var(--space-6); margin:0; padding:0 var(--space-2); border:0; border-radius:999px; background:color-mix(in srgb, var(--accent) 10%, var(--surface)); color:var(--accent-text); font:inherit; font-size:var(--text-caption); font-weight:700; cursor:pointer; }
.log-set .mark-chip[aria-pressed="true"] { background:var(--accent); color:var(--on-accent); }
.mark-legend { display:flex; flex-wrap:wrap; gap:var(--space-1) var(--space-3); margin:var(--space-2) 0 0; font-size:var(--text-caption); color:var(--text-secondary); }
.mark-legend:empty { display:none; }
.mark-legend strong { color:var(--ink); }
.ex-levels .chips { margin-top:0; }
.ex-levels .level-plan { margin:var(--space-1) 0 0; font-size:var(--text-caption); color:var(--text-secondary); }
.exercise-levels { margin-top:var(--space-4); }
.plan-grid .cell-level { display:block; font-size:var(--text-caption); font-weight:700; color:var(--accent-text); }
.plan-picks .mark-chip:focus-visible,
.log-set .mark-chip:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.log-set .set-steps { display:flex; flex-wrap:wrap; gap:var(--space-2) var(--space-4); }
/* A stepper shares the row only when its number has room for five characters ("142.5"): two 44 px buttons, the gaps,
   five digits of the display face and the unit. At 375 px each stepper takes a full row. */
.log-set .stepper { flex:1 1 210px; gap:var(--space-1); }
.log-set .stepper .step { width:44px; min-height:44px; font-size:var(--display-s); }
.log-set .stepper input { width:100%; min-width:0; min-height:44px; border:0; font-size:var(--display-m); }
.log-set .stepper .unit { font-size:var(--text-caption); }
.set-sheet .add-set { margin-top:var(--space-2); }
.sheet-buttons { display:flex; gap:var(--space-2); margin-top:var(--space-4); }
.sheet .sheet-buttons .btn, .sheet .sheet-buttons > .btn + .btn { flex:1 1 0; width:auto; margin:0; }
.set-sheet .error, .note-sheet .error { margin:0 0 var(--space-3); }
.note-sheet textarea { min-height:calc(var(--space-7) * 2); font-family:inherit; resize:vertical; }
a.card.row { color:inherit; text-decoration:none; }
a.card.row .end { text-align:right; }
.open-classes .empty-state { padding:var(--space-5) var(--space-4); }
.open-classes > .btn { width:100%; margin-bottom:var(--space-3); }
/* A class row (_session_card.html), on Classes and in Today's open classes: the time in the display face, the class name
   over the spots left, the member's badge at the end. Then Workout and the place's button share a row, each at least
   44 px tall, and wrap on a narrow phone, each growing to fill its line. */
.session-head { display:flex; align-items:center; gap:var(--space-3); }
.session-head .when { flex:none; }
.session-head .num { font-size:var(--display-m); }
.session-head .what { flex:1; min-width:0; }
.session-head .class-name { margin:0; font-size:var(--display-s); overflow-wrap:anywhere; }
.session-head .spots { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
.session-head .badge { flex:none; margin:0; }
.session .error { margin:var(--space-3) 0 0; }
.session .actions { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3); }
.session .actions .btn { flex:1 1 auto; padding:var(--space-3) var(--space-4); }
.session .note { margin:var(--space-2) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
/* The class sheet (_class_sheet.html): the day and time over the class name, the spots, then the workout as in Details
   (the coach's lines in the display face, a long line in the body face) and the member's numbers as movement rows. */
.sheet.class-sheet .spots { margin:0 0 var(--space-5); color:var(--ink-2); font-size:var(--text-secondary); }
.sheet.class-sheet .spots .badge { margin:0 0 0 var(--space-2); }
.workout .wod-title { margin:0 0 var(--space-1); font-weight:600; }
.workout .details-lines + .move { margin-top:var(--space-3); }
.workout .not-posted { margin:0; color:var(--ink-2); }
.sheet.class-sheet .error { margin:var(--space-4) 0 0; }
.sheet.class-sheet > .btn { margin-top:var(--space-5); }
.sheet.class-sheet .note { margin:var(--space-2) 0 0; color:var(--ink-2); font-size:var(--text-secondary); }
/* "You're in" (_booked_sheet.html): a check in a soft accent circle (56 px: 48 + 8 from the scale), the title and the
   day centred, then "Tell your coach?" with the note chips, a line of text, and Not now beside Send. The waitlist sheet
   is the title and one line. */
.sheet-icon { display:flex; align-items:center; justify-content:center; width:calc(var(--space-7) + var(--space-2)); height:calc(var(--space-7) + var(--space-2)); margin:0 auto var(--space-3); border-radius:50%; background:color-mix(in srgb, var(--accent) 14%, var(--surface)); color:var(--accent-text); }
.sheet.booked .sheet-title { margin-bottom:var(--space-1); text-align:center; }
.sheet.booked .when { margin:0 0 var(--space-5); color:var(--ink-2); font-size:var(--text-secondary); text-align:center; }
.sheet.booked .booked-line { margin:0; text-align:center; line-height:1.4; }
.booked-note .kicker + form { margin-top:0; }
.booked-note .error { margin:0 0 var(--space-2); }
.booked-note .actions { display:flex; gap:var(--space-2); margin-top:var(--space-4); }
.booked-note .actions .btn { flex:1 1 0; }
/* The PR moment (_pr_sheet.html, RD3): "New PR" in the accent over the new best, big and centred, one line with the gap,
   the old best and (a weight only) "Next time, try" as rows, then Nice. The number counts from the old best in
   --dur-count (app.js) while its colour settles from the accent to the ink: one gentle tap of colour. */
.sheet.pr .kicker { color:var(--accent-text); text-align:center; }
.sheet.pr .sheet-title { margin:0; text-align:center; }
.sheet.pr .sheet-title .num { font-size:var(--display-xl); font-weight:700; animation:pr-tint var(--dur-count) var(--ease) both; }
@keyframes pr-tint { from { color:var(--accent-text); } }
.sheet.pr .pr-gap { margin:var(--space-2) 0 var(--space-5); color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; text-align:center; }
.sheet.pr .move .num { font-size:var(--display-m); }
.sheet.pr form { margin-top:var(--space-5); }
.summary-text { margin:0; white-space:pre-line; }
.ai-summary .muted { margin:var(--space-2) 0 0; font-size:var(--text-caption); }

/* The sheet is the only thing in the app with a shadow. It sits at the bottom edge and rises in on open. */
.sheet { width:100%; max-width:640px; max-height:90%; margin:auto auto 0; padding:var(--space-5) var(--space-4) var(--space-6); border:0; border-radius:var(--radius-sheet) var(--radius-sheet) 0 0; background:var(--surface); color:var(--ink); box-shadow:0 -8px 32px color-mix(in srgb, var(--ink) 20%, transparent); }
.sheet[open] { animation:enter var(--dur-sheet) var(--ease) both; }
.sheet::backdrop { background:color-mix(in srgb, var(--ink) 40%, transparent); }
.sheet-title { margin:0 0 var(--space-3); color:var(--ink); font-size:var(--display-s); font-weight:700; letter-spacing:0; text-transform:none; }
.sheet form { margin:var(--space-3) 0 0; }
.sheet .btn { width:100%; }

/* Motion: only on load and on a user action, never on scroll. */
@keyframes enter { from { opacity:0; transform:translateY(var(--rise)); } }
main.member .card { animation:enter var(--dur-enter) var(--ease) both; }
/* The stagger stops at four steps: the fifth card and every later one arrive with the fifth, 160ms after the first. */
main.member .card:nth-child(1) { animation-delay:calc(0 * var(--stagger)); }
main.member .card:nth-child(2) { animation-delay:calc(1 * var(--stagger)); }
main.member .card:nth-child(3) { animation-delay:calc(2 * var(--stagger)); }
main.member .card:nth-child(4) { animation-delay:calc(3 * var(--stagger)); }
main.member .card:nth-child(n+5) { animation-delay:calc(4 * var(--stagger)); }
/* The Progress tiles rise as one grid: seven staggered tiles would take too long. */
main.member .tiles { animation:enter var(--dur-enter) var(--ease) both; }
/* A card swapped in by a partial HTMX update does not rise again (app.js adds no-enter; boosted loads still animate).
   `main.member .card` is more specific than a bare class, so the second selector is the one that wins. */
.no-enter, main.member .card.no-enter { animation:none; }
button { transition:transform var(--dur-press-up) var(--ease); }
button:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); }
@keyframes fade-in { from { opacity:0; } }
.confirm { animation:fade-in var(--dur-state) var(--ease) both; }
/* Skeleton shimmer while HTMX content loads: the only gradient in the app. */
.skeleton-line { background:linear-gradient(90deg,var(--surface-2) 0%,var(--line) 50%,var(--surface-2) 100%); background-size:200% 100%; animation:shimmer var(--dur-shimmer) linear infinite; }
@keyframes shimmer { from { background-position:200% 0; } to { background-position:0 0; } }

/* Reduced motion: nothing moves. The skeleton is a still block; the press does not scale.
   Opacity-only cross-fades stay: list them in the :not() below. */
@media (prefers-reduced-motion:reduce) {
  .skeleton, .skeleton-line { animation:none; }
  .skeleton-line { background:var(--surface-2); }
  *:not(.confirm), *::before, *::after { animation:none !important; transition:none !important; }
  button:active, .tile:active { transform:none; }
}
.staff-links { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:var(--space-3); }

/* Coach Today and the class page (coach_today.html, coach_class.html). Tokens only. A card is one link; its pills are
   badges (injury bad, low recovery and sore warn, notes accent). */
.badge.accent { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
.class-link { display:flex; flex-direction:column; gap:var(--space-1); color:var(--ink); text-decoration:none; }
.class-head { display:flex; justify-content:space-between; align-items:baseline; gap:var(--space-3); }
.class-title { font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.1; }
.class-count { font-family:var(--font-display); font-size:var(--display-s); font-weight:600; color:var(--ink-2); }
.class-wod { font-size:var(--text-body); font-weight:600; overflow-wrap:anywhere; }
.class-format { color:var(--ink-2); font-size:var(--text-secondary); }
.class-wod.missing { color:var(--bad); font-weight:600; }
.class-pills { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-2); }
.class-pills .badge { margin:0; }
.class-card > .btn { width:100%; margin-top:var(--space-3); }
/* A class that is over: the same card, compact, its text dimmed (not the card), a Done pill and how many came. */
.class-card.done { padding:var(--space-3) var(--space-4); }
.class-card.done .class-head, .class-card.done .class-wod, .class-card.done .class-format { opacity:.6; }
/* Coaching coach home (coach_home.html): today's class cards, two tiles, then one full-width Later this week button. */
.heads-up { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); width:100%; min-height:44px; margin:0 0 var(--space-3); padding:var(--space-2) var(--space-4); border:0; border-radius:var(--radius-card); background:var(--surface); color:var(--ink); font:inherit; text-align:left; cursor:pointer; transition:transform var(--dur-press-up) var(--ease); }
.heads-up:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); }
.heads-up .badge { margin:0; }
.heads-up .chev { margin-left:auto; }
/* Today's sections: a small heading over each block (Needs a look, Classes today, To do, More) so the page reads in
   parts. Secondary text is smaller and in --ink-2; the class time and the counts take the accent. Tokens only. */
.section-head { display:flex; align-items:center; gap:var(--space-2); margin:var(--space-5) 0 var(--space-2); padding-bottom:var(--space-1); border-bottom:1px solid var(--line); font-family:var(--font-display); font-size:var(--text-secondary); font-weight:600; letter-spacing:var(--display-tracking); }
.kicker .badge.count { margin:0 0 0 var(--space-1); padding:0 var(--space-2); }
.section-head .badge { margin:0; padding:0 var(--space-2); font-size:var(--text-caption); line-height:20px; }
.badge.count { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); font-weight:600; }
.class-name-line { display:flex; flex-direction:column; gap:0; min-width:0; }
.class-time { color:var(--accent-text); font-size:var(--text-secondary); font-weight:600; letter-spacing:.3px; }
.class-card .class-count { font-family:var(--font-body); font-size:var(--text-caption); font-weight:600; }
.class-card .class-format { font-size:var(--text-caption); }
.home-tiles { margin:var(--space-2) 0 var(--space-3); }
.home-tiles .tile .big { color:var(--accent-text); }
.home-tiles .tile, .admin-tiles .tile { justify-content:flex-start; } /* both numbers sit right under their label, at the same height */
/* One line that says what a plan is (the sets, reps and weights a coach sets): review sheets, class plans, her class. */
.plan-hint { margin:0 0 var(--space-3); color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; }
.plan-hint strong { color:var(--ink); }
.home-buttons { display:flex; flex-direction:column; gap:var(--space-3); margin:0 0 var(--space-3); }
.week-button { width:100%; justify-content:space-between; }
.week-button .badge { margin:0; }
.class-bar { display:flex; align-items:center; gap:var(--space-3); margin:0 0 var(--space-3); }
.class-bar .badge { margin:0; }
.class-bar .class-count { margin-left:auto; }
.coach-row { display:flex; align-items:center; gap:var(--space-3); min-height:56px; border-top:1px solid var(--line); }
.coach-row:first-child { border-top:0; }
.coach-row-who { flex:1; display:flex; flex-direction:column; align-items:flex-start; gap:var(--space-1); min-height:44px; margin:0; padding:var(--space-2) 0; background:transparent; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.coach-row-who .name { font-weight:600; }
.coach-row-who .name .badge { margin:0 0 0 var(--space-2); }
.coach-row-who .sub { color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; }
.coach-row .chips { margin:0; flex:none; }
/* Coaching class page (coach_session.html, _attendance_row.html): one line per member, a link to the review with the
   status pills and tag chips beside the name, then a small Here toggle (tinted; green with a check once in) and, with
   two coaches, a Move button beside the row. */
.coach-row-who.inline { flex-direction:row; flex-wrap:wrap; align-items:center; gap:var(--space-1) var(--space-2); min-width:0; text-decoration:none; }
.coach-row-who.inline .name { margin-right:var(--space-1); }
.coach-row-who { text-decoration:none; }
.row-pills { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-1); }
.row-pills .badge { margin:0; }
.row-pills .tag-chips { display:contents; }
.coach-row-who.inline .badge { margin:0; }
.attendance-list { padding-top:var(--space-1); padding-bottom:var(--space-1); }
.attendance-row form { flex:none; margin:0; }
.attendance-row .error { flex-basis:100%; margin:0 0 var(--space-2); }
.coach-row.attendance-row { flex-wrap:wrap; }
.here-toggle { display:inline-flex; align-items:center; gap:var(--space-1); min-height:44px; margin:0; padding:0 var(--space-3); border:0; border-radius:999px; background:color-mix(in srgb, var(--accent) 14%, var(--surface)); color:var(--accent-text); font:inherit; font-size:var(--text-secondary); font-weight:600; cursor:pointer; transition:transform var(--dur-press-up) var(--ease); }
.here-toggle:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); }
.here-toggle[aria-pressed="true"] { background:color-mix(in srgb, var(--ok) 18%, var(--surface)); color:color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.here-toggle .icon { width:18px; height:18px; }
.row-wrap { display:flex; align-items:center; gap:var(--space-2); border-top:1px solid var(--line); }
.row-wrap:first-child { border-top:0; }
.row-wrap > .coach-row { flex:1; min-width:0; border-top:0; }
.btn.move-button { flex:none; min-height:44px; padding:0 var(--space-3); font-size:var(--text-secondary); }
.group-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); margin:var(--space-5) 0 var(--space-2); }
.group-head h2 { margin:0; }
.group-head .badge { margin:0; }
.empty-line { margin:0; padding:var(--space-3) 0; color:var(--ink-2); }
.btn.block-button { width:100%; margin-top:var(--space-3); }
.dropin-sheet input[name="name"] { width:100%; min-height:44px; }
.sheet.member-sheet section { margin-bottom:var(--space-4); }
.sheet.member-sheet .note-tags { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:0 0 var(--space-2); }
.sheet.member-sheet .note-tags .badge { margin:0; }
.sheet.member-sheet .note-text { margin:0; line-height:1.4; }
.override-form input[type="text"] { min-height:44px; }

/* Plan (coach_plan.html): two big buttons; the week cards are under "Coach screens" at the end. .strip-cell.add is the
   dashed + Add cell, also on the program page. */
.plan-buttons { display:flex; gap:var(--space-2); margin:0 0 var(--space-3); }
.plan-buttons .btn { flex:1 1 0; min-height:var(--space-7); font-size:var(--text-body); }
.strip-cell { display:flex; align-items:center; width:100%; min-height:44px; margin:0; padding:var(--space-2); border:0; border-radius:var(--radius-control); font:inherit; font-size:var(--text-secondary); text-decoration:none; cursor:pointer; }
.strip-cell.filled { background:var(--surface-2); color:var(--ink); font-weight:600; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.strip-cell.add { justify-content:center; border:1px dashed var(--line); background:transparent; color:var(--ink); font-weight:600; font-size:var(--display-s); }

/* The workout library (coach_workouts.html) and the place page: a search box with its button, cards with one line. */
.btn.wide { width:100%; margin:0 0 var(--space-3); }
.search-bar { display:flex; gap:var(--space-2); margin:0 0 var(--space-3); }
.search-bar input { flex:1; min-width:0; min-height:44px; }
.search-bar .btn { flex:none; }
a.card.workout-card { display:flex; flex-direction:column; gap:var(--space-1); color:var(--ink); text-decoration:none; }
.workout-card .badge { flex:none; margin:0; }
.one-line { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* The workout form (coach_workout_edit.html). Minutes show for For time only. A movement row: the name and one number,
   and a quiet Edit for the row's sheet (women's kg, Remove). */
.field-label { margin:var(--space-4) 0 0; font-size:var(--text-secondary); }
.workout-form label:first-child { margin-top:0; }
.workout-form input, .workout-form textarea { min-height:44px; }
.workout-form textarea { resize:vertical; font-family:inherit; }
.workout-form:not(:has(input[name="shape"][value="for_time"]:checked)) .minutes-field { display:none; }
.move-row { padding:var(--space-2) 0; border-top:1px solid var(--line); }
.move-row:first-child { border-top:0; }
.move-line { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); }
.move-name { flex:1; font-weight:600; }
.move-num { display:flex; align-items:baseline; gap:var(--space-1); flex:none; }
.move-num input { width:calc(var(--space-7) * 2); font-family:var(--font-display); font-size:var(--display-s); text-align:center; }
.move-num .unit { color:var(--ink-2); font-size:var(--text-secondary); }
.move-edit.btn { flex:none; padding:var(--space-2) var(--space-3); font-size:var(--text-secondary); }
.move-sheet label:first-of-type { margin-top:0; }
.move-sheet input { min-height:44px; font-family:var(--font-display); font-size:var(--display-s); }
.move-sheet .btn.primary { margin-top:var(--space-4); }
.moves-card .move-rows:not(:empty) { margin-bottom:var(--space-3); }
.moves-card .btn.wide { margin:0; }
.workout-actions { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3); }
.workout-actions > .btn, .workout-actions > form { flex:1 1 0; margin:0; }
.workout-actions form .btn { width:100%; }
.workout-actions .btn { padding:var(--space-3) var(--space-2); white-space:nowrap; }
.sheet.picker .picker-list { max-height:50vh; overflow-y:auto; margin-top:var(--space-3); }
.picker-item { width:100%; border:0; border-top:1px solid var(--line); background:transparent; font:inherit; text-align:left; cursor:pointer; }
.picker-item:first-child { border-top:0; }
.picker-item[hidden] { display:none; }
.sheet .btn + .btn { margin-top:var(--space-2); }
.sheet .sheet-line { margin:0 0 var(--space-3); color:var(--ink-2); line-height:1.4; }

/* The place page (coach_place.html): pick one workout, a row that turns to the accent when picked. */
.pick-list { display:flex; flex-direction:column; gap:var(--space-2); max-height:60vh; overflow-y:auto; }
.pick-row { position:relative; display:flex; flex-direction:column; gap:var(--space-1); margin:0; padding:var(--space-3); border-radius:var(--radius-control); background:var(--surface-2); color:var(--ink); cursor:pointer; }
.pick-row input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.pick-row:has(input:checked) { background:var(--accent); color:var(--on-accent); }
.pick-row:has(input:focus-visible) { outline:2px solid var(--accent-text); outline-offset:2px; }
.pick-title { font-weight:600; font-size:var(--text-body); }
.pick-sub { font-size:var(--text-secondary); opacity:.85; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Programs (coach_programs.html, coach_program.html): the status pill under the title, then ‹ Week 3 › with "3 of 8",
   one row per day (the workout and one detail, or Rest and + Add), then the buttons. Tokens only. */
.program-status { margin:0 0 var(--space-3); }
.program-status .badge { margin:0; }
.week-switch { display:flex; align-items:center; gap:var(--space-2); margin:0 0 var(--space-2); }
.week-step { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; border-radius:var(--radius-control); color:var(--ink); font-family:var(--font-display); font-size:var(--display-s); line-height:1; text-decoration:none; }
.week-step.off { color:var(--line); }
.week-name { font-family:var(--font-display); font-size:var(--display-s); font-weight:600; }
.week-of { margin-left:auto; color:var(--ink-2); font-size:var(--text-secondary); }
.program-day { display:flex; align-items:center; gap:var(--space-3); min-height:56px; border-top:1px solid var(--line); }
.program-day:nth-child(2) { border-top:0; }
.program-weekday { flex:none; width:var(--space-7); font-family:var(--font-display); font-size:var(--text-body); font-weight:600; color:var(--ink-2); }
.program-cell { flex:1; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); min-height:44px; padding:var(--space-2) var(--space-3); border-radius:var(--radius-control); background:var(--surface-2); color:var(--ink); text-decoration:none; }
.program-cell.add { font-size:var(--text-body); }  /* + Add reads like the rows, not the strip's big plus */
.program-actions { display:flex; flex-direction:column; gap:var(--space-2); margin-top:var(--space-3); }
.program-actions form { margin:0; }
.program-actions .btn { width:100%; }
.program-form input { min-height:44px; }
.program-form .btn { width:100%; margin-top:var(--space-4); }
.sheet.pick-sheet .search-bar .btn { width:auto; }
.sheet.pick-sheet .pick-list { max-height:45vh; margin-bottom:var(--space-3); }

/* Coach screens (staff_base.html marks main "member staff"). They move like the member side: every block of the page
   rises in with the card stagger (a card inside a block rises with it), and everything a coach taps scales on press. */
main.staff > :where(:not(.page-title, .sheet-slot, dialog)) { animation:enter var(--dur-enter) var(--ease) both; }
main.staff > :nth-child(2) { animation-delay:calc(1 * var(--stagger)); }
main.staff > :nth-child(3) { animation-delay:calc(2 * var(--stagger)); }
main.staff > :nth-child(4) { animation-delay:calc(3 * var(--stagger)); }
main.staff > :nth-child(n+5) { animation-delay:calc(4 * var(--stagger)); }
main.staff > * .card, main.staff > .no-enter { animation:none; }
a.btn, a.card, .list-row, .week-row, label.chip, .pick-row, .plan-cell, .program-cell, .source-pill, .class-card, nav.tabs a { transition:transform var(--dur-press-up) var(--ease); }
/* The press is only for motion-on phones: under reduced motion nothing scales (the blanket stop covers the transition). */
@media (prefers-reduced-motion:no-preference) {
  a.btn:active, a.card:active, a.list-row:active, a.week-row:active, button.list-row:active, label.chip:active, .pick-row:active, .plan-cell:active,
  .program-cell:active, a.source-pill:active, .class-card:has(> .class-link:active), nav.tabs a:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); }
}
/* A chevron on a row or card that opens something. */
.chev { display:inline-block; flex:none; width:8px; height:8px; margin-left:var(--space-2); border-top:2px solid var(--ink-2); border-right:2px solid var(--ink-2); transform:rotate(45deg); }
a.card.tappable { position:relative; padding-right:var(--space-6); }
a.card.tappable::after { content:""; position:absolute; top:50%; right:var(--space-4); width:8px; height:8px; border-top:2px solid var(--ink-2); border-right:2px solid var(--ink-2); transform:translateY(-50%) rotate(45deg); }
.tap-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); color:var(--ink); text-decoration:none; }
.tap-label { font-weight:600; }
.tap-label .sub { display:block; margin-top:var(--space-1); color:var(--ink-2); font-size:var(--text-secondary); font-weight:400; }
.class-count .chev { margin-left:var(--space-3); vertical-align:middle; }
/* Fields: no border, a soft fill, rounded, like the member log fields. A search box on the page itself is white. */
main.staff :where(input, textarea) { min-height:44px; border:0; background:var(--bg); }
main.staff > .search-bar input { background:var(--surface); }
.field-label.first { margin-top:0; }
.btn.danger { color:var(--bad); }
/* Day chips: one row that scrolls sideways to the card's edges (-16px undoes the card or sheet padding). */
.day-chips { display:flex; gap:var(--space-2); margin:var(--space-2) -16px 0; padding:0 var(--space-4) var(--space-1); overflow-x:auto; scroll-snap-type:x proximity; scroll-padding:0 var(--space-4); scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.day-chips::-webkit-scrollbar { display:none; }
.day-chips .day-chip { flex:none; margin:0; padding:var(--space-2) var(--space-4); background:var(--surface-2); color:var(--ink); font-size:var(--text-body); white-space:nowrap; scroll-snap-align:start; }
.day-chips .day-chip:has(input:checked) { background:var(--accent); color:var(--on-accent); }
/* The stepper: − and + in round buttons either side of one big number in the display face. */
.stepper { display:flex; align-items:center; gap:var(--space-3); margin-top:var(--space-2); }
.stepper .step { flex:none; width:var(--space-7); min-height:var(--space-7); margin:0; padding:0; border-radius:50%; font-family:var(--font-display); font-size:var(--display-m); line-height:1; }
.stepper .step-value { flex:1; display:flex; align-items:baseline; justify-content:center; gap:var(--space-1); min-width:0; }
.stepper input { width:calc(var(--space-7) * 2); min-height:var(--space-7); padding:0; background:transparent; font-family:var(--font-display); font-size:var(--display-xl); font-weight:700; text-align:center; -moz-appearance:textfield; appearance:textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { margin:0; -webkit-appearance:none; }
/* A movement's kg or metres: big, centred and rounded, as the member log field. */
.move-num input, .move-sheet .big-input { padding:var(--space-2); border-radius:var(--radius-control); background:var(--bg); font-family:var(--font-display); font-size:var(--display-s); font-weight:600; text-align:center; }
.move-sheet .big-input { font-size:var(--display-m); }
/* Plan: the library row, then This week as one card per class type. The header names the type and where its week comes
   from (a program pill that opens it, or Day by day). A day is its workout (with a Program mark) or + Add. */
.type-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2) var(--space-3); margin:0 0 var(--space-2); }
.type-head .class-title { min-width:0; overflow-wrap:anywhere; }
.source-pill { display:inline-flex; align-items:center; flex:none; max-width:100%; padding:var(--space-1) var(--space-3); border-radius:999px; background:var(--surface-2); color:var(--ink-2); font-size:var(--text-caption); font-weight:600; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
a.source-pill { min-height:44px; background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
.plan-day { display:flex; align-items:center; gap:var(--space-3); min-height:56px; border-top:1px solid var(--line); }
.type-head + .plan-day { border-top:0; }
.plan-weekday { flex:none; width:var(--space-7); color:var(--ink-2); font-family:var(--font-display); font-size:var(--text-body); font-weight:600; }
.plan-day.today .plan-weekday { color:var(--accent-text); }
.plan-cell { flex:1; display:flex; align-items:center; gap:var(--space-2); min-width:0; min-height:44px; margin:0; padding:var(--space-2) var(--space-3); border:0; border-radius:var(--radius-control); background:var(--surface-2); color:var(--ink); font:inherit; font-size:var(--text-body); text-align:left; text-decoration:none; cursor:pointer; }
.plan-cell.add { justify-content:center; font-size:var(--text-body); }
/* A day's workout (Plan and the program page): its name on up to two lines, its format in one quiet line under it. */
.cell-text { flex:1; display:flex; flex-direction:column; gap:0; min-width:0; padding:var(--space-1) 0; }
.plan-title, .program-title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-weight:600; line-height:1.25; overflow-wrap:anywhere; }
.cell-sub { overflow:hidden; color:var(--ink-2); font-size:var(--text-secondary); font-weight:400; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.program-mark { flex:none; margin:0; }
.day-actions { margin-top:var(--space-5); }
.day-actions .btn + .btn { margin-top:var(--space-2); }
/* Program page: ‹ and › are round buttons either side of the week; a day row carries a chevron. */
.week-switch { justify-content:space-between; margin:0 0 var(--space-3); }
.week-switch .week-step { width:var(--space-7); min-height:var(--space-7); padding:0; border-radius:50%; font-family:var(--font-display); font-size:var(--display-m); }
.week-switch .week-step.off { color:var(--line); cursor:default; }
.week-label { display:flex; flex-direction:column; align-items:center; gap:var(--space-1); }
.week-label .week-of { margin:0; font-size:var(--text-caption); }
.program-cell.add { justify-content:center; }
/* Program page, top to bottom in one column: Use this program (full width), the week card, then Copy week and Edit
   program (full width, the standard gap), a note, and On the calendar with one row per use (its line, then Take off
   calendar full width under it). Nothing is positioned over anything else. */
.program-actions > * { width:100%; }
.program-note { margin:var(--space-3) 0 0; color:var(--ink-2); font-size:var(--text-secondary); line-height:1.4; }
.run-row { display:flex; flex-direction:column; gap:var(--space-2); padding:var(--space-3) 0; border-top:1px solid var(--line); }
.run-row:first-child { padding-top:0; border-top:0; }
.run-row:last-child { padding-bottom:0; }
.run-line { font-weight:600; overflow-wrap:anywhere; }
.run-row .btn { width:100%; }

/* Members tab (staff_members.html, _staff_member_row.html). A row is one button with a chevron at the end, drawn like the
   list-row chevron (the › in the markup stays for the layout, its glyph hidden). Rows rise one after another, as an
   athlete list, capped at four steps. The readiness dot sits on the name's middle. */
.coach-row > .go { flex:none; width:8px; height:8px; margin-right:var(--space-1); overflow:hidden; border-top:2px solid var(--ink-2); border-right:2px solid var(--ink-2); color:transparent; transform:rotate(45deg); }
main.member .member-list .coach-row { animation:enter var(--dur-enter) var(--ease) both; }
main.member .member-list .coach-row:nth-child(2) { animation-delay:calc(1 * var(--stagger)); }
main.member .member-list .coach-row:nth-child(3) { animation-delay:calc(2 * var(--stagger)); }
main.member .member-list .coach-row:nth-child(4) { animation-delay:calc(3 * var(--stagger)); }
main.member .member-list .coach-row:nth-child(n+5) { animation-delay:calc(4 * var(--stagger)); }
main.member .member-list .coach-row.no-enter { animation:none; }
.coach-row-who .name { display:flex; align-items:center; }
.coach-row-who .name .dot { flex:none; }
.member-filters .chips { margin:0 0 var(--space-3); }
.member-filters { margin:0; }
.readiness-block .confirm { margin-top:var(--space-2); }
.readiness-block .override-form { margin-top:var(--space-4); }

/* Staff pages: every action is a real button. The page background and --surface-2 are nearly the same grey, so a
   secondary button or a chip that sits on the page itself is white; inside a card or a sheet it keeps --surface-2.
   A quiet (text-only) button never shows on a staff page: it takes the secondary look. :where() keeps these at the
   specificity of the rules they follow, so a pressed or checked chip still takes the accent. */
:where(main.staff) .btn.secondary, :where(main.staff) .btn.quiet, :where(main.staff) .chips .chip { background:var(--surface); color:var(--ink); }
:where(main.staff :is(.card, .sheet)) .btn.secondary, :where(main.staff :is(.card, .sheet)) .btn.quiet,
:where(main.staff :is(.card, .sheet)) .chips .chip { background:var(--surface-2); }
:where(main.staff) .chips .chip[aria-pressed="true"], :where(main.staff) .chips .chip:has(input:checked) { background:var(--accent); color:var(--on-accent); }
:where(main.staff) .btn.danger { color:var(--bad); }
.btn.back { align-self:flex-start; margin:0 0 var(--space-3); padding:var(--space-2) var(--space-4); font-size:var(--text-secondary); }
.heavy-load .heavy-load-row { width:100%; background:none; border:0; font:inherit; text-align:left; cursor:pointer; }
.heavy-load .heavy-load-row::after { content:""; flex:none; width:8px; height:8px; border-top:2px solid var(--ink-2); border-right:2px solid var(--ink-2); transform:rotate(45deg); }

/* The bell: a round icon button with the unread count as a badge on its corner. */
header.top a.bell { position:relative; display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:50%; background:var(--surface-2); color:var(--ink); text-decoration:none; }
header.top a.bell:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); }
header.top .bell-count { position:absolute; top:0; right:0; min-width:20px; height:20px; padding:0 var(--space-1); border-radius:10px; background:var(--accent); color:var(--on-accent); font-size:var(--text-caption); font-weight:700; line-height:20px; text-align:center; }

/* Away members on staff lists: faded row, the Away chip stays readable. */
.away { opacity:.6; }
.away .badge { opacity:1; }
.att-grid { width:auto; font-variant-numeric:tabular-nums; }
.att-grid th, .att-grid td { text-align:center; padding:var(--space-2) var(--space-3); }
.att-grid th:first-child, .att-grid td:first-child { text-align:left; }
.att-grid td.gap { background:color-mix(in srgb, var(--bad) 16%, var(--surface)); font-weight:600; }
.att-grid td.away, .att-grid td.none { color:var(--muted); }
.att-grid td.away { opacity:1; }

/* Injury cases (coach_injury_cases.html, coach_injury_case.html, _injury_form_fields.html). The list is one card of rows
   (the issue, kind and stage under it, one status pill); Flag for rehab and New case are buttons that open sheets. The
   form: kind, stage and status as chips, the to-do in the body face, not for now as toggle chips under a filter box.
   The stage chips hide while Chronic is picked (app.js resets them to Not set). */
.case-link .badge { flex:none; margin:0; }
.case-link .label { font-weight:600; overflow-wrap:anywhere; }
.case-link .sub { font-weight:400; }
.page-actions { display:flex; gap:var(--space-2); margin:var(--space-3) 0 0; }
.page-actions > .btn, .page-actions > form { flex:1 1 0; min-width:0; margin:0; }
.page-actions form .btn { width:100%; }
.case-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2); margin:0 0 var(--space-3); }
.case-bar .badge { margin:0; }
.case-bar .btn { min-height:44px; padding:var(--space-2) var(--space-4); font-size:var(--text-secondary); }
.case-bar .btn .badge { font-size:var(--text-caption); }
.case-form .chips { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:var(--space-2) 0 0; }
.case-form .chips .chip { min-height:40px; padding:var(--space-1) var(--space-3); font-size:var(--text-secondary); }
.case-form label.field-label { display:block; color:var(--ink); font-weight:600; }
.case-form p.field-label { margin-bottom:0; color:var(--ink); font-weight:600; }
.case-form label.field-label :where(input, textarea) { margin-top:var(--space-2); font-weight:400; }
.case-form textarea { width:100%; min-height:96px; font-family:inherit; font-size:var(--text-body); line-height:1.4; resize:vertical; }
.case-form:has(input[name="kind"][value="chronic"]:checked) .stage-field { display:none; }
.case-form .error { margin:var(--space-3) 0 0; }
.chip-filter { width:100%; margin:var(--space-2) 0 0; }
.no-go-chips .chip[hidden] { display:none; }
.case-card .block-button, .case-form .block-button { margin-top:var(--space-5); }
.history-sheet .rev { padding:var(--space-3) 0; }
.history-sheet .rev:first-of-type { padding-top:0; }
.history-sheet .details-pills { margin:var(--space-1) 0 0; }
/* The staff note page (coach_staff_note.html): one card with the text box and Save, then History (a sheet). */
.note-card textarea { width:100%; min-height:160px; font-family:inherit; font-size:var(--text-body); line-height:1.4; resize:vertical; }
.note-card .error { margin:var(--space-2) 0 0; }
.block-button .badge { margin:0; font-size:var(--text-caption); }
/* A member's tags (coach_member_tags.html): one row per tag (the tinted chip, the detail on one line) that opens its
   sheet; Add tag picks a tag as a tinted chip (a ring marks the picked one); New tag picks its colour as a swatch. */
.tag-row { width:100%; margin:0; border-left:0; border-right:0; border-bottom:0; border-radius:0; background:none; font:inherit; text-align:left; cursor:pointer; }
.tag-row .label { display:flex; flex-direction:column; align-items:flex-start; gap:var(--space-1); min-width:0; }
.tag-row .sub { max-width:100%; margin:0; }
.tag-sheet .sheet-line { margin:0 0 var(--space-2); }
.tag-sheet .tag-remove { margin-top:var(--space-2); }
.tag-form > textarea, .tag-form > input:not([type="hidden"]), .tag-sheet textarea { width:100%; margin:var(--space-3) 0 0; font-family:inherit; font-size:var(--text-body); }
.tag-form > textarea, .tag-sheet textarea { min-height:88px; resize:vertical; }
.tag-form .chips { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:var(--space-2) 0 0; }
.tag-picks { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.tag-pick { position:relative; display:inline-flex; align-items:center; min-height:44px; margin:0; padding:0 var(--space-4); border-radius:999px; font-size:var(--text-secondary); font-weight:600; cursor:pointer; }
.tag-pick input, .swatch input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.tag-pick:has(input:checked) { outline:2px solid currentColor; outline-offset:-2px; }
.tag-pick:has(input:focus-visible), .swatch:has(input:focus-visible) { outline:2px solid var(--accent-text); outline-offset:2px; }
.swatches { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:var(--space-2) 0 0; }
.swatch { position:relative; display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; margin:0; padding:0 var(--space-1); border-radius:999px; background:var(--surface-2); color:var(--ink); font-size:var(--text-secondary); font-weight:600; cursor:pointer; }
.swatch.default { padding:0 var(--space-3); }
.swatch .dot { width:28px; height:28px; margin:0; }
.swatch:has(input:checked) { outline:2px solid var(--ink); outline-offset:-2px; }
/* A member's page (coach_member_history.html) and an exercise's logs (coach_exercise_logs.html): the week switch, then
   one class row per session or one card per log, the sets as big chips, the plan and notes as one row each (wrapping: they are the
   record, not a summary). A log card opens the member. */
/* Inside a week: one block per class she was in (the date and time; class, site, coach under it) that opens the workout. */
button.list-row.history-class { margin:0 0 var(--space-2); padding:var(--space-3) var(--space-4); border:0; border-radius:var(--radius-card); background:var(--surface); }
.history-class .label { font-weight:600; min-width:0; overflow-wrap:anywhere; }
.history-class .sub { font-weight:400; }
.history-card .ex-title, .history-ex .ex-title { margin:0; font-weight:600; }
.history-card .no-plan, .history-ex .no-plan { margin-top:var(--space-2); }
.history-card .ex-row, .history-ex .ex-row { cursor:default; align-items:flex-start; }
.history-card .ex-row .value, .history-ex .ex-row .value { white-space:normal; overflow:visible; overflow-wrap:anywhere; }
.history-ex .set-chips { margin-top:var(--space-2); }
a.card.log-card { display:block; color:var(--ink); text-decoration:none; }
.log-head { display:flex; align-items:center; gap:var(--space-2); }
.log-who { flex:1; min-width:0; font-weight:600; overflow-wrap:anywhere; }
.log-day { flex:none; color:var(--ink-2); font-size:var(--text-secondary); }
.log-card .set-chips { margin-top:var(--space-2); }
.planned-row { width:100%; margin:0 0 var(--space-3); padding:var(--space-3) var(--space-4); border:0; border-radius:var(--radius-card); background:var(--surface); font:inherit; font-weight:600; text-align:left; cursor:pointer; }
.planned-sheet .list-row .label { font-weight:600; }
.planned-sheet .list-row .sub { font-weight:400; }
.history-switch { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); margin:var(--space-2) 0 var(--space-3); }
.week-nav { display:inline-flex; flex:none; align-items:center; justify-content:center; width:var(--space-7); height:var(--space-7); border-radius:50%; background:var(--surface); color:var(--ink); text-decoration:none; transition:transform var(--dur-press-up) var(--ease); }
.week-nav .chev { width:10px; height:10px; margin:0 var(--space-1) 0 0; border-color:var(--ink); }
.week-nav .chev.back { margin:0 0 0 var(--space-1); transform:rotate(-135deg); }
.week-nav.off { opacity:.35; }
@media (prefers-reduced-motion:no-preference) { a.week-nav:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); } }
/* The Members tab (coach_search.html): one search box, then a card of member rows (name; locations, pills and tags on
   one line under it) and, once something is typed, a card of exercises. */
.member-list .kicker + .coach-row, .exercise-list .kicker + .list-row { border-top:0; }
.member-list .row-pills .sub { margin-right:var(--space-1); }
.member-list .coach-row-who { gap:var(--space-1); }
#search-results > .empty-line { padding:0 var(--space-1) var(--space-3); }
/* Staff messages (coach_messages.html, coach_thread.html). The inbox: one row per member, the newest line cut to one
   line, the time and an unread dot on the right. The thread is the member chat turned round (staff on the right). */
.thread-row { display:flex; align-items:center; gap:var(--space-3); min-height:64px; padding:var(--space-2) 0; border-top:1px solid var(--line); color:var(--ink); text-decoration:none; }
.thread-row:first-child { border-top:0; }
.thread-main { flex:1; display:flex; flex-direction:column; gap:var(--space-1); min-width:0; }
.thread-name { font-weight:600; }
.thread-name .badge { margin:0 0 0 var(--space-1); }
.thread-last { overflow:hidden; color:var(--ink-2); font-size:var(--text-secondary); text-overflow:ellipsis; white-space:nowrap; }
.thread-row.unread .thread-last { color:var(--ink); }
.thread-side { flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:var(--space-2); }
.thread-time { color:var(--ink-2); font-size:var(--text-caption); }
.unread-dot { width:10px; height:10px; border-radius:50%; background:var(--accent); }
.thread-row { transition:transform var(--dur-press-up) var(--ease); }
@media (prefers-reduced-motion:no-preference) { a.thread-row:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); } }
main.staff .composer textarea { background:var(--surface); }
/* Notifications (notifications.html), member and staff: one row per notice (an icon, the title on one line, the time
   and an unread dot), Mark all read, then the email switch as two chips. */
.notif-row { display:flex; align-items:center; gap:var(--space-3); min-height:56px; padding:var(--space-2) 0; border-top:1px solid var(--line); color:var(--ink); text-decoration:none; transition:transform var(--dur-press-up) var(--ease); }
.notif-row:first-child { border-top:0; }
@media (prefers-reduced-motion:no-preference) { a.notif-row:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); } }
.notif-icon { flex:none; display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:50%; background:var(--surface-2); color:var(--ink-2); }
.notif-row.unread .notif-icon { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
.notif-icon .icon { width:20px; height:20px; }
.notif-title { flex:1; min-width:0; overflow:hidden; color:var(--ink-2); text-overflow:ellipsis; white-space:nowrap; }
.notif-row.unread .notif-title { color:var(--ink); font-weight:600; }
.notif-side { flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:var(--space-2); }
.notif-time { color:var(--ink-2); font-size:var(--text-caption); }
.notif-read-all { margin:0 0 var(--space-3); }
.notif-read-all .btn { width:100%; }
.notif-email { margin:0; }
.email-line { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); }
.email-line .label { font-weight:600; }
.email-line .chips { display:flex; gap:var(--space-2); margin:0; }
/* Admin screens in coaching mode (coaching_admin_*.html). Filters are link chips (the picked one in the accent); a
   page's main action sits under its title; a sheet of facts shows long values (an email) in the body face. */
a.chip { text-decoration:none; }
.chips a.chip[aria-current="true"], :where(main.staff) .chips a.chip[aria-current="true"] { background:var(--accent); color:var(--on-accent); }
.filter-chips { margin:0 0 var(--space-3); }
.filter-chips .chips { flex-wrap:nowrap; overflow-x:auto; margin:0 0 var(--space-2); padding-bottom:var(--space-1); scrollbar-width:none; }
.filter-chips .chip { flex:none; white-space:nowrap; }
.top-actions { margin:0 0 var(--space-3); }
.top-actions > .btn { flex:1 1 0; }
.facts-sheet .list-row .value, .facts .list-row .value, .values-body .list-row .value { max-width:65%; font-family:var(--font-body); font-size:var(--text-body); font-weight:600; text-align:right; overflow-wrap:anywhere; }
/* Attendance (coaching_admin_attendance.html): one row per member, her name over one dot per cycle week. A filled dot
   holds the classes she came to, a ring is booked, grey is away, a red ring is a gap. The week numbers sit once on
   top, on the same grid. */
.att-row { display:flex; flex-direction:column; gap:var(--space-2); padding:var(--space-3) 0; border-top:1px solid var(--line); color:var(--ink); text-decoration:none; }
.att-head { padding-top:0; border-top:0; }
.att-head .att-name { display:none; }
.att-name { display:flex; align-items:center; gap:var(--space-2); font-weight:600; }
.att-name .badge { margin:0; }
.att-dots { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.att-week, .att-dot { flex:none; display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; font-variant-numeric:tabular-nums; }
.att-week { height:auto; color:var(--ink-2); font-size:var(--text-secondary); font-weight:600; }
.att-week.now { color:var(--accent-text); }
.att-dot { background:var(--surface); outline:2px solid var(--line); outline-offset:-2px; font-size:var(--text-secondary); font-weight:700; }
.att-dot.attended { background:var(--accent); color:var(--on-accent); outline:0; }
.att-dot.booked { background:var(--surface); outline:2px solid var(--accent); outline-offset:-2px; }
.att-dot.away { background:var(--line); outline:0; }
.att-dot.gap { background:color-mix(in srgb, var(--bad) 14%, var(--surface)); outline:2px solid var(--bad); outline-offset:-2px; }
.att-key { display:flex; flex-wrap:wrap; gap:var(--space-2) var(--space-4); padding-top:var(--space-3); border-top:1px solid var(--line); color:var(--ink-2); font-size:var(--text-secondary); }
.att-key > span { display:inline-flex; align-items:center; gap:var(--space-2); }
.att-key .att-dot { width:20px; height:20px; font-size:var(--text-caption); }
@media (prefers-reduced-motion:no-preference) { a.att-row { transition:transform var(--dur-press-up) var(--ease); } a.att-row:active { transform:scale(var(--press-scale)); transition-duration:var(--dur-press-down); } }
/* Admin builders (coaching_admin_program.html, coaching_admin_timetable.html): a card per class or day, its rows are
   buttons that open a sheet (the row's actions live there, not on the row), a New button under each list. A sheet
   form: a bold label over each field, chips and steppers in place of selects and number boxes, a switch for on/off. */
.section-title { margin:var(--space-6) 0 var(--space-2); } /* the h2 kicker look comes from :where(main.member) h2 */
.program-class h2.class-title, .day-card h2.class-title { margin:0 0 var(--space-2); color:var(--ink); letter-spacing:0; text-transform:var(--display-transform); }
button.list-row { width:100%; margin:0; padding:var(--space-2) 0; border-left:0; border-right:0; border-bottom:0; border-radius:0; background:none; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.list-row:first-child, .class-title + .list-row { border-top:0; }
.list-row .badge { flex:none; margin:0; }
.ex-no { flex:none; display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:var(--surface-2); color:var(--ink-2); font-family:var(--font-display); font-weight:600; font-variant-numeric:tabular-nums; }
.ex-pick .label { font-weight:600; overflow-wrap:anywhere; }
.ex-pick .sub { font-weight:400; }
.card > .block-button, .sheet .block-button { margin-top:var(--space-3); }
main.staff > .block-button { margin:0 0 var(--space-3); }
.sheet-form { display:flex; flex-direction:column; gap:var(--space-2); }
.sheet-form > .btn { margin-top:var(--space-3); }
.sheet-form .field-label { margin:var(--space-2) 0 0; color:var(--ink); font-weight:600; }
.sheet-form label.field-label :where(input, textarea) { margin-top:var(--space-2); font-weight:400; }
.sheet-form .chips, .sheet-form .day-chips { margin:0; }
.sheet-form .chip-filter + [data-chip-list] .chips { margin-top:var(--space-2); }
.sheet-gap { margin-top:var(--space-2); }
.sheet .page-actions { margin:0; }
.switch-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); min-height:44px; margin:var(--space-2) 0 0; font-weight:600; cursor:pointer; }
input.switch { flex:none; position:relative; width:52px; min-height:0; height:32px; margin:0; padding:0; border:0; border-radius:999px; background:var(--line); appearance:none; -webkit-appearance:none; cursor:pointer; transition:background var(--dur-state) var(--ease); }
input.switch::after { content:""; position:absolute; top:3px; left:3px; width:26px; height:26px; border-radius:50%; background:var(--surface); transition:transform var(--dur-state) var(--ease); }
input.switch:checked { background:var(--accent); }
input.switch:checked::after { transform:translateX(20px); }
input.switch:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.list-row.off .label { color:var(--ink-2); }
.time-pick { display:flex; flex-direction:column; gap:var(--space-2); }
.facts { padding:var(--space-2) var(--space-4); background:var(--surface-2); }
.sheet .facts { margin:0 0 var(--space-3); }
main.staff > .block-button + .block-button { margin-top:0; }
/* Invite (coaching_admin_invite.html): the link in a read-only box to copy; Rehab hides the location chips. */
.invite-link input { width:100%; font-size:var(--text-secondary); }
.invite-link .confirm, .invite-link .error { margin:var(--space-2) 0 0; }
.invite-form form:has(input[name="role"][value="rehab"]:checked) .location-field { display:none; }
.list-row .chev { margin-left:0; }
/* Settings (coaching_admin_settings.html): rows of setting and value; the accent as a dot; long sheets scroll. */
.accent-dot { flex:none; width:24px; height:24px; margin:0; }
.sheet-kicker { margin:var(--space-4) 0 0; }
main code { overflow-wrap:anywhere; } /* a long key (the 2FA secret) wraps instead of widening the page */
/* A list editor in a sheet (settings: rehab stages, admin areas): a text box and a round remove button per row. */
.edit-rows { display:flex; flex-direction:column; gap:var(--space-2); }
.edit-row { display:flex; align-items:center; gap:var(--space-2); }
.edit-row input[type="text"] { flex:1; min-width:0; margin:0; }
.edit-row input.cue-code-input { flex:0 0 5.5em; }
.edit-row .remove-row { flex:none; width:44px; padding:0; border-radius:50%; font-size:var(--display-s); }
/* The program page's sections (coaching_admin_program.html): one segmented control, the picked part in the accent. */
.segmented { display:flex; gap:var(--space-1); margin:0 0 var(--space-3); padding:var(--space-1); border-radius:var(--radius-control); background:var(--surface); overflow-x:auto; scrollbar-width:none; }
.segmented::-webkit-scrollbar { display:none; }
/* Each section keeps its whole word: on a phone the row scrolls sideways instead of cutting "Exercises" off. */
.segmented .chip { flex:1 0 auto; min-height:40px; margin:0; padding:var(--space-2) var(--space-3); border-radius:calc(var(--radius-control) - 2px); background:transparent; color:var(--ink); text-decoration:none; white-space:nowrap; }
.segmented .chip[aria-current="true"] { background:var(--accent); color:var(--on-accent); }
/* Text for a screen reader only (an attendance dot's week and state). */
.visually-hidden { position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
/* The class plan grid: members by exercises for one week. It scrolls sideways in its own box, the name column stays put;
   the page itself never scrolls sideways. */
.chips a.chip.now { text-decoration:underline; text-decoration-thickness:3px; text-underline-offset:var(--space-1); }
.plan-grid-wrap { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--line); border-radius:var(--radius-control); background:var(--surface); }
.plan-grid { border-collapse:separate; border-spacing:0; font-size:var(--text-secondary); }
.plan-grid th, .plan-grid td { padding:0; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.plan-grid thead th { padding:var(--space-2); font-weight:600; white-space:nowrap; }
.plan-grid th:first-child, .plan-grid td:first-child { position:sticky; left:0; z-index:1; background:var(--surface); border-right:1px solid var(--line); }
.plan-grid tbody th { min-width:7.5rem; max-width:9rem; padding:var(--space-2); font-weight:600; overflow-wrap:anywhere; }
.plan-grid tbody th a { color:var(--ink); }
.plan-grid .cell { display:flex; flex-direction:column; gap:var(--space-1); min-width:8rem; max-width:11rem; min-height:44px; padding:var(--space-2); color:var(--ink); text-decoration:none; }
.plan-grid .cell-text { overflow-wrap:anywhere; }
.plan-grid .cell-text.empty { color:var(--ink-2); }
.plan-grid .cell-last { color:var(--ink-2); font-size:var(--text-caption); overflow-wrap:anywhere; }
.plan-grid td.no-go { background:color-mix(in srgb, var(--bad) 10%, var(--surface)); }
/* Fade the away row's content, never the sticky name cell itself: its background must stay solid over what scrolls. */
.plan-grid tr.away td > *, .plan-grid tr.away th > a { opacity:.6; }
.program-class .class-head { align-items:center; margin:0 0 var(--space-2); }
.program-class .class-head h2.class-title { margin:0; min-width:0; overflow-wrap:anywhere; }
.program-class .class-head + .list-row { border-top:0; }
.class-plan-link { margin:0 0 var(--space-3); }
/* The member's class calendar (plan_calendar.html): the week buttons in one row that wraps, then one card per day; a
   class row is the time, the class with its site under it, and the pills. */
.cal-nav { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:0 0 var(--space-3); }
.cal-nav .btn { flex:1 1 0; min-height:44px; white-space:nowrap; }
.cal-day.today > .kicker { color:var(--accent-text); }
.week-row.cal-row { grid-template-columns:5.5rem minmax(0, 1fr) auto; border-top-color:var(--line); }
.cal-row .wk-end { flex-wrap:wrap; justify-content:flex-end; }
.plan-links { display:flex; gap:var(--space-2); margin:0 0 var(--space-3); }
.plan-links .btn { flex:1 1 0; min-height:44px; white-space:nowrap; }
.session-week { margin:var(--space-1) 0 0; }
.session-week .badge { margin:0; }
/* A notification about one exercise links to its card (#card-<id>): mark the card it lands on. */
.ex-card:target { outline:2px solid var(--accent); outline-offset:2px; }
/* Substitutions (S7), end-of-cycle reviews (S6) and the joining form (S8). The card line under an exercise name that
   says which exercise a substitute is in place of; the member page's links; the substitution block (_substitution.html)
   with its sheet; the review form and the member's review page; the joining form's question and answer rows. */
.sub-line { margin:var(--space-1) 0 0; color:var(--ink-2); font-size:var(--text-secondary); overflow-wrap:anywhere; }
.sub-line .sub-note { display:block; color:var(--ink); }
.member-links { padding-top:var(--space-1); padding-bottom:var(--space-1); }
.member-links .list-row:first-child { border-top:0; }
.sub-block .sub-row { align-items:center; gap:var(--space-2); }
.sub-block .sub-row .label { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }
.sub-block .sub-row .btn { flex:0 0 auto; width:auto; padding:var(--space-2) var(--space-3); font-size:var(--text-secondary); }
.sub-block .sub-row .btn.has-note { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); }
.sub-card .sub-block:first-of-type .list-row { border-top:0; }
.history-card .ex-head .btn { padding:var(--space-2) var(--space-3); font-size:var(--text-secondary); }
.stack-form .field, .sub-sheet .field { display:flex; flex-direction:column; gap:var(--space-1); margin:0 0 var(--space-3); }
.stack-form .field .kicker, .sub-sheet .field .kicker { margin:0; }
.stack-form .hint, .sub-sheet .hint { margin:0 0 var(--space-3); color:var(--ink-2); font-size:var(--text-secondary); }
.review-parts .list-row .value { white-space:normal; text-align:right; overflow-wrap:anywhere; }
.review-message { margin:0; line-height:1.45; white-space:pre-line; overflow-wrap:anywhere; }
.qa-row { padding:var(--space-2) 0; border-top:1px solid var(--line); }
.qa-row:first-of-type { border-top:0; }
.qa-row .q { margin:0; color:var(--ink-2); font-size:var(--text-secondary); overflow-wrap:anywhere; }
.qa-row .a { margin:var(--space-1) 0 0; white-space:pre-line; overflow-wrap:anywhere; }
.qa-edit { display:grid; gap:var(--space-1); padding:var(--space-2) 0; border-top:1px solid var(--line); }
.qa-edit:first-of-type { border-top:0; }

/* Rehab reminders on the case page: one row per reminder (when, the note under it, Remove). In the Add reminder sheet
   only the fields of the picked kind show: a day (On a date), a first day and a number of days (Every day for a
   while), an hour for both; the session kinds need none. */
.reminder-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding:var(--space-2) 0; border-bottom:1px solid var(--line); }
.reminder-row:last-of-type { border-bottom:0; }
.reminder-row .label { display:flex; flex-direction:column; min-width:0; overflow-wrap:anywhere; }
.reminder-row .sub { color:var(--ink-2); font-size:var(--text-secondary); }
.reminder-card .block-button { margin-top:var(--space-3); }
.reminder-form:has(input[name="kind"][value="after_session"]:checked) :is(.on-date-field, .range-field, .time-field),
.reminder-form:has(input[name="kind"][value="next_session"]:checked) :is(.on-date-field, .range-field, .time-field),
.reminder-form:has(input[name="kind"][value="on_date"]:checked) .range-field,
.reminder-form:has(input[name="kind"][value="date_range"]:checked) .on-date-field { display:none; }

/* Stages, cues and focus (app.coaching.stages). The stage chip takes the theme's tones: the accent while she learns the
   cues, ok once she loads, a quiet neutral while she holds, warn when she slips. Focus is an outlined accent chip. */
.badge.steady { background:var(--surface-2); color:var(--ink); }
.stage-chip { font-weight:700; white-space:nowrap; }
.stage-chip.big { margin:0; padding:var(--space-1) var(--space-3); font-size:var(--text-secondary); }
.focus-chip { margin:0; border:1.5px solid var(--accent); background:transparent; color:var(--accent-text); font-weight:700; }
.stage-mark { display:inline-flex; flex-wrap:wrap; gap:var(--space-1); align-items:center; }
.stage-mark .badge { margin:0; }
button.stage-button { display:inline-flex; align-items:center; min-height:44px; margin:0; padding:0 var(--space-1); border:0; background:none; color:inherit; font:inherit; cursor:pointer; }
button.stage-button:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; border-radius:var(--radius-control); }
.ex-row.expect-row .value { white-space:normal; }
.ex-actions:has(> :nth-child(4)) { display:grid; grid-template-columns:1fr 1fr; }

/* The member x exercise sheet (_mx_*.html): sections 16 apart with a hairline, big rows to tick. */
.mx-body { display:flex; flex-direction:column; }
.mx-section { padding:var(--space-4) 0; border-top:1px solid var(--line); }
.mx-section:first-child { padding-top:0; border-top:0; }
.mx-section .kicker { margin:0 0 var(--space-2); }
.mx-section .kicker + .kicker, .mx-section .set-chips + .kicker, .mx-section .mx-line + .kicker { margin-top:var(--space-4); }
.mx-stage { margin:0 0 var(--space-2); }
.mx-expect { margin:0; font-size:var(--text-body); line-height:1.4; }
.mx-expect.empty, .mx-line, .mx-empty { color:var(--ink-2); }
.mx-line { margin:0; font-size:var(--text-secondary); line-height:1.4; }
.mx-line + .mx-line { margin-top:var(--space-2); }
.mx-plan { color:var(--ink); font-family:var(--font-display); font-size:var(--display-s); font-weight:600; }
.mx-empty { margin:0 0 var(--space-3); line-height:1.4; }
.mx-chips { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.mx-chips .badge { margin:0; }
.mx-note { margin:var(--space-2) 0 0; font-size:var(--text-secondary); line-height:1.4; }
.mx-group { margin-top:var(--space-3); }
.mx-cues .mx-group:first-child { margin-top:0; }
.cue-list { display:flex; flex-direction:column; gap:var(--space-2); margin:0 0 var(--space-3); padding:0; list-style:none; }
.cue-item { display:flex; align-items:stretch; gap:var(--space-2); }
.cue-item form { margin:0; }
.cue-tick { flex:1; min-width:0; }
.cue-row { display:flex; align-items:center; gap:var(--space-3); width:100%; min-height:56px; margin:0; padding:var(--space-3); border:1.5px solid var(--line); border-radius:var(--radius-control); background:var(--bg); color:var(--ink); font:inherit; font-size:var(--text-body); font-weight:600; text-align:left; cursor:pointer; transition:background var(--dur-state) var(--ease), border-color var(--dur-state) var(--ease); }
p.cue-row { cursor:default; }
.cue-item.working-on .cue-row { border-color:var(--accent); }
.cue-item.covered .cue-row { border-color:transparent; background:color-mix(in srgb, var(--ok) 16%, var(--surface)); color:var(--ink-2); }
.cue-row .tick { flex:none; position:relative; width:28px; height:28px; border:2px solid var(--line); border-radius:50%; background:var(--surface); }
.cue-item.working-on .cue-row .tick { border-color:var(--accent); }
.cue-item.covered .cue-row .tick { border-color:var(--ok); background:var(--ok); }
.cue-item.covered .cue-row .tick::after { content:""; position:absolute; left:8px; top:3px; width:7px; height:13px; border:solid var(--on-ok, var(--surface)); border-width:0 3px 3px 0; transform:rotate(45deg); }
.cue-row .cue-text { flex:1; min-width:0; overflow-wrap:anywhere; }
.cue-row:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.cue-move { flex:none; display:flex; }
.cue-move .btn { width:auto; min-width:44px; min-height:56px; margin:0; padding:0 var(--space-3); font-size:var(--text-caption); }
.mx-stage-buttons { display:grid; grid-template-columns:1fr 1fr; gap:var(--space-2); margin:0 0 var(--space-3); }
.mx-stage-buttons form { margin:0; }
.mx-stage-buttons form:has(.back-stage) { grid-column:1 / -1; }
.mx-stage-buttons .btn { width:100%; min-height:52px; margin:0; }
.btn.stage-pick { border:1.5px solid transparent; font-weight:700; }
.btn.stage-pick.ok { border-color:color-mix(in srgb, var(--ok) 40%, transparent); background:color-mix(in srgb, var(--ok) 16%, var(--surface)); color:color-mix(in srgb, var(--ok) 85%, var(--ink)); }
.btn.stage-pick.warn { border-color:color-mix(in srgb, var(--warn) 40%, transparent); background:color-mix(in srgb, var(--warn) 16%, var(--surface)); color:color-mix(in srgb, var(--warn) 85%, var(--ink)); }
.btn.stage-pick.steady { border-color:var(--line); background:var(--surface-2); color:var(--ink); }
.btn.back-stage { background:none; border:1.5px solid var(--line); color:var(--ink-2); }
.mx-focus form { margin:0; }
.focus-toggle { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); width:100%; min-height:56px; margin:0; padding:var(--space-2) 0; border:0; background:none; color:var(--ink); font:inherit; font-size:var(--text-body); font-weight:600; text-align:left; cursor:pointer; }
.focus-toggle .label { display:flex; flex-direction:column; gap:var(--space-1); }
.focus-toggle .sub { color:var(--ink-2); font-size:var(--text-secondary); font-weight:400; }
.focus-toggle .knob { flex:none; position:relative; width:52px; height:32px; border-radius:999px; background:var(--line); transition:background var(--dur-state) var(--ease); }
.focus-toggle .knob::after { content:""; position:absolute; top:3px; left:3px; width:26px; height:26px; border-radius:50%; background:var(--surface); transition:transform var(--dur-state) var(--ease); }
.focus-toggle[aria-pressed="true"] .knob { background:var(--accent); }
.focus-toggle[aria-pressed="true"] .knob::after { transform:translateX(20px); }
.focus-toggle:focus-visible { outline:2px solid var(--accent-text); outline-offset:2px; }
.mx-page .mx-section:first-child { padding-top:0; }
.plan-grid .cell-expect { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; color:var(--ink-2); font-size:var(--text-caption); line-height:1.3; overflow-wrap:anywhere; }
.plan-grid .cell-expect:empty, .ex-row.expect-row:has(.value:empty) { display:none; }
.plan-grid .stage-mark .badge { font-size:var(--text-caption); }
.cell-stage-part .btn { margin-top:var(--space-2); }
.history-ex .ex-title-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2); }
.history-ex .ex-title-row .ex-title { margin:0; }
.sheet .history-ex .small-button { width:auto; min-height:44px; margin:0; padding:0 var(--space-4); }
/* The member's card: her stage and what it asks, then her cues as a short list (a covered one has a tick). */
.my-stage { margin:var(--space-2) 0 var(--space-3); }
.my-stage-line { display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--space-2); margin:0; line-height:1.4; }
.my-stage-line .badge { margin:0; }
.my-expect { font-size:var(--text-secondary); }
.my-cues { display:flex; flex-wrap:wrap; gap:var(--space-1) var(--space-3); margin:var(--space-2) 0 0; padding:0; list-style:none; color:var(--ink-2); font-size:var(--text-secondary); }
.my-cues li::before { content:"○"; margin-right:var(--space-1); }
.my-cues li.covered::before { content:"✓"; color:var(--ok); font-weight:700; }

/* The builder's exercise sheet: Add cue on top, the cues as numbered boxes, then what each stage asks. */
.cue-count { margin:0; white-space:nowrap; }
.sheet-section { padding:var(--space-4) 0 0; }
.sheet-section + .sheet-section { margin-top:var(--space-4); border-top:1px solid var(--line); }
.cue-add { display:flex; gap:var(--space-2); margin:0 0 var(--space-3); }
.sheet .cue-add .btn { width:auto; flex:none; margin:0; }
.cue-add input { flex:1; min-width:0; margin:0; }
.cue-edit-list { display:flex; flex-direction:column; gap:var(--space-3); margin:0; padding:0; list-style:none; }
.cue-edit-row { padding:var(--space-2) 0 0; border-top:1px solid var(--line); }
.cue-edit-row:first-child { border-top:0; }
.sheet .cue-edit { display:flex; align-items:center; gap:var(--space-2); margin:0; }
.cue-edit input { flex:1; min-width:0; margin:0; }
.sheet .cue-edit .btn { width:auto; flex:none; margin:0; }
.cue-no { flex:none; width:24px; color:var(--ink-2); font-family:var(--font-display); font-weight:700; text-align:center; }
.cue-tools { display:flex; gap:var(--space-2); margin:var(--space-2) 0 0 32px; }
.cue-tools form { margin:0; flex:1 1 0; }
.sheet .cue-tools .btn { width:100%; min-height:44px; margin:0; font-size:var(--text-secondary); }

/* Pathways (AD8): the builder's Pathways tab, the member page's Pathway line, the block on her class page and the
   review page, and the pathway columns of the class plan grid. */
.pathway-hint { margin-top:var(--space-1); }
.pathway-card .pathway-about .label { color:var(--ink-2); overflow-wrap:anywhere; }
.pathway-kicker { margin:var(--space-4) 0 var(--space-1); }
.badge.add-cue { background:color-mix(in srgb, var(--accent) 16%, var(--surface)); color:var(--accent-text); font-weight:600; }
.pathway-member { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); }
.pathway-member .label { min-width:0; overflow-wrap:anywhere; }
.member-pathway { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); margin:0 0 var(--space-3); padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius-control); background:var(--surface); }
.member-pathway .label { font-weight:600; min-width:0; overflow-wrap:anywhere; }
.pathway-block { margin-top:var(--space-5); }
h2.pathway-title { margin:var(--space-5) 0 var(--space-2); font-size:var(--display-s); color:var(--ink); letter-spacing:0; text-transform:var(--display-transform); overflow-wrap:anywhere; }
.pathway-block > h2.pathway-title { margin-top:0; }
.plan-grid th.pathway-col, .plan-grid td.pathway-col:not(.no-go) { background:color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.plan-grid .col-pathway { display:block; color:var(--accent-text); font-size:var(--text-caption); font-weight:600; }
.plan-grid td.off { min-width:8rem; }

/* Sections inside a sheet (the program builder's exercise and level sheets): a heading in the display face and a
   line above, so a long sheet reads as parts. One main button per part, in the quieter secondary style. */
.sheet-section { margin-top:var(--space-5); padding-top:var(--space-4); border-top:1px solid var(--line); }
.section-title .count { margin-left:var(--space-1); color:var(--ink-2); font-family:var(--font-body); font-size:var(--text-secondary); font-weight:600; }
.section-title { margin:0 0 var(--space-2); font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.15; color:var(--ink); }
.sheet-section .sheet-form .btn, .sheet-section > .btn { width:100%; }

/* Levels: a colour dot for a level named after a colour (band colours). */
.level-dot { display:inline-block; flex:none; box-sizing:border-box; width:14px; height:14px; margin-right:var(--space-2); border:1px solid var(--line); border-radius:50%; vertical-align:middle; }
.level-set + .level-set { margin-top:var(--space-4); }
.level-set .btn { width:100%; margin-top:var(--space-3); }
.level-set form + form .btn { margin-top:var(--space-2); }

/* Add levels: its own sheet over the exercise's sheet, the ways to add a set. */
.add-levels-open { width:100%; margin-top:var(--space-4); }
.add-levels .field-label { margin-top:var(--space-4); }
.preset-list { display:grid; gap:var(--space-2); margin-top:var(--space-2); }
.preset { display:flex; flex-direction:column; align-items:flex-start; gap:var(--space-1); width:100%; min-height:44px; margin:0; padding:var(--space-3) var(--space-4); border:1px solid var(--line); border-radius:var(--radius-control); background:var(--bg); color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.preset-name { font-family:var(--font-display); font-size:var(--text-body); font-weight:700; }
.preset-levels { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-1) var(--space-2); color:var(--ink-2); font-size:var(--text-caption); }
.preset-levels .level-dot { margin-right:var(--space-1); }
.custom-levels input, .custom-levels textarea { margin-top:var(--space-2); }

/* Admin home (coaching_admin_home.html): three parts, each under a heading in the display face. Needs you tiles are
   tinted in the accent when a number waits; At a glance tiles are smaller; Set up is a plain list. */
.admin-part + .admin-part { margin-top:var(--space-6); }
.part-title { margin:0 0 var(--space-3); font-family:var(--font-display); font-size:var(--display-s); font-weight:700; line-height:1.15; color:var(--ink); }
.admin-tiles.three { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:var(--space-2); }
.admin-tiles.three .tile { min-height:0; padding:var(--space-3); }
.admin-tiles.three .tile .big { font-size:var(--display-m); }
.admin-tiles.three .tile .kicker { letter-spacing:.3px; }
.admin-tiles .tile.attention { background:color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.admin-tiles .tile.attention .big { color:var(--accent-text); }
.admin-tiles.glance .tile .big { font-size:var(--display-s); }
.setup-list { padding-top:0; padding-bottom:0; }
