:root {
  --bg: #0b1020; --surface: #121a2e; --surface2: #1a2440; --surface3: #223052; --text: #f1f5f9; --muted: #9aa6bf; --line: #24304d;
  --accent: #22c55e; --on-accent: #04220f; --accent-soft: rgba(34, 197, 94, .14); --accent-line: rgba(34, 197, 94, .45);
  --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, .14); --hard: #fb923c; --hard-soft: rgba(251, 146, 60, .16);
  --danger: #f87171; --info: #60a5fa; --info-soft: rgba(96, 165, 250, .14);
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --r: 18px; --r-sm: 14px; --tab-h: 62px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb; --surface: #fff; --surface2: #eef1f6; --surface3: #e2e7f0; --text: #0f172a; --muted: #5b6476; --line: #e2e6ee;
    --accent: #16a34a; --on-accent: #fff; --accent-soft: rgba(22, 163, 74, .12); --accent-line: rgba(22, 163, 74, .45);
    --warn: #b45309; --warn-soft: rgba(245, 158, 11, .14); --hard: #ea580c; --hard-soft: rgba(234, 88, 12, .12);
    --danger: #dc2626; --info: #2563eb; --info-soft: rgba(37, 99, 235, .1);
    --shadow: 0 12px 32px rgba(15, 23, 42, .18);
    color-scheme: light;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding-bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom));
  overscroll-behavior-y: contain;
}
body.full { padding-bottom: 0; }
body.has-sheet, body.has-overlay { overflow: hidden; }
#view { max-width: 560px; margin: 0 auto; padding: calc(6px + env(safe-area-inset-top)) 16px 24px; }
#view.enter { animation: enter .18s ease-out; }
/* Nothing drawn after six seconds: the scripts did not start. Almost always a browser that is too old. */
#view:empty::before {
  content: "Still loading\2026  Nothing after a while? Then this browser is too old for the app. Update it, or update the phone, and open this page again.";
  display: block; padding: 22vh 12px 0; text-align: center; color: var(--muted); line-height: 1.5;
  opacity: 0; animation: late-note 0s linear 6s forwards;
}
@keyframes late-note { to { opacity: 1; } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
h1 { font-size: 30px; line-height: 1.12; margin: 4px 0 6px; letter-spacing: -.015em; }
h2 { margin: 0; }
h3 { margin: 0 0 6px; font-size: 20px; }
p { margin: 8px 0; }
small { font-size: .8em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }

.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* headers */
header.top { display: flex; align-items: center; gap: 12px; padding: 10px 0 8px; min-height: 64px; }
.kicker { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.phase { font-size: 15px; font-weight: 600; }
.title-lg { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.iconbtn {
  width: 48px; height: 48px; display: grid; place-items: center; flex: none; padding: 0;
  border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.iconbtn:active { background: var(--surface3); }
.iconbtn:disabled { opacity: .3; }
.iconbtn.plain { background: none; border-color: transparent; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 12px 0; }
.card.main { padding: 20px; }
.card.flat { background: none; }
.card h3 { font-size: 18px; }
.meta { color: var(--muted); font-size: 16px; margin-bottom: 8px; }
.lead { font-size: 17px; margin: 10px 0; }
.note { background: var(--accent-soft); padding: 10px 12px; border-radius: 12px; font-size: 15px; margin: 10px 0 0; }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; margin: 12px 0; }
.banner .ic { color: var(--warn); width: 20px; height: 20px; margin-top: 1px; }
.banner.info { background: var(--info-soft); border-color: var(--info); }
.banner.info .ic { color: var(--info); }
.banner.good { background: var(--accent-soft); border-color: var(--accent-line); }
.banner.good .ic { color: var(--accent); }
.banner .grow b { display: block; }
.banner .btn { margin-top: 8px; min-height: 44px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.chip .ic { width: 16px; height: 16px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.grid2 .card, .grid3 .card { margin: 0; }
.stat { padding: 14px; }
.stat .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.big small { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat .with-ring { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ring-bg { fill: none; stroke: var(--surface3); }
.ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.donebox { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: var(--accent); padding: 10px 0 2px; }
.donebox .ic { width: 30px; height: 30px; stroke-width: 3; }
.linkcard { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; color: var(--text); font-size: 17px; font-weight: 600; text-align: left; }
.linkcard .ic { color: var(--muted); }
.linkcard .lc-ic { color: var(--accent); }
.linkcard small { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }

/* session hero */
.hero-head { display: flex; align-items: flex-start; gap: 12px; }
.kind-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.kind-ic.cardio { background: var(--info-soft); color: var(--info); }
.kind-ic.rest, .kind-ic.checkin, .kind-ic.setup { background: var(--surface2); color: var(--muted); }
.kind-ic.event { background: var(--warn-soft); color: var(--warn); }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 10px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface2); color: var(--text);
  font-size: 17px; font-weight: 650; text-decoration: none; padding: 8px 12px; text-align: center;
  transition: transform .06s, background .12s;
}
.btn:active { transform: scale(.985); background: var(--surface3); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:active { filter: brightness(.94); background: var(--accent); }
.btn.big { min-height: 62px; font-size: 20px; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 44px; font-size: 15px; margin-top: 0; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn:disabled { opacity: .45; }
.btn .ic { width: 20px; height: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row2.tight, .row3.tight { margin-top: 10px; }
.row2 .btn, .row3 .btn { font-size: 15px; }
.row2:has(> :only-child) { grid-template-columns: 1fr; }
.link { background: none; border: none; color: var(--muted); font-size: 15px; padding: 12px; width: 100%; text-decoration: underline; display: block; text-align: center; }

/* lists */
details.list summary { color: var(--muted); padding: 14px 0 0; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; }
details.list summary::-webkit-details-marker { display: none; }
details.list summary .ic { width: 18px; height: 18px; transition: transform .15s; }
details.list[open] summary .ic { transform: rotate(180deg); }
.exlist { list-style: none; padding: 0; margin: 8px 0 0; }
.exlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 16px; }
.exlist li:first-child { border-top: none; }
.exlist li b { font-weight: 650; white-space: nowrap; text-align: right; }
.exlist li small { color: var(--muted); }
.exlist li.muted b { font-weight: 500; }
.exlist em, .tag { font-style: normal; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; }
.exlist .wrap b { white-space: normal; }
.up { display: block; color: var(--accent); font-size: 13px; font-weight: 650; }
.tasks { display: grid; gap: 8px; margin-top: 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-sm); background: var(--surface2); border: 1px solid var(--line); color: var(--text); font-size: 16px; text-align: left; width: 100%; }
.task .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; }
.task .box .ic { width: 18px; height: 18px; stroke-width: 3; opacity: 0; color: var(--on-accent); }
.task.on .box { background: var(--accent); border-color: var(--accent); }
.task.on .box .ic { opacity: 1; }
.task.on span:last-child { color: var(--muted); text-decoration: line-through; }

/* tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; z-index: 8;
  background: var(--surface); /* for iPhones older than iOS 16.2, which do not know color-mix() */
  background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 9px; font-size: 12px; font-weight: 600; color: var(--muted); background: none; border: none; min-height: var(--tab-h); }
#tabs button.on { color: var(--accent); }
#tabs button.on .ic { stroke-width: 2.4; }
body.full #tabs, body.gate #tabs { display: none; }

/* week strip */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0 12px; }
.sday { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 9px; border-radius: 14px; background: none; border: 1px solid transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.sday.sel { background: var(--surface); border-color: var(--line); color: var(--text); }
.sday.is-today .sd-num { color: var(--accent); }
.sd-num { font-size: 16px; font-weight: 750; color: var(--text); }
.sd-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.sd-dot .ic { width: 14px; height: 14px; stroke-width: 3.2; }
.sd-dot.done, .sd-dot.home { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sd-dot.short { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); color: transparent; }
.sd-dot.active { border-color: var(--accent); }
.sd-dot.active::after, .sd-dot.today::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.sd-dot.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sd-dot.today::after { opacity: .0; }
.sd-dot.missed { border-style: dashed; opacity: .55; }
.sd-dot.rest, .sd-dot.none { border-color: transparent; }
.sd-dot.rest::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.sd-dot.todo { border-color: var(--muted); opacity: .6; }

/* week list */
.card.days { padding: 4px 0; overflow: hidden; }
.dayrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; background: none; border: none; border-top: 1px solid var(--line); color: var(--text); text-align: left; font-size: 17px; }
.dayrow:first-child { border-top: none; }
.dayrow.is-today { background: var(--accent-soft); }
.dayrow:active { background: var(--surface2); }
.mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); flex: none; color: var(--muted); font-weight: 800; }
.mark.ok { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mark.half { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.mark.ok .ic { width: 18px; height: 18px; stroke-width: 3; }
.mark.act { border-color: var(--accent); color: var(--accent); }
.mark.miss { border-style: dashed; }
.mark.off { border-color: transparent; }
.dname { width: 58px; font-weight: 700; flex: none; }
.dname small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.dtitle { flex: 1; min-width: 0; }
.dtitle small { display: block; color: var(--muted); font-size: 13px; }
.chev { color: var(--muted); }

/* player */
.ptop { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 0 8px; margin-top: calc(-6px - env(safe-area-inset-top)); }
.segs { display: flex; gap: 3px; margin-top: 7px; }
.segs i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface3); min-width: 3px; }
.segs i.done { background: var(--accent); }
.segs i.part { background: linear-gradient(90deg, var(--accent) 50%, var(--surface3) 50%); }
.segs i.cur { box-shadow: 0 0 0 2px var(--accent-line); background: var(--muted); }
.segs i.cur.done { background: var(--accent); }
.pcount { min-width: 48px; height: 48px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); color: var(--text); font-weight: 800; font-size: 15px; padding: 0 8px; }
.pbody { padding-bottom: 150px; }
.exname { font-size: 27px; line-height: 1.12; margin: 6px 0 2px; letter-spacing: -.015em; }
.opt { font-size: 13px; color: var(--muted); font-style: normal; font-weight: 650; border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.target { font-size: 36px; font-weight: 850; letter-spacing: -.02em; line-height: 1.15; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
.target small { font-size: 16px; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.sidehint { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--info); background: var(--info-soft); border-radius: 999px; padding: 4px 10px; margin: 4px 0 2px; }
.lastline { font-size: 15px; color: var(--accent); font-weight: 650; margin: 4px 0 4px; }
.lastline.down { color: var(--warn); }
.media { position: relative; display: block; aspect-ratio: 3 / 2; max-height: 30vh; border-radius: 16px; overflow: hidden; background: #000; margin: 10px auto; width: 100%; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s; }
.media img.on { opacity: 1; }
.media.paused::after { content: 'paused'; position: absolute; right: 10px; top: 8px; color: #fff; font-size: 12px; background: rgba(0, 0, 0, .55); padding: 2px 8px; border-radius: 8px; }
.media.none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: var(--surface2); text-decoration: none; aspect-ratio: 16 / 5; font-size: 15px; border: none; }
.media.none .ic { width: 32px; height: 32px; color: var(--text); }
.media.short { aspect-ratio: 16 / 9; max-height: 26vh; }
.cue { font-size: 15.5px; color: var(--muted); line-height: 1.45; margin: 10px 0; }
.cue b { color: var(--text); }
.toolrow { display: flex; gap: 8px; margin: 10px 0; }
.toolrow .btn { flex: 1; min-width: 0; }
.toolrow .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* set list */
.sets { display: grid; gap: 8px; margin: 12px 0 6px; }
.setrow { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 52px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); width: 100%; text-align: left; font-size: 17px; }
.setrow .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; background: var(--surface3); color: var(--muted); flex: none; }
.setrow.done { border-color: var(--accent-line); }
.setrow.done .n { background: var(--accent); color: var(--on-accent); }
.setrow.done .n .ic { width: 16px; height: 16px; stroke-width: 3.2; }
.setrow.done b { font-weight: 750; }
.setrow.done .ic.edit { color: var(--muted); width: 18px; height: 18px; margin-left: auto; }
.setrow.todo { color: var(--muted); background: none; border-style: dashed; font-size: 15px; }
.setcur { border-radius: var(--r); background: var(--surface); border: 2px solid var(--accent); padding: 10px 10px 12px; }
.setcur .cur-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 8px; font-weight: 750; }
.setcur .cur-head .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.setcur .cur-head .linkbtn { margin-left: auto; }
.linkbtn { background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; padding: 6px 4px; }
.steppers { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.stepper { display: flex; align-items: center; background: var(--surface2); border-radius: 16px; border: 1px solid var(--line); min-width: 0; }
.sbtn { width: 52px; height: 62px; font-size: 30px; font-weight: 500; background: none; border: none; color: var(--text); flex: none; display: grid; place-items: center; border-radius: 16px; }
.sbtn:active { background: var(--surface3); }
.sval { flex: 1; text-align: center; background: none; border: none; padding: 4px 0; min-width: 0; }
.sval b { display: block; font-size: 27px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sval small { color: var(--muted); font-size: 12.5px; }
.sval input { width: 100%; text-align: center; font-size: 26px; font-weight: 800; background: var(--bg); border: 2px solid var(--accent); border-radius: 10px; padding: 4px 0; }
.effort { margin: 14px 0 4px; }
.effort .kicker { margin-bottom: 8px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg3 button { min-height: 50px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface2); color: var(--text); font-size: 16px; font-weight: 700; }
.seg3 button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg3 button.on.hard { background: var(--hard); border-color: var(--hard); color: #1a0d00; }
.seg3 button.on.easy { background: var(--info); border-color: var(--info); color: #04122b; }
.pfoot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.pfoot-in { display: flex; align-items: center; gap: 10px; max-width: 536px; margin: 0 auto; }
.pfoot .btn { margin-top: 0; }
.pfoot .sub { display: flex; justify-content: center; }
.pfoot .link { padding: 8px 6px 0; width: auto; }

/* timers */
.clock { font-size: 64px; font-weight: 850; text-align: center; font-variant-numeric: tabular-nums; margin: 12px 0 4px; letter-spacing: -.02em; line-height: 1.05; }
.clock.huge { font-size: min(92px, 26vw); }
.ivlabel { text-align: center; font-size: 40px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; margin-top: 14px; color: var(--muted); }
.ivlabel.hard { color: var(--hard); }
.ivlabel.easy { color: var(--accent); }
.ivlabel.pause { color: var(--info); }
.ivinfo { text-align: center; font-size: 17px; min-height: 48px; }
.ivinfo small { color: var(--muted); font-size: 15px; }
.ivbar { position: relative; display: flex; gap: 2px; height: 14px; border-radius: 7px; margin: 18px 0 10px; }
.ivbar span { background: var(--surface3); }
.ivbar span:first-child { border-radius: 7px 0 0 7px; }
.ivbar span:last-of-type { border-radius: 0 7px 7px 0; }
.ivbar span.hard { background: var(--hard); opacity: .75; }
.ivbar span.pause { background: var(--info); opacity: .5; }
.ivbar i { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--text); border-radius: 2px; left: 0; }

/* rest panel */
#rest {
  position: fixed; left: 10px; right: 10px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: 540px; margin: 0 auto; background: var(--surface); border: 2px solid var(--accent); border-radius: 22px;
  padding: 12px 16px 14px; box-shadow: var(--shadow);
  transform: translateY(140%); opacity: 0; pointer-events: none; transition: transform .25s, opacity .25s;
}
#rest.show { transform: none; opacity: 1; pointer-events: auto; }
#rest .btn { margin-top: 0; min-height: 48px; }
.rk { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; text-align: center; }
.rclock { font-size: 58px; font-weight: 850; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rbar { height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; margin: 6px 0 8px; }
.rbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; width: 100%; transform-origin: left; }
.rnext { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.rnext b { color: var(--text); }

/* hold overlay: the phone may be a metre away, so everything is huge */
#overlay { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: none; flex-direction: column; align-items: center; justify-content: center; padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); text-align: center; }
#overlay.show { display: flex; }
#overlay.ph-hold { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
#overlay.ph-switch { background: color-mix(in srgb, var(--info) 16%, var(--bg)); }
.ov-name { font-size: 18px; color: var(--muted); font-weight: 650; }
.ov-phase { font-size: min(52px, 13vw); font-weight: 900; letter-spacing: .02em; text-transform: uppercase; margin: 10px 0 0; line-height: 1.05; }
.ov-sub { font-size: 18px; color: var(--muted); min-height: 26px; margin-top: 6px; }
.ov-ring { position: relative; width: min(72vw, 300px); aspect-ratio: 1; margin: 18px 0; }
.ov-ring svg { width: 100%; height: 100%; }
.ov-ring .ring-fg { transition: none; }
.ov-clock { position: absolute; inset: 0; display: grid; place-items: center; font-size: min(104px, 28vw); font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.ov-sides { display: flex; gap: 10px; margin-bottom: 8px; }
.ov-side { padding: 6px 16px; border-radius: 999px; border: 2px solid var(--line); color: var(--muted); font-weight: 800; font-size: 15px; letter-spacing: .05em; }
.ov-side.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ov-side.done { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
#overlay .btn { max-width: 420px; }

/* sheet */
#sheet { position: fixed; inset: 0; z-index: 40; display: none; }
#sheet.show { display: block; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fade .18s; }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-bottom: none; border-radius: 24px 24px 0 0;
  padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); animation: rise .22s ease-out;
}
.sheet-body::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--surface3); margin: -8px auto 14px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.steplist { list-style: none; margin: 8px 0 0; padding: 0; }
.steplist button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; background: none; border: none; border-top: 1px solid var(--line); color: var(--text); text-align: left; font-size: 16px; }
.steplist li:first-child button { border-top: none; }
.steplist .cur { font-weight: 800; }
.steplist small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50; max-width: calc(100vw - 32px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 650; text-align: center; font-size: 15px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* A bottom sheet has its buttons where a message normally appears: show it at the top then. */
body.has-sheet #toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -20px); }
body.has-sheet #toast.show { transform: translate(-50%, 0); }

/* done */
.donehero { text-align: center; padding: 28px 0 6px; }
.bigcheck { width: 72px; height: 72px; stroke: var(--accent); stroke-width: 2.6; }
.pad { padding: 8px 0 30px; }
.prs { list-style: none; padding: 0; margin: 6px 0 0; }
.prs li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 650; }
.prs .ic { color: var(--warn); }

/* forms */
.form .field { margin: 16px 0; }
.form label, .lbl { display: block; font-weight: 650; margin-bottom: 6px; }
.form input[type=number], .form input[type=date], .form input[type=text], .form textarea, .input {
  width: 100%; font: inherit; font-size: 20px; padding: 13px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface2); color: var(--text);
}
.form textarea, textarea.input { font-size: 17px; resize: vertical; }
.form small { color: var(--muted); font-size: 14px; display: block; margin-top: 4px; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seg button { min-height: 54px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface2); color: var(--text); font-size: 21px; font-weight: 750; }
.seg button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seglabels { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 4px; }
.toggle { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; }
.toggle:first-of-type { border-top: none; }
.toggle small { display: block; color: var(--muted); font-size: 13px; }
.toggle input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
label.btn { font-weight: 650; margin-bottom: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills button { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font-weight: 650; font-size: 15px; min-height: 42px; }
.pills button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
pre.preview { white-space: pre-wrap; word-break: break-word; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; max-height: 320px; overflow: auto; margin: 10px 0 0; }

/* progress */
.bigline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bigline .big { font-size: 38px; font-weight: 850; letter-spacing: -.02em; }
.delta { font-weight: 750; font-size: 18px; color: var(--muted); }
.delta.good { color: var(--accent); }
.delta.bad { color: var(--warn); }
.chart { width: 100%; height: auto; margin-top: 8px; display: block; }
.cline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.cdot { fill: var(--accent); }
.tline { stroke: var(--muted); stroke-dasharray: 4 4; opacity: .55; }
.tlabel, .clabel { font-size: 11px; fill: var(--muted); }
.spark { width: 84px; height: 28px; flex: none; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.lifts li { padding: 0; }
.lifts button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; background: none; border: none; color: var(--text); text-align: left; font-size: 16px; }
.lifts .lname { flex: 1; min-width: 0; }
.lifts .lname small { display: block; color: var(--muted); font-size: 13px; }
.wbars { display: flex; gap: 8px; align-items: flex-end; height: 120px; margin-top: 10px; }
.wbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.wtrack { width: 100%; flex: 1; display: flex; align-items: flex-end; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.wfill { width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 0; }
.wbar small { font-size: 11px; color: var(--muted); }
.wbar b { font-size: 12px; }
.cilist a, .cilist button { display: flex; justify-content: space-between; width: 100%; color: var(--text); text-decoration: none; background: none; border: none; font-size: 16px; padding: 0; text-align: left; }
.hist { list-style: none; padding: 0; margin: 8px 0 0; }
.hist li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.hist li:first-child { border-top: none; }
.hist b { font-weight: 650; text-align: right; }

/* guide pages */
.rules { padding-left: 22px; margin: 0; }
.rules li { margin: 0 0 12px; }
.rules li:last-child { margin-bottom: 0; }
.rules b { display: block; font-size: 17px; }
.rules span { color: var(--muted); font-size: 15px; }
.plain { padding-left: 18px; margin: 8px 0 0; }
.plain li { margin: 6px 0; font-size: 15px; }

/* join */
.join { padding: 28px 4px 24px; }
.join h1 { font-size: 32px; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 14px; }
.logo .ic { width: 38px; height: 38px; stroke: var(--accent); stroke-width: 2.4; }
.keyinput { font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.keyinput::placeholder { letter-spacing: .02em; font-weight: 500; opacity: .5; }
.steps-list { list-style: none; padding: 0; margin: 10px 0; counter-reset: s; }
.steps-list[start="2"] { counter-reset: s 1; } /* a list that goes on after something in between */
.steps-list li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: 16px; }
.steps-list li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; display: grid; place-items: center; flex: none; }
.err { color: var(--danger); font-weight: 650; margin: 10px 0 0; }
.keyshow { font: 800 24px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; text-align: center; padding: 16px 8px; background: var(--surface2); border: 1px dashed var(--accent-line); border-radius: var(--r-sm); margin: 12px 0; word-break: break-all; user-select: all; }

/* small text under a name or number */
small.sub { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
small.sub.up { color: var(--accent); font-weight: 650; }
.grow-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.inv { visibility: hidden; }
button.media { border: 0; padding: 0; cursor: pointer; }
button.chip { cursor: pointer; color: var(--text); }
.banner .grow { min-width: 0; }
.hero-head { margin-bottom: 8px; }
.hero-head h1 { margin: 2px 0 0; font-size: 28px; }
.setrow b { flex: 1; min-width: 0; }
.sheet-body h3 { margin-bottom: 8px; }
.toggle > span { flex: 1; min-width: 0; }
.wbar b { min-height: 15px; }
.lead b { font-weight: 750; }
.steps-list li span b { font-weight: 750; }

/* the bottom bar of the player has a variable height: everything above it follows */
.pbody { padding-bottom: calc(var(--foot-h, 110px) + 28px); }
body.resting .pbody { padding-bottom: calc(var(--foot-h, 110px) + 230px); }
#rest { bottom: calc(var(--foot-h, 92px) + 8px); }

/* --- after looking at every screen in a real browser --- */
/* weight on its own row, left and right next to each other */
.steppers.n3 { grid-template-columns: 1fr 1fr; }
.steppers.n3 > :first-child { grid-column: 1 / -1; }
/* planned-day circles were too faint to see */
.mark { border-color: var(--muted); }
.mark.todo { opacity: .55; }
.mark.ok, .mark.half, .mark.act { border-color: var(--accent); opacity: 1; }
.mark.off { border-color: transparent; }
/* settings: switches instead of checkboxes */
.toggle input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 999px; flex: none; margin: 0;
  background: var(--surface3); border: 1px solid var(--line); position: relative; transition: background .15s; cursor: pointer;
}
.toggle input[type="checkbox"]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--text); opacity: .75; transition: transform .15s, opacity .15s;
}
.toggle input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(20px); background: #fff; opacity: 1; }
.toggle input[type="checkbox"]:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
/* a key always fits on one line, so it is easy to read out or type over */
.keyshow { font-size: clamp(14px, 5.2vw, 22px); letter-spacing: 0; white-space: nowrap; word-break: normal; overflow: hidden; }
/* a plain timer: the clock sits lower on the screen with a bar that fills up */
.clock.alone { margin-top: 9vh; }
.tbar { height: 8px; border-radius: 4px; background: var(--surface3); overflow: hidden; margin: 14px auto 18px; max-width: 320px; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 4px; transform-origin: left; transform: scaleX(0); }
/* the whole key stays visible while typing, also on a narrow phone (16px or more: iOS zooms in on smaller fields) */
.keyinput { font-size: clamp(16px, 4.9vw, 22px); letter-spacing: .02em; padding-left: 8px; padding-right: 8px; }
/* narrow phones: the three tool buttons keep their words */
.toolrow .btn { padding-left: 10px; padding-right: 10px; }
.toolrow .btn[data-act="swap"] { flex: 1.5; }
@media (max-width: 400px) {
  .toolrow .btn[data-act="how"] .ic, .toolrow .btn[data-act="video"] .ic { display: none; }
  .toolrow .btn { font-size: 14.5px; gap: 6px; }
}

