/* Gym workout tracker: mobile first */
.gym{--gr:#e4443a;--gb:#2f6bff;--gy:#e9b520;--gg:#1fa463;--go:#ef7d1a;--gx:#7b8494;--done:#1fa463;margin:8px 0;position:relative;display:flex;flex-direction:column;padding-bottom:calc(92px + env(safe-area-inset-bottom,0px));-webkit-tap-highlight-color:transparent}
.gym *{box-sizing:border-box}
.gym button,.gym input,.gym select{font:inherit;color:inherit;touch-action:manipulation}
.gym button{cursor:pointer}
.gym :focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.gym input,.gym select{background:var(--bg);border:1.5px solid var(--line);border-radius:14px;padding:12px 14px;min-width:0;min-height:50px;font-size:17px}
.gym button:disabled{opacity:.4;cursor:default}
/* bottom tab bar */
.gtabs{position:fixed;left:0;right:0;bottom:0;z-index:45;display:grid;grid-template-columns:repeat(5,1fr);background:var(--surface);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))}
.gtabs button{border:0;background:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 2px;min-height:56px;font-size:11.5px;font-weight:600;border-radius:14px}
.gtabs svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.gtabs button.on{color:var(--brand)}
.gtabs button.on svg{stroke-width:2.3}
.gtabs span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* type */
.gh{font-size:26px;line-height:1.15;margin:14px 0 10px;letter-spacing:-.4px}
.gh2{font-size:19px;margin:20px 0 8px}
.gym h3{font-size:18px;margin:0}
.gp{font-size:17px;line-height:1.55}
.gmu{color:var(--muted);font-size:14px}.gmt{margin-top:12px}
.gc{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:16px;margin:10px 0;box-shadow:var(--shadow);width:100%}
.gok{background:var(--soft);font-weight:700;text-align:center}
.grow{display:flex;align-items:center;gap:10px}.gsp{justify-content:space-between}.gwrap{flex-wrap:wrap}
.gym input.gw,.gym select.gw{width:100%}.gfl{flex:1}
.gbtn,.gs{border:0;border-radius:16px;background:var(--brand);color:var(--brand-ink);font-weight:700;padding:14px 20px;min-height:52px;font-size:17px}
.gs{padding:10px 14px;font-size:15px;min-height:44px;border-radius:13px}
.gg,.gline{background:transparent;color:var(--ink);border:1.5px solid var(--line)}
.gfull{width:100%;margin-top:12px}
.gx{border:0;background:none;color:var(--muted);min-width:44px;min-height:44px;font-size:20px;border-radius:12px}
.gchips{display:flex;gap:8px;overflow-x:auto;padding:2px 0 8px;scrollbar-width:none}
.gchips::-webkit-scrollbar,.gpills::-webkit-scrollbar{display:none}
.gchip{white-space:nowrap;background:var(--surface);border:1.5px solid var(--line);padding:11px 18px;min-height:46px;border-radius:99px;font-weight:700;font-size:15px}
.gchip.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.gprog{display:flex;justify-content:space-between;font-size:14px;color:var(--muted);margin-top:4px}.gprog b{color:var(--ink)}
.gbar{height:10px;border-radius:9px;background:var(--soft);overflow:hidden;margin:6px 0 12px}
.gbar i{display:block;height:100%;border-radius:9px;background:var(--done);transition:width .3s}
/* exercise pills */
.gpills{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 12px;scrollbar-width:none}
.gpill{flex:0 0 auto;width:50px;height:50px;border-radius:50%;padding:0;border:4px solid var(--gc);background:var(--surface);font-weight:800;font-size:17px}
.gpill.ok{background:var(--gc);color:#fff}
.gpill.cur{box-shadow:0 0 0 3px var(--surface),0 0 0 6px var(--ink)}
/* focus card */
.gfocus{background:var(--surface);border:1px solid var(--line);border-top:8px solid var(--gc);border-radius:24px;padding:18px 16px 16px;box-shadow:var(--shadow)}
.gtitle{font-size:26px;line-height:1.15;margin:0 0 2px;letter-spacing:-.4px}
.glast{margin-top:10px;background:var(--soft);border-radius:12px;padding:8px 12px;font-size:14px;font-weight:600}
.gsetl{margin:16px 0 8px;font-weight:700;font-size:15px;color:var(--muted)}
.gdots{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:6px}
.gdot{width:52px;height:52px;border-radius:50%;padding:0;border:4px solid var(--gc);background:var(--bg);font-weight:800;font-size:18px}
.gdot.ok{background:var(--gc);color:#fff}
.gdot.cur{box-shadow:0 0 0 3px var(--surface),0 0 0 6px var(--ink)}
.gdot.gadd{border:2px dashed var(--line);color:var(--muted);font-size:24px;font-weight:600}
.gstep{margin-top:14px}
.gsr{display:grid;grid-template-columns:68px 1fr 68px;gap:10px;margin-top:6px}
.gpm{height:64px;border-radius:18px;border:0;background:var(--soft);color:var(--ink);font-size:34px;font-weight:700;line-height:1;padding:0}
.gpm:active{background:var(--line)}
.gym .gsr input{height:64px;text-align:center;font-size:34px;font-weight:800;padding:0;border-radius:18px;width:100%}
.gdone{display:block;width:100%;min-height:68px;margin-top:18px;border:0;border-radius:20px;background:var(--done);color:#fff;font-size:21px;font-weight:800}
.gdone.undo{background:transparent;color:var(--ink);border:2px solid var(--line);font-size:17px;min-height:56px}
.gdone:active{filter:brightness(.92)}
.gnav{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.gnav button{min-height:54px;border-radius:16px;border:1.5px solid var(--line);background:var(--surface);font-weight:700;font-size:16px}
/* programs */
.gpe{margin-top:14px;border-left:6px solid var(--gc);padding-left:12px}
.gfields{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:8px}
.gfields label span{display:block;font-size:13px;color:var(--muted);margin-bottom:4px}
.gym .gfields input{width:100%;text-align:center}
.gtag{display:inline-block;font-size:13px;font-weight:700;padding:4px 11px;border-radius:99px;background:var(--gc);color:#fff;white-space:nowrap}
.glib{display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;border-left:8px solid var(--gc);min-height:68px;font-size:16px}
.gstat>div{flex:1;text-align:center}.gstat b{display:block;font-size:34px;line-height:1.1}.gstat span{color:var(--muted);font-size:13px}
.gtbl{width:100%;border-collapse:collapse}.gtbl td{padding:10px 0;border-bottom:1px solid var(--line)}.gtbl tr:last-child td{border-bottom:0}.gtbl td:last-child{text-align:right;font-weight:700}
.gbig{font-size:34px;font-weight:800;letter-spacing:-.5px}
/* rest timer */
.grest{position:fixed;left:12px;right:12px;bottom:calc(80px + env(safe-area-inset-bottom,0px));transform:translateY(180%);z-index:44;background:var(--ink);color:var(--bg);border-radius:20px;overflow:hidden;transition:transform .25s;box-shadow:0 14px 34px -8px rgba(0,0,0,.55);max-width:560px;margin:0 auto}
.grest.on{transform:none}
.grf{position:absolute;left:0;top:0;bottom:0;width:100%;background:rgba(255,255,255,.14)}
.grin{position:relative;display:flex;align-items:center;gap:8px;padding:10px 12px}
.grin span{font-size:14px;opacity:.8}
.grin b{font-size:32px;min-width:78px;font-variant-numeric:tabular-nums}
.grin .gs{background:var(--bg);color:var(--ink);padding:10px 12px}
.grin .gsk{margin-left:auto}
/* sheet */
.gmod{position:fixed;inset:0;background:rgba(8,12,28,.6);display:none;align-items:flex-end;z-index:60}
.gmod.on{display:flex}
.gmod>div{background:var(--surface);color:var(--ink);width:100%;max-width:640px;margin:0 auto;border-radius:26px 26px 0 0;padding:10px 20px calc(24px + env(safe-area-inset-bottom,0px));max-height:90vh;overflow:auto}
.ghandle{width:44px;height:5px;border-radius:9px;background:var(--line);margin:4px auto 8px}
.gmod .gh{margin:0}
/* desktop */
@media (min-width:900px){
 .gym{padding-bottom:12px;max-width:720px;margin-left:auto;margin-right:auto}
 .gtabs{position:static;order:-1;border:0;border-radius:18px;background:var(--soft);padding:5px;gap:4px;margin-bottom:6px}
 .gtabs button{flex-direction:row;justify-content:center;font-size:14px;min-height:48px;gap:8px}
 .gtabs button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
 .gtabs svg{width:21px;height:21px}
 .grest{bottom:20px}
 .gmod{align-items:center}.gmod>div{border-radius:26px}
}
@media (prefers-reduced-motion:reduce){.gym *,.grest{transition:none!important}}
@media (max-width:899px){body[data-x="gym"] footer{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}}
