:root{
  --bg:#0b0b0b;
  --card:#161616;
  --card-2:#1d1d1d;
  --accent:#00ff88;
  --accent-dim:rgba(0,255,136,.14);
  --accent-glow:rgba(0,255,136,.35);
  --text:#ffffff;
  --text-2:#aaaaaa;
  --text-3:#6f6f6f;
  --danger:#ff4d6a;
  --stroke:#242424;
  --font-display:'Poppins',sans-serif;
  --font-body:'Inter',sans-serif;
  --r-lg:20px;
  --r-md:16px;
  --r-sm:12px;
  --shadow: 0 8px 24px rgba(0,0,0,.45);
}
[data-theme="light"]{
  --bg:#f6f7f6;
  --card:#ffffff;
  --card-2:#f0f1ef;
  --accent:#00c97a;
  --accent-dim:rgba(0,201,122,.12);
  --accent-glow:rgba(0,201,122,.28);
  --text:#101210;
  --text-2:#6b6f6c;
  --text-3:#9a9d9a;
  --danger:#e0335a;
  --stroke:#e7e8e6;
  --shadow: 0 8px 24px rgba(20,20,20,.08);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{height:100%;}
body{
  margin:0; font-family:var(--font-body); background:#000;
  display:flex; align-items:flex-start; justify-content:center;
  padding:24px 12px;
}
.device{
  width:390px; max-width:100%; height:844px; max-height:96vh;
  background:var(--bg); color:var(--text);
  border-radius:44px; border:10px solid #000;
  position:relative; overflow:hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.03);
  display:flex; flex-direction:column;
  transition:background .35s ease, color .35s ease;
}
[data-theme="light"] .device{ border-color:#111; }
.notch{
  position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:120px; height:26px; background:#000; border-radius:0 0 16px 16px; z-index:50;
}
.statusbar{
  height:46px; flex:0 0 auto; display:flex; align-items:flex-end;
  justify-content:space-between; padding:0 22px 6px; font-size:13px; font-weight:600;
  color:var(--text); font-family:var(--font-display);
}
.screen{
  flex:1 1 auto; overflow-y:auto; padding:4px 20px 110px;
  scrollbar-width:none;
}
.screen::-webkit-scrollbar{display:none;}
.screen{ animation:fadeIn .35s ease; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);} }
@media (prefers-reduced-motion: reduce){
  .screen{ animation:none; }
  *{ transition-duration:.01ms !important; animation-duration:.01ms !important; }
}

