:root {
  --bg: #ffffff;
  --ink: #111111;
  --sub: #707072;
  --line: #e5e5e5;
  --soft: #f5f5f5;
  --hot: #ff5a1f;
  --inv: #ffffff;
  --paper: #ffffff;
  --ok: #0f8a63;
  --head: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="grey"] { --bg: #efeff0; --soft: #ffffff; --paper: #ffffff; --line: #dcdcdf; }
[data-theme="grey"] .poster, [data-theme="grey"] .play-hero { box-shadow: 0 1px 2px rgba(0,0,0,.04); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
#view { max-width: 600px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 20px calc(40px + var(--safe-b)); outline: none; }
h1, h2, h3, .head { font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: 0; line-height: .92; margin: 0; }
h1 { font-size: 48px; }
h2 { font-size: 34px; }
h3 { font-size: 22px; line-height: 1; }
p { margin: 6px 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.sub { color: var(--sub); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sub); margin: 0 0 6px; }
.section { margin: 34px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.section-head a, .textlink { font-size: 14px; font-weight: 600; color: var(--sub); background: none; border: 0; padding: 0; cursor: pointer; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }

/* header */
.nav { display: flex; align-items: center; justify-content: space-between; height: 52px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .mark { height: 34px; width: auto; }
.brand .wordmark { height: 17px; width: auto; }
.brand small { font-family: var(--head); font-weight: 800; font-size: 15px; color: var(--sub); letter-spacing: .08em; border-left: 1.5px solid var(--line); padding-left: 8px; }
.nav-icons { display: flex; gap: 4px; }
.ibtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.ibtn:active { background: var(--soft); }
.ibtn.solid { background: var(--soft); }
.ibtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* buttons */
.btn { appearance: none; border: 0; border-radius: 999px; background: var(--ink); color: var(--inv); font-weight: 600; font-size: 16px; padding: 15px 26px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.block { display: flex; width: 100%; }
.btn.light { background: #fff; color: #111; }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { padding: 10px 18px; font-size: 14px; }
.btn.danger { background: transparent; color: #d12d2d; box-shadow: inset 0 0 0 1.5px #f1c9c9; }
.btn:disabled { opacity: .4; }

/* poster */
.poster { position: relative; overflow: hidden; border-radius: 6px; background: var(--c, #111); color: #fff; padding: 22px; min-height: 380px; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; isolation: isolate; }
.poster::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.28), transparent 55%),
  linear-gradient(180deg, transparent 35%, rgba(0,0,0,.35) 100%); }
.poster-num { position: absolute; top: -18px; right: -6px; font-family: var(--head); font-weight: 800; font-size: 230px; line-height: 1; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.35); z-index: -1; letter-spacing: -.02em; }
.poster .eyebrow { color: rgba(255,255,255,.85); }
.poster-title { font-size: 52px; line-height: .9; margin-bottom: 10px; }
.poster-meta { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.9); margin: 0 0 18px; }
.poster .btn { align-self: flex-start; }
.poster.sm { min-height: 210px; padding: 16px; }
.poster.sm .poster-title { font-size: 30px; margin-bottom: 6px; }
.poster.sm .poster-num { font-size: 130px; top: -10px; }
.poster.sm .poster-meta { margin: 0; font-size: 12px; }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }

/* cards */
.note { background: var(--soft); border-radius: 6px; padding: 16px 18px; margin: 18px 0 0; }
.note .eyebrow { margin-bottom: 4px; }
.note p { margin: 0; font-size: 15px; }
.prompt { display: flex; gap: 14px; align-items: center; border: 1.5px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-top: 14px; }
.prompt svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prompt b { display: block; font-size: 15px; }
.prompt span { font-size: 13px; color: var(--sub); }

/* week strip */
.week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 4px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); font-weight: 500; }
.week b { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 600; color: #b5b5b7; }
.week .plan b { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.week .today b { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.week .did b { background: var(--ink); color: var(--inv); box-shadow: none; }
.week div { cursor: pointer; }
.week .rest b { color: var(--sub); opacity: .6; }
.week svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* program bar */
.segs { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 10px 0 8px; }
.segs i { height: 6px; background: var(--line); border-radius: 2px; }
.segs i.on { background: var(--ink); }
.segs i.now { background: var(--hot); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 18px 0; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font-family: var(--head); font-size: 40px; font-weight: 800; line-height: 1; }
.stats span { font-size: 12px; color: var(--sub); }

/* list rows */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list a, .list .li { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.tile { width: 54px; height: 54px; flex: none; border-radius: 4px; background: var(--soft); display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 22px; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-weight: 600; font-size: 16px; }
.li-main span { font-size: 14px; color: var(--sub); }
.chev { width: 18px; height: 18px; flex: none; fill: none; stroke: #b5b5b7; stroke-width: 2; }

/* workout detail */
.detail-top { margin: calc(-12px - var(--safe-t)) -20px 0; }
.detail-top .poster { border-radius: 0; min-height: 440px; padding: calc(70px + var(--safe-t)) 20px 26px; cursor: default; }
.detail-top .back { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 6px; }
.facts div b { display: block; font-family: var(--head); font-size: 30px; font-weight: 800; line-height: 1; }
.facts div span { font-size: 12px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--soft); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 500; }
.start-wrap { position: sticky; bottom: 0; padding: 16px 0 calc(16px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 10px; }

/* player */
.play { max-width: 600px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.play-hero { background: var(--c); color: #fff; padding: calc(10px + var(--safe-t)) 20px 26px; position: relative; overflow: hidden; isolation: isolate; }
.play-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(110% 90% at 100% 0%, rgba(255,255,255,.25), transparent 55%); }
.play-bar { display: flex; align-items: center; gap: 12px; }
.play-bar .ibtn { color: #fff; background: rgba(255,255,255,.18); }
.pseg { flex: 1; display: flex; gap: 3px; }
.pseg i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); }
.pseg i.on { background: #fff; }
.pseg i.now { background: rgba(255,255,255,.75); }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; min-width: 46px; text-align: right; }
.play-hero .eyebrow { color: rgba(255,255,255,.85); margin-top: 34px; }
.play-name { font-size: 58px; line-height: .88; margin: 4px 0 16px; }
.play-rx { display: flex; gap: 22px; align-items: flex-end; }
.play-rx div b { display: block; font-family: var(--head); font-weight: 800; font-size: 40px; line-height: 1; }
.play-rx div span { font-size: 12px; color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.play-body { padding: 18px 20px calc(24px + var(--safe-b)); flex: 1; display: flex; flex-direction: column; }
.sets { list-style: none; margin: 0; padding: 0; }
.setrow { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 16px; margin: 0 0 8px; border: 0; border-radius: 6px; background: var(--soft); cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.setrow .k { font-family: var(--head); font-weight: 800; font-size: 20px; width: 64px; text-transform: uppercase; }
.setrow .what { flex: 1; font-weight: 500; }
.setrow .circ { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px #c9c9cb; display: grid; place-items: center; }
.setrow .circ svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.setrow.on { background: var(--ink); color: var(--inv); }
.setrow.on .circ { background: var(--bg); color: var(--ink); box-shadow: none; }
.setrow.on .circ svg { opacity: 1; }
.setrow.next { box-shadow: inset 0 0 0 2px var(--ink); }
.bigaction { margin: 6px 0 8px; }
.howrow { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); margin-top: 14px; cursor: pointer; background: none; border-left: 0; border-right: 0; width: 100%; font-weight: 600; text-align: left; }
.coachnote { font-size: 14px; color: var(--sub); margin: 14px 0 0; }
.coachnote b { color: var(--ink); }
.play-nav { display: flex; gap: 10px; margin-top: auto; padding-top: 24px; }
.play-nav .ibtn { width: 54px; height: 54px; box-shadow: inset 0 0 0 1.5px var(--line); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: #f2f2f3; color: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(30px + var(--safe-t)) 24px calc(30px + var(--safe-b)); transition: background .3s; }
.overlay .eyebrow { color: #707072; }
.overlay.on-color { color: #fff; }
.overlay.on-color .eyebrow { color: rgba(255,255,255,.8); }
.ov-label { font-family: var(--head); font-weight: 800; font-size: 34px; text-transform: uppercase; letter-spacing: .04em; }
.ov-time { font-family: var(--head); font-weight: 800; font-size: clamp(120px, 42vw, 220px); line-height: .9; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.ov-bar { width: min(340px, 80vw); height: 4px; background: rgba(0,0,0,.1); border-radius: 2px; overflow: hidden; margin-bottom: 28px; }
.overlay.on-color .ov-bar { background: rgba(255,255,255,.25); }
.ov-bar i { display: block; height: 100%; background: #111; width: 0; transition: width 1s linear; }
.ov-next { margin: 0 0 30px; }
.ov-next b { display: block; font-family: var(--head); font-weight: 800; font-size: 26px; text-transform: uppercase; }
.ov-btns { display: flex; gap: 10px; }
.overlay.on-color .ov-bar i { background: #fff; }
.ov-btns .btn.ghost { background: rgba(0,0,0,.07); color: #111; }
.ov-btns .btn.light { background: #111; color: #fff; }
.overlay.on-color .ov-btns .btn.ghost { background: rgba(255,255,255,.18); color: #fff; }
.overlay.on-color .ov-btns .btn.light { background: #fff; color: #111; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 600px; border-radius: 16px 16px 0 0; padding: 10px 22px calc(26px + var(--safe-b)); max-height: 88vh; overflow-y: auto; animation: up .22s ease; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 18px; }
.steps { padding: 0; margin: 14px 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; margin: 0 0 14px; }
.steps li::before { content: counter(s); font-family: var(--head); font-weight: 800; font-size: 20px; min-width: 22px; line-height: 1.2; }
.keys { list-style: none; margin: 0; padding: 0; }
.keys li { padding: 10px 0 10px 26px; border-top: 1px solid var(--line); position: relative; font-size: 15px; }
.keys li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.keys.avoid li::before { background: #d12d2d; }
.lbl { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sub); margin: 20px 0 6px; }

/* done */
.done { text-align: left; padding-top: 40px; }
.done-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--inv); display: grid; place-items: center; margin-bottom: 26px; }
.done-check svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done h1 { font-size: 64px; }

/* plan */
.tabs2 { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 16px 0 18px; }
.tabs2 button { background: none; border: 0; padding: 0 0 12px; font-weight: 600; color: var(--sub); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs2 button.on { color: var(--ink); border-color: var(--ink); }
.weeks { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 6px; padding: 0 20px 6px; scrollbar-width: none; }
.weeks::-webkit-scrollbar { display: none; }
.weeks button { flex: none; width: 52px; height: 60px; border-radius: 6px; border: 0; background: var(--soft); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.weeks button small { font-size: 10px; color: var(--sub); font-weight: 600; letter-spacing: .06em; }
.weeks button b { font-family: var(--head); font-size: 24px; font-weight: 800; line-height: 1; }
.weeks button.sel { background: var(--ink); color: var(--inv); }
.weeks button.sel small { color: var(--inv); opacity: .7; }
.weeks button.cur:not(.sel) { box-shadow: inset 0 0 0 2px var(--hot); }
.dayhead { display: flex; align-items: center; gap: 10px; margin: 26px 0 4px; }
.dayhead i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.wtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: center; font-size: 14px; }
.wtable th { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: .06em; padding: 8px 0; font-weight: 600; }
.wtable td { padding: 9px 0; border-top: 1px solid var(--line); }
.wtable tr.cur td { font-weight: 700; color: var(--hot); }
.search { width: 100%; padding: 14px 18px; border-radius: 999px; border: 0; background: var(--soft); font: inherit; outline: none; }

/* progress */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bars i { width: 100%; background: var(--ink); border-radius: 3px 3px 0 0; min-height: 2px; display: block; }
.bars i.zero { background: var(--line); }
.bars small { font-size: 11px; color: var(--sub); }
.chart { width: 100%; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--sub); margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--k); margin-right: 6px; vertical-align: -1px; }

/* settings */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.setting b { display: block; font-weight: 600; }
.setting span { font-size: 13px; color: var(--sub); }
.switch { width: 52px; height: 32px; border-radius: 99px; background: var(--line); border: 0; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--ok); }
.switch.on i { transform: translateX(20px); }

/* empty / center */
.center-screen { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; margin: 40vh auto 0; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(26px + var(--safe-b)); z-index: 80; background: var(--ink); color: var(--inv); padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: 14px; max-width: 90vw; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (min-width: 640px) { .scroller { grid-auto-columns: 46%; } .detail-top { margin: 0; } .detail-top .poster { border-radius: 6px; } }

/* added */
.status-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--sub); }
.status-pill.ok { background: #e3f4ec; color: #0b6b4c; }
.hint { font-size: 13px; color: var(--sub); margin: 10px 0 0; text-align: center; }
.heavy { background: none; border: 0; color: var(--sub); font-size: 14px; font-weight: 500; padding: 8px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.heavy.on { color: var(--hot); text-decoration: none; font-weight: 600; }
.set-group { margin-top: 30px; }
.set-group h3 { margin-bottom: 4px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.dp { padding: 11px 0; border-radius: 999px; background: var(--soft); border: 0; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.dp.on { background: var(--ink); color: var(--inv); }
.timein { font: inherit; font-weight: 600; border: 0; background: var(--soft); color: var(--ink); padding: 9px 12px; border-radius: 999px; }
.logo-full { width: 150px; height: auto; display: block; margin-bottom: 26px; }
.badge-done { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.22); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
