:root {
  --bg:#ffffff; --bg2:#f3f4f7; --card:#ffffff; --line:#e6e7ec; --text:#14161c; --muted:#7b7f8c;
  --accent:#5b4bff; --accent2:#ece9ff; --good:#21b26b; --warn:#ff8a3d; --danger:#e5484d;
  --body:#dfe1e8; --body-line:#c9ccd6; --sec:#b3a9ff; --mp:#e8413c; --ms:#f5a39a;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e0f13; --bg2:#1a1c22; --card:#16181e; --line:#262932; --text:#f2f3f6; --muted:#8b8f9c;
    --accent:#7d70ff; --accent2:#26224d; --body:#2c2f39; --body-line:#3a3e4a; --sec:#5a4fb0; --mp:#ff5a50; --ms:#a85a55; }
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text);
  font:15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; overscroll-behavior:none; }
button { font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer; text-align:inherit; }
input { font:inherit; color:inherit; }
h1, h2, h3 { margin:0; } h1 { font-size:19px; font-weight:700; } h2 { font-size:22px; } h3 { font-size:17px; margin:18px 0 8px; }
p { margin:4px 0 12px; } small { font-size:12px; } .muted { color:var(--muted); } .center { text-align:center; display:block; margin-inline:auto; }
.accent { color:var(--accent); }
.ic { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }

#app { height:100%; position:relative; overflow:hidden; max-width:520px; margin:0 auto; }
.main, .pageover, .ascroll { position:absolute; inset:0; overflow-y:auto; -webkit-overflow-scrolling:touch; padding-top:var(--safe-t); }
.pageover { background:var(--bg); z-index:40; } .pageover.enter { animation:slidein .22s ease-out; }
@keyframes slidein { from { transform:translateX(30%); opacity:.4; } }
.spacer { height:calc(150px + var(--safe-b)); }
.pad { padding:0 16px; }

