*{-webkit-tap-highlight-color:transparent}
:root{color-scheme:light;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);box-sizing:border-box;height:100%}
body{margin:0;font:14px system-ui,sans-serif}
img{max-width:100%}
[hidden]{display:none!important}
/* One-screen session app: progress strip, figure stage, exercise card, thumb-zone actions. */
:root{
  --bg:#F1F1F1; --surface:#FFFFFF; --ink:#111111; --muted:#666666; --line:#D9D9D9;
  --accent:#111111; --accent-ink:#FFFFFF; --band:#9A5A00; --stage:#E5E5E5; --skin:#C8C8C8; --eq:#848484; --m1:#D3312B; --m2:#F09A8C; --mm0:#D2D2D2;
  --display:"Geist",system-ui,-apple-system,"Segoe UI",sans-serif;
  --body:"Geist",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0D0D0D; --surface:#1B1B1B; --ink:#F2F2F2; --muted:#A3A3A3; --line:#303030;
  --accent:#F2F2F2; --accent-ink:#0D0D0D; --band:#FFB547; --stage:#151515; --skin:#6F6F6F; --eq:#5E5E5E; --m1:#FF5A4E; --m2:#A14B42; --mm0:#313131; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0D0D0D; --surface:#1B1B1B; --ink:#F2F2F2; --muted:#A3A3A3; --line:#303030;
  --accent:#F2F2F2; --accent-ink:#0D0D0D; --band:#FFB547; --stage:#151515; --skin:#6F6F6F; --eq:#5E5E5E; --m1:#FF5A4E; --m2:#A14B42; --mm0:#313131; color-scheme:dark}
[hidden]{display:none!important}
html,body{height:100%;overscroll-behavior:none}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;-webkit-tap-highlight-color:transparent}
.app{height:100%;max-width:480px;margin:0 auto;display:flex;flex-direction:column;gap:14px;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:12px 16px;box-sizing:border-box}
.top{display:flex;align-items:center;gap:10px}
.iconbtn{width:44px;height:44px;border-radius:12px;border:0;background:var(--surface);color:var(--ink);display:grid;place-items:center;cursor:pointer;flex:none}
.iconbtn:disabled{opacity:.35;cursor:default}
.iconbtn svg{width:20px;height:20px}
.progress{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
.plabel{font-family:var(--body);font-weight:700;font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);text-align:center}
.segs{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px}
.seg{height:6px;border-radius:3px;background:var(--line)}
.seg.done{background:var(--accent);opacity:.45}
.seg.now{background:var(--accent)}
.stage{flex:1 1 auto;min-height:240px;background:var(--stage);border-radius:20px;display:flex;flex-direction:column;overflow:hidden;position:relative;padding:12px 12px 10px;box-sizing:border-box}
.figwrap{flex:1;min-height:0;position:relative;display:grid;place-items:center}
.c3d{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;display:block}
.c3d:active{cursor:grabbing}
.nofig{color:var(--muted);font-size:14px;text-align:center;max-width:30ch;margin:0}
.stagefoot{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.legend{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:600;line-height:1.3;min-width:0}
.legend span{display:flex;align-items:center;gap:6px}
.legend i{width:12px;height:12px;border-radius:3px;flex:none}
.legend .k1{background:var(--m1)} .legend .k2{background:var(--m2)}
.sheetsec{margin:20px 0 0;font-family:var(--display);font-weight:700;font-size:18px;letter-spacing:-0.01em}
.card{display:flex;flex-direction:column;gap:8px}
.name{margin:0;font-family:var(--display);font-weight:700;font-size:34px;line-height:1;letter-spacing:-0.02em;text-wrap:balance}
.rx{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.big{font-family:var(--display);font-weight:700;font-size:28px;letter-spacing:-0.02em;color:var(--accent);font-variant-numeric:tabular-nums}
.namerow{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.namerow .name{min-width:0}
.tipsbtn{flex:none;width:44px;height:44px;margin:-6px -8px 0 0;border:0;border-radius:50%;background:transparent;color:var(--accent);display:grid;place-items:center;cursor:pointer}
.tipsbtn svg{width:26px;height:26px}
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:flex-end;justify-content:center;z-index:20}
.sheet{width:100%;max-width:480px;background:var(--surface);color:var(--ink);border-radius:22px 22px 0 0;box-sizing:border-box;
  padding-left:max(20px,env(safe-area-inset-left,0px));padding-right:max(20px,env(safe-area-inset-right,0px));padding-top:18px;padding-bottom:calc(24px + env(safe-area-inset-bottom,0px));
  max-height:80%;overflow-y:auto;animation:up .22s ease-out}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
@media (prefers-reduced-motion: reduce){.sheet{animation:none}}
.sheethead{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sheet .iconbtn{background:var(--bg)}
.sheethead h2{margin:0;font-family:var(--display);font-weight:700;font-size:26px;line-height:1.05;letter-spacing:-0.02em}
.leavetitle{margin:0;font-family:var(--display);font-weight:700;font-size:26px;line-height:1.05;letter-spacing:-0.02em}
.leavetext{margin:8px 0 0;font-size:16px;line-height:1.45;color:var(--muted)}
.leavebtns{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}
.leavebtns .btn{padding:0 12px;white-space:nowrap}
.quiet{background:var(--bg);color:var(--ink)}
.tips{margin:8px 0 0;padding-left:20px;display:flex;flex-direction:column;gap:10px;font-size:16px;line-height:1.45}
.tips li::marker{color:var(--accent)}
.mistakes{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.mistakes li{background:var(--bg);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:4px;font-size:16px;line-height:1.45}
.unit{font-size:15px;font-weight:600;color:var(--muted)}
.actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}
.btn{min-height:56px;border-radius:16px;border:0;font-family:var(--display);font-weight:700;font-size:19px;cursor:pointer;padding:0 18px}
.primary{background:var(--accent);color:var(--accent-ink)}
.timerbtn{width:56px;height:56px;border-radius:16px;border:0;background:var(--surface);color:var(--accent);display:grid;place-items:center;cursor:pointer}
.timerbtn svg{width:26px;height:26px}
button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.rest{background:var(--surface);border-radius:20px;padding:16px;display:flex;align-items:center;gap:16px}
.ring{width:96px;height:96px;flex:none;position:relative}
.ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ring .t{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--display);font-weight:700;font-size:28px;color:var(--ink);font-variant-numeric:tabular-nums}
.restinfo{flex:1;display:flex;flex-direction:column;gap:10px;min-width:0}
.restlabel{font-family:var(--body);font-weight:700;font-size:15px;color:var(--muted)}
.restbtns{display:flex;gap:8px;flex-wrap:wrap}
.small{min-height:44px;padding:0 16px;border-radius:12px;font-family:var(--display);font-weight:700;font-size:16px;cursor:pointer;border:2px solid var(--accent);background:transparent;color:var(--accent)}
.small.fill{background:var(--accent);color:var(--accent-ink)}
/* After the first set the exercise card grows (big reps or rest ring) and the demo takes what's left. */
.zone{display:contents}
.focus .stage{min-height:100px;padding:8px}
.focus .stagefoot{display:none}
.focus .name{font-size:28px}
.focus .zone{display:flex;flex-direction:column;gap:14px}
.fcard{background:var(--surface);border-radius:20px;padding:16px 18px;gap:10px}
.fcard:not(.resting) .rx{padding:8px 0;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center}
.fcard:not(.resting) .big{font-size:72px;line-height:1}
.fcard:not(.resting) .unit{font-size:17px}
.ccard{background:var(--surface);border-radius:20px;padding:16px 18px}
.setchip{align-self:flex-start;font-family:var(--display);font-weight:700;font-size:15px;color:var(--accent);background:var(--bg);border-radius:999px;padding:5px 12px;font-variant-numeric:tabular-nums}
.setchip .of{color:var(--muted)}
.fcard .setchip{align-self:center;font-size:18px;padding:6px 16px;margin-bottom:8px}
.focus .actions .btn{min-height:clamp(88px,16vh,128px);font-size:26px}
.focus .timerbtn{width:72px;height:auto}
.focus .timerbtn svg{width:32px;height:32px}
.fcard .rest{flex-direction:column;justify-content:center;gap:14px;background:none;border:0;border-top:1px solid var(--line);border-radius:0;padding:14px 0 0}
.fcard .ring{width:clamp(120px,26vh,210px);height:clamp(120px,26vh,210px);align-self:center}
.fcard .ring .t{font-size:48px}
@media (max-height:620px){.fcard .ring{width:96px;height:96px}.fcard .ring .t{font-size:28px}}
.fcard .restinfo{flex:none;align-items:center;text-align:center;gap:12px}
.fcard .restlabel{font-size:17px}
.fcard .small{min-height:56px;padding:0 26px;font-size:18px}
.screen{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px}
.plabel.left{text-align:left}
.plabel.count{font-family:var(--display);font-size:14px;letter-spacing:.04em;color:var(--ink);font-variant-numeric:tabular-nums}
.plabel.count .of{color:var(--muted)}
.totpill{font-size:13px;font-weight:600;color:var(--accent);background:var(--surface);border-radius:999px;padding:5px 12px;white-space:nowrap}
.finhead{display:flex;align-items:center;justify-content:space-between;gap:12px}
.finbody{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center;padding-bottom:8%}
.hero{margin:0;font-family:var(--display);font-weight:700;font-size:48px;line-height:.95;letter-spacing:-0.03em;text-wrap:balance}
.hl{color:var(--accent)}
.hello{margin:0;font-family:var(--display);font-weight:700;font-size:28px;line-height:1.05;letter-spacing:-0.02em}
.bigweek{background:var(--surface);border-radius:22px;padding:18px 18px 16px;display:flex;flex-direction:column;gap:4px}
.bwhead{display:flex;align-items:baseline;gap:8px}
.bwnum{font-family:var(--display);font-weight:700;font-size:76px;line-height:.85;color:var(--accent);font-variant-numeric:tabular-nums}
.bwof{font-family:var(--display);font-weight:700;font-size:30px;line-height:1;letter-spacing:-0.02em}
.bwlab{font-family:var(--body);font-weight:600;font-size:16px;color:var(--muted)}
.bwrow{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.bwtext{min-width:0}
.bwdots{display:flex;gap:8px;flex:none}
.bwd{width:44px;height:44px;border-radius:50%;border:2px dashed var(--line);display:grid;place-items:center;font-family:var(--display);font-weight:600;font-size:16px;color:var(--muted);box-sizing:border-box}
.bwd.on{border:2px solid var(--accent);background:var(--accent);color:var(--accent-ink)}
.bwd svg{width:46%;height:46%;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.decor{flex:1;min-height:90px;position:relative}
.decor .figwrap{position:absolute;inset:0}
.decor .c3d{pointer-events:none;cursor:default}
.lede{margin:0;color:var(--muted);font-size:17px;line-height:1.45;max-width:40ch}
.weekcard{display:flex;align-items:center;gap:14px;background:var(--surface);border-radius:16px;padding:14px 16px}
.weekdots{display:flex;gap:6px;flex:none}
.wd{width:22px;height:22px;border-radius:50%;border:2px solid var(--line);box-sizing:border-box}
.wd.on{background:var(--accent);border-color:var(--accent)}
.wklab{font-family:var(--display);font-weight:700;font-size:19px;line-height:1.1;letter-spacing:-0.01em}
.btn.big{min-height:64px;font-size:22px}
.hellorow{display:flex;align-items:center;gap:14px}
.avatar{width:64px;height:64px;border-radius:50%;object-fit:cover;flex:none;border:3px solid var(--surface);box-shadow:0 0 0 2px var(--accent)}
.avpick{display:block;cursor:pointer;flex:none;border-radius:50%}
.avpick:focus-within{outline:3px solid var(--accent);outline-offset:3px}
.avph{display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);font-family:var(--display);font-weight:700;font-size:28px}
.avatar.big.avph{font-size:52px}
.avatar.big{width:128px;height:128px;border-width:4px;box-shadow:0 0 0 3px var(--accent)}
.champ{position:relative;width:128px;height:128px;margin-top:8px}
.champtick{position:absolute;right:-6px;bottom:-4px;width:46px;height:46px;border-radius:50%;background:var(--accent);border:3px solid var(--bg);display:grid;place-items:center}
.champtick svg{width:62%;height:62%}
.champtick .badge-tick{stroke:var(--accent-ink)}
.badge-tick{fill:none;stroke:var(--accent);stroke-width:10;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:80;stroke-dashoffset:80;animation:tick .6s .15s ease-out forwards}
@keyframes tick{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion: reduce){.badge-tick{animation:none;stroke-dashoffset:0}}
.confetti{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:30}
