/* CrossCoach: cast iron and chalk, with competition plate colours that carry meaning
   (Push red, Pull blue, Legs yellow, done and recovered green). Fonts are self-hosted (SIL OFL). */
@font-face { font-family: "Big Shoulders"; src: url("fonts/bigshoulders-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Big Shoulders"; src: url("fonts/bigshoulders-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

* { box-sizing: border-box; }
:root {
  color-scheme: dark light;
  --push: #d62839; --pull: #2f62d0; --legs: #f2c230; --full: #2fa05a; --done: #2fa05a;
  --bg: #1b1f22; --raise: #242a2e; --raise-2: #30373d; --line: #3a424a;
  --ink: #f0f2ec; --soft: #a6aeb4; --ink-on-focus: #15181b;
  --danger: #e5484d;
  --r: 16px; --tap: 48px;
  --display: "Big Shoulders", "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --focus: var(--full);
  --m-idle: #464d54; --m-d0: #2fa05a; --m-d1: #5f8f7a; --m-d2: #c9a23e; --m-d3: #cf5f39;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #e9ebe7; --raise: #f7f8f5; --raise-2: #dfe2dd; --line: #d0d4ce;
    --ink: #1b1f23; --soft: #5b636a;
    --m-idle: #c9cec8; --m-d0: #2fa05a; --m-d1: #74a892; --m-d2: #cfa63e; --m-d3: #cf5f39;
  }
}

html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--text); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- frame: full screen on a phone, a centred column on a desktop ---------- */
.frame { height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; position: relative; background: var(--bg); }
@media (min-width: 560px) {
  body { background: #121417; }
  .frame { height: calc(100dvh - 48px); margin-top: 24px; border-radius: 28px; overflow: hidden; box-shadow: 0 0 0 1px #ffffff12, 0 30px 80px -30px #000; }
}
@media (min-width: 560px) and (prefers-color-scheme: light) { body { background: #cfd3cd; } .frame { box-shadow: 0 0 0 1px #00000014, 0 30px 80px -30px #0005; } }
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: calc(12px + env(safe-area-inset-top)) 16px 28px; }
#view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* ---------- tab bar ---------- */
.tabbar { flex: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;display: grid; grid-template-columns: repeat(4, 1fr); background: var(--raise); border-top: 1px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; background: none; border: 0; color: var(--soft); font: 500 12px/1 var(--text); cursor: pointer; border-radius: 12px; position: relative; }
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { stroke-width: 2.3; }
.tab.live::after { content: ""; position: absolute; top: 4px; right: calc(50% - 20px); width: 8px; height: 8px; border-radius: 4px; background: var(--done); }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.sec { font: 700 22px/1 var(--display); letter-spacing: .01em; margin: 6px 0 10px; }
.soft { color: var(--soft); }

/* ---------- buttons ---------- */
.go { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 58px; border: 0; border-radius: var(--r); background: var(--focus); color: var(--ink-on-focus); font: 800 24px/1 var(--display); letter-spacing: .02em; cursor: pointer; }
.go:active { transform: scale(.985); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 18px; border-radius: 12px; background: var(--raise-2); border: 0; color: var(--ink); font: 600 16px/1 var(--text); cursor: pointer; text-decoration: none; }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.textbtn { background: none; border: 0; padding: 10px 0; color: var(--soft); font: 500 16px/1 var(--text); cursor: pointer; }

/* ---------- today: the hero ---------- */
.hero { display: grid; gap: 6px; padding-top: 4px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.date { color: var(--soft); font-weight: 500; }
.why-btn { background: var(--raise-2); border: 0; border-radius: 12px; min-height: 36px; padding: 0 14px; font-weight: 600; cursor: pointer; }
.hero-main { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.focus-word { font: 800 clamp(76px, 25vw, 112px)/.82 var(--display); letter-spacing: -.01em; text-transform: uppercase; margin: 4px 0 0; }
.focus-word::after { content: ""; display: block; height: 10px; width: 64px; margin-top: 12px; border-radius: 5px; background: var(--focus); }
.figs { display: flex; gap: 2px; height: 150px; background: none; border: 0; padding: 0; cursor: pointer; }
.figs .body { height: 100%; width: auto; }
.lede { font-size: 18px; color: var(--soft); }

/* ---------- swipe rows ---------- */
.sw { position: relative; overflow: hidden; border-radius: var(--r); touch-action: pan-y; }
.sw-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 20px; font: 700 18px/1 var(--display); letter-spacing: .03em; opacity: 0; }
.sw-bg.l { justify-content: flex-end; background: var(--danger); color: #fff; }
.sw-bg.r { justify-content: flex-start; background: var(--pull); color: #fff; }
.sw.go-l .sw-bg.l, .sw.go-r .sw-bg.r { opacity: 1; }
.sw-body { position: relative; transition: transform .22s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.sw.dragging .sw-body { transition: none; }

/* ---------- today: the plan ---------- */
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; width: 100%; text-align: left; background: var(--raise); border: 0; border-radius: var(--r); padding: 12px 14px; cursor: pointer; }
.pr-name { font-weight: 600; font-size: 17px; line-height: 1.2; }
.pr-last { grid-column: 1; font-size: 14px; color: var(--soft); }
.pr-dose { grid-row: 1 / span 2; grid-column: 2; text-align: right; display: grid; justify-items: end; }
.pr-dose b { font: 700 26px/1 var(--display); }
.pr-dose span { font: 700 17px/1.1 var(--display); color: var(--soft); }
.pr.extra { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; }
.tag.up { background: color-mix(in srgb, var(--done) 22%, transparent); color: var(--done); }
.tag.down { background: var(--raise-2); color: var(--soft); }
.tag.new { background: color-mix(in srgb, var(--focus) 22%, transparent); color: var(--focus); }
.days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { background: var(--raise); border-radius: 12px; padding: 10px 2px 12px; text-align: center; display: grid; gap: 4px; min-width: 0; }
.day span { font-size: 12px; color: var(--soft); }
.day b { font: 800 14px/1 var(--display); text-transform: uppercase; color: var(--focus); overflow: hidden; text-overflow: ellipsis; }
.day small { font-size: 11px; line-height: 1; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day.off b { color: var(--soft); opacity: .5; }
.try-h { margin: 12px 0 4px; font-size: 14px; font-weight: 500; }
.swipe-hint { text-align: center; font-size: 13px; color: var(--soft); }

/* two options to pick from, the first is preselected */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { border: 0; border-radius: var(--r); background: var(--raise); padding: 12px 16px 16px; text-align: left; cursor: pointer; display: grid; gap: 2px; box-shadow: inset 0 0 0 2px transparent; }
.tile b { font: 800 34px/.9 var(--display); text-transform: uppercase; }
.tile small { color: var(--soft); font-size: 14px; }
.tile::after { content: ""; display: block; height: 6px; width: 40px; margin-top: 8px; border-radius: 3px; background: var(--focus); opacity: .35; }
.tile.on { box-shadow: inset 0 0 0 2px var(--focus); }
.tile.on::after { opacity: 1; }

/* cardio line with the choices under it */
.cardio-row { background: var(--raise); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; }
.cardio-row .top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; }
.cardio-row .name { font-weight: 600; font-size: 17px; line-height: 1.2; }
.cardio-row .sub { grid-column: 1; font-size: 14px; color: var(--soft); }
.cardio-row .min { grid-row: 1 / span 2; grid-column: 2; font: 700 26px/1 var(--display); text-align: right; }
.cardio-row .min span { font: 700 17px/1.1 var(--display); color: var(--soft); margin-left: 4px; }
.cardio-row .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cardio-row .chip-btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
.go-dock { position: sticky; bottom: -28px; z-index: 3; padding: 18px 0 28px; margin: -18px 0 -28px; background: linear-gradient(to bottom, transparent, var(--bg) 18px); }
/* in flow the dock's 28px bottom padding (the mask under the stuck button) reaches 12px past the 16px gap: keep the next section clear of it */
.go-dock + * { margin-top: 12px; }

/* ---------- other workouts ---------- */
.routines { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.routine { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; background: var(--raise); padding: 10px 12px 10px 14px; }
.routine h3 { font: 700 21px/1.1 var(--display); letter-spacing: .01em; }
.routine p { grid-column: 1; font-size: 14px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routine .row-btns { grid-row: 1 / span 2; grid-column: 2; gap: 4px; }
.liftc { display: contents; }
.cat-push { --focus: var(--push); } .cat-pull { --focus: var(--pull); } .cat-legs { --focus: var(--legs); } .cat-full, .cat-rest, .cat-done { --focus: var(--full); }

/* ---------- active workout ---------- */
.wk { position: sticky; top: calc(-10px - env(safe-area-inset-top)); z-index: 4; background: var(--bg); padding: 6px 0 10px; margin: -6px 0 0; display: grid; gap: 4px; }
.wk-name { font: 800 34px/1 var(--display); letter-spacing: .01em; color: var(--ink); background: none; border: 0; padding: 0; width: 100%; text-transform: uppercase; }
.wk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.elapsed { font: 700 22px/1 var(--display); color: var(--soft); font-variant-numeric: tabular-nums; }
.fin { min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--done); color: #fff; font: 800 20px/1 var(--display); letter-spacing: .03em; cursor: pointer; }
.exo { background: var(--raise); border-radius: var(--r); padding: 12px 8px 6px; }
.ss-tag { display: block; margin: 0 6px 4px; font-size: 13px; font-weight: 500; color: var(--soft); }
.exo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 6px; }
.exo-name { font: 700 22px/1.05 var(--display); letter-spacing: .01em; text-decoration: none; color: var(--ink); }
.exo-note { margin: 4px 6px 0; font-size: 14px; color: var(--soft); }
.icon-btn { width: 40px; height: 36px; display: grid; place-items: center; background: var(--raise-2); border: 0; border-radius: 10px; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.sets { display: grid; gap: 4px; margin-top: 8px; }
.set { display: grid; grid-template-columns: 34px minmax(0, 1fr) 68px 60px 46px; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 8px; background: var(--raise); }
.set.head { font-size: 12px; font-weight: 600; color: var(--soft); padding-top: 0; padding-bottom: 0; background: none; }
.set.head span:nth-child(n+3) { text-align: center; }
.set.done { background: color-mix(in srgb, var(--done) 18%, var(--raise)); }
.set-n { width: 32px; height: 32px; border-radius: 9px; border: 0; background: var(--raise-2); font: 700 17px/1 var(--display); cursor: pointer; display: inline-grid; place-items: center; }
.t-warmup .set-n { color: var(--legs); }
.t-drop .set-n, .t-failure .set-n { color: var(--push); }
.prev { font: 700 16px/1.1 var(--display); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set input { width: 100%; min-height: 42px; text-align: center; font: 700 22px/1 var(--display); color: var(--ink); background: var(--raise-2); border: 0; border-radius: 10px; padding: 0 2px; -moz-appearance: textfield; }
.set input::-webkit-outer-spin-button, .set input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rpe { display: flex; align-items: center; gap: 6px; padding: 4px 6px 2px 40px; font-size: 13px; color: var(--soft); }
.rpe .chip-btn { min-height: 32px; padding: 0 12px; font: 700 15px/1 var(--display); }
.set input::placeholder { color: var(--soft); opacity: .6; }
.set input:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.set.done input { background: transparent; }
.chk { width: 44px; height: 42px; border-radius: 10px; border: 0; background: var(--raise-2); color: var(--soft); cursor: pointer; display: grid; place-items: center; }
.chk svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chk[aria-pressed="true"] { background: var(--done); color: #fff; animation: pop .25s ease-out; }
@keyframes pop { 50% { transform: scale(1.12); } }
.exo-foot { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; }
.addset { background: none; border: 0; min-height: 40px; padding: 0; font-weight: 600; color: var(--ink); cursor: pointer; }
.btn:disabled { opacity: .4; cursor: default; }
.shake { animation: shake .4s; }
.set input.need { box-shadow: inset 0 0 0 2px var(--focus); }
.set input.warn { box-shadow: inset 0 0 0 2px var(--danger); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.exo.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--done); } }
.tag-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag-row .btn { flex: none; white-space: nowrap; }
.confirm { background: color-mix(in srgb, var(--danger) 16%, var(--raise)); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }

/* rest timer: a pill above the tab bar */
.restbar { flex: none; margin: 0 12px 8px; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 20px; background: var(--ink); color: var(--bg); box-shadow: 0 8px 24px -12px #0008; }
.restbar[hidden] { display: none; }

.ring { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: color-mix(in srgb, var(--bg) 25%, transparent); }
.ring .left { stroke: var(--done); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.rest-t { flex: 1; font: 800 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.rest-b { display: flex; gap: 6px; }
.rest-b button { min-height: 40px; min-width: 46px; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); font: 700 17px/1 var(--display); cursor: pointer; }
.restbar.over { background: var(--done); color: #fff; }
.restbar.over .rest-b button { color: #fff; }

/* ---------- lists: history, lifts ---------- */
.search { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--raise); border: 0; border-radius: 12px; min-height: var(--tap); padding: 0 14px; }
.list { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.month { font: 700 18px/1 var(--display); letter-spacing: .02em; color: var(--soft); margin: 14px 2px 8px; }
.hist { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-decoration: none; color: var(--ink); background: var(--raise); padding: 12px 14px; }
.h-name { font-weight: 600; font-size: 17px; }
.h-sub { grid-column: 1; font-size: 14px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-right { grid-row: 1 / span 2; grid-column: 2; text-align: right; display: grid; align-content: center; justify-items: end; }
.h-right b { font: 700 22px/1 var(--display); }
.h-right span { font-size: 13px; color: var(--soft); }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; text-decoration: none; color: var(--soft); font-weight: 500; }
.back::before { content: "‹"; font-size: 24px; line-height: 1; margin-top: -3px; }
.title { font: 800 40px/.95 var(--display); letter-spacing: .005em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stat .pr-badge { margin-left: 4px; vertical-align: 1px; font-size: 11px; padding: 2px 5px; }
.cardio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip-btn.on { background: var(--focus); color: var(--ink-on-focus); }
.stat { background: var(--raise); border-radius: var(--r); padding: 10px 12px; }
.stat b { display: block; font: 700 28px/1 var(--display); }
.stat span { font-size: 13px; color: var(--soft); }
.d-ex { background: var(--raise); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.d-sets { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.d-sets li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; font: 700 19px/1.1 var(--display); }
.d-sets li .soft { font: 500 13px/1 var(--text); }
.set-n.sm { width: 26px; height: 26px; font-size: 14px; }
.pr-badge { display: inline-block; margin-left: 8px; font: 700 14px/1 var(--display); background: var(--legs); color: var(--ink-on-focus); padding: 4px 8px; border-radius: 6px; vertical-align: 3px; }
.saved { background: color-mix(in srgb, var(--done) 20%, var(--raise)); border-radius: var(--r); padding: 16px; display: grid; gap: 4px; }
.saved h2 { font: 800 30px/1 var(--display); }
.big { font: 800 64px/.9 var(--display); }
.big small { font-size: 26px; color: var(--soft); margin-left: 4px; }
.chart { width: 100%; height: auto; display: block; background: var(--raise); border-radius: var(--r); }
.chart polyline { fill: none; stroke: var(--focus); stroke-width: 2.5; stroke-linejoin: round; }
.chart circle { fill: var(--focus); }
.chart text { fill: var(--soft); font: 600 11px var(--text); }
.repmax { display: flex; flex-wrap: wrap; gap: 6px; }
.repmax span { background: var(--raise); border-radius: 10px; padding: 6px 10px; font: 700 18px/1 var(--display); }
.repmax span i { font-style: normal; color: var(--soft); margin-left: 3px; }
.sess { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.sess li { background: var(--raise); font-size: 15px; }
.sess li a { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 8px 12px; color: inherit; text-decoration: none; }
.sess li a:active { background: var(--raise-2); }
.chart-box { display: grid; gap: 6px; }
.chart-box .chart { touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.chart-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 44px; }
.chart-read b { font: 800 22px var(--display); }
.chart-read span { color: var(--soft); font-size: 14px; }
.chart-read a { margin-left: auto; font-weight: 600; font-size: 14px; color: var(--focus); }
.chart-read small { flex-basis: 100%; color: var(--soft); font-size: 13px; }
.chart .guide { stroke: var(--line); stroke-width: 1.5; }
.chart circle.on { fill: var(--raise); stroke: var(--focus); stroke-width: 3; }

/* ---------- you ---------- */
.map { display: flex; justify-content: center; gap: 10px; height: 300px; background: none; border: 0; padding: 0; width: 100%; cursor: pointer; }
.map.big { height: min(58vh, 520px); } .map.big .m { cursor: pointer; }
.body .m.sel { stroke: var(--ink); stroke-width: 6px; stroke-linejoin: round; paint-order: stroke; }
.menu-list .soft-t { color: var(--soft); font-weight: 400; }
.map .body { height: 100%; width: auto; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; color: var(--soft); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.score { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: var(--raise); border-radius: var(--r); padding: 14px 16px; }
.score-num b { font: 800 56px/1 var(--display); } .score-num span { font: 700 22px/1 var(--display); color: var(--soft); }
.score-txt .sec { margin: 0 0 2px; } .score-txt p { font-size: 14px; color: var(--soft); }
.facts { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.fact { display: grid; grid-template-columns: 110px 1fr; gap: 10px; background: var(--raise); padding: 12px 16px; font-size: 15px; }
.fact > span:first-child { color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--raise-2); font: 600 15px/1 var(--text); cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
details.fold { background: var(--raise); border-radius: var(--r); }
details.fold > summary { list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font: 700 22px/1 var(--display); color: var(--soft); }
details.fold[open] > summary::after { content: "−"; }
.sheet details.fold > summary { padding-left: 0; padding-right: 0; }
.sheet details.fold > .fold-body { padding-left: 0; padding-right: 0; }
details.fold > .fold-body { padding: 0 16px 16px; display: grid; gap: 10px; }
/* rows of the You tab that open in place: label left, current value right */
.rows { display: grid; gap: 6px; }
.rowf > summary span { flex: none; }
.rowf > summary em { margin-left: auto; min-width: 0; font-style: normal; font-weight: 400; font-size: 14px; color: var(--soft); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowf[open] > summary em { visibility: hidden; }
.rowf .bodyparts > legend { display: none; }
.rowf .fold-body > .checks { padding: 0; background: none; }
.coach-checks > .rowf { margin-top: 6px; }
details.check > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 500; }
details.check > summary::-webkit-details-marker { display: none; }
details.check > summary::after { content: "+"; margin-left: auto; padding-left: 8px; font: 700 20px/1 var(--display); color: var(--soft); }
details.check[open] > summary::after { content: "−"; }
.check { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; padding-top: 0; }
.check h3 { font-size: 16px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; }
.check p { font-size: 14px; color: var(--soft); }
.sev { width: 10px; height: 10px; flex: none; border-radius: 5px; }
.sev-fix { background: var(--push); } .sev-improve { background: var(--legs); } .sev-good { background: var(--done); }
.check .sev-none { display: none; }
.rid { text-decoration: none; font: 700 13px/1 var(--display); letter-spacing: .03em; padding: 4px 7px; border-radius: 6px; background: var(--raise-2); color: var(--ink); white-space: nowrap; }
a.rid { text-decoration: underline; text-underline-offset: 2px; }
.rid.own { background: color-mix(in srgb, var(--legs) 25%, transparent); }
.settings { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--raise); padding: 8px 14px; min-height: 54px; }
.setting select, .fld input, .fld select, input[type=text] { font: inherit; font-size: 16px; color: var(--ink); background: var(--raise-2); border: 0; border-radius: 10px; min-height: 40px; padding: 0 10px; }
.setting input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--done); }
.fld { display: grid; gap: 4px; font-size: 14px; color: var(--soft); }
.fld input, .fld select { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
/* split selector and days a week (You tab, coach profile) */
.splits, .dpw, .runplan { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.splits legend, .dpw legend, .runplan legend { font-size: 14px; color: var(--soft); margin-bottom: 2px; padding: 0; }
.runplan .rp-row { display: grid; gap: 4px; }
.runplan .rp-row b { font: 800 15px/1 var(--display); text-transform: uppercase; }
.runplan .chip-btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
.runplan .soft { font-size: 13px; margin: 2px 0 0; }
/* planned run inside the active workout: the step, the heart rate against its target */
.runp { background: var(--raise-2); border-radius: 12px; padding: 10px 12px; margin: 4px 6px 8px; display: grid; gap: 8px; }
.runp .soft, .runp-res { font-size: 13px; margin: 0; }
.runp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.runp-top b { font: 800 17px/1 var(--display); text-transform: uppercase; }
.runp-top span { font-size: 14px; color: var(--soft); text-align: right; }
.runp-step { display: flex; justify-content: space-between; align-items: baseline; }
.runp-step span { font-weight: 600; }
.runp-step b { font: 800 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.runp-hr { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 2px 8px; border-radius: 10px; padding: 10px 12px; background: var(--raise); }
.runp-hr b { font: 800 56px/0.9 var(--display); font-variant-numeric: tabular-nums; }
.runp-hr span { color: var(--soft); }
.runp-hr em { font-style: normal; text-align: right; color: var(--soft); font-size: 14px; }
.runp-hr i { grid-column: 1 / -1; font-style: normal; font-weight: 700; min-height: 1.2em; }
.runp-hr.in { background: color-mix(in srgb, var(--done) 30%, var(--raise)); }
.runp-hr.high { background: color-mix(in srgb, var(--danger) 34%, var(--raise)); }
.runp-hr.low { background: color-mix(in srgb, var(--pull) 30%, var(--raise)); }
.runp-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--soft); }
.runp-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.split { border: 0; border-radius: 12px; background: var(--raise-2); padding: 10px 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; box-shadow: inset 0 0 0 2px transparent; color: var(--ink); }
.split b { font: 700 16px/1.2 var(--text); }
.split b .tag { background: var(--raise); color: var(--soft); }
.split span { font-size: 13px; color: var(--soft); }
.split small { font-size: 12px; color: var(--soft); }
.split small em { font-style: normal; color: var(--push); }
.split.on { box-shadow: inset 0 0 0 2px var(--ink); }
.dpw .soft { font-size: 13px; margin: 2px 0 0; }
.msgs { display: grid; gap: 6px; }
.msg { font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.msg.ok { background: color-mix(in srgb, var(--done) 18%, var(--raise)); }
.msg.err { background: color-mix(in srgb, var(--danger) 20%, var(--raise)); }
.foot { color: var(--soft); font-size: 13px; text-align: center; }
.empty-hero { display: grid; gap: 14px; padding: 20px 0; }

/* ---------- routine editor ---------- */
.r-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.r-row { display: grid; gap: 8px; background: var(--raise); border-radius: var(--r); padding: 10px 12px; }
.r-name { font-weight: 600; }
.r-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.r-ctl b { min-width: 24px; text-align: center; font: 700 20px/1 var(--display); }
.r-ctl .icon-btn { width: 40px; height: 36px; font: 700 17px/1 var(--display); }
.r-ctl .icon-btn[aria-pressed="true"] { background: var(--pull); color: #fff; }

/* ---------- sheets ---------- */
.scrim { position: absolute; inset: 0; background: #000a; z-index: 20; animation: fade .18s ease-out; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto; z-index: 21; background: var(--raise); border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2, .8, .2, 1); display: grid; gap: 12px; }
.sheet::before { content: ""; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 4px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-head h2 { font: 800 28px/1 var(--display); }
.pick-list { display: grid; }
.pick-row { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 4px; font-size: 16px; cursor: pointer; }
.pick-row.new { color: var(--done); font-weight: 600; }
.menu-list { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.menu-list button { text-align: left; background: var(--raise-2); border: 0; padding: 16px; font-size: 16px; font-weight: 500; cursor: pointer; }
.menu-list .danger-t { color: var(--danger); }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.why-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: 16px; }
.plates { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.plate { display: inline-grid; place-items: center; min-width: 34px; height: 40px; padding: 0 4px; border-radius: 6px; background: var(--raise-2); font: 700 17px/1 var(--display); }
.plate.kg25, .plate.lb55 { background: var(--push); color: #fff; }
.plate.kg20, .plate.lb45 { background: var(--pull); color: #fff; }
.plate.kg15, .plate.lb35 { background: var(--legs); color: var(--ink-on-focus); }
.plate.kg10, .plate.lb25 { background: var(--full); color: #fff; }
.plates .soft { margin-left: 6px; font-size: 14px; }

/* ---------- muscle figure ---------- */
.body .m { fill: var(--m-idle); }
.body .rest { fill: var(--m-idle); opacity: .55; }
.body .inert, .body .hair { fill: var(--raise-2); }
.body .m.focus { fill: var(--focus); }
.body .m.help { fill: color-mix(in srgb, var(--focus) 45%, var(--m-idle)); }
.body .m.tired { fill: var(--soft); opacity: .7; }
.body .m.d0 { fill: var(--m-d0); } .body .m.d1 { fill: var(--m-d1); } .body .m.d2 { fill: var(--m-d2); } .body .m.d3 { fill: var(--m-d3); }
.banner { flex: none; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--danger); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.3; }
.banner[hidden] { display: none; }
.banner:has(.banner-x) { display: flex; align-items: center; gap: 12px; }
.banner-x { flex: none; margin-left: auto; background: none; border: 1.5px solid #fff; border-radius: 12px; color: #fff; font: 600 14px var(--text); padding: 8px 12px; cursor: pointer; }
/* two figures side by side never wider than the sheet (the big map overflowed a 390 px phone) */
.map .body { max-width: calc(50% - 5px); min-width: 0; }
.checks { background: var(--raise); border-radius: var(--r); padding: 14px; display: grid; }
.sec-row { display: flex; align-items: center; gap: 10px; }
.info-btn { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--soft); background: none; color: var(--soft); font: 700 14px/1 var(--text); display: inline-grid; place-items: center; margin-left: 8px; cursor: pointer; padding: 0; vertical-align: middle; }
.why-list.nfc li { grid-template-columns: 1fr; }
.why-list.plain li { grid-template-columns: 1fr; gap: 4px; }
details.src > summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--soft); text-decoration: underline; text-underline-offset: 2px; width: max-content; padding: 4px 0; }
details.src > summary::-webkit-details-marker { display: none; }
details.src p { margin: 6px 0 0; font-size: 14px; color: var(--soft); }
details.src .links a { color: inherit; }
.rules-h { font: 700 17px var(--display); margin: 14px 0 8px; color: var(--soft); }
.why-list.rules small { display: block; margin-top: 4px; font-size: 12px; color: var(--soft); }
.why-list.rules small a { color: inherit; }
.profile { background: var(--raise); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.order { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.order li, .r-list li { touch-action: pan-y; }
.order li { display: grid; grid-template-columns: 28px 1fr auto 44px; align-items: center; gap: 8px; background: var(--raise-2); border-radius: 12px; padding: 4px 4px 4px 12px; min-height: 52px; transition: transform .15s; }
.order li.sel { box-shadow: inset 0 0 0 2px var(--focus); }
.order .o-n { font: 800 20px var(--display); color: var(--soft); }
.order .o-name { font-weight: 600; }
.order .o-sets { color: var(--soft); font-size: 14px; }
.o-h { width: 44px; height: 44px; border: 0; background: none; color: var(--soft); font-size: 22px; cursor: grab; touch-action: none; }
.order li.lifted, .r-list li.lifted { transition: none; z-index: 2; position: relative; box-shadow: 0 10px 24px -8px #0008; background: var(--raise); }
.r-list li { transition: transform .15s; }
.checks.unknown { margin-bottom: 10px; gap: 8px; }
.checks.unknown h3 { font-size: 16px; font-weight: 600; }
.first { display: grid; gap: 10px; margin-top: 18px; }
.map-form { display: grid; gap: 8px; }
.map-form .fld small { color: var(--soft); font-weight: 400; }
.legal { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.legal h3 { font: 700 17px var(--display); margin-top: 6px; }
.legal p, .sheet > p { font-size: 15px; line-height: 1.45; }
.legal-links { display: flex; gap: 18px; }
/* setup wizard (first start): full screen, one question per step */
#app.in-setup .tabbar { display: none; }
.setup { display: grid; grid-template-rows: auto 1fr auto; gap: 18px; min-height: calc(100dvh - 40px); }
.su-top { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; }
.su-top .textbtn:last-child { justify-self: end; }
.su-dots { display: flex; gap: 6px; justify-content: center; }
.su-dots i { width: 22px; height: 5px; border-radius: 3px; background: var(--line); }
.su-dots i.on { background: var(--ink); }
.su-body { display: grid; gap: 14px; align-content: start; }
.su-hi { font-size: 64px; }
.su-note { background: var(--raise); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; }
.su-list { display: grid; gap: 8px; }
.su-days { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); }
.su-two { grid-template-columns: 1fr 1fr; }
.su-choice { display: grid; gap: 4px; text-align: left; background: var(--raise); border: 2px solid transparent; border-radius: var(--r); padding: 14px 16px; color: var(--ink); font: inherit; cursor: pointer; min-height: 56px; }
.su-days .su-choice { text-align: center; place-items: center; }
.su-choice b { font-size: 17px; font-weight: 600; }
.su-choice span { color: var(--soft); font-size: 14px; line-height: 1.35; }
.su-choice.on { border-color: var(--ink); }
.su-foot { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.su-foot .go { width: 100%; }

/* ---------- day strip: sleep, protein and form under the hero (one tap opens the sheet) ---------- */
.daystrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dt { border: 0; border-radius: var(--r); background: var(--raise); padding: 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; color: var(--ink); min-width: 0; }
.dt .dt-l { font-size: 12px; color: var(--soft); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.dt b { font: 800 26px/1 var(--display); }
.dt small { font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt.ok b { color: var(--done); }
.dt.warn b { color: var(--push); }
.daystrip.four { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.daystrip.four .dt { padding: 8px; }
.daystrip.four .dt b { font-size: 22px; }
.daystrip.four .dt small, .daystrip.four .dt .dt-l { font-size: 11px; }

/* ---------- effort: RPE per set (a cell per working set, chips when open) and the session rating ---------- */
.set.with-rpe { grid-template-columns: 34px minmax(0, 1fr) 62px 54px 34px 46px; }
.rpe-cell { width: 34px; height: 42px; border: 0; border-radius: 10px; background: var(--raise-2); color: var(--soft); font: 700 15px/1 var(--display); cursor: pointer; }
.rpe-cell.set { color: var(--ink); }
.rpe-cell:disabled { background: transparent; cursor: default; }
.rpe-cell[aria-expanded="true"] { outline: 2px solid var(--focus); }
.set.head .info-btn { width: auto; height: auto; border: 0; border-radius: 4px; padding: 0; margin: 0; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.rpe small { margin-left: auto; font-size: 12px; }
.srpe { display: grid; gap: 6px; background: var(--raise); border-radius: var(--r); padding: 10px 12px; }
.srpe > span { font-size: 13px; color: var(--soft); font-weight: 500; }
.srpe .chip-btn { min-height: 34px; padding: 0 12px; font: 700 15px/1 var(--display); }
/* 1 to 10 in two rows of five: ten in one row wrapped the 10 alone on a phone */
.srpe .chips { display: grid; grid-template-columns: repeat(5, 1fr); }
.srpe small { font-size: 13px; color: var(--soft); }

/* ---------- evidence grade tags and the health markers ---------- */
.grade { display: inline-block; font: 600 11px/1 var(--text); letter-spacing: .02em; padding: 2px 6px; border-radius: 6px; background: var(--raise-2); color: var(--soft); vertical-align: 1px; white-space: nowrap; }
.hm-list { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.hm { display: grid; grid-template-columns: 18px 1fr auto; grid-template-areas: "dot label value" "dot label sub"; gap: 0 10px; align-items: center; background: var(--raise); border: 0; padding: 10px 14px; text-align: left; color: var(--ink); cursor: pointer; font-size: 15px; }
.hm .sev { grid-area: dot; }
.hm .sev-none { background: var(--raise-2); }
.hm .hm-l { grid-area: label; }
.hm b { grid-area: value; font: 700 20px/1 var(--display); text-align: right; }
.hm small { grid-area: sub; font-size: 12px; color: var(--soft); text-align: right; }
.hm-vo2 { margin-top: 8px; font-size: 14px; }
.wk-line { border: 0; background: var(--raise); border-radius: var(--r); padding: 12px 16px; text-align: left; font-size: 15px; color: var(--soft); cursor: pointer; }

/* sleep sheet: the last seven nights as bars against the 7 h line */
.bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; padding-top: 4px; }
.bar { display: grid; grid-template-rows: 1fr auto; gap: 4px; align-items: end; }
.bar i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: var(--raise-2); align-self: end; min-height: 2px; }
.bar.ok i { background: var(--done); }
.bar.short i { background: var(--push); }
.bar span { font-size: 12px; color: var(--soft); text-align: center; }
.bar-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--soft); opacity: .6; margin-bottom: 20px; pointer-events: none; }

/* food sheet */
.meter { height: 8px; border-radius: 4px; background: var(--raise-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--done); border-radius: 4px; transition: width .2s; }
.menu-list button small { display: block; font-size: 13px; color: var(--soft); margin-top: 2px; }
.food-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.food-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; background: var(--raise-2); padding: 8px 8px 8px 14px; font-size: 15px; }
.food-list li small { color: var(--soft); }
.food-list li b { font: 700 18px/1 var(--display); }
.food-list .icon-btn { background: var(--raise); font-size: 18px; }
.own-food { display: grid; gap: 8px; background: var(--raise-2); border-radius: var(--r); padding: 12px; }
.sheet .search { background: var(--raise-2); }

/* form sheet: fitness and fatigue lines over the daily load */
.form-chart polyline.fitness { stroke: var(--done); }
.form-chart polyline.fatigue { stroke: var(--push); stroke-width: 2; }
.form-chart rect { fill: var(--soft); opacity: .35; }
.legend .l-fit { background: var(--done); } .legend .l-fat { background: var(--push); } .legend .l-load { background: var(--soft); opacity: .5; }

/* lift goals: the goal line and the dashed projection on the progress chart */
.chart line.goal { stroke: var(--legs); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart polyline.proj { stroke: var(--legs); stroke-width: 2; stroke-dasharray: 5 5; opacity: .9; }
.goal { display: grid; gap: 8px; }
.goal .sec .tag { background: var(--raise-2); color: var(--soft); font: 600 12px/1 var(--text); letter-spacing: 0; text-transform: none; }
.goal-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: end; }
.goal-line { background: var(--raise); border-radius: var(--r); padding: 12px 16px; font-size: 15px; }

/* body parts: resting parts hatched, missing limbs faded on every figure */
.bodyparts { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.bodyparts legend { font: 700 22px/1 var(--display); letter-spacing: .01em; margin-bottom: 6px; }
.bodyparts .chip-btn[aria-pressed="true"] { background: var(--push); color: #fff; }
.body .m path.rest, .body .inert path.rest, .body .rest path.rest { opacity: .3; }
.body .m path.gone, .body .inert path.gone, .body .rest path.gone { opacity: .07; }
.route { width: 100%; height: auto; display: block; background: var(--raise); border-radius: var(--r); }
/* live tracking (a run, ride or walk with GPS) */
.tk { display: grid; gap: 12px; }
.tk-time { font: 800 clamp(72px, 24vw, 104px)/.9 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tk-gps { margin: 0; font-size: 13px; color: var(--soft); display: inline-flex; align-items: center; gap: 6px; }
.tk-gps::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 4px; background: var(--soft); }
.tk-gps.ok::before { background: var(--done); }
.tk-gps.denied::before, .tk-gps.error::before { background: var(--danger); }
.tk-btns .btn { flex: 1; min-height: 56px; font-size: 18px; }
.tk-discard { justify-self: center; background: none; color: var(--soft); }
.btn.big { width: 100%; min-height: 64px; font-size: 20px; border-radius: var(--r); margin-top: 8px; }
.route polyline { fill: none; stroke: var(--focus); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.route circle { fill: var(--done); }
