/* ═══════════ Design system — PULSE Fitness ═══════════ */
:root{
  --bg:#070a0e;
  --surface:#111820;
  --surface-2:#18212b;
  --surface-3:#1f2a36;
  --fill-0:rgba(255,255,255,.03);
  --fill-1:rgba(255,255,255,.06);
  --fill-2:rgba(255,255,255,.08);
  --fill-3:rgba(255,255,255,.12);
  --fill-4:rgba(255,255,255,.20);
  --fill-5:rgba(255,255,255,.28);
  --line:var(--fill-2);
  --text:#eef4fa;
  --muted:#8b9aab;
  --lime:#c6f432;
  --lime-dim:#9ad11a;
  --lime-ink:#c6f432;
  --violet:#7c5cff;
  --coral:#ff6b4a;
  --cyan:#3ddad7;
  --frame:#14181e;
  --bar-bg:rgba(9,13,18,.86);
  --player-bg:#080b10;
  --player-glow:rgba(124,92,255,.28);
  --player-glow-rest:rgba(61,218,215,.26);
  --tip-bg:#ffffff;
  --tip-fg:#080c10;
  --page:#05070a;
  --page-glow-1:rgba(124,92,255,.18);
  --page-glow-2:rgba(198,244,50,.12);
  --radius:22px;
  --radius-sm:16px;
  --shadow:0 18px 40px rgba(0,0,0,.45);
  --font:"Outfit",system-ui,-apple-system,"Segoe UI",sans-serif;
  --display:"Bebas Neue","Outfit",sans-serif;
}

