:root {
  --bg: #f6f8f8;
  --card: #ffffff;
  --text: #13201f;
  --muted: #5b6b69;
  --line: #dde5e4;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e0f2f0;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --good: #15803d;
  --good-soft: #dcfce7;
  --radius: 12px;
  --tap: 48px;
  /* fonts: a coach's custom stylesheet may set these (docs/BRANDING.md) */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: var(--font-body);
  color-scheme: light dark;
}
/* Dark: the device's setting unless Profile → Appearance picks light;
   always when it picks dark (js/theme.js sets data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1416;
    --card: #132022;
    --text: #e6efee;
    --muted: #93a7a4;
    --line: #22383a;
    --accent: #2dd4bf;
    --accent-ink: #062b27;
    --accent-soft: #123a36;
    --warn: #fbbf24;
    --warn-soft: #3a2d0b;
    --bad: #f87171;
    --bad-soft: #3b1414;
    --good: #4ade80;
    --good-soft: #10301b;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1416;
  --card: #132022;
  --text: #e6efee;
  --muted: #93a7a4;
  --line: #22383a;
  --accent: #2dd4bf;
  --accent-ink: #062b27;
  --accent-soft: #123a36;
  --warn: #fbbf24;
  --warn-soft: #3a2d0b;
  --bad: #f87171;
  --bad-soft: #3b1414;
  --good: #4ade80;
  --good-soft: #10301b;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.45 var(--font-body);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.2; margin: 0.2em 0 0.5em; font-family: var(--font-heading); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 140px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* A page title with a button beside it; the button is taller than the title, so the row needs its own gap below. */
.page-head { margin-bottom: 12px; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.hidden { display: none !important; }

#top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600;
}
/* a coach's logo (js/brand.js): wide, at most 40 px tall */
#title { display: flex; align-items: center; gap: 10px; min-width: 0; }
#title .brand-logo { display: block; flex: none; max-height: 40px; max-width: min(40vw, 200px); object-fit: contain; }
#title .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sync { font: inherit; font-size: 0.8rem; background: rgba(0,0,0,.18); color: inherit; padding: 2px 10px; border: 0; border-radius: 999px; min-height: 0; cursor: default; }
#sync[hidden] { display: none; }
/* writes that stopped, or a workout saved in two places: tap to sort out (app.js) */
#sync.attn { background: #b45309; color: #fff; font-weight: 600; cursor: pointer; }
.copy-card { margin: 8px 0; }
.copy-card p { margin: 2px 0; }
.copy-sets { margin: 4px 0 0; padding-left: 18px; }
/* "A new version is ready" (app.js) */
#update { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: 12px; background: #1f2937; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#update button { min-height: 36px; }
.top-right { display: flex; align-items: center; gap: 8px; }
/* The public site's header links and Sign in (views/site.js) */
#title .site-home { color: inherit; text-decoration: none; }
#sitenav { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 12px; font-weight: 500; }
#sitenav a { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
#sitenav a:hover, #sitenav a:focus-visible { background: rgba(0,0,0,.16); }
#top .site-signin { background: transparent; border: 1px solid currentColor; color: inherit; font-weight: 600; }
#top .site-signin:hover { background: rgba(0,0,0,.16); }
@media (max-width: 640px) {
  /* the links move under the name, in a row of their own */
  #top { flex-wrap: wrap; }
  #sitenav { order: 3; width: 100%; margin: 6px 0 0 -10px; font-size: .9rem; }
}
/* ...and its footer */
#foot { max-width: 960px; margin: 32px auto 0; padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); }
#foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 10px; }
#foot a { color: var(--accent); text-decoration: none; }
#foot a:hover { text-decoration: underline; }
#foot p { margin: 0; }
#signout, #help { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 0; padding: 0; margin: -8px -8px -8px 0;
  background: transparent; border: 0; border-radius: 50%; color: var(--accent-ink); }
#help { margin-right: -4px; }
#signout:hover, #signout:focus-visible, #help:hover, #help:focus-visible { background: rgba(0,0,0,.18); }
#signout[hidden], #help[hidden] { display: none; }

