:root{
  --bg:#070b16; --bg2:#0a1020; --surface:#111a2e; --surface2:#16213a; --surface3:#1d2a47;
  --line:#22304f; --line2:#2c3c60;
  --text:#eef2fb; --text2:#a9b4cc; --muted:#7f8ba6;
  --accent:#2f7cf6; --accent2:#5aa2ff; --accent-soft:rgba(47,124,246,.14);
  --s1:#3987e5; --s2:#d95926; --s3:#199e70;
  --good:#0ca30c; --warn:#fab219; --bad:#d03b3b;
  --grid:#1c2742; --axis:#2c3a5a;
  --r:16px; --r-sm:10px;
  --font: system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:var(--font);-webkit-font-smoothing:antialiased}
body{background:radial-gradient(1200px 600px at 80% -10%,#10224a 0%,transparent 60%),var(--bg)}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
input,select,textarea{font:inherit;color:var(--text)}
h1,h2,h3,h4{margin:0;letter-spacing:-.01em}
.muted{color:var(--muted)} .t2{color:var(--text2)}
.num{font-variant-numeric:tabular-nums}
:focus-visible{outline:2px solid var(--accent2);outline-offset:2px}
.sheet:focus{outline:none}
.input:focus-visible,.sets input:focus-visible,.ex-note textarea:focus-visible{outline:none}

/* ---------- shell ---------- */
.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;padding:24px 16px;border-right:1px solid var(--line);background:rgba(10,16,32,.7);backdrop-filter:blur(12px);display:flex;flex-direction:column;gap:24px}
.brand{font-size:22px;font-weight:600;padding:0 10px;display:flex;align-items:center;gap:10px}
.brand b{background:linear-gradient(90deg,var(--accent2),#9ccfff);-webkit-background-clip:text;color:transparent}
.brand-mark{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,var(--accent),#1747a8);color:#fff}
.brand-mark i{display:grid;place-items:center}
.nav{display:flex;flex-direction:column;gap:4px}
.nav a{display:flex;gap:12px;align-items:center;padding:11px 12px;border-radius:12px;color:var(--text2);font-weight:500;transition:.15s}
.nav a i{font-style:normal;width:22px;height:22px;display:grid;place-items:center;flex:none;opacity:.9}
.nav a:hover{background:var(--surface)}
.nav a.active{background:var(--accent-soft);color:#fff}
.nav a.active i{color:var(--accent2)}
.sidebar-foot{margin-top:auto}
.main{padding:28px 36px 100px;max-width:1280px;width:100%}

@media (max-width:860px){
  .shell{grid-template-columns:1fr}
  .sidebar{position:fixed;bottom:0;top:auto;left:0;right:0;height:auto;z-index:20;flex-direction:row;padding:6px 8px calc(6px + env(safe-area-inset-bottom));border-right:0;border-top:1px solid var(--line)}
  .brand,.sidebar-foot{display:none}
  .nav{flex-direction:row;width:100%;justify-content:space-around;gap:2px}
  .nav a{flex-direction:column;gap:2px;font-size:11px;padding:6px 2px;flex:1 1 0;min-width:0}
  .nav a span{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .main{padding:18px 14px 110px}
}

/* ---------- common ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:22px;flex-wrap:wrap}
.page-head h1{font-size:30px;font-weight:700}
.page-head p{margin:6px 0 0;color:var(--text2)}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.span2{grid-column:span 2}
@media (max-width:1100px){.g4{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:1fr 1fr}}
@media (max-width:700px){.g2,.g3{grid-template-columns:1fr}.span2{grid-column:auto}}
.card{background:linear-gradient(180deg,var(--surface) 0%,#0f1729 100%);border:1px solid var(--line);border-radius:var(--r);padding:18px}
.card-h{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:14px}
.card-h h3{font-size:15px;font-weight:600}
.card-h .sub{font-size:12px;color:var(--muted)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 18px;border-radius:12px;font-weight:600;background:var(--surface2);border:1px solid var(--line2);transition:.15s;white-space:nowrap}
.btn:hover{background:var(--surface3)}
.btn.primary{background:linear-gradient(180deg,#3b86ff,var(--accent));border-color:transparent;color:#fff;box-shadow:0 6px 20px rgba(47,124,246,.35)}
.btn.primary:hover{filter:brightness(1.08)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--text2)}
.btn.sm{padding:7px 12px;font-size:13px;border-radius:9px}
.btn.danger{color:#ff8080}
.btn.block{width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;background:var(--surface2);border:1px solid var(--line2);font-size:13px;color:var(--text2);white-space:nowrap}
.chip.on{background:var(--accent-soft);border-color:var(--accent);color:#fff}
button.chip:hover{border-color:var(--accent2)}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chips.scroll{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.tag{font-size:11px;padding:3px 8px;border-radius:6px;background:var(--surface3);color:var(--text2);text-transform:capitalize}
.tag.b{background:var(--accent-soft);color:var(--accent2)}
.input{width:100%;background:var(--bg2);border:1px solid var(--line2);border-radius:12px;padding:12px 14px;outline:none}
.input:focus{border-color:var(--accent)}
.seg{display:inline-flex;background:var(--bg2);border:1px solid var(--line2);border-radius:11px;padding:3px}
.seg button{padding:6px 12px;border-radius:8px;font-size:13px;color:var(--text2)}
.seg button.on{background:var(--surface3);color:#fff}
.empty{padding:40px;text-align:center;color:var(--muted)}
.loading{display:grid;place-items:center;height:60vh;color:var(--text2)}
.spinner{width:36px;height:36px;border:3px solid var(--line2);border-top-color:var(--accent);border-radius:50%;animation:spin 0.8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.demo-banner{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 14px;border-radius:12px;background:rgba(250,178,25,.08);border:1px solid rgba(250,178,25,.25);font-size:13px;color:#f3d48b;margin-bottom:18px;flex-wrap:wrap}

/* ---------- stat tiles ---------- */
.stat .label{font-size:13px;color:var(--text2)}
.stat .value{font-size:30px;font-weight:600;margin-top:6px;font-variant-numeric:tabular-nums}
.stat .value small{font-size:14px;color:var(--muted);font-weight:500;margin-left:4px}
.stat .row{display:flex;justify-content:space-between;align-items:flex-end;gap:8px}
.delta{font-size:12px;font-weight:600;margin-top:4px;display:flex;align-items:center;gap:4px}
.delta.up{color:#3fd06b} .delta.down{color:#ff7a7a} .delta.flat{color:var(--muted)}

/* ---------- hero (dashboard) ---------- */
.hero{position:relative;overflow:hidden;border-radius:22px;padding:28px;border:1px solid var(--line2);
  background:radial-gradient(500px 300px at 100% 0%,rgba(47,124,246,.35),transparent 70%),linear-gradient(135deg,#0f1b38,#0a1226)}
.hero h2{font-size:28px;font-weight:700;line-height:1.15}
.hero h2 span{background:linear-gradient(90deg,#fff,#8fc4ff);-webkit-background-clip:text;color:transparent}
.hero p{color:var(--text2);margin:8px 0 18px;max-width:520px}
.hero .next{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.thumbs{display:flex}
.thumbs img{width:44px;height:44px;border-radius:10px;object-fit:cover;background:#fff;border:2px solid #0f1b38;margin-left:-10px}
.thumbs img:first-child{margin-left:0}

/* ---------- charts ---------- */
.chart{position:relative;width:100%}
.chart svg{display:block;width:100%;overflow:visible}
.chart .gridline{stroke:var(--grid);stroke-width:1}
.chart .axis{stroke:var(--axis);stroke-width:1}
.chart text{fill:var(--muted);font-size:11px;font-family:var(--font)}
.chart .lbl{fill:var(--text2);font-weight:600}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12px;color:var(--text2);margin-bottom:8px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.tooltip{position:fixed;z-index:100;pointer-events:none;background:#0b1224;border:1px solid var(--line2);border-radius:10px;padding:8px 10px;font-size:12px;box-shadow:0 10px 30px rgba(0,0,0,.4);min-width:120px}
.tooltip b{display:block;margin-bottom:4px;color:#fff;font-weight:600}
.tooltip .tr{display:flex;justify-content:space-between;gap:14px;color:var(--text2)}
.tooltip .tr i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:6px}
.tooltip .tr em{font-style:normal;color:#fff;font-variant-numeric:tabular-nums}
.hbar{display:grid;grid-template-columns:110px 1fr 44px;align-items:center;gap:10px;font-size:13px;margin:7px 0}
.hbar .track{height:10px;border-radius:0 4px 4px 0;background:transparent;position:relative}
.hbar .fill{height:100%;border-radius:0 4px 4px 0;background:var(--s1)}
.hbar .v{text-align:right;color:var(--text2);font-variant-numeric:tabular-nums}
.cal{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,1fr);gap:3px}
.cal i{width:100%;aspect-ratio:1;border-radius:3px;background:#16203a;display:block}
.cal-wrap{display:grid;grid-template-columns:22px 1fr;gap:6px;font-size:10px;color:var(--muted)}
.cal-days{display:grid;grid-template-rows:repeat(7,1fr);gap:3px}
.scale{display:flex;gap:3px;align-items:center;font-size:11px;color:var(--muted);justify-content:flex-end;margin-top:8px}
.scale i{width:11px;height:11px;border-radius:3px;display:inline-block}

/* ---------- body map ---------- */
.bodymap{display:flex;gap:6px;justify-content:center}
.bodymap figure{margin:0;text-align:center}
.bodymap svg{height:260px;width:auto;display:block}
.bodymap figcaption{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-top:4px}
.bodymap .m{transition:fill .3s,filter .15s;cursor:pointer}
.bodymap .m:hover{filter:brightness(1.35)}
.recov-list{display:grid;grid-template-columns:repeat(2,1fr);gap:6px 14px;font-size:12px}
.recov-list div{display:flex;justify-content:space-between;align-items:center;gap:6px}
.recov-list .pill{font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;font-variant-numeric:tabular-nums}

/* ---------- library ---------- */
.lib-tools{display:flex;flex-direction:column;gap:12px;margin-bottom:18px;position:sticky;top:0;z-index:5;padding:10px 0;background:linear-gradient(180deg,var(--bg) 70%,transparent)}
.lib-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.lib-row select{background:var(--bg2);border:1px solid var(--line2);border-radius:10px;padding:9px 12px}
.ex-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}
.ex-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden;cursor:pointer;transition:.15s;display:flex;flex-direction:column}
.ex-card:hover{border-color:var(--accent);transform:translateY(-2px)}
.ex-img{position:relative;aspect-ratio:4/3;background:#fff;overflow:hidden}
.ex-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transition:opacity .25s}
.ex-img img.f1{opacity:0}
.ex-card:hover .ex-img img.f1{opacity:1}
.credit{font-size:11px;color:var(--muted)}
.credit a{text-decoration:underline}
.ex-body{padding:12px;display:flex;flex-direction:column;gap:6px;flex:1}
.ex-body h4{font-size:14px;font-weight:600;line-height:1.3}
.ex-body .en{font-size:11px;color:var(--muted)}
.ex-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto}

/* ---------- modal ---------- */
.modal{position:fixed;inset:0;z-index:50;background:rgba(3,6,14,.7);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;padding:20px}
.modal[hidden]{display:none}
.sheet{background:var(--bg2);border:1px solid var(--line2);border-radius:20px;width:min(920px,100%);max-height:92vh;overflow:auto;position:relative}
.sheet .close{position:absolute;right:14px;top:14px;width:36px;height:36px;border-radius:50%;background:var(--surface2);z-index:2;display:grid;place-items:center;color:var(--text2)}
.sheet .close:hover{background:var(--surface3);color:#fff}
.ex-detail{display:grid;grid-template-columns:1.1fr 1fr}
.ex-detail .media{background:#fff;position:relative;min-height:340px}
.ex-detail .media{display:flex;align-items:center;justify-content:center}
.ex-detail .media img{width:min(100%,360px);height:auto;object-fit:contain}
.ex-detail .info{padding:26px;display:flex;flex-direction:column;gap:14px}
.ex-detail ol{margin:0;padding-left:18px;color:var(--text2);font-size:14px;line-height:1.55}
.ex-detail ol li{margin-bottom:6px}
.play-ctl{position:absolute;left:12px;bottom:12px;display:flex;gap:6px}
.play-ctl button{background:rgba(10,16,32,.85);color:#fff;border-radius:8px;padding:6px 10px;font-size:12px}
@media (max-width:760px){.ex-detail{grid-template-columns:1fr}.ex-detail .media{min-height:260px}}

/* ---------- planner ---------- */
.wizard{display:grid;gap:18px}
.q h4{font-size:14px;margin-bottom:10px;color:var(--text2);font-weight:600}
.opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.opt{padding:14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);text-align:left;transition:.15s}
.opt:hover{border-color:var(--line2)}
.opt.on{border-color:var(--accent);background:linear-gradient(180deg,rgba(47,124,246,.18),rgba(47,124,246,.05))}
.opt b{display:block;font-size:14px;margin-bottom:3px}
.opt small{color:var(--muted);font-size:12px}
.opt .ic{width:40px;height:40px;border-radius:12px;margin-bottom:10px;display:grid;place-items:center;background:var(--surface2);color:var(--accent2);transition:.15s}
.opt.on .ic{background:var(--accent);color:#fff}
.routine-card{display:flex;flex-direction:column;gap:12px}
.ex-line{display:flex;gap:12px;align-items:center;padding:8px;border-radius:12px;background:var(--bg2);border:1px solid var(--line)}
.ex-line img{width:52px;height:52px;border-radius:9px;object-fit:cover;background:#fff;flex:none}
.ex-line .t{flex:1;min-width:0}
.ex-line .t b{display:block;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ex-line .t small{color:var(--muted);font-size:12px}
.ex-line .bars{display:flex;gap:2px;margin-bottom:3px}
.ex-line .bars i{width:10px;height:4px;border-radius:2px;background:var(--accent)}
.ex-line .bars i.off{background:var(--line2)}
.working{display:grid;grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:8px}
.working div{background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:8px;text-align:center;font-size:11px}
.working b{display:block;font-size:12px;margin-bottom:4px}
.working .pill{display:inline-block;margin-top:4px;padding:1px 7px;border-radius:999px;font-weight:600}
.ai-thinking{display:flex;flex-direction:column;align-items:center;gap:14px;padding:60px 20px;text-align:center}
.ai-thinking .orb{width:70px;height:70px;border-radius:50%;background:conic-gradient(from 0deg,var(--accent),#7ab8ff,#1747a8,var(--accent));animation:spin 1.2s linear infinite;mask:radial-gradient(circle,transparent 52%,#000 54%)}

/* ---------- workout player ---------- */
.player{position:fixed;inset:0;z-index:40;background:var(--bg);display:flex;flex-direction:column}
.player .ico{flex:none;display:block}
.player .btn.icon{padding:9px;min-width:40px}
.player .btn[disabled]{opacity:.35;pointer-events:none}
.player .btn.ghost.danger{color:#ff8080}
.player-top{display:flex;align-items:center;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top));border-bottom:1px solid var(--line);gap:8px;background:var(--bg2)}
.player-top .pt-mid{flex:1;min-width:0}
.player-top .pt-name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.player-top .pt-sub{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.player-top .clock{font-variant-numeric:tabular-nums;font-weight:600;color:var(--text)}
.player-top .btn.off{color:var(--muted)}
.player-top .wake{display:none;color:var(--warn);opacity:.9}
.player-top .wake.on{display:block}
.player-prog{height:3px;background:var(--line)}
.player-prog i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .3s}
.player-body{flex:1;overflow:auto;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:0;overscroll-behavior:contain}
.player-media{position:relative;background:#fff;min-height:300px;display:flex;align-items:center;justify-content:center}
.player-media img.main{width:min(78%,400px);height:auto;object-fit:contain}
.player-media .credit{position:absolute;left:10px;bottom:8px;color:#8a93a8}
.player-strip{position:absolute;right:10px;top:10px;bottom:10px;display:flex;flex-direction:column;gap:8px;overflow:auto;width:64px;scrollbar-width:none}
.player-strip::-webkit-scrollbar{display:none}
.player-strip button{position:relative;width:60px;height:60px;border-radius:10px;overflow:hidden;border:2px solid #dfe5f0;flex:none;background:#fff}
.player-strip button img{width:100%;height:100%;object-fit:cover}
.player-strip button.cur{border-color:var(--accent);box-shadow:0 0 0 2px rgba(47,124,246,.3)}
.player-strip button .ok{position:absolute;top:2px;right:2px;width:16px;height:16px;border-radius:4px;background:var(--accent);color:#fff;display:grid;place-items:center}
.player-panel{display:flex;flex-direction:column;padding:18px 18px 24px;gap:12px;border-left:1px solid var(--line);min-width:0}
.player-panel h2{font-size:20px;color:var(--accent2);line-height:1.25}
.ex-kicker{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-bottom:2px}
.ex-sub{font-size:13px;color:var(--muted);margin-top:4px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.sug{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--line);color:var(--text2)}
.sug .ico{color:var(--accent2)}
.sug>div{flex:1;min-width:0}
.sug b{display:block;font-size:13.5px;color:var(--text)}
.sug small{font-size:12px;color:var(--muted)}
.sug.up{border-color:rgba(12,163,12,.45);background:linear-gradient(180deg,rgba(12,163,12,.12),rgba(12,163,12,.04))}
.sug.up .ico{color:#3ccf3c}
.ex-tools,.set-ctl,.ex-move{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ex-tools .chip{margin-left:auto;font-weight:600}
.ex-move{border-top:1px solid var(--line);padding-top:10px}
.ex-move .danger{margin-left:auto}
.sets{width:100%;border-collapse:separate;border-spacing:0 6px;table-layout:fixed}
.sets th{font-size:12px;color:var(--muted);font-weight:500;text-align:center;padding:2px 4px}
.sets th:first-child{width:52px}.sets th:nth-child(2){width:24%}.sets th:last-child{width:52px}
.sets.with-rpe th:nth-child(5){width:16%}
.sets td{text-align:center;padding:0;background:var(--surface);font-variant-numeric:tabular-nums;transition:background .15s}
.sets td:first-child{border-radius:10px 0 0 10px}.sets td:last-child{border-radius:0 10px 10px 0}
.sets td.prev{font-size:13px;color:var(--muted)}
.sets td.prev button{color:inherit;padding:8px 2px;width:100%;border-radius:6px}
.sets td.prev button:hover{color:var(--accent2)}
.sets tr.done td{background:var(--accent);color:#fff}
.sets tr.done td.prev{color:rgba(255,255,255,.75)}
.sets tr.done input{color:#fff;border-bottom-color:rgba(255,255,255,.35)}
.sets input{width:100%;max-width:72px;background:transparent;border:0;border-bottom:1px solid var(--line2);text-align:center;padding:12px 0 6px;font-size:17px;font-weight:600;outline:none;border-radius:0}
.sets input:focus{border-bottom-color:var(--accent2);background:rgba(47,124,246,.08)}
.sets input.rpe{font-size:15px}
.sets input::placeholder{color:var(--muted)}
.sets .stype{width:36px;height:36px;border-radius:9px;font-weight:700;font-size:15px;color:var(--text2)}
.sets .stype:hover{background:var(--surface3)}
.sets tr.warm .stype{color:#0b0b0b;background:var(--warn)}
.sets tr.warm:not(.done) td{background:rgba(250,178,25,.08)}
.sets .chk{width:44px;height:44px;color:var(--muted);display:inline-grid;place-items:center}
.sets .chk .o{width:22px;height:22px;border-radius:50%;border:2px solid var(--line2);display:block}
.sets .chk:hover .o{border-color:var(--accent2)}
.sets tr.done .chk{color:#fff}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.player-hint{font-size:12px;color:var(--muted);line-height:1.5}
.player-hint kbd{font:inherit;font-size:11px;padding:1px 5px;border-radius:5px;background:var(--surface2);border:1px solid var(--line2);color:var(--text2)}
.ex-note{display:flex;flex-direction:column;gap:6px}
.ex-note span{font-size:12px;color:var(--muted);font-weight:600}
.ex-note textarea{width:100%;resize:vertical;min-height:44px;background:var(--bg2);border:1px solid var(--line2);border-radius:10px;padding:10px 12px;outline:none;font-size:14px}
.ex-note textarea:focus{border-color:var(--accent)}
.ex-note small{font-size:12px;color:var(--text2)}
.player-actions{position:sticky;bottom:0;display:flex;gap:8px;padding:12px 0 calc(4px + env(safe-area-inset-bottom));margin-top:auto;background:linear-gradient(180deg,transparent,var(--bg) 30%);z-index:2}
.player.resting .player-actions{bottom:96px}
.player.resting .player-panel{padding-bottom:110px}
.rest{position:fixed;inset:auto 0 0 0;z-index:45;background:#0b1430;border-top:1px solid var(--accent);padding:14px 20px calc(14px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:16px;justify-content:center;box-shadow:0 -10px 40px rgba(0,0,0,.5)}
.rest .ring{width:64px;height:64px;flex:none}
.rest .rest-t{min-width:0}
.rest .rest-l{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600}
.rest .big{font-size:28px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.1}
.rest .rest-next{font-size:12px;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:280px}
.rest .rest-btns{display:flex;gap:6px}
.resume-pill{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));z-index:30;display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:14px;background:#0b1430;border:1px solid var(--accent);box-shadow:0 10px 30px rgba(0,0,0,.45);text-align:left;color:var(--text)}
.resume-pill b{display:block;font-size:13px}
.resume-pill small{display:block;font-size:12px;color:var(--muted);max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.resume-pill .dot{width:9px;height:9px;border-radius:50%;background:var(--good);box-shadow:0 0 0 4px rgba(12,163,12,.2);flex:none;animation:pulse 1.6s ease-in-out infinite}
.resume-pill .ico{color:var(--accent2)}
@keyframes pulse{50%{box-shadow:0 0 0 7px rgba(12,163,12,.05)}}
body.in-workout .resume-pill{display:none}
body:has(#restBar) .toast{bottom:150px}
.sheet.resume-sheet,.sheet.plates-sheet{width:min(440px,100%)}
.sheet.pick-sheet{width:min(560px,100%)}
.resume{padding:30px 24px 24px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.resume-ic{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent2);border:1px solid var(--accent)}
.resume p{line-height:1.5;font-size:14px}
.resume-btns{display:flex;gap:10px;margin-top:8px;width:100%}
.resume-btns .btn{flex:1}
.pick{padding:24px;display:flex;flex-direction:column;gap:12px}
.pick h3,.plates-calc h3{font-size:18px;padding-right:40px}
.pick p,.plates-calc>p{font-size:13.5px}
.pick-list{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow:auto;padding-right:2px}
.pick-item{width:100%;text-align:left;color:var(--text)}
.pick-item:hover{border-color:var(--accent)}
.pick-item>.ico{color:var(--accent2)}
.plates-calc{padding:24px;display:flex;flex-direction:column;gap:14px}
.pc-in{display:grid;grid-template-columns:1fr 130px;gap:10px}
.pc-in label{display:flex;flex-direction:column;gap:6px}
.pc-in label span{font-size:12px;color:var(--muted);font-weight:600}
.pc-in .input{font-size:16px}
.pc-quick,.pc-list{display:flex;gap:8px;flex-wrap:wrap}
.pc-list .chip i{width:10px;height:10px;border-radius:3px;display:block}
.pc-out{display:flex;flex-direction:column;gap:12px}
.pc-msg{font-size:13px;color:var(--text2)}
.pc-msg.warn{color:var(--warn)}
.bar-vis{position:relative;height:120px;display:flex;align-items:center;gap:3px;padding-left:8px;border-radius:12px;background:var(--bg2);border:1px solid var(--line);overflow:hidden}
.bar-vis .sleeve{width:26px;height:16px;background:linear-gradient(180deg,#b7c0d3,#6f7c98);border-radius:3px;flex:none}
.bar-vis .plate{flex:none;width:22px;height:var(--h);background:var(--c);border-radius:4px;display:grid;place-items:center;font-size:9px;font-weight:700;color:#0b0b0b;writing-mode:vertical-rl;transform:rotate(180deg);box-shadow:inset 0 0 0 1px rgba(0,0,0,.25)}
.bar-vis .collar{width:8px;height:26px;background:#a9b4cc;border-radius:2px;flex:none}
.bar-vis .shaft{flex:1;height:8px;background:linear-gradient(180deg,#c9d1e0,#7d889f);border-radius:0 4px 4px 0}
@media (max-width:860px){
  .player-body{grid-template-columns:1fr;display:flex;flex-direction:column}
  .player-panel{border-left:0}
  .player-media{min-height:0;height:min(34vh,260px);flex:none;padding-bottom:64px}
  .player-media img.main{width:auto;height:100%;max-width:80%;flex:none;aspect-ratio:1}
  .player-media .credit{bottom:70px}
  .player-strip{top:auto;left:0;right:0;bottom:0;width:auto;height:64px;flex-direction:row;padding:6px 10px;background:var(--bg2);border-top:1px solid var(--line)}
  .player-strip button{width:52px;height:52px}
  .player.resting .player-actions{position:static;background:none}
}
@media (max-width:560px){
  .player-top{padding:8px 10px;padding-top:calc(8px + env(safe-area-inset-top));gap:4px}
  .player-top .btn.primary{padding:8px 12px}
  .player-panel{padding:14px 12px 18px;gap:10px}
  .player-panel h2{font-size:18px}
  .ex-tools .btn{padding:7px 10px}
  .sets th:first-child{width:42px}.sets th:last-child{width:46px}
  .sets .stype{width:32px;height:32px}
  .sets input,.sets input.rpe,.ex-note textarea,.pick .input{font-size:16px}
  .player-hint{display:none}
  .rest{gap:10px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));justify-content:flex-start}
  .rest .ring{width:52px;height:52px}
  .rest .ring svg{width:52px;height:52px}
  .rest .big{font-size:24px}
  .rest .rest-t{flex:1}
  .rest .rest-next{max-width:none}
  .rest .rest-btns{flex-direction:column;gap:4px}
  .rest .rest-btns .btn{padding:5px 10px;font-size:12px}
  .player.resting .player-actions{position:static;background:none}
  .resume-pill{left:12px;right:12px;bottom:calc(80px + env(safe-area-inset-bottom))}
  .resume-pill small{max-width:none}
  .resume-pill>span:nth-child(2){flex:1}
  .pc-in{grid-template-columns:1fr 110px}
}

.summary-hero{text-align:center;padding:30px 20px 10px}
.summary-hero .trophy{width:76px;height:76px;margin:0 auto 6px;border-radius:50%;display:grid;place-items:center;color:#fab219;background:rgba(250,178,25,.12);border:1px solid rgba(250,178,25,.3)}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:#0b1224;border:1px solid var(--accent);padding:10px 16px;border-radius:12px;z-index:200;font-size:14px}
.table{width:100%;border-collapse:collapse;font-size:13px}
.table th{text-align:left;color:var(--muted);font-weight:500;padding:8px;border-bottom:1px solid var(--line)}
.table td{padding:9px 8px;border-bottom:1px solid var(--grid)}
.table td.r,.table th.r{text-align:right;font-variant-numeric:tabular-nums}
.hist-item{display:flex;gap:14px;align-items:center;padding:14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);cursor:pointer}
.hist-item:hover{border-color:var(--line2)}
.hist-date{width:52px;text-align:center;flex:none}
.hist-date b{display:block;font-size:20px}
.hist-date small{color:var(--muted);font-size:11px;text-transform:uppercase}
.pr-badge{font-size:11px;font-weight:700;color:#0b0b0b;background:var(--warn);padding:2px 7px;border-radius:6px}

/* ---------- modelos de treino ---------- */
.tpl-tools{display:flex;flex-direction:column;gap:12px;margin-bottom:8px}
.tpl-tools .seg{align-self:flex-start;max-width:100%;overflow-x:auto;scrollbar-width:none}
.tpl-tools .seg button{white-space:nowrap;flex:none}
@media (max-width:420px){.tpl-tools .seg button{padding:6px 9px}}
.tpl-sec{display:flex;align-items:baseline;gap:12px;margin:22px 0 12px;flex-wrap:wrap}
.tpl-sec h2{font-size:19px;font-weight:700}
.tpl-sec .muted{font-size:13px}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.tpl-card{background:linear-gradient(180deg,var(--surface) 0%,#0f1729 100%);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;cursor:pointer;transition:.15s;display:flex;flex-direction:column;outline:none}
.tpl-card:hover,.tpl-card:focus-visible{border-color:var(--accent);transform:translateY(-2px);box-shadow:0 10px 30px rgba(0,0,0,.3)}
.tpl-media{position:relative;display:grid;grid-template-columns:repeat(4,1fr);gap:2px;background:var(--line);aspect-ratio:4/1.15}
.tpl-media img{width:100%;height:100%;object-fit:cover;background:#fff;display:block}
.tpl-lv{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;letter-spacing:.02em;padding:3px 9px;border-radius:999px;color:var(--lv);background:#0a1020;border:1px solid var(--lv);vertical-align:middle;white-space:nowrap}
.tpl-lv::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--lv)}
.tpl-media .tpl-lv{position:absolute;left:10px;bottom:10px;box-shadow:0 2px 10px rgba(0,0,0,.35)}
.tpl-body{padding:14px 16px 16px;display:flex;flex-direction:column;gap:7px;flex:1}
.tpl-area{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent2);font-weight:600}
.tpl-body h3{font-size:16px;font-weight:650;line-height:1.25}
.tpl-body p{margin:0;font-size:13px;color:var(--text2);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tpl-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.tpl-meta span{display:inline-flex;align-items:center;gap:5px}
.tpl-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:auto;padding-top:6px}
.sheet.wide{width:min(980px,100%)}
.tpl-detail{display:flex;flex-direction:column}
.tpl-hero{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);border-bottom:1px solid var(--line)}
.tpl-hero-img{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;background:var(--line)}
.tpl-hero-img img{width:100%;aspect-ratio:1;object-fit:cover;background:#fff;display:block}
.tpl-hero-txt{padding:26px 56px 22px 24px;display:flex;flex-direction:column;gap:10px;justify-content:center;background:radial-gradient(400px 220px at 100% 0%,rgba(47,124,246,.22),transparent 70%)}
.tpl-hero-txt h2{font-size:24px;line-height:1.2;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tpl-hero-txt p{margin:0;color:var(--text2);font-size:14px;line-height:1.55}
.tpl-stats{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid var(--line)}
.tpl-stats div{padding:14px 18px;border-right:1px solid var(--line)}
.tpl-stats div:last-child{border-right:0}
.tpl-stats b{display:block;font-size:20px;font-variant-numeric:tabular-nums}
.tpl-stats small{color:var(--muted);font-size:12px}
.tpl-sub{padding:18px 24px 4px}
.tpl-sub h3{font-size:14px;color:var(--text2);margin-bottom:6px;font-weight:600}
.tpl-bars{columns:2;column-gap:32px}
.tpl-bars .hbar{break-inside:avoid;margin:5px 0}
@media (max-width:760px){.tpl-bars{columns:1}}
.tpl-routines{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:14px;padding:16px 24px}
.tpl-routine{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:7px}
.tpl-routine .ex-line{cursor:pointer}
.tpl-routine .ex-line:hover{border-color:var(--line2)}
.tpl-n{width:18px;flex:none;text-align:center;font-size:12px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.tpl-actions{display:flex;gap:10px;justify-content:flex-end;align-items:center;flex-wrap:wrap;padding:16px 24px 22px;position:sticky;bottom:0;background:linear-gradient(180deg,transparent,var(--bg2) 30%)}
.tpl-actions .credit{margin-right:auto}
.tpl-back{position:absolute;left:14px;top:14px;z-index:3;background:rgba(10,16,32,.85)}
.tpl-guide{padding:28px 28px 0}
.tpl-guide h2{font-size:22px;margin-bottom:6px;padding-right:40px}
.tpl-steps{margin:18px 0 0;padding-left:20px;display:flex;flex-direction:column;gap:14px;color:var(--text2);font-size:14px;line-height:1.55}
.tpl-steps b{color:var(--text)}
.tpl-steps .table{margin-top:8px}
.tpl-goals{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;margin-top:8px}
.tpl-goals div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px}
.tpl-goals span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--surface2);color:var(--accent2);margin-bottom:4px}
.tpl-goals small{color:var(--muted);font-size:12px}
.tpl-guide .tpl-actions{padding:18px 0 24px}
@media (max-width:760px){
  .tpl-hero{grid-template-columns:1fr}
  .tpl-hero-img{grid-template-columns:repeat(6,1fr)}
  .tpl-hero-txt{padding:18px}
  .tpl-stats{grid-template-columns:repeat(2,1fr)}
  .tpl-stats div:nth-child(2){border-right:0}
  .tpl-stats div:nth-child(-n+2){border-bottom:1px solid var(--line)}
  .tpl-routines{grid-template-columns:1fr;padding:14px}
  .tpl-sub{padding:16px 14px 0}
  .tpl-actions{padding:14px}
  .tpl-actions .btn{flex:1}
  .tpl-actions .credit{flex-basis:100%;order:3;text-align:center}
  .tpl-guide{padding:22px 16px 0}
}
/* ---------- construtor manual (Criar meu treino) ---------- */
.bd-actions{display:flex;gap:8px;flex-wrap:wrap}
.btn:disabled{opacity:.4;cursor:not-allowed}
.bd-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}
.bd-main{display:flex;flex-direction:column;gap:14px;min-width:0}
.bd-side{display:flex;flex-direction:column;gap:14px;position:sticky;top:16px}
.bd-info{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}
.bd-field{display:flex;flex-direction:column;gap:6px;min-width:150px}
.bd-field>span{font-size:12px;color:var(--muted);font-weight:600;letter-spacing:.03em}
.bd-grow{flex:1;min-width:200px}
select.input{padding:11px 12px;cursor:pointer}
.input.bad{border-color:var(--bad)}
.bd-tabs{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin;scrollbar-color:var(--line2) transparent}
.bd-tab{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 14px;border-radius:12px;background:var(--surface);border:1px solid var(--line);min-width:120px;max-width:220px;text-align:left;transition:.15s;flex:none}
.bd-tab b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.bd-tab small{font-size:11.5px;color:var(--muted)}
.bd-tab:hover{border-color:var(--line2)}
.bd-tab.on{background:var(--accent-soft);border-color:var(--accent)}
.bd-tab.add{border-style:dashed;color:var(--accent2);min-width:100px}
.bd-tab.add:disabled{opacity:.4;cursor:not-allowed}
.bd-routine{display:flex;flex-direction:column;gap:10px}
.bd-rhead{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.bd-rbtns{display:flex;gap:6px;flex-wrap:wrap}
.bd-rmeta{font-size:12.5px}
.bd-list{display:flex;flex-direction:column;gap:8px}
.bd-ex{display:grid;grid-template-columns:auto auto 52px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:8px 10px;border-radius:12px;background:var(--bg2);border:1px solid var(--line);transition:border-color .15s,opacity .15s}
.bd-ex.dragging{opacity:.45}
.bd-ex.over{border-color:var(--accent);box-shadow:0 -2px 0 var(--accent) inset}
.bd-handle{cursor:grab;color:var(--muted);user-select:none;padding:0 2px;display:grid;place-items:center}
.bd-num{width:22px;height:22px;border-radius:7px;background:var(--surface3);display:grid;place-items:center;font-size:11.5px;font-weight:600;color:var(--text2)}
.bd-ex img{width:52px;height:52px;border-radius:9px;object-fit:cover;background:#fff;cursor:pointer}
.bd-t{min-width:0}
.bd-t b{display:block;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.bd-t b:hover{color:var(--accent2)}
.bd-t small{color:var(--muted);font-size:12px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bd-params{display:flex;gap:6px}
.bd-params label{display:flex;flex-direction:column;gap:3px}
.bd-params label span{font-size:10.5px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.05em}
.bd-params .input{padding:7px 8px;border-radius:9px;font-size:13.5px;width:64px;font-variant-numeric:tabular-nums}
.bd-params select.input{width:94px;padding:7px 6px}
.bd-ord{display:flex;gap:4px}
.bd-ord .btn{padding:6px 9px}
.bd-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center}
.bd-kpis div{background:var(--bg2);border:1px solid var(--line);border-radius:12px;padding:10px 4px}
.bd-kpis b{display:block;font-size:22px;font-variant-numeric:tabular-nums}
.bd-kpis small{font-size:11px;color:var(--muted)}
@media (max-width:1100px){.bd-layout{grid-template-columns:1fr}.bd-side{position:static}}
@media (max-width:760px){
  .bd-ex{grid-template-columns:auto 52px minmax(0,1fr) auto;grid-template-areas:"num img t ord" "par par par par"}
  .bd-handle{display:none}
  .bd-num{grid-area:num}.bd-ex img{grid-area:img}.bd-t{grid-area:t}.bd-ord{grid-area:ord}
  .bd-params{grid-area:par}.bd-params label{flex:1}.bd-params .input,.bd-params select.input{width:100%}
}
/* seletor de exercícios */
.sheet.bd-sheet{width:min(860px,100%)}
.bd-pick{display:flex;flex-direction:column}
.bd-pick-h{padding:22px 24px 6px}
.bd-pick-h p{margin:4px 0 0;font-size:13px}
.bd-pick-tools{display:flex;flex-direction:column;gap:10px;padding:10px 24px 12px;position:sticky;top:0;background:var(--bg2);z-index:1;border-bottom:1px solid var(--line)}
.bd-pick-tools .lib-row select{background:var(--bg);border:1px solid var(--line2);border-radius:10px;padding:8px 12px}
.bd-pick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px;padding:14px 24px 0}
.bd-pick-item{display:flex;gap:10px;align-items:center;padding:7px;border-radius:12px;background:var(--surface);border:1px solid var(--line);text-align:left;transition:.15s}
.bd-pick-item:hover{border-color:var(--accent2)}
.bd-pick-item.on{border-color:var(--accent);background:var(--accent-soft)}
.bd-pick-item img{width:48px;height:48px;border-radius:8px;object-fit:cover;background:#fff;flex:none}
.bd-pi-t{flex:1;min-width:0}
.bd-pi-t b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bd-pi-t small{font-size:11.5px;color:var(--muted)}
.bd-pi-add{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--surface3);color:var(--accent2);font-weight:700;flex:none;font-size:13px}
.bd-pick-item.on .bd-pi-add{background:var(--accent);color:#fff}
.bd-pick-foot{position:sticky;bottom:0;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 24px;background:var(--bg2);border-top:1px solid var(--line);margin-top:10px;font-size:13px}
/* adicionar ao treino */
.sheet.bd-sheet-sm{width:min(520px,100%)}
.bd-addto{padding:24px;display:flex;flex-direction:column;gap:16px}
.bd-addto #atBody{display:flex;flex-direction:column;gap:14px}
.bd-addto-h{display:flex;gap:14px;align-items:center;padding-right:40px}
.bd-addto-h img{width:64px;height:64px;border-radius:12px;object-fit:cover;background:#fff;flex:none}
.bd-addto-h h2{font-size:19px;margin:2px 0}
.bd-rpick{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}
.bd-ropt{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--line);text-align:left}
.bd-ropt b{font-size:13.5px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bd-ropt small{font-size:11.5px;color:var(--muted)}
.bd-ropt.on{border-color:var(--accent);background:var(--accent-soft)}
.bd-params-row label{flex:1}.bd-params-row .input,.bd-params-row select.input{width:100%}
.bd-addto-btns{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
/* ---------- PWA: botão instalar ---------- */
.install-app{position:fixed;right:20px;bottom:20px;z-index:150;display:inline-flex;align-items:center;gap:8px;padding:10px 10px 10px 16px;border-radius:999px;font-weight:600;font-size:14px;color:#fff;background:linear-gradient(180deg,#3b86ff,var(--accent));box-shadow:0 10px 30px rgba(47,124,246,.4),0 0 0 1px rgba(255,255,255,.08) inset;animation:installIn .35s ease-out}
.install-app[hidden]{display:none}
.install-app:hover{filter:brightness(1.08)}
.install-app .install-x{font-style:normal;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;margin-left:2px;line-height:1;background:rgba(255,255,255,.16)}
.install-app .install-x:hover{background:rgba(255,255,255,.28)}
@keyframes installIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (max-width:860px){.install-app{right:14px;bottom:calc(82px + env(safe-area-inset-bottom))}}
@media (display-mode:standalone){.install-app{display:none}}
/* ---------- conta (login Google / modo local) ---------- */
.account{margin-top:auto;padding:0 4px}
.account:empty{display:none}
.account + .sidebar-foot{margin-top:0}
.account-slot{display:flex;align-items:center}
.acc-local{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);padding:4px 8px;border-radius:999px;cursor:default}
.acc-local i{width:7px;height:7px;border-radius:50%;background:var(--muted);opacity:.7}
.account .acc-local{padding:4px 8px}
.acc-login{gap:9px;background:var(--surface);border-color:var(--line2)}
.acc-login:disabled{opacity:.7;cursor:progress}
.acc-g{width:16px;height:16px;flex:none}
.account .acc-login{width:100%}
.acc-wrap{position:relative}
.acc-btn{display:flex;align-items:center;gap:10px;padding:6px 10px 6px 6px;border-radius:999px;background:var(--surface);border:1px solid var(--line2);color:var(--text);font-weight:600;max-width:100%;transition:.15s}
.acc-btn:hover{border-color:var(--accent2)}
.account .acc-btn{width:100%;border-radius:12px}
.acc-av{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:none;background:var(--surface3)}
.acc-ini{display:grid;place-items:center;font-size:13px;color:#fff;background:linear-gradient(135deg,var(--accent),#1747a8)}
.acc-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.acc-caret{margin-left:auto;display:grid;place-items:center;color:var(--muted)}
.acc-menu{position:absolute;right:0;top:calc(100% + 6px);min-width:220px;padding:6px;border-radius:12px;background:var(--surface2);border:1px solid var(--line2);box-shadow:0 14px 40px rgba(0,0,0,.45);z-index:40;display:none}
.acc-menu.up{top:auto;bottom:calc(100% + 6px);left:0;right:auto;width:100%}
.acc-wrap.open .acc-menu{display:block}
.acc-who{padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:4px;display:flex;flex-direction:column;gap:2px;min-width:0}
.acc-who b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-who small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:9px 10px;border-radius:8px;color:var(--text2);font-weight:500}
.acc-item:hover{background:var(--surface3);color:#fff}
@media (max-width:860px){ .account{display:none} }
.sheet.acc-sheet{max-width:480px}
/* ---------- progresso (análise) ---------- */
.tgt{display:grid;grid-template-columns:96px 1fr 34px 62px;align-items:center;gap:10px;font-size:13px;margin:7px 0;cursor:default}
.tgt .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tgt .track{height:10px;position:relative;border-radius:0 4px 4px 0}
.tgt .band{position:absolute;top:-3px;bottom:-3px;background:rgba(57,135,229,.10);border-left:1px dashed var(--line2);border-right:1px dashed var(--line2)}
.tgt .fill{position:relative;height:100%;border-radius:0 4px 4px 0}
.tgt .v{text-align:right;color:var(--text);font-variant-numeric:tabular-nums}
.tgt .st{font-size:11.5px;color:var(--text2);display:inline-flex;align-items:center;gap:5px}
.tgt .st i{width:7px;height:7px;border-radius:50%;flex:none}
.tgt:hover .nm{color:var(--text)}
.stat .cmp{font-size:11.5px;color:var(--muted);margin-top:2px}
.rec-row{cursor:pointer}
.rec-row:hover td{background:var(--surface2)}
.rec-row .ex{display:flex;align-items:center;gap:10px;min-width:0}
.rec-row .ex img{width:34px;height:34px;border-radius:7px;object-fit:cover;background:#fff;flex:none}
.rec-row .ex b{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}
.tbl-wrap{overflow-x:auto}
.mini-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.mini-stats div{background:var(--bg2);border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.mini-stats small{display:block;font-size:11.5px;color:var(--muted)}
.mini-stats b{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
.mini-stats b small{display:inline;font-size:12px;font-weight:500;margin-left:3px}
.weeks-strip{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:3px;margin-top:6px}
.weeks-strip i{height:22px;border-radius:4px;display:block}
.exs-head{display:flex;gap:14px;align-items:center;margin-bottom:16px;padding-right:44px}
.exs-head img{width:64px;height:64px;border-radius:12px;object-fit:cover;background:#fff;flex:none}
.set-list{font-variant-numeric:tabular-nums;color:var(--text2);font-size:12.5px}
.set-list b{color:var(--text);font-weight:600}
@media (max-width:700px){.mini-stats{grid-template-columns:1fr 1fr}.tgt{grid-template-columns:84px 1fr 30px 56px;gap:8px}}
.main,.prog,.prog .grid>*{min-width:0}
.prog .card-h{flex-wrap:wrap}
.prog .page-head{flex-wrap:wrap;gap:12px}
@media (max-width:700px){.prog .tgt{grid-template-columns:78px 1fr 30px 50px}.prog .tgt .st{font-size:10.5px}.prog .tbl-wrap .table{min-width:560px}.prog .rec-row .ex b{max-width:150px}}
.prog .tbl-wrap td.r,.prog .tbl-wrap th.r{white-space:nowrap}
.mini-stats.four{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:700px){.mini-stats.four{grid-template-columns:1fr 1fr}}
/* integração: botão Instalar não sobrepõe o atalho de treino em andamento */
body:has(.resume-pill) .install-app{bottom:calc(86px + env(safe-area-inset-bottom))}
@media (max-width:860px){.resume-pill{bottom:calc(80px + env(safe-area-inset-bottom))}body:has(.resume-pill) .install-app{bottom:calc(146px + env(safe-area-inset-bottom))}}
.grid>*{min-width:0}

/* ===== Ícones SVG (Lucide, js/icons.js) ===== */
.ico{flex:none;display:inline-block;vertical-align:-.2em}
.btn .ico,.chip .ico{vertical-align:0}
.h-ic{display:flex;align-items:center;gap:10px}
.h-ic .ico{color:var(--accent2)}
.muted>.ico:first-child{vertical-align:-.25em;margin-right:4px}
.demo-banner span .ico{vertical-align:-.25em;margin-right:4px}
.chip .ico{opacity:.85}
.empty .ico{display:block;margin:0 auto 12px;color:var(--muted);opacity:.7}
.input-ic{position:relative}
.input-ic>.ico{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.input-ic>.input{padding-left:42px}
.bd-pi-add .ico{display:block}
.tpl-back .ico{margin-left:-4px}
/* ---------- compartilhar (js/share.js) ---------- */
.share-sheet{width:min(1000px,100%)}
.share-head{padding:24px 70px 0 26px}
.share-head h2{font-size:22px}
.share-head p{margin:4px 0 0;font-size:14px}
.share{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;padding:18px 26px 26px}
.share-preview{position:relative;display:flex;align-items:center;justify-content:center;background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:16px;min-height:280px}
.share-preview canvas{display:block;max-width:100%;max-height:min(70vh,720px);width:auto;height:auto;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.45)}
.share-busy{position:absolute;top:12px;left:12px;padding:5px 10px;border-radius:8px;background:rgba(10,16,32,.85);font-size:12px;color:var(--text2)}
.share-busy[hidden]{display:none}
.share-side{display:flex;flex-direction:column;gap:16px;min-width:0}
.share-field label{display:block;font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.share-opts{display:flex;flex-wrap:wrap;gap:6px}
.share-opt{display:inline-flex;flex-direction:column;align-items:flex-start;padding:8px 12px;border-radius:10px;background:var(--surface);border:1px solid var(--line2);font-size:14px;font-weight:600;color:var(--text2);transition:.15s}
.share-opt small{font-size:11px;font-weight:500;color:var(--muted);margin-top:2px}
.share-opt:hover{background:var(--surface2)}
.share-opt.on{border-color:var(--accent);background:var(--accent-soft);color:#fff}
.share-theme{flex-direction:row;align-items:center;gap:8px}
.share-theme i{width:18px;height:18px;border-radius:50%;border:1px solid rgba(255,255,255,.25)}
.share-select{width:100%;padding:9px 10px;border-radius:10px;background:var(--surface);border:1px solid var(--line2)}
.share-actions{display:flex;flex-direction:column;gap:8px;margin-top:auto}
.share-row{display:flex;gap:8px}
.share-row .btn{flex:1;padding:10px 8px}
.share-note{margin:2px 0 0;font-size:12px;color:var(--muted)}
.share-note a{text-decoration:underline}
.share-note[hidden]{display:none}
@media (max-width:760px){
  .modal:has(.share-sheet){padding:10px}
  .share-sheet{max-height:96vh}
  .share-head{padding:18px 60px 0 16px}
  .share{grid-template-columns:1fr;gap:14px;padding:12px 16px 18px}
  .share-preview{padding:10px;min-height:0}
  .share-preview canvas{max-height:46vh}
}