/* header */
.top { display:flex; align-items:center; gap:10px; padding:10px 16px; min-height:54px; }
.top h1 { flex:1; text-align:center; } .top h1.left { text-align:left; font-size:24px; } .top h1.small { font-size:17px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.top.sticky { position:sticky; top:0; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(12px); z-index:5; }
.icbtn { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; flex:none; }
.icbtn.sm { width:30px; height:30px; } .icbtn.sm .ic { width:16px; height:16px; }
.avatar { width:36px; height:36px; border-radius:50%; background:var(--bg2); display:grid; place-items:center; color:var(--muted); }
.link { color:var(--accent); font-weight:600; font-size:14px; padding:6px 0; }
.row-between { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.row-between h3 { margin:18px 0 8px; }
.grow { flex:1; min-width:0; } .txt { display:flex; flex-direction:column; }
.txt b, .exrow b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:12px 18px; border-radius:14px; background:var(--bg2); font-weight:600; }
.btn.primary { background:var(--accent); color:#fff; } .btn.danger { color:var(--danger); }
.btn.sm { padding:7px 12px; border-radius:10px; font-size:14px; } .btn.sm .ic { width:14px; height:14px; }
.btn.block { display:flex; width:100%; margin:10px 0; } .btn.ghost { background:transparent; color:var(--muted); }
.btnrow { display:flex; gap:10px; margin:12px 0; } .btnrow .btn { flex:1; }
.chips { display:flex; gap:8px; overflow-x:auto; padding:6px 0 10px; scrollbar-width:none; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px; background:var(--bg2); font-size:14px; font-weight:600; white-space:nowrap; text-decoration:none; color:var(--text); }
.chip .ic { width:16px; height:16px; } .chip.on { background:var(--accent); color:#fff; }
.toggle { display:inline-flex; background:var(--bg2); border-radius:12px; padding:3px; }
.toggle button { padding:6px 14px; border-radius:9px; font-size:13px; font-weight:600; color:var(--muted); }
.toggle button.on { background:var(--card); color:var(--text); box-shadow:0 1px 3px #0002; }
.toggle.wide { display:flex; margin:6px 0 12px; } .toggle.wide button { flex:1; text-align:center; }

/* cards */
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:14px; margin:10px 0; }
.card.row { display:flex; gap:14px; align-items:center; } .card h3 { margin-top:0; }
.card-cta { margin-top:8px; } .card-cta h2 { margin:20px 0 6px; }
.optcard { display:flex; align-items:center; gap:12px; width:100%; padding:14px; border-radius:16px; background:var(--bg2); margin:8px 0; }
.optcard div { flex:1; display:flex; flex-direction:column; } .optcard small { color:var(--muted); }
.dot { width:14px; height:14px; border-radius:50%; flex:none; }

/* home */
.snapshot { display:grid; grid-template-columns:auto repeat(3, 1fr); gap:8px; align-items:center; }
.streak { display:flex; flex-direction:column; align-items:center; color:var(--warn); padding-right:6px; }
.streak b { font-size:20px; margin-top:-4px; } .streak span { font-size:12px; font-weight:600; }
.flame { color:var(--warn); width:34px; height:34px; } .flame.big { width:30px; height:30px; }
.snap { display:flex; flex-direction:column; } .snap b { font-size:17px; } .snap span { font-size:12px; color:var(--muted); }
.snap em { font-style:normal; font-size:11px; background:var(--bg2); border-radius:6px; padding:1px 6px; width:max-content; margin-top:3px; color:var(--muted); }
.snap em.up { color:var(--good); }
.hscroll { display:flex; gap:12px; overflow-x:auto; padding-bottom:6px; scroll-snap-type:x mandatory; scrollbar-width:none; }
.chal { flex:0 0 86%; scroll-snap-align:start; display:flex; gap:12px; background:var(--bg2); border-radius:18px; padding:14px; }
.chal-badge { width:56px; height:62px; flex:none; display:grid; place-items:center; font-weight:800; color:#fff; background:linear-gradient(160deg, var(--accent), #2d2470);
  clip-path:polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.chal p { color:var(--muted); font-size:13px; margin:2px 0 8px; }
.prog { height:7px; background:var(--line); border-radius:9px; overflow:hidden; } .prog i { display:block; height:100%; background:var(--accent); border-radius:9px; }
.wcard { display:block; width:100%; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:12px 14px; margin:8px 0; }
.wstats { display:flex; gap:14px; margin:6px 0; font-size:13px; } .wstats span { display:flex; align-items:center; gap:4px; } .wstats .ic { width:14px; height:14px; }
.recrow { display:flex; justify-content:space-between; gap:6px; }
.recitem { display:flex; flex-direction:column; align-items:center; gap:4px; flex:1; } .recitem small { font-size:11px; color:var(--muted); }
.recitem .micon, .recitem .cardio-ico { height:62px; }
.pill { background:var(--good); color:#fff; font-size:12px; font-weight:700; border-radius:999px; padding:2px 9px; }
.pill.warn { background:var(--warn); }

/* body map */
.bodymap { display:block; }
.bm-base { fill:var(--body); }
.bm-m { fill:var(--body); stroke:var(--body-line); stroke-width:.6; transition:fill .2s; }
.bm-s { fill:var(--ms); }
.bm-p { fill:var(--mp); }
.bm-pulse { animation:pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.55; } }
.bm-sel { stroke:var(--text); stroke-width:1.4; }
[data-action="pick-muscle"] { cursor:pointer; }
.thumb { height:100%; width:auto; margin:auto; }
.micon { height:72px; margin:auto; }
.cardio-ico { display:grid; place-items:center; height:72px; font-size:34px; color:var(--danger); }
.mapsec .bigmap { display:flex; justify-content:center; padding:4px 0; }
.bigmap .bodymap { height:300px; }
.mgrid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.mgrid button { background:var(--bg2); border-radius:16px; padding:10px 4px; display:flex; flex-direction:column; align-items:center; gap:4px; font-weight:600; font-size:13px; }
.maps2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; background:var(--bg2); border-radius:18px; padding:14px; text-align:center; }
.maps2 .bodymap { height:220px; margin:auto; } .maps2 small { color:var(--muted); }
.legend { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:13px; margin:10px 0; } .legend.center { justify-content:center; }
.legend span { display:flex; align-items:center; gap:6px; }
.legend i { width:12px; height:12px; border-radius:4px; display:inline-block; } .lp { background:var(--mp); } .ls { background:var(--ms); }

/* explore */
.searchbar { flex:1; display:flex; align-items:center; gap:8px; background:var(--bg2); border-radius:999px; padding:10px 14px; }
.searchbar .ic { width:18px; height:18px; color:var(--muted); } .searchbar input { border:0; background:none; outline:none; flex:1; min-width:0; }
.searchbar.m { margin:0 16px 8px; flex:none; }
.segtabs { display:flex; justify-content:space-around; border-bottom:1px solid var(--line); margin-bottom:4px; }
.segtabs button { display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 24px; font-size:13px; color:var(--muted); border-bottom:2.5px solid transparent; }
.segtabs button.on { color:var(--text); font-weight:700; border-color:var(--text); }
.pgrid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.pcard { display:flex; flex-direction:column; gap:2px; }
.pcard-art { position:relative; aspect-ratio:1; border-radius:16px; background:linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 40%, #000)); display:grid; place-items:center; overflow:hidden; margin-bottom:6px; }
.pmap { height:88%; } .pmap .bm-base, .pmap .bm-m, .heromap .bm-base, .heromap .bm-m { fill:#ffffff33; stroke:none; } .pmap .bm-p, .heromap .bm-p { fill:#fff; }
.lvl { position:absolute; left:8px; top:8px; background:#0006; color:#fff; font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; }
.pcard small { color:var(--muted); }
.exlist { display:flex; flex-direction:column; }
.exrow { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); width:100%; }
.exrow.slim { border:0; padding:6px 0; } .exrow div.grow { display:flex; flex-direction:column; } .exrow small { color:var(--muted); }
.exrow .fav { color:var(--accent); width:18px; height:18px; }
.thumbbox { width:56px; height:56px; border-radius:12px; background:var(--bg2); display:grid; place-items:center; padding:3px; flex:none; overflow:hidden; }
.hero { display:flex; gap:14px; align-items:center; padding:16px; margin:0 16px 12px; border-radius:20px; color:#fff; background:linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 40%, #000)); }
.hero .heromap { height:140px; } .hero .lvl { position:static; } .hero h2 { margin:6px 0 4px; } .hero p { font-size:14px; opacity:.9; }

/* workout tab */
.weekstrip { display:flex; justify-content:space-between; padding:0 12px 10px; border-bottom:1px solid var(--line); }
.day { display:flex; flex-direction:column; align-items:center; gap:4px; width:42px; position:relative; }
.day small { font-size:10px; color:var(--muted); font-weight:600; } .day b { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; font-weight:600; }
.day.on b { background:var(--bg2); } .day.today b { color:var(--accent); } .day.today.on b { background:var(--accent); color:#fff; }
.day i { width:5px; height:5px; border-radius:50%; background:var(--accent); position:absolute; bottom:-6px; }
.insights { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ins { background:var(--bg2); border-radius:18px; padding:16px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; aspect-ratio:1.05; }
.bignum { font-size:30px; }
.ring { --p:100; width:110px; height:110px; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; flex:none;
  background:radial-gradient(closest-side, var(--card) 82%, transparent 83%), conic-gradient(var(--good) calc(var(--p)*1%), var(--line) 0); }
.ins .ring { background:radial-gradient(closest-side, var(--bg2) 82%, transparent 83%), conic-gradient(var(--good) calc(var(--p)*1%), var(--line) 0); }
.ring b { font-size:24px; } .ring small { font-size:11px; color:var(--muted); }
.ring.sm { width:56px; height:56px; } .ring.sm b { font-size:13px; }
.rrow { display:flex; align-items:center; gap:10px; padding:12px 14px; background:var(--card); border:1px solid var(--line); border-radius:16px; margin:8px 0; }
.rrow small { color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* you */
.ultabs { display:flex; gap:20px; padding:0 16px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.ultabs button { padding:10px 0; color:var(--muted); font-weight:600; font-size:14px; border-bottom:2.5px solid transparent; white-space:nowrap; }
.ultabs button.on { color:var(--text); border-color:var(--text); }
.bigval { font-size:28px; margin-bottom:6px; }
.chart { width:100%; height:auto; display:block; margin:6px 0; }
.chart .bar { fill:var(--accent); } .chart .axis { font-size:9px; fill:var(--muted); }
.chart .gridline { stroke:var(--line); } .chart .dash { stroke-dasharray:3 3; }
.totals { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; text-align:center; margin:10px 0; }
.totals.four { grid-template-columns:repeat(2, 1fr); }
.totals div { background:var(--bg2); border-radius:14px; padding:12px 6px; display:flex; flex-direction:column; } .totals b { font-size:18px; } .totals small { color:var(--muted); }
.addrow { display:flex; gap:8px; margin-bottom:8px; } .addrow input { flex:1; min-width:0; padding:10px 12px; border-radius:12px; border:1px solid var(--line); background:var(--bg); }
.mrow { display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line); } .mrow span { flex:1; color:var(--muted); }
.recline { display:flex; align-items:center; gap:12px; width:100%; padding:8px 0; border-bottom:1px solid var(--line); } .recline div.grow { display:flex; flex-direction:column; }
.recline .micon { height:46px; }

/* exercise detail */
.demo { position:relative; background:#fff; border:1px solid var(--line); border-radius:20px; margin:12px 0; overflow:hidden; }
.demo-svg { display:block; width:100%; height:auto; aspect-ratio:200/190; }
.demo-btn { position:absolute; width:34px; height:34px; border-radius:50%; background:var(--card); display:grid; place-items:center; box-shadow:0 1px 4px #0002; }
.demo-btn .ic { width:16px; height:16px; } .demo-btn.tl { right:10px; top:10px; } .demo-btn.br { right:10px; bottom:10px; }
.demo-tag { position:absolute; left:10px; top:10px; background:var(--card); border-radius:999px; padding:4px 10px; font-size:12px; font-weight:600; }
.demo-svg { --skin:#d4d6dc; --skin-far:#e6e7eb; --skin-line:#8d929f; --hair:#3b3430; --cloth:#2a2e37; --frame:#b7bbc5; --pad:#30343d; }
.demo-svg .sk { fill:var(--skin); stroke:var(--skin-line); stroke-width:.7; stroke-linejoin:round; }
.demo-svg .sk.far { fill:var(--skin-far); }
.demo-svg .farside { opacity:.75; }
.demo-svg .gh { fill:var(--skin); stroke:none; }
.demo-svg .ghost { opacity:.2; }
.demo-svg .ghp { opacity:.8; }
.demo-svg .shorts, .demo-svg .top { fill:var(--cloth); stroke:none; } .demo-svg .shorts.far { fill:#4a4f5c; }
.demo-svg .shoe { fill:#3d424e; stroke:none; } .demo-svg .shoe.far { fill:#6b7080; }
.demo-svg .hair { fill:var(--hair); } .demo-svg .ear { fill:var(--skin); stroke:var(--skin-line); stroke-width:.6; }
.demo-svg .def { fill:none; stroke:var(--skin-line); stroke-width:.6; opacity:.7; stroke-linecap:round; }
.demo-svg .m-p { fill:var(--mp); opacity:.92; animation:glow 1.3s ease-in-out infinite; }
.demo-svg .m-s { fill:var(--ms); opacity:.85; }
@keyframes glow { 50% { opacity:.65; } }
.demo-svg .shadow { fill:#000; opacity:.08; }
.demo-svg .floorline { stroke:var(--line); stroke-width:1.5; fill:none; }
.demo-svg .pr { fill:var(--pad); } .demo-svg .pl { stroke:var(--frame); stroke-width:4; fill:none; }
.demo-svg .pf { fill:none; stroke:var(--frame); stroke-width:3.2; } .demo-svg .pb { stroke:#4a4f5c; stroke-width:3.5; stroke-linecap:round; fill:none; }
.demo-svg .cable { stroke:#555b68; stroke-width:1.2; fill:none; } .demo-svg .pulley { fill:#fff; stroke:var(--frame); stroke-width:2; }
.demo-svg .wt { fill:#9aa0ad; } .demo-svg .wt.on { fill:#4a4f5c; }
.demo-svg .plate { fill:#2b2e36; stroke:#4b505c; stroke-width:1; } .demo-svg .plate2 { fill:#3c404b; } .demo-svg .hub { fill:#a9aeb9; }
.demo-svg .pad { fill:var(--pad); }
.demo-svg .guide { stroke:var(--good); stroke-width:1.2; stroke-dasharray:3 2.5; fill:none; }
.demo-svg .cuedot { fill:#fff; stroke:var(--accent); stroke-width:1.4; } .demo-svg .cueline { stroke:var(--accent); stroke-width:.7; fill:none; }
.demo-svg .cuetxt { font-size:7px; font-weight:700; fill:var(--text); paint-order:stroke; stroke:var(--bg); stroke-width:2.4px; stroke-linejoin:round; }
.demo-svg .phase { font-size:7.5px; font-weight:800; paint-order:stroke; stroke:var(--bg); stroke-width:2.4px; } .demo-svg .phase.up { fill:var(--good); } .demo-svg .phase.down { fill:var(--warn); }
@media (prefers-color-scheme: dark) { .demo-svg { --skin:#8d93a0; --skin-far:#6c7280; --skin-line:#4a4f5b; --frame:#5a5f6b; --pad:#1f2228; } .demo-svg .pulley { fill:#2a2d34; } }
.equipcard { display:flex; align-items:center; gap:14px; } .equipcard div { display:flex; flex-direction:column; }
.equip { width:120px; flex:none; stroke:var(--muted); fill:none; stroke-width:2.5; stroke-linecap:round; }
.equip .fill { fill:var(--accent); stroke:none; } .equip .fill2 { fill:var(--muted); stroke:none; } .equip .thin { stroke-width:2; }
.equip .floor { stroke:var(--line); }
.equip .mv { animation:lift 2s ease-in-out infinite; } .equip .mv-stack { animation:lift 2s ease-in-out infinite; }
.equip .mv-h { animation:pull 2s ease-in-out infinite; transform-origin:46px 16px; } .equip .mv-arm { animation:arm 2s ease-in-out infinite; transform-origin:78px 70px; }
@keyframes lift { 50% { transform:translateY(-10px); } } @keyframes pull { 50% { transform:rotate(14deg); } } @keyframes arm { 50% { transform:rotate(-30deg); } }
.steps { padding-left:0; list-style:none; counter-reset:s; } .steps li { counter-increment:s; display:flex; gap:12px; margin:10px 0; }
.steps li::before { content:counter(s); width:26px; height:26px; border-radius:50%; background:var(--accent2); color:var(--accent); display:grid; place-items:center; font-weight:700; font-size:13px; flex:none; }
.setline { display:flex; align-items:center; gap:12px; padding:5px 0; } .setline span:nth-child(2) { flex:1; }
.fulldemo { position:absolute; inset:0; z-index:80; background:var(--bg); overflow-y:auto; padding:var(--safe-t) 0 30px; }
.fulldemo .demo-svg { width:100%; } .fulldemo .steps { padding:0 16px; }
.congrats { text-align:center; font-size:40px; padding:10px 0; } .congrats h2 { font-size:22px; } .congrats p { font-size:14px; color:var(--muted); }

/* tab bar, fab */
.tabbar { position:absolute; left:12px; right:12px; bottom:calc(10px + var(--safe-b)); display:flex; justify-content:space-around; z-index:20;
  background:color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter:blur(16px); border:1px solid var(--line); border-radius:28px; padding:6px; box-shadow:0 6px 24px #0000001a; }
.tabbar button { display:flex; flex-direction:column; align-items:center; gap:1px; font-size:10px; font-weight:600; color:var(--muted); padding:6px 10px; border-radius:20px; }
.tabbar button.on { color:var(--text); background:var(--bg2); }
.fab { position:absolute; right:16px; bottom:calc(84px + var(--safe-b)); z-index:21; display:flex; align-items:center; gap:8px; background:var(--accent); color:#fff;
  padding:13px 20px; border-radius:16px; font-weight:700; box-shadow:0 8px 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.fab .ic { width:16px; height:16px; }
.wpill { position:absolute; left:16px; right:16px; bottom:calc(84px + var(--safe-b)); z-index:21; display:flex; align-items:center; gap:12px; padding:10px 16px;
  background:color-mix(in srgb, var(--good) 18%, var(--card)); border:1px solid color-mix(in srgb, var(--good) 40%, transparent); border-radius:18px; box-shadow:0 6px 20px #0002; }
.wpill i { width:10px; height:10px; border-radius:50%; background:var(--good); animation:pulse 1.4s infinite; } .wpill div { flex:1; display:flex; flex-direction:column; }

/* active workout */
.active { position:absolute; inset:0; z-index:30; background:var(--bg); transform:translateY(105%); transition:transform .28s cubic-bezier(.2,.8,.2,1); display:flex; flex-direction:column; padding-top:var(--safe-t); }
.active.open { transform:none; }
.active > .top { position:relative; z-index:2; }
.ascroll { position:relative; inset:auto; flex:1; padding:0 16px calc(120px + var(--safe-b)); }
.titleinput { width:100%; font-size:22px; font-weight:700; border:0; background:none; outline:none; padding:4px 0 10px; }
.astats { display:grid; grid-template-columns:repeat(3, 1fr); border:1px solid var(--line); border-radius:16px; padding:10px; text-align:center; }
.astats div { display:flex; flex-direction:column; } .astats small { color:var(--muted); } .astats b { font-size:17px; font-variant-numeric:tabular-nums; }
.empty { text-align:center; padding:28px 0 6px; }
.aex { margin:18px 0; }
.aex-head { display:flex; align-items:center; gap:12px; } .aex-head small { color:var(--muted); } .aex-head b { color:var(--accent); }
.notes { width:100%; border:0; background:none; outline:none; color:var(--muted); padding:8px 0; font-size:14px; }
.settable { font-size:14px; }
.sh, .sr { display:grid; grid-template-columns:34px 1fr 64px 64px 40px; gap:8px; align-items:center; }
.sh { font-size:11px; font-weight:700; color:var(--muted); padding:4px 0; } .sh .ic { width:14px; height:14px; justify-self:center; }
.sr { padding:4px 0; border-radius:10px; transition:background .2s; }
.sr.done { background:color-mix(in srgb, var(--good) 14%, transparent); }
.setno { font-weight:700; color:var(--accent); text-align:center; }
.setno.warmup { color:var(--warn); } .setno.drop { color:#a855f7; } .setno.failure { color:var(--danger); }
.prev { color:var(--muted); font-size:13px; text-align:center; }
.sr input { width:100%; text-align:center; padding:8px 2px; border-radius:9px; border:0; background:var(--bg2); outline:none; font-weight:600; }
.sr.done input { background:transparent; }
.chk { width:34px; height:30px; border-radius:9px; background:var(--bg2); display:grid; place-items:center; justify-self:center; }
.chk .ic { width:16px; height:16px; } .sr.done .chk { background:var(--good); color:#fff; }
.restbar { position:absolute; left:12px; right:12px; bottom:calc(14px + var(--safe-b)); z-index:3; display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:18px;
  background:var(--card); border:1px solid var(--line); box-shadow:0 8px 24px #0003; overflow:hidden; }
.restbar b { flex:1; font-size:20px; font-variant-numeric:tabular-nums; }
.restprog { position:absolute; left:0; bottom:0; height:3px; background:var(--accent); transition:width .5s linear; }

/* picker */
.sheet { position:absolute; inset:0; z-index:35; background:var(--bg); display:flex; flex-direction:column; padding-top:var(--safe-t); } .sheet.enter { animation:up .25s ease-out; }
@keyframes up { from { transform:translateY(40%); opacity:.3; } }
.mchips { display:flex; gap:8px; overflow-x:auto; padding:2px 16px 10px; scrollbar-width:none; flex:none; }
.mchips button { display:flex; flex-direction:column; align-items:center; gap:2px; border-radius:14px; padding:4px; border:2px solid transparent; }
.mchips button.on { border-color:var(--accent); } .mchips .micon, .mchips .cardio-ico { height:54px; font-size:24px; } .mchips small { font-size:10px; color:var(--muted); }
.allico { height:54px; width:30px; display:grid; place-items:center; font-weight:800; font-size:12px; }
.pgrid2 { flex:1; overflow-y:auto; display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:4px 16px 110px; align-content:start; }
.pcell { position:relative; background:var(--bg2); border-radius:16px; padding:10px; display:flex; flex-direction:column; border:2px solid transparent; }
.pcell.sel { border-color:var(--accent); background:var(--accent2); }
.pimg { position:relative; height:120px; display:flex; justify-content:center; margin:14px 0 6px; } .pimg .pic { height:100%; width:auto; }
.minimap { position:absolute; right:-4px; bottom:-4px; height:46px; background:var(--card); border-radius:10px; padding:3px; } .minimap .thumb { height:100%; } .pcell b { font-size:14px; line-height:1.2; } .pcell small { color:var(--muted); }
.pfav, .pinfo, .pcheck { position:absolute; top:8px; color:var(--muted); } .pfav { left:8px; } .pinfo { right:8px; } .pcheck { right:34px; color:var(--accent); }
.pfav .ic, .pinfo .ic, .pcheck .ic { width:18px; height:18px; }
.floatbtn { position:absolute; left:16px; right:16px; bottom:calc(16px + var(--safe-b)); padding:15px; border-radius:16px; box-shadow:0 8px 24px #0003; }

/* routine editor */
.rex { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); } .rex div.grow { display:flex; flex-direction:column; } .rex small { color:var(--muted); }
.stepper { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; }
.stepper button { width:28px; height:28px; border-radius:8px; background:var(--bg2); font-size:16px; text-align:center; }

/* action sheet, toast */
.scrim { position:absolute; inset:0; background:#0006; z-index:90; } .scrim.enter { animation:fade .2s; }
@keyframes fade { from { opacity:0; } }
.actionsheet { position:absolute; left:10px; right:10px; bottom:calc(10px + var(--safe-b)); z-index:91; background:var(--card); border-radius:22px; padding:10px; max-height:80%; overflow-y:auto; } .actionsheet.enter { animation:up .22s ease-out; }
.actionsheet h3 { margin:6px 10px 8px; font-size:14px; color:var(--muted); }
.actionsheet button { display:flex; align-items:center; gap:12px; width:100%; padding:13px 12px; border-radius:12px; font-weight:600; }
.actionsheet button:active { background:var(--bg2); } .actionsheet .danger { color:var(--danger); }
.actionsheet .cancel { justify-content:center; background:var(--bg2); margin-top:6px; }
#toast { position:absolute; left:50%; top:calc(14px + var(--safe-t)); transform:translate(-50%, -80px); z-index:100; background:var(--text); color:var(--bg); padding:10px 16px; border-radius:999px;
  font-size:14px; font-weight:600; transition:transform .25s; white-space:nowrap; pointer-events:none; }
#toast.show { transform:translate(-50%, 0); }

.thumbbox .pic { width:100%; height:100%; aspect-ratio:auto; }

.demo-btn.bl { left:10px; bottom:10px; width:auto; padding:0 12px; border-radius:999px; font-size:12px; font-weight:700; }
.demo-btn.bl.on { background:var(--accent); color:#fff; }
.sexpick { display:flex; gap:8px; margin:4px 0 0; }
.sexpick button { flex:1; padding:9px; border-radius:12px; background:var(--bg2); font-weight:700; font-size:14px; text-align:center; }
.sexpick button.on { background:var(--text); color:var(--bg); }
@media (prefers-color-scheme: dark) { .demo { background:#15171c; } }

/* quick builder, suggestions */
.qtiles { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin:6px 0 10px; }
.qtile { background:var(--bg2); border-radius:16px; padding:8px 4px; display:flex; flex-direction:column; align-items:center; gap:4px; font-size:12px; }
.qtile .qmap { height:64px; } .dice { height:64px; display:grid; place-items:center; font-size:34px; }
.genrow { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); } .genrow small { color:var(--muted); }
.genrow .icbtn { background:var(--bg2); font-size:16px; }
.suggest { display:flex; align-items:center; gap:12px; width:100%; background:linear-gradient(135deg, var(--accent2), var(--bg2)); border-radius:18px; padding:10px; margin:6px 0; }
.suggest .pic { width:110px; height:auto; flex:none; background:#fff; border-radius:12px; }
.suggest div { display:flex; flex-direction:column; } .suggest small { color:var(--muted); } .suggest b { font-size:17px; } .suggest span { font-size:13px; color:var(--accent); font-weight:600; }
.card.note { background:color-mix(in srgb, var(--warn) 10%, var(--card)); border-color:color-mix(in srgb, var(--warn) 35%, transparent); font-size:14px; }

/* onboarding */
.onb { position:absolute; inset:0; z-index:95; background:var(--bg); display:flex; flex-direction:column; padding-top:var(--safe-t); overflow-y:auto; }
.onb-prog { flex:1; height:6px; background:var(--bg2); border-radius:9px; overflow:hidden; } .onb-prog i { display:block; height:100%; background:var(--accent); transition:width .3s; }
.onb-hero { flex:1; padding:10px 24px; text-align:center; } .onb-hero h1 { font-size:28px; margin:10px 0 6px; }
.onb-figs { display:grid; grid-template-columns:1fr 1fr; gap:10px; } .onb-figs > div { background:#fff; border:1px solid var(--line); border-radius:20px; overflow:hidden; }
.onb-q { flex:1; padding:6px 20px 16px; } .onb-q h1 { font-size:26px; margin:8px 0 4px; }
.onb-foot { padding:12px 20px calc(18px + var(--safe-b)); position:sticky; bottom:0; background:var(--bg); }
.onb-opts { display:flex; flex-direction:column; gap:10px; margin-top:16px; } .onb-opts.grid { display:grid; grid-template-columns:1fr 1fr; }
.onb-opts button { display:flex; align-items:center; gap:12px; padding:16px; border-radius:16px; background:var(--bg2); border:2px solid transparent; font-size:16px; }
.onb-opts button div { flex:1; display:flex; flex-direction:column; } .onb-opts small { color:var(--muted); font-size:13px; }
.onb-opts button.on { border-color:var(--accent); background:var(--accent2); } .onb-opts .ic { color:var(--accent); }
.onb-opts .em { font-size:24px; }
.onb-sex { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.onb-sex button { background:#fff; border:2px solid var(--line); border-radius:20px; padding:6px 6px 12px; display:flex; flex-direction:column; align-items:center; font-size:17px; color:#14161c; }
.onb-sex button.on { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent2); }
.onb-input { width:100%; font-size:20px; padding:14px 16px; border-radius:14px; border:1.5px solid var(--line); background:var(--bg2); margin:14px 0 6px; outline:none; }
.onb-lbl { display:block; font-weight:600; margin-top:10px; }
.hero.small { margin:14px 0; } .hero.small .heromap { height:110px; } .hero.small h2 { font-size:19px; }
.weekplan { display:grid; grid-template-columns:repeat(7, 1fr); gap:4px; }
.weekplan div { background:var(--bg2); border-radius:12px; padding:8px 2px; text-align:center; display:flex; flex-direction:column; gap:2px; min-height:64px; }
.weekplan small { color:var(--muted); font-size:11px; } .weekplan b { font-size:10px; line-height:1.15; color:var(--muted); }
.weekplan .on { background:var(--accent); } .weekplan .on small, .weekplan .on b { color:#fff; }

/* run tab */
.runhero { background:linear-gradient(150deg, #ff7a45, #e8413c); color:#fff; border-radius:22px; padding:18px; margin:6px 0 10px; }
.runhero small { opacity:.85; } .runhero h2 { margin:4px 0; font-size:24px; } .runhero p { opacity:.92; }
.runhero .btn.primary { background:#fff; color:#e8413c; } .btn.big { font-size:17px; padding:15px; }
.runhero .legend { color:#fff; font-size:12px; }
.segstrip { display:flex; gap:2px; height:14px; border-radius:7px; overflow:hidden; margin:10px 0 4px; }
.segstrip i, .legend i.rl-run, .legend i.rl-walk, .legend i.rl-warm { display:block; }
.segstrip .run, .rl-run { background:#fff; } .segstrip .walk, .rl-walk { background:#ffffff70; } .segstrip .warm, .segstrip .cool, .rl-warm { background:#ffffff35; }
.plangrid { display:flex; flex-direction:column; gap:6px; }
.wkrow { display:flex; align-items:center; gap:8px; font-size:12px; } .wkrow > small { width:24px; font-weight:700; color:var(--muted); }
.wkrow span { flex:1; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rdot { width:32px; height:32px; border-radius:50%; background:var(--bg2); font-weight:700; font-size:13px; text-align:center; flex:none; }
.rdot.on { background:var(--good); color:#fff; } .rdot.next { box-shadow:0 0 0 2.5px #e8413c; color:#e8413c; }
.okc { color:var(--good); font-weight:700; }
.route { width:100%; max-height:240px; } .route polyline { fill:none; stroke:#e8413c; stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }
.route .s { fill:var(--good); } .route .e { fill:#e8413c; } .nomap { text-align:center; padding:30px 0; }

.runlive { position:absolute; inset:0; z-index:96; display:flex; flex-direction:column; padding-top:var(--safe-t); color:#fff; transition:background .4s;
  background:linear-gradient(170deg, #ff7a45, #e8413c); }
.runlive.walk { background:linear-gradient(170deg, #22b8cf, #1c7ed6); } .runlive.warm, .runlive.cool { background:linear-gradient(170deg, #748ffc, #5f3dc4); }
.runlive .top { color:#fff; } .runlive .gps { opacity:.8; font-size:12px; }
.rl-total { height:5px; margin:0 16px; background:#ffffff40; border-radius:9px; overflow:hidden; } .rl-total i { display:block; height:100%; width:0; background:#fff; }
.rl-main { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:0 20px; }
.rl-label { font-size:22px; font-weight:800; letter-spacing:2px; opacity:.95; }
.rl-time { font-size:88px; font-weight:800; font-variant-numeric:tabular-nums; line-height:1.05; }
.rl-segbar { width:70%; height:8px; background:#ffffff40; border-radius:9px; overflow:hidden; margin:10px 0 8px; } .rl-segbar i { display:block; height:100%; width:0; background:#fff; transition:width .5s linear; }
.rl-next { font-size:14px; opacity:.9; }
.rl-stats { display:grid; grid-template-columns:repeat(3, 1fr); text-align:center; padding:10px 16px; }
.rl-stats div { display:flex; flex-direction:column; } .rl-stats b { font-size:24px; font-variant-numeric:tabular-nums; } .rl-stats small { opacity:.85; }
.rl-msg { margin:8px 16px; min-height:58px; background:#ffffff26; border-radius:18px; padding:12px 16px; font-size:17px; font-weight:600; text-align:center; display:grid; place-items:center; }
.rl-msg:empty { visibility:hidden; }
.rl-ctrl { display:flex; gap:10px; padding:10px 16px 4px; } .rl-ctrl .btn { flex:1; background:#ffffff30; color:#fff; } .rl-ctrl .btn.primary { flex:2; background:#fff; color:#14161c; }
.rl-ctrl .btn.danger { color:#fff; }
.rl-tip { text-align:center; font-size:12px; opacity:.75; margin:4px 16px calc(14px + var(--safe-b)); }
.tabbar button { padding:6px 6px; }
.chips.wrap { flex-wrap:wrap; }
.rl-feel { display:flex; gap:8px; padding:4px 16px; } .rl-feel button { flex:1; background:#ffffff26; color:#fff; border-radius:14px; padding:10px 4px; font-size:13px; font-weight:700; text-align:center; }
.rl-coach { text-align:center; opacity:.8; min-height:14px; font-size:12px; }
.runhero .fin { margin:6px 0 0; font-weight:700; opacity:1; }
.onb-input.sm { font-size:16px; padding:11px 14px; } .muted.small { font-size:12px; }
.qtiles { grid-template-columns:repeat(5, 1fr); } .qtile b { font-size:11px; text-align:center; }
.scrim { z-index:97; } .actionsheet { z-index:98; } #toast { z-index:100; }

/* real photo pairs: fade between start and end position */
.ph { position:relative; width:100%; height:100%; overflow:hidden; background:#e9eaee; }
.ph img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.ph .b { animation:phswap 2.6s ease-in-out infinite; }
.ph.paused .b { animation-play-state:paused; }
@keyframes phswap { 0%, 38% { opacity:0; } 50%, 88% { opacity:1; } 100% { opacity:0; } }
.ph.big { aspect-ratio:3/2; height:auto; border-radius:16px; }
.demo.photo { padding:0; } .demo.photo .ph.big { border-radius:0; }
.demo-map { left:auto; right:10px; top:52px; bottom:auto; height:70px; box-shadow:0 1px 4px #0003; }
.se-tag { position:absolute; left:10px; bottom:10px; background:#000a; color:#fff; font-size:12px; font-weight:700; border-radius:999px; padding:4px 10px; }
.demo.photo .demo-tag { top:10px; }
.thumbbox .ph { border-radius:10px; }
.pimg .ph { border-radius:10px; }
.suggest .ph { width:110px; height:80px; flex:none; border-radius:12px; }
.sexpick.vis { margin-bottom:8px; } .sexpick.vis button { font-size:13px; }
.hdr-btns { display:flex; gap:2px; }
.share-card { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; align-items:start; background:linear-gradient(135deg, var(--accent2), var(--card)); }
.share-card h3 { margin:0 0 2px; } .share-card p { margin:0 0 4px; font-size:14px; } .share-card .btn { grid-column:1 / -1; margin-bottom:0; }
.share-ico { width:42px; height:42px; border-radius:12px; background:var(--accent); color:#fff; display:grid; place-items:center; }
.cardwrap { position:relative; } .cardwrap .wcard { padding-right:44px; } .cardwrap .optcard { padding-right:48px; }
.cardmenu { position:absolute; right:6px; top:8px; z-index:2; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; color:var(--muted); }
.cardmenu.mid { top:50%; transform:translateY(-50%); } .cardmenu:active { background:var(--bg2); }
.rrow .icbtn.sm { color:var(--muted); }
.danger-link { color:var(--danger); margin:8px auto; }
.active > .top .btn.danger { background:var(--bg2); }
