:root {
  --bg: #0d0f12;
  --surface: #171a1f;
  --surface-2: #20242b;
  --line: #2c313a;
  --text: #f2f4f7;
  --muted: #8b93a1;
  --accent: #c4f542;
  --accent-ink: #11140a;
  --hit: #c4f542;
  --miss: #ff6b6b;
  --warn: #ffc24b;
  --radius: 14px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { background: radial-gradient(120% 60% at 50% -10%, #1d2530 0%, var(--bg) 60%) fixed, var(--bg); min-height: 100vh; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { margin: 0; line-height: 1.2; }

#view {
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--tabs-h) + var(--safe-b) + 96px);
  max-width: 560px;
  margin: 0 auto;
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top h1 { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.top .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }

/* Generic */
.card { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: 12px; font-weight: 700;
  background: var(--surface-2); width: 100%;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--miss); }
.btn.ghost { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.btn:active { transform: scale(0.98); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.banner { background: #2a2410; border: 1px solid #574a1c; color: var(--warn); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.banner button { color: var(--text); font-weight: 700; white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

/* Week summary */
.week-card {
  border-radius: 18px; padding: 16px; margin-bottom: 4px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 15%, transparent), rgba(62, 212, 255, 0.05) 55%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.week-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.week-stats b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.week-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--muted); }
.wd i { width: 100%; max-width: 34px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }
.wd.on i { background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.wd.today span { color: var(--text); }
.wd.today i { outline: 1.5px solid rgba(255, 255, 255, 0.35); outline-offset: 2px; }

/* Day type grid */
.days { display: grid; gap: 10px; }
.day-btn {
  --c: var(--accent);
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px; text-align: left;
  border-radius: 18px; padding: 16px 14px; min-height: 84px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 20%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  transition: transform 0.12s;
}
.day-btn::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%);
  pointer-events: none;
}
.day-ico {
  width: 52px; height: 52px; border-radius: 15px; flex: none; display: grid; place-items: center; font-size: 26px;
  background: color-mix(in srgb, var(--c, var(--accent)) 22%, #0d0f12);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 40%, transparent);
}
.day-ico.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.day-txt { flex: 1; min-width: 0; }
.day-btn strong { font-size: 18px; font-weight: 800; display: block; letter-spacing: -0.01em; }
.day-btn .muscles { display: block; font-size: 12px; color: color-mix(in srgb, var(--c) 70%, var(--text)); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-btn .when { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.day-btn .go { width: 38px; height: 38px; border-radius: 50%; background: var(--c); color: #0d0f12; display: grid; place-items: center; flex: none; z-index: 1; }
.day-btn .go svg { width: 18px; height: 18px; }
.day-btn:active { transform: scale(0.98); }
.big-ico { font-size: 44px; margin-bottom: 8px; }

/* Active workout */
.workout-head {
  position: sticky; top: 0; z-index: 5; margin: calc(-1 * var(--safe-t) - 16px) -16px 14px; padding: calc(var(--safe-t) + 12px) 16px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, var(--bg)) 0%, rgba(13, 15, 18, 0.96) 100%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.workout-head .top { margin: 0 0 12px; }
.wh-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.workout-head h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { height: 4px; margin: 0 -16px; background: rgba(255, 255, 255, 0.06); }
.prog i { display: block; height: 100%; background: var(--c); box-shadow: 0 0 10px var(--c); transition: width 0.3s ease; }
.finish-btn { background: var(--c, var(--accent)); color: #0d0f12; font-weight: 800; padding: 10px 18px; border-radius: 99px; flex: none; }
.btn.primary.day { background: var(--c); }

.ex-card {
  position: relative; background: var(--surface); border-radius: 18px; padding: 14px 12px 12px; margin-bottom: 14px;
  border: 1px solid var(--line); transition: border-color 0.3s, box-shadow 0.3s;
}
.ex-card::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, var(--accent)); }
.ex-card.complete { border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent), 0 8px 30px -12px var(--c); }
.ex-card.complete h3::after { content: ' ✓'; color: var(--c); }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c, var(--accent)); margin-bottom: 2px; }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-left: 4px; }
.ex-head h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.ex-tools { display: flex; gap: 6px; flex: none; }
.ex-tools button { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.suggest { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c, var(--accent)) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 30%, transparent); }
.suggest .target { font-weight: 800; font-size: 17px; color: var(--c, var(--accent)); }
.suggest .why { font-size: 13px; color: var(--muted); margin-top: 2px; }
.suggest.first { background: var(--surface-2); border-color: var(--line); }
.last { font-size: 13px; color: var(--muted); margin: 6px 0 8px; }

