/* Component styles. Colors only via var(--…) from tokens.css (no hex here; brand.test.js).
   Type: Barlow Condensed 600 (header line), 700/800 for display + buttons, Barlow 400/600 for body + names. */

/* ---- fonts (self-hosted, SIL OFL: fonts/OFL.txt) ---- */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-condensed-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/barlow-condensed-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap;
  src: url(fonts/barlow-condensed-latin-800-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap;
  src: url(fonts/barlow-condensed-latin-ext-800-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/barlow-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/barlow-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.45 "Barlow", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}
.app {
  max-width: 480px;
  min-height: 100svh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) max(var(--s-4), env(safe-area-inset-right)) 0 max(var(--s-4), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
/* Focus scrolling keeps a control clear of a pinned bottom bar (the tallest is a footer's
   confirm with its prompt). */
html:has([data-pinned="bottom"]) { scroll-padding-bottom: calc(2 * var(--btn) + 2 * var(--s-6)); }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
.vh {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---- type roles ---- */
/* The live screen's own header line: the class label and "R 2/4". */
.hdr {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding-top: var(--s-3);
  font: 600 13px/1.3 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  min-height: 17px;
}
.hdr .hdr-count { white-space: nowrap; }
/* One question per screen (D-028): the first-name label, the returning greeting and the
   coach's empty board look like the <h1> (.screen-title): Barlow Condensed 800 32 px. */
.q {
  font: 800 32px/1.05 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .02em;
}
/* Context line above the question: "You + Sam". Names stay as typed. */
.kicker {
  font: 600 17px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; color: var(--muted); margin-bottom: -6px;
}
.fin-note { font: 600 17px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; border-left: 4px solid var(--finisher); padding-left: 10px; }
.name { font-family: "Barlow", "Helvetica Neue", Arial, sans-serif; font-weight: 600; text-transform: none; letter-spacing: 0; }
.station, .group {
  font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
}
h2.group, h3.group, legend.group { font-size: 15px; color: var(--muted); letter-spacing: .1em; margin-top: 4px; }
h2.station { font-size: 18px; }
.copy, .help { font-size: 1rem; }
.help { color: var(--muted); }

/* ---- buttons (components/button.js; app/UI.md › Button) ---- */
button, input, a.btn { font: inherit; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2); width: 100%;
  min-height: var(--btn); padding: var(--s-3) var(--s-4); border-radius: var(--r-card); border: 1px solid transparent;
  font: 800 16px/1.15 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .12em; text-transform: uppercase; text-align: center; text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); color: var(--on-accent); }
.btn[aria-disabled="true"] { background: var(--surface); color: var(--muted); border-color: var(--line); cursor: default; }
/* ---- rows (components/row.js; app/UI.md › Row) ---- */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%;
  min-height: var(--row); padding: 10px var(--s-4); border-radius: var(--r-card); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  font-size: 1rem;
}
.row .station { font-size: 17px; }
.row-status {
  flex: none; font: 800 14px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.row[aria-disabled="true"] { color: var(--muted); cursor: default; }
.row-dashed { background: none; border-style: dashed; }
.row[aria-current="true"] { border-color: var(--text); }
[aria-busy="true"] { cursor: progress; }

/* ---- layout helpers ---- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* "Hi Alex" with the quiet Not you? pill beside it (D-025). */
.hi { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.hi .name { font-size: 28px; }
.field label.q { font-weight: 800; }

/* You're set: the team line, who on the left and Change on the right. */
.team-line {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-1) var(--s-2); margin: 0 calc(-1 * var(--s-2)); border-radius: var(--r-card);
}
.team-line .with-icon { font-size: 17px; min-width: 0; }
.team-line .icon { color: var(--muted); }

/* The Workout and Who's here sheets: one block per station, a rule between them. */
.wk-st, .who-st { display: flex; flex-direction: column; gap: var(--s-1); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.wk-st:first-child, .who-st:first-child { padding-top: 0; border-top: 0; }
.wk-head { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.wk-head .icon { color: var(--text); }
.wk-lines, .who-list { list-style: none; margin: 0; padding: 0 0 0 38px; display: flex; flex-direction: column; gap: 2px; }
.wk-lines { font-size: 15px; }
/* The W/M load gets its own line so it never wraps mid-load (owner, 2026-10-28). */
.wk-load { display: block; color: var(--muted); }
.wk-fin { margin-left: 38px; padding-left: var(--s-2); border-left: 3px solid var(--finisher); font-size: 15px; font-weight: 600; }
/* Your station in the Workout sheet. */
.you-tag {
  padding: var(--s-1) 7px; border-radius: 6px; background: var(--accent); color: var(--on-accent);
  font: 800 12px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase;
}
.who-cap { margin-left: auto; color: var(--muted); font-size: 15px; font-weight: 700; }
.who-list { font-size: 16px; }
.who-loose { padding-left: 0; }
.who-list .mine { color: var(--accent); }
.who-open { color: var(--muted); }

/* ---- Home and Your classes (#12) ---- */
/* The greeting, and (#13) your answer for the next class: "✓ You're going". */
.home-hi, .rsvp-status { font: 800 22px/1.15 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.home-hi .name { font-size: 20px; }
.class-line { font: 600 17px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.cl-type { font: 800 18px/1.2 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.icon-row { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text); }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.entry { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.entry > h2.station { font-size: 18px; }
.entry-rate { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; font-weight: 600; }
.app-version { margin-top: var(--s-2); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; } /* #5: v0.1.1 at the bottom of Your classes and the coach board */
.entry-rate .liked { gap: 6px; }
.entry-rate .icon { color: var(--text); }
/* Home: your answer for the next class (#13), its lines laid out as You're set's .team-line. */
.rsvp { padding-top: var(--s-3); border-top: 1px solid var(--line); }
.rsvp-status { display: flex; align-items: center; gap: var(--s-2); }
.team-line .rsvp-status .icon { color: var(--done); }

/* ---- form fields ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; }
.field input {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 1.125rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--text); }
.field-error:not(:empty) { border-left: 4px solid var(--danger); padding-left: 8px; }
.inline-form { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.choices { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer;
}
.choice input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

/* ---- coach: status card ---- */
.status-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.status-ready { border-left: 4px solid var(--done); }
.status-warn { border-color: var(--line); } /* Start will place / fix these: neutral */
.status-warn .sc-detail, .status-warn .sc-lines { color: var(--muted); }
.status-blocked { border-left: 4px solid var(--danger); }
.sc-title { font: 800 22px/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.status-ready .sc-title { color: var(--done); }
.sc-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-lines .bang { font-weight: 600; color: var(--danger); }

/* ---- warnings (coach, running) ---- */
.warnings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.warnings li { padding: 8px 12px; background: var(--surface); border-radius: 4px; }
.warnings .warn { border-left: 4px solid var(--danger); }
.warnings .bang { font-weight: 600; }
.confirm { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }

/* ---- coach, running: "This round · 2 of 4" ---- */
.board-title {
  font: 800 15px/1.2 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* ---- icons (D-027; components/icons.js SIZES): fixed box so text never shifts if the sprite fails ---- */
.icon { flex: none; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; overflow: visible; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-22 { width: 22px; height: 22px; }
.icon-24 { width: 24px; height: 24px; }
.icon-28 { width: 28px; height: 28px; }
.icon-32 { width: 32px; height: 32px; }
.icon-40 { width: 40px; height: 40px; }
.with-icon { display: flex; align-items: center; gap: 8px; }
.row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .icon, h2.with-icon .icon { color: var(--text); }

/* ---- buttons added for the live screen ---- */
.btn-danger-outline { background: var(--surface); color: var(--text); border: 2px solid var(--danger); }

/* ---- live screen (issue #4 › Live screen design) ----
   Tier 1 (3 m): phase block + word + countdown. Tier 2 (1–2 m): station line, SWAP / mode
   lines. Tier 3 (arm's length): cards, Next, teammates, demo link, Leave class.
   Portrait display sizes use min(vw, svh) so they never overflow short or wide screens. */
.app.app-live { max-width: 560px; gap: 8px; }
.app.app-live .hdr { font-size: 14px; }
.app.app-live .screen-main, .app.app-live .screen-body { gap: 6px; }
/* The coach bar reaches the bottom edge, so a toast measures it and sits above it. */
.app.app-live .screen-main:has(.coach-bar:not([hidden])) { padding-bottom: 0; }
.live { display: flex; flex-direction: column; gap: 6px; }
.live-alerts { display: flex; flex-direction: column; gap: 8px; }
.live-alerts:not(:has(> :not([hidden]))) { display: none; }
.live-alerts > .btn { min-height: 48px; letter-spacing: .06em; }
.live-grid { display: flex; flex-direction: column; gap: 8px; }
.live-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.phase-block {
  --fill: var(--accent);
  background: var(--fill); color: var(--on-accent);
  border-radius: 12px; padding: 12px 16px 16px;
  height: clamp(220px, 40svh, 380px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  overflow: hidden;
}
.phase-block[data-tone="work"] { --fill: var(--accent); }
.phase-block[data-tone="finisher"] { --fill: var(--finisher); }
.phase-block[data-tone="rest"] { --fill: var(--rest); }
.phase-block[data-tone="paused"] { --fill: var(--paused); }
.phase-block[data-tone="done"] { --fill: var(--done); }
.phase-block[data-tone="sync"] { --fill: var(--surface); color: var(--text); border: 1px solid var(--line); }
.pb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-height: 1em; }
.pb-word {
  font: italic 800 min(11vw, 7svh, 52px)/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; flex: none;
}
.pb-badge {
  flex: 0 1 auto; min-width: 0; padding: 4px 10px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  font: 600 12px/1.2 "Barlow", "Helvetica Neue", Arial, sans-serif; text-align: right;
}
/* While the offline / back-online badge shows, the phase word steps down so the word stays
   on one line and the badge fits beside it in two lines; the countdown never moves. */
.pb-top:has(> .pb-badge:not([hidden])) .pb-word { font-size: min(8vw, 5svh, 40px); }
.pb-clock {
  font: 800 max(25vw, min(40vw, 30svh, 224px))/.85 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  font-variant-numeric: tabular-nums; text-align: center; letter-spacing: -.01em; white-space: nowrap;
}
.phase-block[data-state="syncing"] .pb-clock, .phase-block[data-state="lobby"] .pb-clock {
  font: 600 20px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; letter-spacing: 0;
}
.pb-next {
  min-height: 1.2em; text-align: center;
  font: 800 min(7vw, 4.5svh, 32px)/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .06em; text-transform: uppercase;
}
.pb-next[hidden] { display: block !important; visibility: hidden; } /* keeps the block from moving */
/* A native <progress>: the track is the fill colour at 22 %, the value solid. */
.pb-bar {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 4px;
  overflow: hidden; background: color-mix(in srgb, var(--on-accent) 22%, transparent); color: var(--on-accent);
}
.pb-bar::-webkit-progress-bar { background: color-mix(in srgb, var(--on-accent) 22%, transparent); }
.pb-bar::-webkit-progress-value { background: var(--on-accent); }
.pb-bar::-moz-progress-bar { background: var(--on-accent); }
/* steps with the tick: no transition, ever */

.st-line {
  display: flex; align-items: center; gap: 10px;
  font: 800 min(9vw, 5.5svh, 44px)/1.05 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .02em;
}
.st-line .icon { color: var(--text); }
.swap-line {
  font: 800 min(8vw, 5svh, 40px)/1.05 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  color: var(--accent); letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.mode-line { font: 600 20px/1.2 "Barlow", "Helvetica Neue", Arial, sans-serif; color: var(--text); }
.hint { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }

/* Movement cards (D-029; components/cards.js): move · dose · W/M load row · note. The note and
   the W / M labels are the only muted text. Landscape: dose + load share one line. */
.card {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 10px; border-radius: 10px; background: var(--surface); color: var(--text);
}
.card .icon { color: var(--text); }
.card-a { border-left: 4px solid var(--accent); }
.card-b { border: 1px solid var(--line); }
.card-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card-move {
  font: 800 20px/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .02em; text-transform: uppercase;
}
.card-meta { display: flex; flex-direction: column; gap: 1px; }
.card-dose { font: 600 17px/1.25 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.card-load { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 18px; }
.card-wm { white-space: nowrap; }
.card-lbl { font: 600 15px/1 "Barlow", "Helvetica Neue", Arial, sans-serif; color: var(--muted); }
.card-val {
  font: 800 20px/1.15 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: .02em; text-transform: uppercase;
}
.card-sep { display: none; color: var(--muted); }
.card-note { font: 400 15px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; color: var(--muted); }
@media (orientation: landscape) and (max-height: 500px) {
  .card-meta { display: block; }
  .card-load, .card-wm { display: inline; }
  .card-sep { display: inline; }
}

.next-line { display: flex; flex-direction: column; gap: 2px; }
.next-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font: 600 18px/1.2 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase;
}
.next-head .icon { color: var(--muted); }
.with { font-size: 17px; }
/* Demo →: a link() (it leaves the app), its tap target 44 px tall. */
.demo-line { display: flex; font-size: 17px; }
.demo-line .link { display: inline-flex; align-items: center; min-height: var(--tap); }
.leave-area { margin-top: var(--s-5); }
.confirm-row { display: flex; flex-direction: column; gap: 8px; }
.confirm-prompt { min-height: 52px; display: flex; align-items: center; font-weight: 600; font-size: 17px; }
.run-strip {
  padding: 8px 12px; border-radius: 8px; background: var(--surface); border-left: 4px solid var(--accent);
  font: 700 15px/1.3 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase;
}
.run-strip:empty { display: none; }

/* Coach bar: sticky at the bottom, buttons ≥ 56 px tall with ≥ 12 px between. */
.coach-bar {
  position: sticky; bottom: 0; z-index: 2; margin: 8px calc(-1 * max(16px, env(safe-area-inset-left))) 0;
  padding: 12px max(16px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.coach-bar:empty { display: none; }
.bar-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.coach-bar .btn { min-height: 56px; }
.coach-bar .confirm-prompt { min-height: 0; }
.coach-bar .pair { gap: 12px; }
.live-coach .live-side { padding-bottom: 8px; }
/* The coach's own controls stay usable while a cue overlay (z-index 10) is up. */
.live-coach .coach-bar { z-index: 11; }

/* Overlays: full screen, phase fill, --on-accent text; aria-hidden; never a button. */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh;
  padding: 24px; text-align: center;
  background: var(--accent); color: var(--on-accent);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.overlay[data-tone="finisher"] { background: var(--finisher); }
.overlay[data-tone="rest"] { background: var(--rest); }
.overlay[data-tone="paused"] { background: var(--paused); }
.overlay[data-tone="done"] { background: var(--done); }
.ov-word { font: italic 800 min(22vw, 20svh)/.95 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.overlay[data-kind="swap"] .ov-word { font-size: min(34vw, 30svh); }
.ov-detail { font: 800 min(8vw, 7svh)/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .02em; }
.ov-clock { font: 800 min(12vw, 10svh)/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; font-variant-numeric: tabular-nums; }

/* Landscape phone: two equal columns; the phase block fills the left at full height,
   only the right column scrolls. The app never locks orientation. */
@media (orientation: landscape) and (max-height: 500px) {
  .app.app-live {
    max-width: none; height: 100svh; overflow: hidden;
    padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .app.app-live .screen, .app.app-live .screen-main, .app.app-live .screen-body, .app.app-live .live { flex: 1; min-height: 0; }
  .app.app-live .screen-main { padding-bottom: 0; }
  .live-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .phase-block { height: 100%; min-height: 0; }
  .pb-word { font-size: min(6vw, 11svh); }
  .pb-top:has(> .pb-badge:not([hidden])) .pb-word { font-size: min(4.5vw, 8svh); }
  /* min(24vw, 55svh) per spec, capped so "10:00" still fits half the screen on one line */
  .pb-clock { font-size: min(24vw, 55svh, calc(20vw - 20px)); }
  .pb-next { font-size: min(4vw, 7svh); }
  .live-side { overflow-y: auto; min-height: 0; padding-right: 4px; }
  .live-side .st-line { font-size: min(5vw, 9svh); }
  .live-side .swap-line { font-size: min(4.5vw, 8svh); }
  .live-side .card-dose, .live-side .with, .live-side .mode-line { font-size: 16px; }
  .live-side .card-move, .live-side .card-val, .live-side .next-head { font-size: 16px; }
  .live-coach .live-grid { padding-bottom: 0; }
  /* A toast stays in the right-hand column: never over the countdown or the phase word. */
  .app.app-live ~ .toast { left: calc(50% + var(--s-2)); max-width: none; }
  .coach-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}

/* ---- end screen (#6; DESIGN.md › End): the DONE / ENDED block compacts and the optional
   rating sits under it. One column, capped at 480 px, in both orientations. ---- */
.app.app-live:has(.live-end) { max-width: 480px; }
.live-end .phase-block { height: 120px; justify-content: center; gap: var(--s-1); padding: var(--s-3) var(--s-4); }
.live-end .pb-word { font-size: 40px; }
.live-end .pb-top:has(> .pb-badge:not([hidden])) .pb-word { font-size: 32px; }
.live-end .pb-clock, .live-end .pb-bar { display: none; }
.live-end .pb-next { min-height: 0; text-align: left; font: 600 20px/1.2 "Barlow", "Helvetica Neue", Arial, sans-serif; letter-spacing: 0; text-transform: none; }
.live-end .live-side { gap: var(--s-3); }
.end-sum { color: var(--muted); font: 600 16px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.logged {
  display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
}
.logged-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--tap); }
.logged-title { color: var(--done); font: italic 800 32px/1.05 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.logged-title .name { font: italic 600 24px/1.1 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.logged-line { font: 600 17px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.logged-status { color: var(--muted); font: 400 15px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.end-proxies { margin-top: var(--s-1); }
.proxy-card {
  display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
}
.proxy-title { font: 800 22px/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.proxy-title .name { font-size: 20px; }
.proxy-foot { display: flex; justify-content: flex-end; }
.proxy-done { font: 600 17px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.proxy-done .name { font-weight: 600; }
@media (orientation: landscape) and (max-height: 500px) {
  /* The block becomes a 56 px strip (DONE  Nice work. … 4 stations · 36:30) so the legend
     and both rows of the scale stay above the fold at 640 × 360. */
  .app.app-live:has(.live-end) { height: auto; overflow: visible; }
  .live-end .live-grid { display: flex; flex-direction: column; gap: var(--s-2); position: relative; }
  .live-end .phase-block { height: 56px; flex: none; flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--s-3); padding: 0 var(--s-4); }
  .live-end .pb-top { min-height: 0; align-items: center; }
  .live-end .pb-word, .live-end .pb-top:has(> .pb-badge:not([hidden])) .pb-word { font-size: 28px; }
  .live-end .pb-next { font-size: 17px; }
  .live-end .live-side { overflow: visible; padding-right: 0; gap: var(--s-2); }
  .live-end .end-sum { position: absolute; top: 0; right: var(--s-4); height: 56px; display: flex; align-items: center; color: var(--on-accent); }
}
@media (prefers-reduced-motion: no-preference) {
  .end-liked { animation: fade 150ms ease-out; } /* the liked row appears: an opacity fade only */
}

/* ---- coach: ratings card (#6): counts, then a summary only in batches of 3 ---- */
.rate-card { gap: var(--s-2); }
.rate-count { font: 600 17px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.rate-note { color: var(--muted); font: 400 15px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.rate-mean { display: flex; align-items: baseline; gap: var(--s-2); }
.rate-avg { font: 800 48px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.rate-avg-lbl { color: var(--muted); font-size: 14px; }
.rate-med, .rate-liked { font: 600 16px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; }
/* 11 columns, 4 px gaps, a 64 px plot: the count over each non-zero bar, 0–10 under. */
.rate-hist { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; align-items: end; }
.rate-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 84px; }
.rate-n { font: 700 14px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.rate-bar { width: 100%; height: 2px; background: var(--line); }
.rate-bar:not([data-h="0"]) { background: var(--muted); border-radius: 3px 3px 0 0; }
.rate-bar[data-h="1"] { height: 4px; }
.rate-bar[data-h="2"] { height: 8px; }
.rate-bar[data-h="3"] { height: 12px; }
.rate-bar[data-h="4"] { height: 16px; }
.rate-bar[data-h="5"] { height: 20px; }
.rate-bar[data-h="6"] { height: 24px; }
.rate-bar[data-h="7"] { height: 28px; }
.rate-bar[data-h="8"] { height: 32px; }
.rate-bar[data-h="9"] { height: 36px; }
.rate-bar[data-h="10"] { height: 40px; }
.rate-bar[data-h="11"] { height: 44px; }
.rate-bar[data-h="12"] { height: 48px; }
.rate-bar[data-h="13"] { height: 52px; }
.rate-bar[data-h="14"] { height: 56px; }
.rate-bar[data-h="15"] { height: 60px; }
.rate-bar[data-h="16"] { height: 64px; }
.rate-axis { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ==== UI kit (js/ui/components/; app/UI.md, D-034) ======================================
   One block per component, in UI.md's catalogue order. Colours via tokens only; sizes,
   radii, spacing and motion via the tokens.css tokens wherever one fits. */

/* -- screen (components/screen.js; UI.md › Screen anatomy): the header, the body with its
   one question or job, and the pinned footer. The body's last block keeps clear of the
   bottom edge; a screen with a footer leaves that to the footer. -- */
.screen { flex: 1; display: flex; flex-direction: column; }
.screen-main { display: flex; flex-direction: column; gap: var(--s-3); padding-bottom: var(--s-6); }
.screen:has(> .footer) > .screen-main { padding-bottom: var(--s-4); }
.screen-title {
  font: 800 32px/1.05 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  text-transform: uppercase; letter-spacing: .02em;
}
.screen-title .name { font: 600 26px/1.15 "Barlow", "Helvetica Neue", Arial, sans-serif; text-transform: none; letter-spacing: 0; }
/* You're set: the start station as the headline (40 px icon, as on the live screen). */
.screen-headline { display: flex; align-items: center; gap: 10px; font-size: min(9vw, 5.5svh, 44px); }
.screen-headline .icon { color: var(--text); }
.screen-muted { color: var(--muted); }
.overline {
  font: 700 13px/1.2 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: calc(-1 * var(--s-1));
}
.screen-lead, .screen-body { display: flex; flex-direction: column; }
.screen-lead { gap: var(--s-2); }
.screen-body { gap: var(--s-3); }
.screen-lead:empty, .screen-alert:empty { display: none; }

/* -- button: compact secondary pill (Change) -- */
.btn-compact {
  display: inline-flex; flex: none; width: auto; align-self: flex-start; min-height: var(--tap);
  padding: 0 var(--s-4); border-radius: var(--r-pill); font-size: 15px; letter-spacing: .1em;
}

/* -- chip: header pill, icon + word or number -- */
.chip {
  display: inline-flex; align-items: center; gap: var(--s-2); flex: none; min-height: var(--tap); padding: 0 var(--s-3);
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font: 700 15px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .08em;
  text-transform: uppercase; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.chip-loading { color: var(--muted); }
.chip-offline { color: var(--muted); background: none; }
.chip-dot { width: var(--s-2); height: var(--s-2); border-radius: 50%; background: var(--muted); flex: none; }

/* -- header: the class label (or Back) left, chips right; when both don't fit on one
   line the chips wrap to their own right-aligned row and the label keeps one line -- */
.header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-2);
  min-height: calc(var(--tap) + 2 * var(--s-2)); padding: var(--s-2) 0; /* border-box: one row stays 60 px */
}
.header-label {
  flex: 1 0 auto; max-width: 100%; min-width: 0; font: 700 13px/1.2 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.header-chips { display: flex; gap: var(--s-2); flex: none; margin-left: auto; }
.back {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding: 0 var(--s-2) 0 0;
  background: none; border: 0; color: var(--text); font: 600 16px/1 "Barlow", "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
}

/* -- footer: every pinned bottom bar; one primary button, a confirm pair, or a status -- */
.footer {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: var(--s-3); min-height: calc(var(--btn) + 2 * var(--s-3));
  margin: auto calc(-1 * max(var(--s-4), env(safe-area-inset-right))) 0 calc(-1 * max(var(--s-4), env(safe-area-inset-left)));
  padding: var(--s-3) max(var(--s-4), env(safe-area-inset-right)) max(var(--s-3), env(safe-area-inset-bottom)) max(var(--s-4), env(safe-area-inset-left));
  background: var(--bg); border-top: 1px solid var(--line);
}
.footer > .btn { flex: 1; }
.footer-confirm, .footer-choice, .footer-noted { flex-direction: column; align-items: stretch; gap: var(--s-2); }
.footer-note { color: var(--text); }
.footer-prompt { font-weight: 600; }
.footer-status { font-weight: 600; }
.footer-muted { color: var(--muted); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

/* -- row variants: alt (Solo: outlined, icon in a circle, second line), second line, › -- */
.row-alt { background: none; border-color: var(--muted); }
.row-badge {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
}
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-sub { color: var(--muted); font-size: 15px; }
/* Status and › sit together on the right: whichever comes first takes the free space. */
.row-status { margin-left: auto; }
.row-chev { display: flex; flex: none; margin-left: auto; }
.row-status + .row-chev { margin-left: 0; }
.row .row-chev .icon { color: var(--muted); }

/* -- pick grid: a one-tap answer where the tap is the answer (the effort scale, Did you
   like it?): a fieldset, its legend and hint, rows of 3, 5 or 6 equal buttons, optional
   anchors under a row. :active is the only press feedback; nothing stays selected. -- */
.pick { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; }
.pick-legend {
  padding: 0; margin-bottom: var(--s-1); color: var(--text);
  font: 800 22px/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .02em; text-transform: uppercase;
}
.pick-hint { margin-bottom: var(--s-2); color: var(--muted); font: 400 16px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.pick-row, .pick-anchors { display: grid; gap: var(--s-2); }
.pick-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pick-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pick-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pick-btn {
  display: flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--row); padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--text);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pick-btn:active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pick:disabled .pick-btn { background: var(--surface); border-color: var(--line); color: var(--muted); cursor: default; }
.pick-num { font: 800 28px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.pick-tile { flex-direction: column; gap: var(--s-1); padding: var(--s-2) var(--s-1); }
.pick-word { font: 600 15px/1.2 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.pick-anchors { margin: var(--s-1) 0 var(--s-3); color: var(--muted); font: 600 13px/1.2 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.pick-anchors:last-child { margin-bottom: 0; }
/* Each anchor is centred on its column and may overhang the unlabelled ones beside it;
   the row's first is left-aligned to the row's edge, its last right-aligned. */
.pick-anchor { display: flex; justify-content: center; min-width: 0; }
.pick-anchor > span { flex: none; white-space: nowrap; }
.pick-anchor:first-child { justify-content: flex-start; }
.pick-anchor:last-child { justify-content: flex-end; }
.pick-compact .pick-row, .pick-compact .pick-anchors { gap: 6px; }

/* -- "or" divider -- */
.or {
  display: flex; align-items: center; gap: var(--s-3); margin: var(--s-1) 0; color: var(--muted);
  font: 700 13px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* -- alert line: a refusal, next to the choices -- */
.alert-line {
  display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--danger); border-radius: 0 var(--r-card) var(--r-card) 0;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px;
}
.alert-bang { color: var(--danger); font: 800 18px/1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif; }

/* -- toast: one at a time, above any pinned bar, never over the headline; tap to dismiss --
   --toast-bottom: how far up the highest pinned bar ([data-pinned="bottom"]) starts,
   measured by toast.js when the toast shows. */
.toast {
  position: fixed; z-index: 5; left: var(--s-3); right: var(--s-3);
  bottom: max(var(--s-4) + env(safe-area-inset-bottom), var(--toast-bottom, 0px) + var(--s-2));
  max-width: calc(480px - 2 * var(--s-3)); margin: 0 auto;
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-card); background: var(--text); color: var(--bg);
  font: 600 15px/1.3 "Barlow", "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 var(--s-2) var(--s-5) color-mix(in srgb, var(--bg) 60%, transparent);
  visibility: hidden; opacity: 0; transform: translateY(var(--s-3)); cursor: pointer;
  pointer-events: none; /* from the moment it starts fading, taps go through */
}
.toast-on { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
/* While a sheet is open the toast lives inside it (the page is inert), at the top of the
   screen over the dimmed page, so it never covers the sheet's own content. */
.sheet .toast { top: max(var(--s-3), env(safe-area-inset-top)); bottom: auto; transform: translateY(calc(-1 * var(--s-3))); }
.sheet .toast-on { transform: none; }
.toast .icon { color: var(--bg); }
.toast-text { min-width: 0; }
/* The part that changed, once (toast.js flash()): a --line fill and a --muted inner ring
   that fade. Both differ from --surface, so rows, cards and sheet content flash too. */
.flash { animation: flash 1.2s ease-out; }

/* -- sheet: a bottom sheet on the native <dialog>; its body scrolls, the page never moves -- */
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: 85svh;
  padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface); color: var(--text); overflow: hidden;
}
.sheet::backdrop { background: var(--bg); opacity: .7; }
.sheet-inner { display: flex; flex-direction: column; max-height: 85svh; }
.sheet-grab { flex: none; width: 40px; height: var(--s-1); margin: var(--s-2) auto 0; border-radius: 2px; background: var(--line); }
.sheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) max(var(--s-2), env(safe-area-inset-right)) var(--s-2) max(var(--s-4), env(safe-area-inset-left));
}
.sheet-title {
  min-width: 0; font: 800 24px/1.1 "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: .03em; text-transform: uppercase;
}
/* A member's name in the title stays as typed. */
.sheet-title .name { font: 600 1.25rem/1.25 "Barlow", "Helvetica Neue", Arial, sans-serif; }
.sheet-x {
  flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: var(--bg); color: var(--text); cursor: pointer;
}
/* The body is a plain block: its content brings its own layout (.stack, .list, …). */
.sheet-body {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 max(var(--s-4), env(safe-area-inset-right)) max(var(--s-5), env(safe-area-inset-bottom)) max(var(--s-4), env(safe-area-inset-left));
}

/* -- link: the only underline (a link that leaves the app) -- */
.link { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* -- kit motion: none under reduced motion -- */
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 1.8s ease-in-out infinite; }
  .sheet[open] { animation: sheet-up var(--t-sheet) cubic-bezier(.2, .8, .2, 1); }
  .toast { transition: opacity var(--t-toast), transform var(--t-toast), visibility var(--t-toast); }
}
/* Reduced motion: the flash holds its fill, then clears, without fading. */
@media (prefers-reduced-motion: reduce) {
  .flash { animation-timing-function: steps(1, end); }
}
@keyframes pulse { 50% { opacity: .3; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes flash { from { background-color: var(--line); box-shadow: inset 0 0 0 2px var(--muted); } }

/* ---- motion: a 150 ms opacity fade on screens and overlays, none with reduced motion
   (the UI kit block above holds its own sheet, toast and pulse motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  .screen-main { animation: fade 150ms ease-out; } /* a new screen fades in; a re-render keeps its <main> */
  .overlay:not([hidden]) { animation: fade 150ms ease-out; } /* only on appear; a replacement does not re-fade */
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