/* #/brand: the coach's colour and logo (views/brand.js) */
.brand-swatches { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.brand-swatch { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.brand-hex { width: 9ch; font-family: ui-monospace, monospace; }
input[type=color] { width: 48px; height: 40px; padding: 2px; }
.brand-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
@media (max-width: 480px) { .brand-previews { grid-template-columns: 1fr; } }
.brand-preview { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bp-top { background: var(--accent); color: var(--accent-ink); padding: 10px 12px; font-weight: 600; min-height: 20px; }
.bp-top img { display: block; max-height: 32px; max-width: 100%; }
.bp-body { padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.brand-backgrounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 4px; }
.brand-bg { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; }
.brand-bg.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bp-mode { display: block; padding: 6px 12px 0; }
.bp-card { flex: 1 1 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.bp-chip { background: var(--accent-soft); color: var(--text); padding: 2px 10px; border-radius: 999px; font-size: 0.9rem; }
/* #/history (views/history.js) */
.history-month { margin: 18px 0 6px; }
.history-row { display: block; }
.history-comment { margin-top: 4px; font-style: italic; }
.history-sets { margin: 4px 0 0; padding-left: 1.4em; }
.history-sets li { padding: 2px 0; }

/* #/coach-sheet/:id (views/brandsheet.js) */
.sheet-css { width: 100%; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.sheet-findings { white-space: pre-wrap; font-size: 0.85rem; padding: 8px 10px; border-radius: 8px; background: var(--good-soft); }
.sheet-findings.bad { background: var(--bad-soft); }
.request-logo { display: block; margin: 0 auto; max-height: 64px; max-width: min(80vw, 320px); }
.brand-logo-current { display: block; max-height: 40px; max-width: 100%; margin-bottom: 10px; }

/* #/help: the user manual */
.manual details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.manual details[open] > summary { margin-bottom: 8px; }
.manual ol, .manual ul { padding-left: 1.3em; }
.manual li + li { margin-top: 6px; }

main { max-width: 960px; margin: 0 auto; padding: 16px; }

#tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs a {
  flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 0.8rem; gap: 2px;
}
#tabs a .ico { font-size: 1.3rem; line-height: 1; }
#tabs a.active { color: var(--accent); font-weight: 600; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.card.link { cursor: pointer; }
.card.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card h3 { margin-top: 0; }

button, .btn {
  min-height: var(--tap); padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
button.small, .btn.small { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
button.block, .btn.block { width: 100%; }
button:disabled { opacity: 0.5; cursor: default; }

label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--text); font-size: 1rem; }
.field { margin-bottom: 12px; }

.chip { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.card.warn { border-color: var(--warn); background: var(--warn-soft); }
.request-row { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; gap: 8px; flex-wrap: wrap; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.gray { background: var(--line); color: var(--muted); }

.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.subtabs button { min-height: 38px; white-space: nowrap; }
.subtabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.stat { font-size: 1.6rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

/* workout logger */
.exercise { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.exercise:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.prescription { font-size: 0.9rem; color: var(--muted); }
.setrow { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 56px; gap: 6px; align-items: center; margin-top: 6px; }
.setrow input { min-height: 52px; text-align: center; font-size: 1.1rem; padding: 6px; }
.setrow .n { text-align: center; color: var(--muted); font-weight: 600; }
.setrow .done { min-height: 52px; padding: 0; font-size: 1.4rem; }
.setrow.is-done input { background: var(--good-soft); }
.setrow.is-done .done { background: var(--good); border-color: var(--good); color: #fff; }
/* Trim: two range inputs over one track; only their thumbs take pointer input. */
.trim { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.trim-range { position: relative; height: 44px; }
.trim-track { position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--line); }
.trim-sel { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.trim-range input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 44px; min-height: 0; margin: 0; padding: 0; border: 0;
  background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.trim-range input[type="range"]::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.trim-range input[type="range"]::-moz-range-track { background: transparent; }
.trim-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 22px; height: 40px; margin-top: 2px;
  border-radius: 6px; border: 3px solid var(--accent); background: var(--card); cursor: ew-resize;
}
.trim-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 16px; height: 34px; border-radius: 6px; border: 3px solid var(--accent); background: var(--card); cursor: ew-resize;
}
.trim-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent-soft); }
.trim-range input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--accent-soft); }
.rec-time { font-weight: 600; font-variant-numeric: tabular-nums; }
/* Coach video review queue */
.queue-item { display: flex; gap: 12px; align-items: flex-start; }
.queue-item .thumb { flex: 0 0 72px; width: 72px; height: 96px; min-height: 0; padding: 0; overflow: hidden; display: grid; place-items: center; background: #000; color: #fff; font-size: 1.4rem; border-radius: 10px; }
.queue-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-body { flex: 1; min-width: 0; }
#tabs a { position: relative; }
#tabs .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; }
/* Password box with an eye toggle inside it; sign-up page */
.pw { position: relative; }
.pw input { padding-right: 52px; }
/* Edge/IE add their own reveal button; ours replaces it. */
.pw input::-ms-reveal, .pw input::-ms-clear { display: none; }
.pw .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pw .eye[aria-pressed="true"] { color: var(--accent); }
input[readonly] { color: var(--muted); }
.auth-page { max-width: 480px; margin: 0 auto; padding-top: 6vh; display: flex; flex-direction: column; gap: 12px; }
.auth-page > img { align-self: center; }
.videobar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
video.player { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
.sethead { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 56px; gap: 6px; font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 8px; }
.setrow.cardio, .sethead.cardio { grid-template-columns: 34px 1fr 1fr 1fr 1fr 56px; }
.card.phase-warmup, .card.phase-post { border-left: 4px solid var(--accent); }
.warmup-list { margin: 6px 0 10px; padding-left: 18px; }
.warmup-list li { margin: 4px 0; }
.block-card.phase-warmup, .block-card.phase-post { border-style: dashed; }
.phase-pick { margin-bottom: 6px; gap: 4px; }

/* overlays */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 18px; } }
.timer-big { font-size: 4.5rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer-phase { text-align: center; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.timer-phase.work { color: var(--good); }
.timer-phase.rest { color: var(--warn); }

#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; pointer-events: none; }
#toast div { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; margin-top: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.25); max-width: 90vw; }
#toast div.error { background: var(--bad); color: #fff; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; background: var(--c); vertical-align: -1px; }

/* program builder */
.cal { display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 0.8rem; }
.cal .wk { display: flex; flex-direction: column; justify-content: center; color: var(--muted); font-weight: 600; }
.cal .day { min-height: 56px; border: 1px dashed var(--line); border-radius: 8px; padding: 4px; cursor: pointer; overflow: hidden; background: var(--card); }
.cal .day.has { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.cal .day.sel { box-shadow: 0 0 0 2px var(--accent); }
.cal .day .w { display: block; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .hd { text-align: center; color: var(--muted); font-weight: 600; }
.block-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 10px 0; background: var(--bg); }
.item-card { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.item-grid label { font-size: 0.75rem; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--line); }
.thread .msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; margin: 6px 0; background: var(--card); border: 1px solid var(--line); }
.thread .msg.mine { margin-left: auto; background: var(--accent-soft); border-color: transparent; }
.thread .meta { font-size: 0.75rem; color: var(--muted); }
.banner { padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); margin-bottom: 12px; }
.body-fig { max-width: 160px; margin: 0 auto; display: block; }
.body-fig .site { fill: var(--line); }
.body-fig .site.on { fill: var(--accent); }
.body-fig .outline { fill: none; stroke: var(--muted); stroke-width: 2; }

/* Coach profiles and the public directory (views/coachprofile.js, views/directory.js). */
.checks { display: flex; flex-wrap: wrap; gap: 0 16px; }
.checks .check { flex: 1 1 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.coach-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.coach-photo.large { width: 112px; height: 112px; }
a.coach-card { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; }
a.coach-card .grow { flex: 1; min-width: 0; }
.coach-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.coach-head h1 { margin: 0 0 4px; }
.coach-head p { margin: 0 0 4px; }

/* ⓘ buttons that explain a term (ui.js infoButton, effort.js). The visible
   circle is small; the padding keeps the tap target comfortable. */
.label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.label-row label { margin: 0; }
button.info { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; min-height: 0; padding: 0; margin-left: 4px;
  border-radius: 50%; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: italic 700 0.75rem/1 Georgia, serif; vertical-align: middle; position: relative; margin-block: -4px; }
button.info::after { content: ''; position: absolute; inset: -12px; }
.sethead button.info { margin-left: 3px; }
table.scale { width: 100%; border-collapse: collapse; margin: 8px 0; }
table.scale th, table.scale td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.scale td:first-child { font-weight: 700; white-space: nowrap; }
table.scale td { overflow-wrap: anywhere; vertical-align: top; }
/* an info sheet never runs wider than the screen; anything that still can't fit scrolls sideways */
.sheet { overflow-x: auto; }

/* The client's note on an exercise and their 1-5 workout rating (workout.js), and how the coach sees them (coach.js). */
textarea.exnote { min-height: 0; margin-top: 8px; font-size: 0.9rem; }
.exnote-view { margin-top: 4px; white-space: pre-wrap; }
/* Running an in-person client's session (tasks/inperson): whose it is, big, and what they did last time. */
.run-head { margin: 6px 0 2px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.run-name { font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.lasttime { margin-top: 2px; color: var(--muted); }
.summary-text { margin: 0; white-space: pre-wrap; font: inherit; line-height: 1.5; }
/* Print: the session summary alone. */
@media print {
  body.print-summary * { visibility: hidden; }
  body.print-summary .summary-text, body.print-summary .summary-text * { visibility: visible; }
  body.print-summary .summary-text { position: absolute; inset: 0 auto auto 0; padding: 24px; color: #000; }
}
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; min-height: var(--tap); font-size: 0.75rem; line-height: 1.2; }
.rating button .face { font-size: 1.5rem; line-height: 1; }
.rating button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* The coach's messages page (views/messages.js). */
.thread-card.unread { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thread-card .msg { margin: 8px 0; }
.thread-card textarea { margin-top: 8px; min-height: 70px; }

/* The coach's review screen (views/review.js) and replies on the client's side. */
.review-src { display: none; }
.review-canvas { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; border-radius: 10px; }
.review-controls { margin: 10px 0 12px; }
.review-controls input[type=range] { width: 100%; margin: 8px 0 4px; }
.review-controls .speeds { gap: 4px; }
.review-controls .speeds button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.review-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.seg { padding: 4px 0; border-bottom: 1px solid var(--line); }
button.reply { border-color: var(--accent); color: var(--accent); }
button.reply.new { background: var(--accent); color: var(--accent-ink); }
@media (hover: none) { .review-controls .keys { display: none; } }

/* Photos and voice notes in messages (views/comments.js). */
.msg-photo { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: 8px; margin: 4px 0; cursor: zoom-in; object-fit: cover; }
.msg-photo-full { display: block; width: 100%; max-height: 75vh; object-fit: contain; border-radius: 8px; margin-bottom: 10px; }
.msg-voice { display: block; width: min(300px, 100%); margin: 4px 0; }
.msg-video { display: block; width: min(320px, 100%); max-height: 420px; border-radius: 8px; margin: 4px 0; background: #000; }
.voice-take { margin-top: 8px; }
.voice-take audio { width: 100%; }

/* The data agreement (views/consent.js). */
.consent { margin: 12px 0; }
.consent details { margin-bottom: 6px; }
.consent summary { cursor: pointer; color: var(--accent); padding: 10px 0; }
.consent ul { margin: 4px 0 8px; padding-left: 20px; }
.consent li { margin-bottom: 6px; }

/* Loads as a weight or % of 1RM (views/programs.js), and the maxes list (views/maxes.js). */
.item-grid .field:has(.load-input) { grid-column: span 2; }
.load-input { display: flex; gap: 6px; }
.load-input input { flex: 1; min-width: 0; }
.load-input select { flex: 0 0 auto; width: auto; }
.max-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.max-row:last-child { border-bottom: 0; }

/* Personal records (views/records.js). */
.pr-burst { font-size: 3.5rem; line-height: 1; margin: 8px 0 4px; animation: pr-pop 0.6s ease-out; }
@keyframes pr-pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pr-burst { animation: none; } }
.pr-list { padding-left: 20px; }
.pr-list li { margin-bottom: 6px; }

/* Progression rules and suggestions (views/progression.js). */
.rule { margin-top: 8px; }
.rule summary { cursor: pointer; color: var(--accent); padding: 6px 0; font-size: 0.9rem; }
.rule label { display: flex; flex-direction: column; gap: 4px; }
.suggestion { padding: 10px 0; border-bottom: 1px solid var(--line); }
/* AI proposals: what a program change does, line by line (views/proposals.js) */
.diff { margin: 4px 0; padding-left: 0; }
.diff li { list-style: none; font-variant-numeric: tabular-nums; }
.suggestion:last-child { border-bottom: 0; }
.suggestion input { width: 6em; }

/* Saved reply snippets (views/snippets.js). */
.snippet-wrap { position: relative; }
.snippet-wrap textarea { width: 100%; }
.snippet-pop { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--card, var(--bg)); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); overflow: hidden; }
.snippet-opt { padding: 10px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: var(--tap); box-sizing: border-box; }
.snippet-opt.on, .snippet-opt:hover { background: var(--accent-soft); }
.snippet-list { max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.snippet-row { display: flex; gap: 6px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.snippet-use { flex: 1; text-align: left; background: none; border: 0; padding: 10px 0; white-space: normal; }

/* What a message is about (MS-3, views/comments.js). */
.msg .about { display: inline-block; margin: 2px 0 4px; padding: 4px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; text-decoration: none; border: 0; min-height: 0; }
.card.focus { outline: 2px solid var(--accent); }

/* Filming guidance before a set video (VS-5, videos.js). */
.film-tip { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 0.9rem; }
.film-tip ul { margin: 6px 0 0; padding-left: 18px; }

/* The coach's alert inbox (views/alerts.js). */
.alerts { border-left: 4px solid var(--warn); }
.alert-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }

/* Weekly check-ins (views/checkins.js). */
.checkin-due { border-left: 4px solid var(--accent); }
.checkin-q { margin-bottom: 14px; }
.checkin-q > label { display: block; font-weight: 600; margin-bottom: 6px; }
/* the check-in's 1-10 picker; not table.scale, the explainer tables in info sheets */
div.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
div.scale button { min-width: 0; padding: 0; }
div.scale button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.table-wrap { overflow-x: auto; }
table.checkins { border-collapse: collapse; width: 100%; font-size: 0.875rem; background: var(--card); border-radius: 10px; }
table.checkins th, table.checkins td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.checkins thead th { white-space: nowrap; }

/* Day toggles (views/automation.js). */
.days { display: flex; flex-wrap: wrap; gap: 4px; }
.days button { min-width: 44px; }

/* Daily habits (views/habits.js). */
.habit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 6px; }
.habit { display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: left; padding: 12px; min-height: 88px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 400; }
.habit.done { border-color: var(--good); background: var(--good-soft); }
.habit .streak { color: var(--warn); font-weight: 600; }
.habit-count { flex-wrap: nowrap; gap: 4px; }
.habit-count input { flex: 1; min-width: 0; width: auto; text-align: center; }
.habit-count button { flex: 0 0 36px; padding: 0; }
.habit-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.habit-row:last-child { border-bottom: 0; }
.dots { display: flex; gap: 4px; margin-top: 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.dot.part { background: var(--warn-soft); border: 1px solid var(--warn); }
.dot.on { background: var(--good); }
/* food journal: totals against the coach's targets */
.meters { display: grid; gap: 6px; margin: 8px 0; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--good); }
.meter.over > span { background: var(--warn); }
.credit-row { margin: 6px 0; }
.recipe-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.team-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
/* a recipe's description in a list: two lines, the rest when it's opened */
.recipe-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0; }
.plan-day { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plan-today { margin: 8px 0; padding: 8px; border-radius: 10px; background: var(--accent-soft); }
.meal-line { display: block; text-align: left; margin: 4px 0; color: var(--muted); }

/* Drawing over the review video (views/draw.js). */
.draw-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0; }
.draw-bar button { min-width: 40px; }
.draw-bar button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.draw-bar .swatch { width: 32px; min-width: 32px; padding: 0; border: 2px solid var(--line); }
.draw-bar .swatch.on { outline: 3px solid var(--accent); outline-offset: 1px; }
.draw-bar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.review-canvas.drawing { touch-action: none; cursor: crosshair; }

/* Scheduling (views/sessions.js). */
.session-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.session-row:last-child { border-bottom: 0; }
.session-row.cancelled strong { text-decoration: line-through; color: var(--muted); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.avail-row { flex-wrap: nowrap; align-items: center; margin-bottom: 6px; }
.avail-row select { flex: 1 1 auto; min-width: 0; }
.avail-row input { flex: 0 1 110px; min-width: 0; }
.next-session { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; }

/* The progress report (views/report.js), on screen and printed. */
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; text-align: center; }
.report table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 8px; }
.report th, .report td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.report-notes { min-height: 90px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; white-space: pre-wrap; }
.report-notes:empty::before { content: attr(data-placeholder); color: var(--muted); }
@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #000; }
  #top, #tabs, .no-print, .toast, .sheet-backdrop { display: none !important; }
  #app { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
  .report-notes { border: 0; }
  .report-notes:empty { display: none; }
}

/* The starting point line (views/metrics.js). */
.start-point { margin: 0 0 8px; }
.linklike { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* Public landing page (views/landing.js). */
.landing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
/* The hero: a photo with the pitch over a dark fade, white text in either theme. */
.landing-hero { position: relative; overflow: hidden; border-radius: var(--radius); min-height: 420px; display: flex; align-items: flex-end; background: #0b1416; color: #fff; margin-bottom: 8px; }
.landing-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 25%; }
.landing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5,12,13,.88) 0%, rgba(5,12,13,.55) 45%, rgba(5,12,13,.1) 100%); }
.landing-hero .hero-text { position: relative; z-index: 1; padding: 24px 20px; max-width: 640px; }
.landing-hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.15; margin: 0 0 10px; color: #fff; }
.landing-hero p { color: rgba(255,255,255,.9); margin: 0 0 16px; }
.hero-actions { flex-wrap: wrap; gap: 8px; }
.btn.light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.55); color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.22); }
.landing-hero button.primary, .landing-hero .btn.primary { background: #2dd4bf; border-color: #2dd4bf; color: #062b27; }
/* The plans, side by side (views/coachplans.js): each card as tall as the
   tallest, its button at the foot */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; align-items: stretch; margin: 12px 0; }