/* --- after the usability review --- */
/* light theme: the green was too pale behind white text and as small text */
@media (prefers-color-scheme: light) {
  :root { --accent: #15803d; --accent-soft: rgba(21, 128, 61, .10); --accent-line: rgba(21, 128, 61, .45); }
}
/* three number tiles never push the third one off a narrow screen */
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 .stat { padding: 12px 10px; min-width: 0; }
.grid3 .stat .kicker { font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) {
  .grid3 .stat .big { font-size: 25px; }
  .grid3 .stat .with-ring svg { display: none; }
}
/* the light warm-up set is not set 1 */
.warmline { margin: 0 0 10px; padding: 9px 12px; border-radius: 12px; background: var(--info-soft, rgba(96, 165, 250, .14)); color: var(--text); font-size: 15px; font-weight: 600; }
/* tool row: the open "Tips" button looks pressed */
.toolrow .btn.on { border-color: var(--accent-line); background: var(--accent-soft); }
/* "left and right were different": a sentence under the numbers, easy to hit */
.linkbtn.wide { display: block; width: 100%; text-align: center; min-height: 44px; margin-top: 6px; font-size: 15px; }
/* the bar at the bottom: the two small actions sit far apart */
.pfoot .sub { justify-content: space-around; gap: 24px; }
.pfoot .link { min-height: 40px; padding: 6px 10px 0; }
/* a long "Next: ..." wraps instead of losing its end */
.grow-text { white-space: normal; text-align: left; line-height: 1.15; font-size: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* removing a set is a deliberate, smaller action */
.link.danger { color: var(--danger, #f87171); margin-top: 6px; }
/* today: the two other ways to do the session say what they are */
.btn.two { justify-content: flex-start; padding-left: 14px; text-align: left; gap: 10px; }
.btn.two > span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.btn.two small { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.main > .link { padding: 12px 0 2px; }
/* short phones: the photo and the rest timer leave room for the numbers */
@media (max-height: 700px) {
  .media { max-height: 24vh; }
  #rest { padding-top: 8px; padding-bottom: 10px; }
  #rest .rk { display: none; }
  .rclock { font-size: 40px; }
  .rbar { margin: 4px 0 6px; }
  .rnext { font-size: 14px; margin-bottom: 6px; }
  #rest .btn { min-height: 44px; }
  body.resting .pbody { padding-bottom: calc(var(--foot-h, 110px) + 190px); }
}