/* ── Light theme ── */
body.light{
  --bg:#eaeef4;
  --surface:#ffffff;
  --surface-2:#f2f5f9;
  --surface-3:#dfe6ee;
  --fill-0:rgba(12,18,26,.04);
  --fill-1:rgba(12,18,26,.06);
  --fill-2:rgba(12,18,26,.10);
  --fill-3:rgba(12,18,26,.14);
  --fill-4:rgba(12,18,26,.22);
  --fill-5:rgba(12,18,26,.30);
  --text:#0d141b;
  --muted:#5c6b7c;
  --lime-dim:#8bc111;
  --lime-ink:#5f8a00;
  --frame:#c9d3de;
  --bar-bg:rgba(255,255,255,.9);
  --player-bg:#f3f6fa;
  --player-glow:rgba(124,92,255,.18);
  --player-glow-rest:rgba(61,218,215,.2);
  --tip-bg:#0d141b;
  --tip-fg:#ffffff;
  --page:#e6ebf2;
  --page-glow-1:rgba(124,92,255,.14);
  --page-glow-2:rgba(163,230,53,.22);
  --shadow:0 18px 40px rgba(15,25,40,.14);
}
body.light .pg-pct{filter:brightness(.72) saturate(1.3)}
body.light .device{box-shadow:0 40px 80px rgba(20,35,55,.22),0 0 0 2px rgba(12,18,26,.08)}
body.light .fab{box-shadow:0 12px 26px rgba(139,193,17,.4)}
body.light .tab.is-on svg{filter:none}
body.light .logo-mark{box-shadow:0 12px 26px rgba(20,35,55,.16)}
/* Contrast fixes for tinted text/graphics on light surfaces */
body.light .muscle-map span{color:#5238cc}
body.light .lvl.b{color:#15803d}
body.light .lvl.i{color:var(--lime-ink)}
body.light .mr-fg.c1,body.light .tr-fg{stroke:var(--lime-dim)}
body.light .bar.on .col{background:linear-gradient(180deg,#aadb1e,#7fae0f)}
body.light .bar:hover .col{background:linear-gradient(180deg,#bde83c,#7fae0f)}
/* Theme toggle icons: show the mode you will switch to */
.ico-sun{display:block}
.ico-moon{display:none}
body.light .ico-sun{display:none}
body.light .ico-moon{display:block}

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  font-family:var(--font);
  background:
    radial-gradient(900px 600px at 88% -10%, var(--page-glow-1), transparent 60%),
    radial-gradient(800px 520px at 5% 110%, var(--page-glow-2), transparent 60%),
    var(--page);
  color:var(--text);
  display:grid;place-items:center;
  padding:32px 20px;
  transition:background .35s ease,color .35s ease;
}
svg{fill:currentColor;display:block}
button{font-family:inherit;color:inherit;background:none;border:0;cursor:pointer}
input{font-family:inherit}

/* ── Stage layout ── */
.stage{display:flex;align-items:center;justify-content:center;gap:44px;width:100%;max-width:1240px}
.brandpane{display:flex;flex-direction:column;gap:18px;flex:1 1 300px;min-width:0;max-width:400px}
.logo-lg{font-family:var(--display);font-size:38px;letter-spacing:3px;display:flex;align-items:center;gap:14px}
.logo-mark{width:54px;height:54px;object-fit:contain;background:#fff;border-radius:16px;padding:5px;box-shadow:0 12px 26px rgba(0,0,0,.4)}
.logo-lg .dot{width:13px;height:13px;border-radius:50%;background:var(--lime);box-shadow:0 0 18px var(--lime)}
.brandpane h1{font-size:34px;line-height:1.3;font-weight:900}
.brandpane h1 span{background:linear-gradient(90deg,var(--lime),var(--violet));-webkit-background-clip:text;background-clip:text;color:transparent;font-size:26px}
.brandpane p{color:var(--muted);line-height:1.9;font-size:15px;max-width:44ch}
.brand-chips{display:flex;flex-wrap:wrap;gap:8px}
.brand-chips span{font-size:12.5px;padding:7px 13px;border-radius:999px;border:1px solid var(--line);background:var(--fill-0);color:var(--muted)}

.minimap{display:flex;flex-direction:column;gap:8px;flex:0 0 180px;width:180px}
.mm-title{font-size:12px;color:var(--muted);letter-spacing:1px;margin-bottom:4px}
.mm{text-align:left;font-size:13.5px;padding:11px 14px;border-radius:13px;border:1px solid var(--line);background:var(--fill-0);color:var(--muted);transition:.2s}
.mm:hover{background:var(--fill-1);color:var(--text)}
.mm.on{background:rgba(198,244,50,.12);border-color:rgba(198,244,50,.4);color:var(--lime-ink)}
.mm-alt{border-style:dashed}
.mm-title-2{margin-top:18px}
.ds{display:flex;flex-direction:column;gap:2px;line-height:1.3}
.ds small{font-size:10px;font-weight:600;letter-spacing:.3px;opacity:.7}

/* ── Device frame ── */
.device{
  position:relative;
  flex:0 0 392px;width:392px;
  height:830px;max-height:calc(100dvh - 64px);
  background:var(--bg);border-radius:52px;
  border:10px solid var(--frame);
  box-shadow:0 50px 90px rgba(0,0,0,.65), 0 0 0 2px var(--fill-1), inset 0 0 60px rgba(0,0,0,.6);
  overflow:hidden;display:flex;flex-direction:column;
}
.notch{position:absolute;top:8px;left:50%;transform:translateX(-50%);width:112px;height:28px;background:#000;border-radius:16px;z-index:60}
.statusbar{display:flex;justify-content:space-between;align-items:center;padding:14px 26px 6px;font-size:13px;font-weight:700;z-index:50}
.statusbar .sbicons{display:flex;align-items:center;gap:6px}
.battery{width:23px;height:12px;border:1.6px solid currentColor;border-radius:4px;position:relative;display:inline-block;opacity:.9}
.battery:after{content:"";position:absolute;left:-3.5px;top:3px;width:2px;height:5px;background:currentColor;border-radius:1px}
.battery i{position:absolute;inset:1.4px;background:currentColor;border-radius:2px;width:72%;right:auto;left:1.4px}

.viewport{position:relative;flex:1;min-height:0;overflow:hidden}
.screen{position:absolute;inset:0;display:none;flex-direction:column}
.screen.is-active{display:flex;animation:screenIn .38s cubic-bezier(.22,1,.36,1)}
@keyframes screenIn{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}

.scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 18px;scrollbar-width:none}
.scroll::-webkit-scrollbar{display:none}
.spacer{height:26px}

/* ── Top bar ── */
.topbar{display:flex;align-items:center;gap:12px;padding:10px 18px 14px}
.avatar{width:44px;height:44px;border-radius:15px;overflow:hidden;border:2px solid var(--fill-4);background:#fff;flex:none}
.avatar img{width:100%;height:100%;object-fit:contain;padding:3px}
.greet{display:flex;flex-direction:column;line-height:1.35;flex:1;min-width:0}
.greet span{font-size:12px;color:var(--muted)}
.greet strong{font-size:16.5px;font-weight:800}
.page-title{flex:1;min-width:0}
.page-title h2{font-size:21px;font-weight:900;letter-spacing:-.2px}
.muted-sm{font-size:12px;color:var(--muted)}
.icon-btn{width:42px;height:42px;border-radius:14px;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;position:relative;flex:none;transition:.2s}
.icon-btn:hover{background:var(--surface-2)}
.icon-btn svg{width:19px;height:19px}
.icon-btn.ghost{background:var(--fill-1);border-color:transparent}

.seg{display:flex;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:3px;gap:2px}
.seg button{font-size:11.5px;padding:6px 10px;border-radius:9px;color:var(--muted);font-weight:700}
.seg button.on{background:var(--lime);color:#0a0d11}

/* ── Hero section ── */
.hero{position:relative;border-radius:28px;padding:22px;overflow:hidden;display:flex;gap:14px;align-items:center;
  background:linear-gradient(135deg,#c6f432 0%,#a3e635 42%,#5ce1c4 100%);color:#0a0f06;box-shadow:0 20px 44px rgba(163,230,53,.22)}
.hero-glow{position:absolute;width:210px;height:210px;border-radius:50%;background:rgba(255,255,255,.35);filter:blur(46px);top:-70px;left:-40px}
.hero-body{position:relative;flex:1;min-width:0}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:800;padding:5px 11px;border-radius:999px;background:rgba(10,15,6,.16)}
.pill-live:before{content:"";width:6px;height:6px;border-radius:50%;background:#0a0f06;animation:blink 1.4s infinite}
@keyframes blink{50%{opacity:.25}}
.hero h2{font-size:23px;font-weight:900;line-height:1.35;margin:10px 0 12px}
.hero-meta{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.hero-meta span{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;background:rgba(10,15,6,.12);padding:5px 9px;border-radius:9px}
.hero-meta svg{width:13px;height:13px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:800;border-radius:14px;transition:.2s}
.btn svg{width:16px;height:16px}
.btn-primary{background:#0a0f14;color:#fff;padding:12px 20px;font-size:14px;box-shadow:0 10px 20px rgba(0,0,0,.25)}
.btn-primary:active{transform:scale(.96)}
.hero-ring{position:relative;width:86px;height:86px;flex:none}
.ring{transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:9;stroke-linecap:round}
.ring-bg{stroke:rgba(10,15,6,.16)}
.ring-fg{stroke:#0b1206;stroke-dasharray:314;stroke-dashoffset:314;animation:ringGo 1.4s cubic-bezier(.22,1,.36,1) .3s forwards}
@keyframes ringGo{to{stroke-dashoffset:69}}
.hero-ring-label{position:absolute;inset:0;display:grid;place-content:center;text-align:center;line-height:1.1}
.hero-ring-label b{font-size:19px;font-weight:900}
.hero-ring-label span{font-size:9.5px;opacity:.7;font-weight:700}

/* ── Blocks ── */
.block{margin-top:24px}
.block-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.block-head h3{font-size:16px;font-weight:800}
.link{font-size:12.5px;color:var(--lime-ink);font-weight:700}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px}

/* ── Daily goals ── */
.goal-card{display:flex;align-items:center;gap:18px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px}
.rings-stack{width:126px;height:126px;flex:none}
.multiring{transform:rotate(-90deg)}
.multiring circle{fill:none;stroke-width:11;stroke-linecap:round}
.mr-bg{stroke:var(--fill-1)}
.mr-fg{transition:stroke-dashoffset 1.3s cubic-bezier(.22,1,.36,1)}
.mr-fg.c1{stroke:var(--lime)}.mr-fg.c2{stroke:var(--violet)}.mr-fg.c3{stroke:var(--coral)}
.goal-legend{list-style:none;display:flex;flex-direction:column;gap:14px;flex:1;min-width:0}
.goal-legend li{display:flex;align-items:center;gap:10px}
.goal-legend i{width:9px;height:9px;border-radius:50%;background:var(--c);box-shadow:0 0 12px var(--c);flex:none}
.goal-legend b{display:block;font-size:19px;font-weight:900;font-variant-numeric:tabular-nums}
.goal-legend small{font-size:11.5px;color:var(--muted)}

/* ── Chips ── */
.chips-scroll{display:flex;gap:9px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.chips-scroll::-webkit-scrollbar{display:none}
.chip{flex:none;display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);font-size:13px;font-weight:700;color:var(--text);transition:.2s;white-space:nowrap}
.chip .em{font-size:15px}
.chip:hover{background:var(--surface-2)}
.chip.on{background:var(--lime);color:#0a0d11;border-color:transparent;box-shadow:0 8px 18px rgba(198,244,50,.24)}

/* ── Plan rail ── */
.hscroll{display:flex;gap:13px;overflow-x:auto;padding-bottom:6px;scrollbar-width:none}
.hscroll::-webkit-scrollbar{display:none}
.plan{flex:none;width:172px;height:212px;border-radius:22px;position:relative;overflow:hidden;padding:15px;display:flex;flex-direction:column;justify-content:flex-end;border:1px solid var(--line);transition:.25s}
.plan:hover{transform:translateY(-4px)}
.plan:before{content:"";position:absolute;inset:0;background:var(--grad);opacity:.9}
.plan:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,rgba(4,7,10,.85))}
.plan .pe{position:absolute;top:12px;left:14px;font-size:32px;z-index:2;filter:drop-shadow(0 6px 12px rgba(0,0,0,.4))}
.plan .pinfo{position:relative;z-index:2}
.plan h4{font-size:15px;font-weight:900;margin-bottom:6px;line-height:1.35}
.plan .pmeta{display:flex;gap:8px;font-size:11px;color:#cfe0ee;font-weight:600}
.plan .pbar{position:relative;z-index:2;height:5px;border-radius:99px;background:var(--fill-4);margin-top:10px;overflow:hidden}
.plan .pbar i{position:absolute;top:0;bottom:0;left:0;width:var(--p);background:var(--lime);border-radius:99px}
.plan .ptag{position:absolute;top:13px;right:14px;z-index:2;font-size:10px;font-weight:800;background:rgba(4,7,10,.5);backdrop-filter:blur(6px);padding:4px 9px;border-radius:99px}

/* ── Activity tracking / bars ── */
.activity-card .act-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:16px}
.big{font-size:26px;font-weight:900;display:block;font-variant-numeric:tabular-nums}
.big small{font-size:12px;color:var(--muted);margin-left:4px;font-weight:700}
.delta{font-size:12px;font-weight:800;padding:5px 10px;border-radius:99px}
.delta.up{color:var(--lime-ink);background:rgba(198,244,50,.12)}
.bars{display:flex;align-items:flex-end;gap:9px;height:104px}
.bars.tall{height:140px}
.bar{flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;height:100%;justify-content:flex-end;cursor:pointer}
.bar .col{width:100%;max-width:26px;border-radius:9px;background:var(--surface-3);position:relative;height:var(--h);transition:height .9s cubic-bezier(.22,1,.36,1),background .2s}
.bar.on .col{background:linear-gradient(180deg,var(--lime),var(--lime-dim));box-shadow:0 6px 16px rgba(198,244,50,.3)}
.bar:hover .col{background:linear-gradient(180deg,#dcff5c,var(--lime-dim))}
.bar span{font-size:10.5px;color:var(--muted);font-weight:700}
.bar.on span{color:var(--lime-ink)}
.bar .tip{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);font-size:10px;background:var(--tip-bg);color:var(--tip-fg);padding:3px 7px;border-radius:7px;font-weight:800;opacity:0;transition:.2s;white-space:nowrap}
.bar:hover .tip{opacity:1}

/* ── Programs ── */
.program-list{display:flex;flex-direction:column;gap:10px}
.program{display:flex;align-items:center;gap:13px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:13px;transition:.2s}
.program:hover{background:var(--surface-2)}
.pg-ico{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;font-size:22px;flex:none;background:var(--bgc)}
.pg-body{flex:1;min-width:0}
.pg-body b{font-size:14.5px;font-weight:800;display:block}
.pg-body small{font-size:11.5px;color:var(--muted)}
.pg-line{height:4px;border-radius:99px;background:var(--fill-2);margin-top:8px;position:relative;overflow:hidden}
.pg-line i{position:absolute;top:0;bottom:0;left:0;width:var(--p);background:var(--accent,var(--lime));border-radius:99px}
.pg-pct{font-size:12.5px;font-weight:900;color:var(--lime-ink)}

/* ── Search & library ── */
.search{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:0 14px;height:48px;margin-bottom:14px}
.search svg{width:18px;height:18px;color:var(--muted);flex:none}
.search input{flex:1;background:none;border:0;outline:none;color:var(--text);font-size:14px}
.search input::placeholder{color:var(--muted)}
.filters{margin-bottom:16px}
.ex-list{display:flex;flex-direction:column;gap:11px}
.ex{display:flex;align-items:center;gap:13px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px;transition:.2s;text-align:left}
.ex:hover{background:var(--surface-2);transform:translateX(3px)}
.ex-thumb{width:60px;height:60px;border-radius:15px;flex:none;display:grid;place-items:center;font-size:26px;background:var(--bgc);position:relative;overflow:hidden}
.ex-thumb:after{content:"";position:absolute;inset:0;background:linear-gradient(140deg,var(--fill-4),transparent)}
.ex-body{flex:1;min-width:0}
.ex-body b{font-size:14.5px;font-weight:800;display:block;margin-bottom:5px}
.ex-tags{display:flex;gap:6px;flex-wrap:wrap}
.ex-tags span{font-size:10.5px;color:var(--muted);background:var(--fill-1);padding:3px 8px;border-radius:7px;font-weight:600}
.lvl{font-size:10px;font-weight:800;padding:4px 8px;border-radius:8px}
.lvl.b{color:#4ade80;background:rgba(74,222,128,.14)}
.lvl.i{color:var(--lime-ink);background:rgba(198,244,50,.14)}
.lvl.a{color:var(--coral);background:rgba(255,107,74,.14)}
.ex-go{width:34px;height:34px;border-radius:11px;background:var(--fill-1);display:grid;place-items:center;flex:none}
.ex-go svg{width:15px;height:15px}
.empty{text-align:center;color:var(--muted);padding:40px 0;font-size:13.5px}

/* ── Week strip & schedule ── */
.weekstrip{display:flex;gap:8px;margin-bottom:6px}
.day{flex:1;border-radius:16px;background:var(--surface);border:1px solid var(--line);padding:11px 0;text-align:center;transition:.2s}
.day span{display:block;font-size:10.5px;color:var(--muted);font-weight:700;margin-bottom:5px}
.day b{font-size:16px;font-weight:900}
.day i{display:block;width:5px;height:5px;border-radius:50%;background:var(--lime);margin:5px auto 0;opacity:.85}
.day.on{background:linear-gradient(160deg,var(--lime),var(--lime-dim));border-color:transparent;color:#0a0d11;box-shadow:0 10px 22px rgba(198,244,50,.25)}
.day.on span{color:rgba(10,13,17,.65)}
.day.on i{background:#0a0d11}

.timeline{position:relative;padding-left:22px}
.timeline:before{content:"";position:absolute;left:6px;top:8px;bottom:8px;width:2px;background:linear-gradient(180deg,var(--lime),rgba(124,92,255,.5),transparent)}
.tl{position:relative;margin-bottom:11px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:13px}
.tl:before{content:"";position:absolute;left:-21px;top:20px;width:11px;height:11px;border-radius:50%;background:var(--bg);border:2.5px solid var(--dc,var(--lime))}
.tl-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.tl-head b{font-size:14.5px;font-weight:800}
.tl-time{font-size:11.5px;color:var(--muted);font-weight:700}
.tl-meta{display:flex;gap:7px;flex-wrap:wrap}
.tl-meta span{font-size:10.5px;background:var(--fill-1);padding:3px 8px;border-radius:7px;color:var(--muted)}
.tl.done{opacity:.55}
.tl.done b{text-decoration:line-through}

.history{display:flex;flex-direction:column;gap:9px}
.hist{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:12px;transition:opacity .22s ease,transform .22s ease}
.hist.removing{opacity:0;transform:translateX(-24px)}
.hist-del{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;color:var(--muted);flex:none;transition:.2s}
.hist-del svg{width:16px;height:16px}
.hist-del:hover{background:rgba(255,107,74,.14);color:var(--coral)}
.link.danger{color:var(--coral)}
.link.armed{background:rgba(255,107,74,.16);padding:4px 11px;border-radius:99px}
.hist .hi{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;font-size:18px;background:var(--bgc);flex:none}
.hist b{font-size:13.5px;display:block}
.hist small{font-size:11px;color:var(--muted)}
.hist .kcal{font-size:13px;font-weight:900;color:var(--lime-ink)}

/* ── Performance dashboard ── */
.kpi-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.kpi{display:flex;flex-direction:column;gap:5px;position:relative;overflow:hidden}
.kpi-ico{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;margin-bottom:4px}
.kpi-ico svg{width:18px;height:18px}
.kpi-ico.lime{background:rgba(198,244,50,.14);color:var(--lime-ink)}
.kpi-ico.violet{background:rgba(124,92,255,.16);color:var(--violet)}
.kpi b{font-size:24px;font-weight:900;font-variant-numeric:tabular-nums}
.spark{height:34px;margin-top:6px}
.spark svg{width:100%;height:100%}

.hr-card{padding:14px 10px 12px}
.hrchart{width:100%;height:130px}
.hr-now{font-size:15px;font-weight:900;color:var(--coral)}
.hr-now small{font-size:10px;color:var(--muted)}
.hr-zones{display:flex;justify-content:space-around;margin-top:8px}
.hr-zones span{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);font-weight:700}
.hr-zones i{width:7px;height:7px;border-radius:50%;background:var(--c)}

.progress-list{display:flex;flex-direction:column;gap:15px}
.pr{display:flex;flex-direction:column;gap:7px}
.pr-top{display:flex;justify-content:space-between;font-size:13px}
.pr-top b{font-weight:700}
.pr-top span{font-weight:900;color:var(--lime-ink)}
.pr-bar{height:8px;border-radius:99px;background:var(--fill-2);position:relative;overflow:hidden}
.pr-bar i{position:absolute;top:0;bottom:0;left:0;width:0;border-radius:99px;background:linear-gradient(90deg,var(--c1,var(--lime)),var(--c2,var(--violet)));transition:width 1.2s cubic-bezier(.22,1,.36,1)}

.metric-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.metric{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:13px 10px;text-align:center}
.metric b{display:block;font-size:19px;font-weight:900;margin:5px 0 2px}
.metric b small{font-size:10px;color:var(--muted)}
.metric span{font-size:11px;color:var(--muted)}
.metric .mv{font-size:10.5px;font-weight:800;margin-top:4px;display:inline-block}
.mv.up{color:var(--lime-ink)}.mv.down{color:var(--coral)}

.badges{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.badge{aspect-ratio:1;border-radius:18px;display:grid;place-items:center;gap:2px;background:var(--surface);border:1px solid var(--line);text-align:center;padding:6px;position:relative}
.badge .be{font-size:24px}
.badge small{font-size:9px;color:var(--muted);line-height:1.2}
.badge.got{background:linear-gradient(150deg,rgba(198,244,50,.16),rgba(124,92,255,.14));border-color:rgba(198,244,50,.32)}
.badge.got small{color:var(--text)}
.badge.lock{opacity:.4;filter:grayscale(1)}

/* ── Profile ── */
.profile-hero{display:flex;flex-direction:column;align-items:center;gap:6px;padding:20px;border-radius:26px;background:linear-gradient(160deg,var(--surface-2),var(--surface));border:1px solid var(--line);position:relative;overflow:hidden}
.profile-hero:before{content:"";position:absolute;width:220px;height:220px;border-radius:50%;background:radial-gradient(circle,rgba(198,244,50,.22),transparent 70%);top:-120px}
.ph-avatar{width:78px;height:78px;border-radius:26px;overflow:hidden;border:3px solid var(--fill-5);background:#fff;position:relative}
.ph-avatar img{width:100%;height:100%;object-fit:contain;padding:6px}
.profile-hero strong{font-size:18px;font-weight:900;margin-top:6px}
.ph-stats{display:flex;gap:26px;margin-top:14px;position:relative}
.ph-stats div{text-align:center}
.ph-stats b{display:block;font-size:19px;font-weight:900}
.ph-stats small{font-size:11px;color:var(--muted)}

.challenges{display:flex;flex-direction:column;gap:11px}
.ch{border-radius:20px;padding:15px;border:1px solid var(--line);background:var(--surface);position:relative;overflow:hidden}
.ch:before{content:"";position:absolute;inset:0;background:var(--grad);opacity:.14}
.ch-top{display:flex;align-items:center;gap:11px;position:relative;margin-bottom:11px}
.ch-em{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;font-size:21px;background:var(--fill-2);flex:none}
.ch-top b{font-size:14.5px;font-weight:800;display:block}
.ch-top small{font-size:11px;color:var(--muted)}
.ch-join{font-size:11px;font-weight:800;background:var(--lime);color:#0a0d11;padding:6px 12px;border-radius:99px}
.ch-join.in{background:var(--fill-3);color:var(--text)}
.ch-bar{height:7px;border-radius:99px;background:var(--fill-3);position:relative;overflow:hidden}
.ch-bar i{position:absolute;top:0;bottom:0;left:0;width:var(--p);background:linear-gradient(90deg,var(--lime),var(--violet));border-radius:99px}
.ch-foot{display:flex;justify-content:space-between;margin-top:7px;font-size:11px;color:var(--muted);font-weight:700;position:relative}

/* ── Bottom navigation ── */
.tabbar{display:flex;align-items:center;justify-content:space-around;padding:9px 12px 4px;background:var(--bar-bg);backdrop-filter:blur(20px);border-top:1px solid var(--line);z-index:40}
.tab{display:flex;flex-direction:column;align-items:center;gap:4px;color:var(--muted);font-size:10.5px;font-weight:700;padding:6px 10px;border-radius:14px;transition:.2s;flex:1}
.tab svg{width:21px;height:21px}
.tab.is-on{color:var(--lime-ink)}
.tab.is-on svg{filter:drop-shadow(0 0 10px rgba(198,244,50,.6))}
.tab-fab{flex:none}
.fab{width:54px;height:54px;border-radius:20px;display:grid;place-items:center;background:linear-gradient(150deg,var(--lime),var(--lime-dim));color:#0a0d11;box-shadow:0 12px 26px rgba(198,244,50,.36);transform:translateY(-12px);transition:.2s}
.fab svg{width:24px;height:24px}
.tab-fab:active .fab{transform:translateY(-12px) scale(.92)}
.homebar{height:20px;display:grid;place-items:center;background:var(--bar-bg)}
.homebar:after{content:"";width:128px;height:5px;border-radius:99px;background:var(--fill-5)}

/* ── Bottom sheet ── */
.sheet-wrap{position:absolute;inset:0;z-index:70;display:none}
.sheet-wrap.open{display:block}
.sheet-backdrop{position:absolute;inset:0;background:rgba(3,5,8,.7);backdrop-filter:blur(3px);animation:fadeIn .25s}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.sheet{position:absolute;left:0;right:0;bottom:0;max-height:86%;background:var(--surface);border-radius:30px 30px 0 0;border-top:1px solid var(--line);display:flex;flex-direction:column;animation:sheetUp .4s cubic-bezier(.22,1,.36,1);box-shadow:0 -20px 50px rgba(0,0,0,.6)}
@keyframes sheetUp{from{transform:translateY(100%)}to{transform:none}}
.sheet-grab{padding:12px 0 6px;display:grid;place-items:center;flex:none}
.sheet-grab:after{content:"";width:44px;height:4.5px;border-radius:99px;background:var(--fill-4)}
.sheet-scroll{overflow-y:auto;padding:6px 20px 24px;scrollbar-width:none}
.sheet-scroll::-webkit-scrollbar{display:none}
.sheet-hero{height:150px;border-radius:22px;display:grid;place-items:center;font-size:60px;background:var(--bgc);margin-bottom:16px;position:relative;overflow:hidden}
.sheet-hero:after{content:"";position:absolute;inset:0;background:linear-gradient(160deg,var(--fill-3),transparent 60%)}
.sheet h3{font-size:20px;font-weight:900;margin-bottom:6px}
.sheet .sub{font-size:12.5px;color:var(--muted);margin-bottom:14px}
.sr-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}
.sr-cell{background:var(--surface-2);border-radius:15px;padding:12px;text-align:center}
.sr-cell b{display:block;font-size:18px;font-weight:900}
.sr-cell span{font-size:11px;color:var(--muted)}
.steps{list-style:none;display:flex;flex-direction:column;gap:10px;margin-bottom:18px}
.steps li{display:flex;gap:11px;font-size:13px;line-height:1.7;color:var(--text)}
.steps li b{width:24px;height:24px;border-radius:8px;background:rgba(198,244,50,.15);color:var(--lime-ink);display:grid;place-items:center;font-size:11.5px;flex:none;margin-top:1px}
.muscle-map{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.muscle-map span{font-size:11.5px;padding:6px 11px;border-radius:10px;background:rgba(124,92,255,.14);color:#c3b5ff;font-weight:700}
.sheet-cta{display:flex;gap:10px}
.sheet-cta .btn-primary{flex:1;background:linear-gradient(150deg,var(--lime),var(--lime-dim));color:#0a0d11;padding:15px;border-radius:16px}
.btn-ghost{width:52px;border-radius:16px;background:var(--surface-2);border:1px solid var(--line);display:grid;place-items:center}
.btn-ghost svg{width:19px;height:19px}

/* ── Workout player ── */
.player{position:absolute;inset:0;z-index:90;background:radial-gradient(700px 420px at 50% 8%,var(--player-glow),transparent 62%),var(--player-bg);
  display:none;flex-direction:column;padding:22px 20px 18px;overflow-y:auto;scrollbar-width:none}
.player::-webkit-scrollbar{display:none}
.player.open{display:flex;animation:playerIn .4s cubic-bezier(.22,1,.36,1)}
@keyframes playerIn{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:none}}
.player.rest{background:radial-gradient(700px 420px at 50% 8%,var(--player-glow-rest),transparent 62%),var(--player-bg)}
.player-top{display:flex;align-items:center;gap:12px;margin-top:16px}
.player-title{flex:1;text-align:center;line-height:1.4}
.player-title b{font-size:15.5px;font-weight:800;display:block}
.player-title span{font-size:11.5px;color:var(--muted)}
.player-visual{height:118px;margin:16px 0 4px;border-radius:24px;background:linear-gradient(150deg,var(--surface-2),var(--surface));border:1px solid var(--line);display:grid;place-items:center;position:relative;overflow:hidden}
.pv-pulse{position:absolute;width:150px;height:150px;border-radius:50%;background:radial-gradient(circle,rgba(198,244,50,.28),transparent 68%);animation:pv 2.4s ease-in-out infinite}
@keyframes pv{0%,100%{transform:scale(.85);opacity:.6}50%{transform:scale(1.1);opacity:1}}
.pv-emoji{font-size:52px;position:relative;animation:bob 2.4s ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}

.timer-wrap{position:relative;width:230px;height:230px;margin:8px auto 4px}
.timer-ring{transform:rotate(-90deg)}
.timer-ring circle{fill:none;stroke-width:13;stroke-linecap:round}
.tr-bg{stroke:var(--fill-2)}
.tr-fg{stroke:var(--lime);stroke-dasharray:653.45;stroke-dashoffset:0;filter:drop-shadow(0 0 14px rgba(198,244,50,.55));transition:stroke-dashoffset .95s linear,stroke .3s}
.player.rest .tr-fg{stroke:var(--cyan);filter:drop-shadow(0 0 14px rgba(61,218,215,.55))}
.timer-label{position:absolute;inset:0;display:grid;place-content:center;text-align:center;gap:2px}
.timer-label span{font-size:12px;color:var(--muted);font-weight:700}
.timer-label b{font-family:var(--display);font-size:60px;letter-spacing:2px;line-height:1;font-variant-numeric:tabular-nums}
.timer-label small{font-size:10.5px;color:var(--muted)}

.setreps{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:10px 0 16px}
.sr-box{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;text-align:center}
.sr-box span{font-size:11px;color:var(--muted);display:block;margin-bottom:4px}
.sr-box b{font-size:19px;font-weight:900}
.sr-box b small{font-size:10px;color:var(--muted)}
.sr-box i{font-style:normal}
#setNow{color:var(--lime-ink)}

.player-actions{display:flex;align-items:center;justify-content:center;gap:14px;margin-bottom:16px}
.rbtn{width:56px;height:56px;border-radius:19px;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;gap:1px;font-size:11px;font-weight:800;transition:.2s}
.rbtn small{font-size:9px;color:var(--muted)}
.rbtn svg{width:21px;height:21px}
.rbtn:hover{background:var(--surface-2)}
.rbtn.on{background:rgba(61,218,215,.16);border-color:rgba(61,218,215,.5);color:var(--cyan)}
.pbtn{width:78px;height:78px;border-radius:28px;background:linear-gradient(150deg,var(--lime),var(--lime-dim));color:#0a0d11;display:grid;place-items:center;box-shadow:0 14px 30px rgba(198,244,50,.35);transition:.2s}
.pbtn svg{width:32px;height:32px}
.pbtn:active{transform:scale(.94)}

.player-strip{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-bottom:4px}
.player-strip::-webkit-scrollbar{display:none}
.ps{flex:none;width:78px;border-radius:15px;background:var(--surface);border:1px solid var(--line);padding:9px 8px;text-align:center;transition:.2s}
.ps .pse{font-size:20px}
.ps small{display:block;font-size:9.5px;color:var(--muted);margin-top:3px;line-height:1.3}
.ps.cur{border-color:var(--lime-ink);background:rgba(198,244,50,.1)}
.ps.done{opacity:.42}

/* ── iPad sizes (iPad mini / iPad / iPad Pro) ── */
.device.is-tablet{
  --gutter:max(22px,calc((100% - 760px) / 2));
  border-radius:38px;border-width:15px;
}
.device.is-tablet .notch{display:none}
.device.is-tablet .statusbar{padding:13px calc(var(--gutter) + 8px) 5px;font-size:14px}
.device.is-tablet .scroll,
.device.is-tablet .sheet-scroll{padding-left:var(--gutter);padding-right:var(--gutter)}
.device.is-tablet .topbar,
.device.is-tablet .tabbar,
.device.is-tablet .player{padding-left:var(--gutter);padding-right:var(--gutter)}
.device.is-tablet .tab{flex:none;min-width:104px}
.device.is-tablet .homebar{height:24px}
.device.is-tablet .homebar:after{width:190px}
.device.is-tablet .sheet{border-radius:34px 34px 0 0}
body.dev-tablet .brandpane{display:none}
body.dev-tablet .stage{max-width:none;gap:32px}

/* ── Responsive ── */

/* Large laptop / iPad Pro landscape (1366) → keep 3 columns */
@media (max-width:1280px){ .stage{gap:34px} }

/* Narrow desktop → drop the screen switcher */
@media (max-width:1160px){ .minimap{display:none} }

/* iPad Pro portrait (1024) & tablets → device only, centered */
@media (max-width:1023px){
  .brandpane{display:none}
  .stage{max-width:none;gap:0}
  body{padding:24px 20px}
}

/* Short viewports (iPad landscape, small laptops) → scale the frame down */
@media (max-height:900px) and (min-width:901px){
  body{padding:18px 20px}
  .device{height:min(830px,calc(100dvh - 36px))}
}

/* Phones → true full-screen app */
@media (max-width:900px){
  body{padding:0;display:block;background:var(--page)}
  .stage{display:block;gap:0}
  .brandpane,.minimap{display:none}
  .device{
    flex:none;width:100%;height:100dvh;max-height:none;
    max-width:none;border-radius:0;border:0;box-shadow:none;
  }
  .notch{display:none}
  .statusbar{padding-top:max(14px,env(safe-area-inset-top))}
  .homebar{padding-bottom:env(safe-area-inset-bottom)}
}