.plans .plan { display: flex; flex-direction: column; margin: 0; }
.plan-price { font-size: 1.7em; line-height: 1.1; margin: 4px 0 8px; }
.plan-per { font-size: .55em; font-weight: 500; color: var(--muted); }
.plan-plus { font-weight: 600; margin-bottom: 0; }
.plan ul { padding-left: 18px; margin-top: 6px; }
.plan-action { margin-top: auto; padding-top: 8px; }
.plan-action:empty { display: none; }
.landing-grid.photos { grid-template-columns: 1fr; }
@media (min-width: 560px) { .landing-grid.photos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .landing-grid.photos { grid-template-columns: repeat(4, 1fr); } }
.card.feature { padding: 0; overflow: hidden; }
.card.feature img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card.feature h3, .card.feature p { margin-left: 14px; margin-right: 14px; }
.card.feature h3 { margin-top: 12px; }
.landing-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; align-items: start; margin: 24px 0 12px; scroll-margin-top: 16px; }
.landing-start > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.landing-start h2 { margin-top: 0; }
/* The AI assistant section (views/landing.js): photo beside the text, kept on phones */
.landing-ai { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; align-items: center; margin: 24px 0 12px; }
.landing-ai > img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.landing-ai h2 { margin-top: 0; }
.landing-ai ul { padding-left: 18px; }
/* Profile › AI activity (views/ai.js) */
.ai-log { padding-left: 18px; margin: 6px 0; }
/* Intake: the days a client can work out, one tap each */
.days-check { display: flex; flex-wrap: wrap; gap: 4px 14px; }
/* A required field's * (views/coachprofile.js). */
.req { color: var(--bad); font-weight: 600; }
/* Breadcrumb trail at the top of public pages (ui.js crumbs). */
.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
/* The features page (views/features.js): photo beside each section, alternating sides. */
.feature-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px 28px; align-items: center; margin: 28px 0; }
.feature-section > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.feature-section h2 { margin-top: 0; }
@media (min-width: 700px) { .feature-section.flip > img { order: 2; } }
.feature-list { padding-left: 1.2em; margin: 8px 0 0; }
.feature-list li { margin: 6px 0; }
.faq details { padding: 0; }
.faq summary { padding: 14px; cursor: pointer; font-weight: 600; }
.faq details p { margin: 0; padding: 0 14px 14px; }
/* On a phone the studio photo only pushes the form down. */
@media (max-width: 640px) {
  .landing-start > img { display: none; }
  .card.feature img { aspect-ratio: 16 / 9; }
  /* the photo above, the pitch below it: no room to put them side by side */
  .landing-hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .landing-hero > img { position: static; height: 230px; object-position: 75% 30%; }
  .landing-hero::after { display: none; }
  .landing-hero .hero-text { padding: 18px 16px 20px; }
}
/* ---- The public pages (signed out; views/site.js puts `site` on <body>):
   larger type, more room between sections, and tinted bands so a long page
   has a rhythm. The app itself, signed in, is as it was. */