.set-head, .set-row { display: grid; grid-template-columns: 34px 1fr 1fr 46px; gap: 8px; align-items: center; }
.set-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 0; text-align: center; }
.set-row { padding: 6px 0; border-top: 1px solid var(--line); }
.set-num { height: 44px; border-radius: 10px; font-weight: 800; color: var(--muted); background: var(--surface-2); }
.set-num.warm { color: var(--warn); font-size: 13px; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 10px; height: 44px; overflow: hidden; }
.stepper button { width: 34px; height: 100%; font-size: 20px; font-weight: 700; color: var(--muted); flex: none; }
.stepper button:active { background: var(--line); color: var(--text); }
.stepper input { width: 100%; min-width: 0; text-align: center; background: transparent; border: 0; font-size: 18px; font-weight: 700; padding: 0; outline: none; }
.stepper input::placeholder { color: #55606e; font-weight: 600; }
.goal { grid-column: 3; font-size: 11px; text-align: center; color: var(--muted); margin-top: -2px; }
.check { height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.check svg { width: 22px; height: 22px; }
.set-row.done .check { background: var(--c, var(--hit)); color: #0d0f12; box-shadow: 0 0 14px -2px var(--c, var(--hit)); }
.set-row.done .set-num { color: var(--c, var(--hit)); }
.set-row.just-done .check { animation: pop 0.35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(0.7); } 100% { transform: scale(1); } }
.set-row.done.miss .check { background: var(--miss); color: #fff; box-shadow: 0 0 14px -2px var(--miss); }
.set-row.done.miss .set-num { color: var(--miss); }
.set-row.done .stepper { background: transparent; }
.set-row.done.miss .reps input { color: var(--miss); }
.set-actions { display: flex; gap: 8px; margin-top: 10px; }
.set-actions button { flex: 1; min-height: 40px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.set-actions .minus { flex: 0 0 96px; color: var(--muted); }

.feel { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.feel span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg { display: flex; flex: 1; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; min-height: 34px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg button.on[data-v="easy"] { background: var(--accent); color: var(--accent-ink); }
.seg button.on[data-v="too_hard"] { background: var(--miss); color: #fff; }

/* Rest timer */
#timer {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--safe-b) + 10px); z-index: 20;
  max-width: 536px; margin: 0 auto;
  --c: var(--accent);
  background: rgba(32, 36, 43, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); border-radius: 20px;
  padding: 8px 10px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
#timer[hidden] { display: none; }
#timer .ring { width: 44px; height: 44px; flex: none; }
#timer .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#timer .ring circle { fill: none; stroke-width: 5; }
#timer .ring .track { stroke: rgba(255, 255, 255, 0.08); }
#timer .ring .fill { stroke: var(--c); stroke-linecap: round; transition: stroke-dasharray 0.5s linear; filter: drop-shadow(0 0 4px var(--c)); }
#timer .tt { flex: 1; min-width: 0; }
#timer .t { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
#timer .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#timer button { min-width: 44px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); font-weight: 700; font-size: 14px; flex: none; }
#timer.over { border-color: var(--c); animation: glow 1.2s ease-in-out infinite alternate; }
#timer.over .t, #timer.over .lbl { color: var(--c); }
@keyframes glow { to { box-shadow: 0 0 0 1px var(--c), 0 0 28px -4px var(--c); } }

/* Tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: rgba(13, 15, 18, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
#tabs button svg { width: 24px; height: 24px; padding: 3px 14px; box-sizing: content-box; border-radius: 99px; transition: background 0.2s; }
#tabs button.on { color: var(--accent); }
#tabs button.on svg { background: color-mix(in srgb, var(--accent) 15%, transparent); }

/* Bottom sheet */
#sheet .overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 30; animation: fade 0.15s; }
#sheet .panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 16px calc(var(--safe-b) + 20px);
  max-width: 560px; margin: 0 auto; animation: up 0.2s ease-out;
  -webkit-overflow-scrolling: touch;
}
#sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
#sheet h2 { font-size: 20px; margin-bottom: 12px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.search { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 14px; font-size: 16px; outline: none; margin-bottom: 8px; }
.search:focus { border-color: var(--accent); }
.pick-group h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pick { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.pick .muted { font-size: 12px; }
.pick.added { opacity: 0.45; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px; font-size: 16px; outline: none; }
.check-field { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; font-size: 15px; }
.check-field input { width: 22px; height: 22px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips button { padding: 10px 14px; border-radius: 99px; background: var(--surface-2); font-weight: 700; }
.chips button.on { background: var(--accent); color: var(--accent-ink); }
.stack > * + * { margin-top: 10px; }

/* Summary / stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.pr-list .pr { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pr-list .pr:last-child { border-bottom: 0; }
.pr b { color: var(--accent); }

/* History */
.hist { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); }
.hist-txt { flex: 1; min-width: 0; }
.hist .top-line { display: flex; justify-content: space-between; align-items: baseline; }
.hist strong { font-size: 17px; }
.hist .ex-names { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-link { color: var(--accent); font-weight: 700; padding: 6px 0; }
.set-line { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 0; }
.set-line .miss { color: var(--miss); }

/* Charts */
.chart-wrap { background: var(--surface); border-radius: var(--radius); padding: 12px 8px 6px; margin-bottom: 12px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 6px; }
.chart-head b { font-size: 22px; }
.chart-head .delta { font-size: 13px; font-weight: 700; }
.delta.up { color: var(--accent); }
.delta.down { color: var(--miss); }
select.ex-select { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-size: 16px; margin-bottom: 10px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.cal i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.cal i.on { background: var(--accent); }
.cal i.today { outline: 1px solid var(--muted); }

.toast { position: fixed; top: calc(var(--safe-t) + 12px); left: 50%; transform: translateX(-50%); z-index: 50; background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 16px; border-radius: 99px; font-size: 14px; animation: up 0.2s; }

/* ---------- Motion ---------- */
#view.enter > *, #view.enter .active > *, #view.enter .days > * {
  animation: rise 0.42s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
#view.enter .active > .workout-head { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.stepper button:active { transform: scale(0.86); }
.stepper button { transition: transform 0.08s; }
.stepper input.bump { animation: bump 0.18s ease-out; }
@keyframes bump { 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Equipment icons ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; }
.tag svg { width: 14px; height: 14px; }
.pick-eq { display: inline-flex; align-items: center; gap: 5px; }
.pick-eq svg { width: 14px; height: 14px; opacity: 0.8; }

/* ---------- PR sets ---------- */
.set-row.pr .check { background: linear-gradient(135deg, #ffe27a, #ffb938) !important; color: #3a2700 !important; box-shadow: 0 0 18px -2px #ffc94b !important; }
.set-row.pr .set-num { color: #ffc94b !important; }
.set-row.pr .goal { color: #ffc94b; font-weight: 700; }
.set-row.pr.just-done { animation: prflash 0.9s ease-out; }
@keyframes prflash { 0% { background: rgba(255, 201, 75, 0.35); } 100% { background: transparent; } }
.pr-toast {
  position: fixed; top: calc(var(--safe-t) + 14px); left: 50%; z-index: 60; transform: translateX(-50%);
  display: flex; gap: 12px; align-items: center; min-width: 260px; max-width: calc(100vw - 32px);
  padding: 12px 18px 12px 14px; border-radius: 18px; color: #3a2700;
  background: linear-gradient(135deg, #ffe58a, #ffb938); box-shadow: 0 12px 40px -6px rgba(255, 185, 56, 0.7);
  animation: prin 0.5s cubic-bezier(.2, 1.5, .4, 1);
}
.pr-toast.out { transition: opacity 0.35s, transform 0.35s; opacity: 0; transform: translate(-50%, -20px); }
.pr-toast b { display: block; font-size: 17px; font-weight: 900; }
.pr-toast small { font-size: 13px; font-weight: 600; }
.pr-trophy { font-size: 30px; animation: spin 0.7s ease-out; }
@keyframes prin { from { transform: translate(-50%, -40px) scale(0.8); opacity: 0; } }
@keyframes spin { from { transform: rotate(-30deg) scale(0.4); } }

/* ---------- Celebration ---------- */
.celebrate {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px 16px calc(var(--safe-b) + 24px);
  background: radial-gradient(90% 60% at 50% 30%, color-mix(in srgb, var(--c) 30%, #0d0f12) 0%, rgba(13, 15, 18, 0.97) 70%);
  animation: fade 0.3s;
}
.cel-inner { width: 100%; max-width: 420px; text-align: center; }
.cel-ico {
  width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 30px; display: grid; place-items: center; font-size: 50px;
  background: color-mix(in srgb, var(--c) 25%, #0d0f12); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent), 0 0 60px -10px var(--c);
  animation: pop 0.6s cubic-bezier(.2, 1.6, .4, 1);
}
.celebrate .eyebrow { color: var(--c); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
.celebrate h1 { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; margin: 4px 0 22px; }
.cel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.cel-stats div { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 14px 6px; }
.cel-stats b { display: block; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cel-stats span { font-size: 12px; color: var(--muted); }
.cel-prs { display: grid; gap: 8px; margin-bottom: 14px; text-align: left; }
.cel-pr { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255, 201, 75, 0.1); border: 1px solid rgba(255, 201, 75, 0.35); }
.cel-pr > span { font-size: 26px; }
.cel-pr b { display: block; }
.cel-pr small { color: #ffd77a; font-size: 13px; }
.cel-streak { font-weight: 800; margin-bottom: 18px; color: var(--warn); }
.celebrate .btn.primary { background: var(--c); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; pointer-events: none; }

/* ---------- Plate calculator ---------- */
.plates-weight { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 6px 0 4px; }
.plates-weight button { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); font-size: 26px; font-weight: 700; }
.plates-weight b { display: block; font-size: 40px; font-weight: 900; text-align: center; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plates-weight span { display: block; text-align: center; font-size: 12px; color: var(--muted); }
.plates-view { background: var(--surface-2); border-radius: 14px; padding: 8px; margin: 12px 0 8px; }
.plates-svg { display: block; width: 100%; height: auto; }
.plates-list { text-align: center; margin: 0 0 16px; }

/* ---------- Accent swatches ---------- */
.swatches { display: flex; gap: 12px; }
.swatches button { width: 42px; height: 42px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 3px var(--surface); }
.swatches button.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--sw), 0 0 18px -2px var(--sw); }

/* ---------- Muscle map ---------- */
.mm-card { padding: 14px 10px; }
.muscle-map { display: block; width: 100%; height: auto; max-height: 280px; }
.muscle-map .mm { transition: fill-opacity 0.4s; }
.mm-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center; }
.pill.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }
.pill.on b { color: var(--accent); }

/* ---------- Charts ---------- */
.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; transition: r 0.15s; }
.chart .pt.pr { fill: #ffc94b; }
.chart .pt.sel { stroke: var(--text); stroke-width: 2.5; }
.chart .trend { stroke: var(--text); stroke-opacity: 0.35; stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .trend-lbl { fill: var(--muted); }
.chart-info { font-size: 13px; color: var(--muted); padding: 8px 6px 4px; min-height: 44px; }
.chart-info.on { color: var(--text); }

/* ---------- Today's pick ---------- */
.pick-card {
  --c: var(--accent);
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin: 14px 0 0;
  padding: 16px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 32%, var(--surface)), var(--surface) 80%);
  border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 10px 30px -14px var(--c);
}
.pick-card.rest { --c: #8b93a1; }
.pick-txt { flex: 1; min-width: 0; }
.pick-txt small { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c); }
.pick-txt b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.pick-txt span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.pick-card .go { width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #0d0f12; display: grid; place-items: center; flex: none; }
.pick-card .go svg { width: 18px; height: 18px; }
.day-btn.suggested { box-shadow: 0 0 0 2px var(--c); }
.day-btn.suggested strong::after { content: "Suggested"; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; margin-left: 8px; padding: 2px 7px; border-radius: 99px; background: var(--c); color: #0d0f12; vertical-align: 3px; }

/* ---------- Banners ---------- */
.banner { margin-top: 14px; }
.banner.info { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }
.banner.deload { flex-direction: column; align-items: stretch; }
.banner-btns { display: flex; gap: 16px; justify-content: flex-end; }

/* ---------- Exercise extras ---------- */
.ex-note { margin: 8px 0 2px 4px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 194, 75, 0.08); color: #ffd98a; font-size: 13px; }
.ex-card.ss { border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.ss-label { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c); margin: -2px 0 6px 4px; }
.ex-tools button[data-act="exMenu"] { letter-spacing: 1px; }
.menu-list { display: grid; margin-top: 16px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.menu-list button { display: flex; align-items: center; gap: 12px; padding: 15px 14px; text-align: left; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu-list button:last-child { border-bottom: 0; }
.menu-list button span { width: 24px; text-align: center; }
.menu-list button.danger { color: var(--miss); }
textarea { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 10px 12px; font: inherit; color: inherit; font-size: 16px; resize: vertical; outline: none; }
textarea:focus { border-color: var(--accent); }
.pick-group h4 { display: flex; justify-content: space-between; align-items: baseline; }
.pick-group h4 span { font-size: 11px; letter-spacing: 0.02em; text-transform: none; font-weight: 700; }
.pick-group h4 span.ok { color: var(--accent); }

/* ---------- Undo ---------- */
.undo-toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 76px); transform: translateX(-50%); z-index: 55;
  display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 18px; border-radius: 14px; white-space: nowrap;
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.undo-toast button { background: var(--bg); color: var(--accent); padding: 8px 14px; border-radius: 10px; font-weight: 800; }

/* ---------- Sub tabs ---------- */
.subtabs { margin: -6px 0 16px; }

/* ---------- Recap ---------- */
.recap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.recap-head b { font-size: 17px; }
.recap-head button { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); font-size: 20px; font-weight: 700; }
.recap-head button:disabled { opacity: 0.3; }
.recap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recap-grid div { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.recap-grid b { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.recap-grid span { font-size: 12px; color: var(--muted); }
.recap-grid em { font-style: normal; font-weight: 800; }
em.up { color: var(--accent); }
em.down { color: var(--miss); }
.recap-line { margin-top: 10px; font-size: 14px; }

/* ---------- Weekly target bars ---------- */
.tbars { display: grid; gap: 7px; margin-top: 12px; }
.tbar { display: grid; grid-template-columns: 82px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.tbar > div { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tbar i { display: block; height: 100%; border-radius: 99px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.tbar.hit i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tbar b { text-align: right; font-variant-numeric: tabular-nums; }
.tbar.zero span, .tbar.zero b { color: var(--muted); }

/* ---------- Strength levels ---------- */
.lvl + .lvl { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lvl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lvl-badge { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.lvl-badge.l2 { background: #2a3a4a; color: #8fd3ff; }
.lvl-badge.l3 { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.lvl-badge.l4 { background: #4a2a4a; color: #ff9ee0; }
.lvl-badge.l5 { background: linear-gradient(135deg, #ffe27a, #ffb938); color: #3a2700; }
.lvl-bar { height: 10px; border-radius: 99px; margin-bottom: 6px; overflow: hidden; background: var(--surface-2); }
.lvl-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent)); }

/* ---------- Awards ---------- */
.awards-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.awards-head b { font-size: 34px; font-weight: 900; color: var(--accent); }
.awards-head span { color: var(--muted); font-weight: 600; }
.awards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.award { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; text-align: center; }
.award .aw-ico { font-size: 34px; filter: grayscale(1); opacity: 0.35; margin-bottom: 6px; }
.award b { display: block; font-size: 14px; }
.award small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.award.on { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.award.on .aw-ico { filter: none; opacity: 1; }
.award .aw-date { color: var(--accent); font-weight: 700; margin-top: 6px; }
.aw-bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.aw-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.cel-awards { display: grid; gap: 8px; margin-bottom: 14px; text-align: left; }
.cel-aw { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); animation: rise 0.5s 0.4s both; }
.cel-aw > span { font-size: 28px; }
.cel-aw small { display: block; color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Share ---------- */
.share-preview { display: block; width: 100%; border-radius: 16px; margin-bottom: 14px; }

/* ---------- Health ---------- */
.import-card { display: flex; gap: 12px; align-items: center; }
.import-card > div { flex: 1; }
.import-card p { margin: 2px 0 0; }
.imp-ico { font-size: 28px; }
.steps { padding-left: 20px; margin: 0 0 12px; line-height: 1.5; }
.steps li + li { margin-top: 6px; }
label.btn { cursor: pointer; }
.measure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.measure { text-align: left; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.measure span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.measure b { display: block; font-size: 22px; font-weight: 900; }
.measure b small { font-size: 13px; color: var(--muted); margin-left: 3px; }
.measure em { font-style: normal; font-size: 12px; color: var(--muted); }
.measure.on { border-color: var(--accent); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid .empty, .photo-grid > .muted { grid-column: 1 / -1; }
.ph { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); }
.ph.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo-full { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; background: #000; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare figure { margin: 0; }
.compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; }
.compare figcaption { text-align: center; font-size: 13px; font-weight: 700; margin-top: 6px; }

/* ---------- Chart time range ---------- */
.range { display: flex; gap: 4px; padding: 0 6px 8px; }
.range button { flex: 1; min-height: 30px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--surface-2); }
.range button.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