h1,h2,h3{ font-family:var(--font-display); margin:0; letter-spacing:-.01em; }
p{ margin:0; }
button{ font-family:inherit; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- Top bar / greeting ---------- */
.topbar{ display:flex; align-items:center; justify-content:space-between; padding:10px 0 18px; gap:10px; }
.greeting-eyebrow{ font-size:12px; color:var(--text-2); font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
.greeting{ font-size:24px; font-weight:700; margin-top:2px; }
.avatar{
  width:44px; height:44px; border-radius:50%;
  background:linear-gradient(145deg,var(--accent),#00b368);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:800; color:#04170d; font-size:16px;
  box-shadow:0 0 0 3px var(--accent-dim); flex:0 0 auto;
}
.count-pill{
  background:var(--accent-dim); color:var(--accent); font-size:12px; font-weight:700;
  padding:4px 10px; border-radius:100px; flex:0 0 auto;
}
.icon-back{
  width:36px;height:36px;border-radius:50%;background:var(--card);border:1px solid var(--stroke);
  display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text);flex:0 0 auto;
}
.icon-back svg{ width:18px;height:18px; }
.icon-back:active{ transform:scale(.9); }

/* ---------- Quick access ---------- */
.quick-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:26px; }
.quick-btn{
  background:var(--card); border:1px solid var(--stroke); border-radius:var(--r-md);
  padding:16px 8px; display:flex; flex-direction:column; align-items:center; gap:8px;
  cursor:pointer; transition:.18s ease; color:var(--text);
}
.quick-btn:active{ transform:scale(.95); background:var(--accent-dim); border-color:var(--accent); }
.quick-btn .qi{ width:22px; height:22px; color:var(--accent); }
.quick-btn span{ font-size:12px; font-weight:600; color:var(--text-2); }

.section-head{ display:flex; align-items:center; justify-content:space-between; margin:22px 0 12px; }
.section-head h2{ font-size:16px; font-weight:700; }
.section-head .link{ font-size:12px; color:var(--accent); font-weight:600; cursor:pointer; }

/* ---------- Recommended routines (horizontal) ---------- */
.hscroll{ display:flex; gap:12px; overflow-x:auto; margin:0 -20px; padding:0 20px 6px; scrollbar-width:none; }
.hscroll::-webkit-scrollbar{display:none;}
.routine-card{
  flex:0 0 auto; width:180px; height:130px; border-radius:var(--r-md);
  padding:14px; position:relative; overflow:hidden; cursor:pointer;
  display:flex; flex-direction:column; justify-content:flex-end;
  background:linear-gradient(160deg,var(--card-2),var(--card));
  border:1px solid var(--stroke); transition:.2s;
}
.routine-card:active{ transform:scale(.97); }
.routine-card .tag{
  position:absolute; top:12px; left:12px; font-size:10px; font-weight:700; letter-spacing:.04em;
  color:#04170d; background:var(--accent); padding:4px 8px; border-radius:20px; text-transform:uppercase;
}
.routine-card h3{ font-size:14px; font-weight:700; margin-bottom:4px; }
.routine-card .meta{ font-size:11px; color:var(--text-2); }

/* ---------- Recent / favorite exercises list ---------- */
.recent-item{
  display:flex; align-items:center; gap:12px; padding:10px; border-radius:var(--r-md);
  background:var(--card); border:1px solid var(--stroke); margin-bottom:10px; cursor:pointer; transition:.15s;
}
.recent-item:active{ background:var(--card-2); }
.thumb{
  width:52px; height:52px; border-radius:14px; flex:0 0 auto; overflow:hidden;
  background:linear-gradient(150deg,var(--card-2),#000);
  display:flex; align-items:center; justify-content:center; color:var(--accent);
  border:1px solid var(--stroke);
}
.thumb svg{ width:22px; height:22px; }
.thumb img{ width:100%; height:100%; object-fit:cover; }
.ritem-title{ font-size:14px; font-weight:600; }
.ritem-sub{ font-size:12px; color:var(--text-2); margin-top:2px; }

/* ---------- Search + filters ---------- */
.search-box{
  display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--stroke);
  border-radius:var(--r-md); padding:12px 14px; margin-bottom:14px;
}
.search-box svg{ width:18px; height:18px; color:var(--text-3); flex:0 0 auto; }
.search-box input{
  border:none; background:transparent; outline:none; color:var(--text); font-size:14px; width:100%;
  font-family:var(--font-body);
}
.search-box input::placeholder{ color:var(--text-3); }
.equip-select{
  width:100%; padding:12px 14px; margin-bottom:16px; border-radius:var(--r-md);
  background:var(--card); border:1px solid var(--stroke); color:var(--text); font-size:13px; font-weight:600;
  appearance:none; -webkit-appearance:none; font-family:var(--font-body); cursor:pointer;
}

.chip-row{ display:flex; gap:8px; overflow-x:auto; margin:0 -20px 16px; padding:0 20px 4px; scrollbar-width:none; }
.chip-row::-webkit-scrollbar{display:none;}
.chip{
  flex:0 0 auto; padding:9px 16px; border-radius:100px; font-size:12.5px; font-weight:600;
  background:var(--card); border:1px solid var(--stroke); color:var(--text-2); cursor:pointer; transition:.15s;
  white-space:nowrap;
}
.chip.active{ background:var(--accent); color:#04170d; border-color:var(--accent); }

/* ---------- Exercise cards ---------- */
.ex-card{
  background:var(--card); border:1px solid var(--stroke); border-radius:var(--r-md);
  padding:12px; display:flex; align-items:center; gap:14px; margin-bottom:12px;
  transition:.15s; cursor:pointer;
}
.ex-card:active{ background:var(--card-2); }
.ex-media{
  width:64px; height:64px; border-radius:14px; flex:0 0 auto; position:relative; overflow:hidden;
  background:linear-gradient(150deg,var(--card-2),#000); border:1px solid var(--stroke);
  display:flex; align-items:center; justify-content:center; color:var(--accent-glow);
}
.ex-media svg{ width:26px;height:26px; color:var(--accent); }
.ex-media img{ width:100%; height:100%; object-fit:cover; }
.ex-info{ flex:1; min-width:0; }
.ex-name{ font-size:14.5px; font-weight:600; }
.ex-meta{ font-size:12px; color:var(--text-2); margin-top:3px; display:flex; gap:6px; align-items:center; }
.dot{ width:3px; height:3px; border-radius:50%; background:var(--text-3); flex:0 0 auto; }
.fav-btn{
  width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:transparent; border:none; cursor:pointer; color:var(--text-3); transition:.2s; flex:0 0 auto;
}
.fav-btn svg{ width:20px; height:20px; }
.fav-btn.active{ color:var(--danger); }
.fav-btn:active{ transform:scale(1.3); }

/* ---------- Exercise detail ---------- */
.detail-media{
  width:100%; height:230px; border-radius:var(--r-lg); margin-bottom:18px; overflow:hidden;
  background:radial-gradient(circle at 50% 40%, var(--accent-dim), transparent 70%), linear-gradient(160deg,var(--card-2),#000);
  display:flex; align-items:center; justify-content:center; color:var(--accent); border:1px solid var(--stroke);
}
.detail-media svg{ width:64px; height:64px; }
.detail-media img{ width:100%; height:100%; object-fit:cover; }
.detail-name{ font-size:22px; font-weight:800; margin-bottom:10px; }
.detail-tags{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.mini-tag{
  font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:100px;
  background:var(--card); border:1px solid var(--stroke); color:var(--text-2); text-transform:capitalize;
}
.mini-tag.accent{ background:var(--accent-dim); color:var(--accent); border-color:transparent; }
.detail-block{ margin-bottom:20px; }
.detail-label{ font-size:11px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px; }
.detail-text{ font-size:14px; line-height:1.6; color:var(--text-2); }
.detail-text.muscle-list{ text-transform:capitalize; }
.detail-note{ display:flex; gap:8px; align-items:flex-start; font-size:11.5px; color:var(--text-3); margin-top:10px; line-height:1.5; text-transform:none; }
.detail-note svg{ width:15px; height:15px; flex:0 0 auto; margin-top:1px; }
.detail-note code{ background:rgba(127,127,127,.15); padding:1px 5px; border-radius:4px; font-size:11px; }

.notice-banner{
  display:flex; gap:10px; align-items:flex-start; background:var(--accent-dim); border:1px solid var(--accent);
  border-radius:var(--r-md); padding:12px 14px; margin-bottom:20px; font-size:12px; color:var(--text); line-height:1.5;
}
.notice-banner svg{ width:18px; height:18px; color:var(--accent); flex:0 0 auto; margin-top:1px; }
.notice-banner code{ background:rgba(0,0,0,.15); padding:1px 5px; border-radius:4px; font-size:11px; }

/* ---------- Routines list (playlist style) ---------- */
.tab-row{ display:flex; gap:6px; background:var(--card); padding:4px; border-radius:100px; margin-bottom:18px; border:1px solid var(--stroke); }
.tab-btn{
  flex:1; text-align:center; padding:9px 4px; border-radius:100px; font-size:12.5px; font-weight:700;
  color:var(--text-2); cursor:pointer; transition:.18s;
}
.tab-btn.active{ background:var(--accent); color:#04170d; }
.plist-item{
  display:flex; align-items:center; gap:14px; padding:14px; border-radius:var(--r-md);
  background:var(--card); border:1px solid var(--stroke); margin-bottom:12px;
}
.plist-num{
  width:38px; height:38px; border-radius:12px; background:var(--accent-dim); color:var(--accent);
  font-family:var(--font-display); font-weight:800; font-size:14px;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.plist-info{ flex:1; min-width:0; }
.plist-title{ font-size:14.5px; font-weight:700; }
.plist-sub{ font-size:12px; color:var(--text-2); margin-top:3px; }
.start-btn{
  border:none; background:var(--accent); color:#04170d; font-family:var(--font-display); font-weight:700;
  font-size:12px; padding:10px 16px; border-radius:100px; cursor:pointer; flex:0 0 auto; transition:.15s;
  box-shadow:0 4px 14px var(--accent-glow);
}
.start-btn:active{ transform:scale(.94); }

/* ---------- Workout in progress ---------- */
.wk-progress-dots{ display:flex; gap:5px; justify-content:center; margin:6px 0 18px; }
.wk-progress-dots span{ width:22px; height:4px; border-radius:4px; background:var(--stroke); }
.wk-progress-dots span.done{ background:var(--accent); }
.wk-progress-dots span.now{ background:var(--text); }
.wk-hero{
  background:linear-gradient(160deg,var(--card-2),var(--card));
  border:1px solid var(--stroke); border-radius:var(--r-lg);
  padding:22px; text-align:center; margin-bottom:20px;
}
.wk-media{
  width:100%; height:180px; border-radius:var(--r-md); margin-bottom:16px; overflow:hidden;
  background:radial-gradient(circle at 50% 40%, var(--accent-dim), transparent 70%), linear-gradient(160deg,#000,#111);
  display:flex; align-items:center; justify-content:center; color:var(--accent); border:1px solid var(--stroke);
}
.wk-media svg{ width:56px; height:56px; }
.wk-media img{ width:100%; height:100%; object-fit:cover; }
.wk-name{ font-size:20px; font-weight:800; margin-bottom:4px; }
.wk-muscle{ font-size:12.5px; color:var(--text-2); font-weight:600; text-transform:capitalize; letter-spacing:.02em; }

.timer-wrap{ display:flex; flex-direction:column; align-items:center; margin:8px 0 22px; }
.timer-ring-box{ position:relative; width:180px; height:180px; }
.timer-ring-box svg{ transform:rotate(-90deg); }
.ring-bg{ fill:none; stroke:var(--stroke); stroke-width:10; }
.ring-fg{ fill:none; stroke:var(--accent); stroke-width:10; stroke-linecap:round;
  filter:drop-shadow(0 0 8px var(--accent-glow)); transition:stroke-dashoffset 1s linear; }
.timer-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.timer-time{ font-family:var(--font-display); font-size:34px; font-weight:800; }
.timer-label{ font-size:11px; color:var(--text-2); font-weight:600; text-transform:uppercase; letter-spacing:.08em; margin-top:2px; }

.wk-actions{ display:flex; gap:10px; }
.btn-ghost{
  flex:1; background:var(--card); border:1px solid var(--stroke); color:var(--text);
  font-family:var(--font-display); font-weight:700; font-size:13px; padding:15px; border-radius:var(--r-sm);
  cursor:pointer; transition:.15s; display:flex; align-items:center; justify-content:center; gap:8px;
}
.btn-ghost svg{ width:16px; height:16px; }
.btn-ghost:active{ transform:scale(.96); }
.btn-primary{
  flex:1.4; background:var(--accent); border:none; color:#04170d;
  font-family:var(--font-display); font-weight:800; font-size:14px; padding:15px; border-radius:var(--r-sm);
  cursor:pointer; transition:.15s; box-shadow:0 6px 18px var(--accent-glow);
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.btn-primary svg{ width:16px; height:16px; }
.btn-primary:active{ transform:scale(.96); }

/* ---------- Progress screen ---------- */
.stat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:22px; }
.stat-card{ background:var(--card); border:1px solid var(--stroke); border-radius:var(--r-md); padding:16px; }
.stat-num{ font-family:var(--font-display); font-size:26px; font-weight:800; color:var(--accent); }
.stat-lab{ font-size:12px; color:var(--text-2); margin-top:2px; font-weight:600; display:flex; align-items:center; gap:5px; }
.stat-lab svg{ width:13px; height:13px; }
.chart-card{ background:var(--card); border:1px solid var(--stroke); border-radius:var(--r-md); padding:18px; margin-bottom:22px; }
.chart-bars{ display:flex; align-items:flex-end; justify-content:space-between; height:100px; margin-top:14px; gap:8px; }
.bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:8px; }
.bar{ width:100%; border-radius:8px 8px 4px 4px; background:var(--stroke); transition:height .4s ease; }
.bar.filled{ background:linear-gradient(180deg,var(--accent),#00b368); }
.bar-day{ font-size:10.5px; color:var(--text-2); font-weight:600; }
.hist-item{ display:flex; align-items:center; gap:12px; padding:12px; background:var(--card); border:1px solid var(--stroke); border-radius:var(--r-md); margin-bottom:10px; }
.hist-date{ width:44px; text-align:center; flex:0 0 auto; }
.hist-date .d{ font-family:var(--font-display); font-size:17px; font-weight:800; }
.hist-date .m{ font-size:10px; color:var(--text-2); text-transform:uppercase; font-weight:700; }

/* ---------- Profile ---------- */
.profile-head{ display:flex; flex-direction:column; align-items:center; padding:16px 0 24px; }
.profile-avatar{
  width:84px; height:84px; border-radius:50%;
  background:linear-gradient(145deg,var(--accent),#00b368);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:800; color:#04170d; font-size:30px;
  margin-bottom:12px; box-shadow:0 0 0 5px var(--accent-dim);
}
.profile-name{ font-size:19px; font-weight:700; }
.profile-mail{ font-size:12.5px; color:var(--text-2); margin-top:2px; }
.setting-group{ margin-bottom:22px; }
.setting-group-label{ font-size:11px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.08em; margin:0 4px 8px; }
.setting-row{
  display:flex; align-items:center; justify-content:space-between; padding:14px 16px;
  background:var(--card); border:1px solid var(--stroke); margin-bottom:2px; cursor:pointer;
}
.setting-row:first-of-type{ border-radius:var(--r-md) var(--r-md) 0 0; }
.setting-row:last-of-type{ border-radius:0 0 var(--r-md) var(--r-md); margin-bottom:10px; }
.setting-left{ display:flex; align-items:center; gap:12px; }
.setting-left svg{ width:19px; height:19px; color:var(--text-2); }
.setting-text{ font-size:13.5px; font-weight:600; }
.switch{ width:44px; height:26px; border-radius:20px; background:var(--stroke); position:relative; cursor:pointer; transition:.2s; flex:0 0 auto; }
.switch.on{ background:var(--accent); }
.switch .knob{ position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; transition:.2s; box-shadow:0 2px 4px rgba(0,0,0,.3); }
.switch.on .knob{ left:21px; background:#04170d; }
.danger-btn{
  width:100%; padding:14px; border-radius:var(--r-md); border:1px solid var(--danger);
  background:transparent; color:var(--danger); font-family:var(--font-display); font-weight:700; font-size:13px;
  cursor:pointer; transition:.15s;
}
.danger-btn:active{ background:rgba(255,77,106,.1); }

/* ---------- Bottom nav ---------- */
.bottomnav{
  position:absolute; bottom:0; left:0; right:0; height:84px;
  background:rgba(20,20,20,.7); backdrop-filter:blur(18px);
  border-top:1px solid var(--stroke);
  display:flex; align-items:flex-start; justify-content:space-around; padding-top:10px; z-index:40;
}
[data-theme="light"] .bottomnav{ background:rgba(255,255,255,.75); }
.nav-btn{ display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; padding:6px 10px; border:none; background:none; color:var(--text-3); transition:.18s; }
.nav-btn svg{ width:23px; height:23px; }
.nav-btn span{ font-size:10px; font-weight:600; font-family:var(--font-body); }
.nav-btn.active{ color:var(--accent); }
.nav-btn:active{ transform:scale(.9); }

.badge-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; padding:50px 20px; color:var(--text-2); }
.badge-empty svg{ width:40px;height:40px; color:var(--text-3); margin-bottom:12px; }
.badge-empty p{ font-size:13px; line-height:1.6; }

.caption{ font-size:12px; color:var(--text-3); text-align:center; margin-top:16px; }