body.site main { max-width: 1080px; font-size: 1.0625rem; line-height: 1.6; }
body.site #foot { max-width: 1080px; }
body.site main h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; }
body.site main h2 { font-size: clamp(1.4rem, 2.8vw, 1.85rem); font-weight: 800; letter-spacing: -0.015em; margin-top: 1.8em; }
body.site main h3 { font-size: 1.15rem; }
body.site main .card h2 { font-size: 1.3rem; margin-top: 0.2em; letter-spacing: 0; }
body.site main .small { font-size: 0.95rem; }
body.site main > p.muted { font-size: 1.1rem; }
body.site .landing-hero { min-height: 460px; margin-bottom: 12px; }
body.site .landing-hero .hero-text { padding: 32px 28px; max-width: 700px; }
body.site .landing-hero p { font-size: 1.1rem; }
/* bands: the AI section, getting started, and every other features section */
body.site .landing-ai, body.site .landing-start, body.site .feature-section.flip { background: var(--accent-soft); border-radius: 20px; padding: 28px; }
body.site .landing-ai, body.site .landing-start { margin: 56px 0 24px; }
body.site .landing-ai h2, body.site .landing-start h2, body.site .feature-section h2 { margin-top: 0; }
body.site .feature-section { margin: 56px 0; gap: 20px 36px; }
body.site .landing-grid { gap: 16px; margin-top: 20px; }
body.site .card { border-radius: 16px; }
/* the home page's plain cards: three across, not four and two left over */
.landing-grid.three { grid-template-columns: 1fr; }
@media (min-width: 560px) { .landing-grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .landing-grid.three { grid-template-columns: repeat(3, 1fr); } }
/* the features page's last blocks: two wide columns, not five narrow ones */
body.site .feature-section ~ .landing-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
body.site .feature-section ~ .landing-grid .feature-list.small { font-size: 1rem; }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.feature-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Screens of the app (views/landing.js): the coach's, wide, and two phones */
.app-shots { margin: 56px 0 24px; }
.app-shots-row { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: start; margin: 20px 0 12px; }
@media (min-width: 900px) { .app-shots-row { grid-template-columns: 2.2fr 1fr 1fr; } }
@media (min-width: 560px) and (max-width: 899px) { .app-shots-row { grid-template-columns: 1fr 1fr; } .app-shot.wide { grid-column: 1 / -1; } }
.app-shot { margin: 0; text-align: center; }
.app-shot img { display: block; width: 100%; height: auto; margin: 0 auto 12px; box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.app-shot.wide img { border-radius: 12px; border: 1px solid var(--line); }
.app-shot.phone img { max-width: 250px; border-radius: 30px; border: 8px solid #13201f; }
.app-shot figcaption { font-weight: 600; }
/* ...each opens larger when clicked (landing.js `enlarge`) */
.shot-open { display: block; cursor: zoom-in; border-radius: 12px; }
.shot-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.shot-open:hover img { box-shadow: 0 18px 40px rgba(0,0,0,.26); }
.shot-dialog { border: 0; padding: 12px; border-radius: 16px; background: var(--card); color: var(--text); max-width: min(96vw, 1180px); max-height: 96vh; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.shot-dialog::backdrop { background: rgba(5, 12, 13, .72); }
.shot-dialog img { display: block; max-width: 100%; max-height: calc(96vh - 90px); width: auto; height: auto; margin: 0 auto 10px; border-radius: 10px; }
.shot-dialog.phone img { max-height: calc(96vh - 90px); }
.shot-dialog .spread { gap: 16px; }
/* Cloudflare's check under a request form's button (publicform.js). */
.turnstile { margin-top: 10px; }
/* Honeypot on the coach-request form: off screen, never shown to people. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* group leaderboards (views/groups.js): the viewer's own row stands out */
table.board td:first-child { width: 2.2em; white-space: nowrap; }
table.board td.num { text-align: right; white-space: nowrap; }
table.board tr.me td { background: var(--accent-soft); }

/* Exercise picker (program builder): a searchable list instead of a select */
.pick-list { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; max-height: 55vh; overflow-y: auto; }
.pick-row { text-align: left; width: 100%; background: none; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 10px 12px; }
.pick-row:hover, .pick-row:focus-visible { border-color: currentColor; }
ol.steps { padding-left: 1.4em; }
ol.steps li { margin: 4px 0; }
