/* PEPP – design tokens */
:root {
  --bg: #0b0c0f;
  --surface: #17191e;
  --surface-2: #1f2229;
  --surface-3: #2a2e37;
  --line: #2a2e37;
  --text: #f3f4f6;
  --text-2: #b9bdc7;
  --muted: #858a97;
  --brand: #ff5a36;
  --brand-2: #ff2d7a;
  --grad: linear-gradient(135deg, #ff7a3d 0%, #ff2d7a 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,122,61,.18), rgba(255,45,122,.18));
  --good: #22c55e;
  --gold: #fbbf24;
  --danger: #ef4444;
  --me: #ff5a36;
  --r: 20px;
  --r-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.4; }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; touch-action: manipulation; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-round); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

#app { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 110px); }
#app.full { padding-bottom: calc(var(--safe-b) + 40px); }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap { gap: 10px; } .gap-s { gap: 6px; } .gap-l { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.mt { margin-top: 14px; } .mt-s { margin-top: 6px; } .mt-l { margin-top: 24px; }
.mb { margin-bottom: 14px; }
.stack > * + * { margin-top: 14px; }
.num { font-variant-numeric: tabular-nums; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-title h2 { font-size: 19px; }
.section-title a, .link { color: var(--brand); font-weight: 600; font-size: 14px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; position: relative; }
.card.tight { padding: 12px; }
.card.glow { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.card.me { background: linear-gradient(160deg, color-mix(in srgb, var(--me) 28%, var(--surface)) 0%, var(--surface) 70%); }
.card-link { display: block; transition: transform .12s; }
.card-link:active, .pressable:active { transform: scale(.98); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px;
  font-weight: 700; font-size: 16px; background: var(--surface-2); color: var(--text); transition: transform .1s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -10px rgba(255, 60, 100, .7); }
.btn.me { background: var(--me); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--surface-3); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.big { min-height: 58px; font-size: 18px; border-radius: 18px; }
.btn.block { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 18px; flex: none; }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--text-2); border: 1.5px solid transparent; }
.chip.on { background: color-mix(in srgb, var(--me) 22%, var(--surface-2)); border-color: var(--me); color: var(--text); }

.seg { display: flex; background: var(--surface); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 10px 6px; border-radius: 10px; font-weight: 650; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); }

/* ---------- forms ---------- */
label.field { display: block; margin-top: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 2px 6px; }
.input, input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent;
  outline: none; font-size: 16px; -webkit-appearance: none; appearance: none; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--me); }
input::placeholder, textarea::placeholder { color: #5f6471; }
.err { color: #ff8a8a; font-size: 14px; margin-top: 10px; min-height: 1em; }

.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 14px; }
.stepper button { width: 46px; height: 46px; font-size: 22px; font-weight: 700; color: var(--text-2); }
.stepper output { min-width: 44px; text-align: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- avatar ---------- */
.av { --c: var(--me); width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: color-mix(in srgb, var(--c) 30%, var(--surface-2)); box-shadow: 0 0 0 2px var(--c); font-size: 21px; line-height: 1; }
.av.s { width: 28px; height: 28px; font-size: 15px; box-shadow: 0 0 0 1.5px var(--c); }
.av.l { width: 64px; height: 64px; font-size: 34px; box-shadow: 0 0 0 3px var(--c); }
.av.xl { width: 96px; height: 96px; font-size: 52px; box-shadow: 0 0 0 4px var(--c); }
.av-stack { display: flex; }
.av-stack .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av:first-child { margin-left: 0; }

/* ---------- tabbar ---------- */
.tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-around;
  padding: 8px 8px calc(var(--safe-b) + 6px); background: rgba(14, 15, 19, .82); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid rgba(255,255,255,.06); }
.tabbar a { flex: 1; max-width: 90px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 4px 0; }
.tabbar a svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { stroke: var(--me); }
.train-btn { width: 62px; height: 62px; margin: -24px 6px 2px; border-radius: 22px; background: var(--grad); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px -8px rgba(255, 50, 100, .8), 0 0 0 5px var(--bg); transition: transform .15s; }
.train-btn:active { transform: scale(.92); }
.train-btn svg { width: 30px; height: 30px; stroke: #fff; stroke-width: 3; stroke-linecap: round; fill: none; }
.train-btn.live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 10px 28px -8px rgba(255,50,100,.8), 0 0 0 5px var(--bg); } 50% { box-shadow: 0 10px 28px -4px rgba(255,50,100,1), 0 0 0 5px var(--bg), 0 0 0 10px rgba(255,45,122,.25); } }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.topbar h1 { font-size: 28px; }
.topbar .back { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; flex: none; }
.topbar .back svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- welcome / auth ---------- */
.welcome { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; justify-content: center; text-align: center; }
.logo { font-family: var(--font-round); font-weight: 900; font-size: 76px; letter-spacing: -.04em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-burst { font-size: 54px; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
.tagline { font-size: 19px; color: var(--text-2); margin-top: 10px; }
.feature-list { display: grid; gap: 10px; margin: 30px 0; text-align: left; }
.feature-list div { display: flex; gap: 14px; align-items: center; background: var(--surface); padding: 14px 16px; border-radius: 16px; }
.feature-list b { display: block; }
.feature-list .fi { font-size: 26px; }
.known-users { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 6px 0 4px; }
.known-users button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-grid button { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); font-size: 26px; border: 2px solid transparent; }
.avatar-grid button.on { border-color: var(--me); background: color-mix(in srgb, var(--me) 25%, var(--surface-2)); }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-row button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.color-row button.on { border-color: #fff; }

/* ---------- home ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hello h1 { font-size: 26px; }
.hello .date { color: var(--muted); font-size: 14px; font-weight: 600; text-transform: capitalize; }
.week-hero { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-bg { stroke: var(--surface-3); }
.ring .ring-fg { stroke: var(--me); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .ring-label b { font-family: var(--font-round); font-size: 30px; line-height: 1; }
.ring .ring-label span { font-size: 12px; color: var(--text-2); }
.week-dots { display: flex; gap: 6px; margin-top: 12px; }
.week-dots div { flex: 1; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.week-dots i { display: block; width: 100%; max-width: 30px; aspect-ratio: 1; margin: 0 auto 4px; border-radius: 10px; background: var(--surface-3); font-style: normal; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.week-dots i.on { background: var(--me); }
.week-dots i.today { box-shadow: 0 0 0 2px var(--text-2); }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-family: var(--font-round); }
.streak .fire { font-size: 22px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; min-height: 96px; transition: transform .1s; }
.quick:active { transform: scale(.97); }
.quick .qi { font-size: 28px; }
.quick b { font-size: 15px; }
.quick span { font-size: 12.5px; color: var(--muted); }
.quick.hero { grid-column: span 2; background: var(--grad); flex-direction: row; align-items: center; min-height: 76px; }
.quick.hero span { color: rgba(255,255,255,.85); }
.live-banner { display: flex; align-items: center; gap: 12px; background: var(--grad); border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; color: #fff; }
.live-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.mini-board { display: flex; justify-content: space-around; text-align: center; gap: 8px; }
.mini-board .who { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.mini-board .cnt { font-family: var(--font-round); font-weight: 800; font-size: 20px; }
.progress { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; display: flex; gap: 2px; }
.progress > i { display: block; height: 100%; background: var(--me); border-radius: 99px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.progress.stacked > i { border-radius: 0; }
.progress.stacked > i:first-child { border-radius: 99px 0 0 99px; }
.progress.stacked > i:last-child { border-radius: 0 99px 99px 0; }
.progress.stacked > i:only-child { border-radius: 99px; }
.progress.thin { height: 6px; }
.tip-card { background: var(--grad-soft); border-radius: var(--r); padding: 16px; }
.tip-card .tip-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #ffb199; }
.tip-card h3 { margin: 6px 0; }
.tip-card p { color: var(--text-2); font-size: 15px; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-card { background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.feed-head { display: flex; align-items: center; gap: 10px; }
.feed-head .who b { display: block; font-size: 15px; }
.feed-head .who span { font-size: 12.5px; color: var(--muted); }
.feed-head .feel { margin-left: auto; font-size: 24px; }
.feed-title { margin: 12px 0 8px; font-size: 18px; }
.stat-line { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.stat-line b { color: var(--text); font-size: 15px; display: block; font-variant-numeric: tabular-nums; }
.pr-banner { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(251,191,36,.12); color: #fde68a; font-size: 14px; font-weight: 600; }
.ex-summary { margin-top: 10px; font-size: 14px; color: var(--text-2); display: grid; gap: 3px; }
.ex-summary div { display: flex; justify-content: space-between; gap: 10px; }
.ex-summary div span:last-child { color: var(--muted); white-space: nowrap; }
.feed-notes { margin-top: 10px; font-size: 14.5px; color: var(--text-2); font-style: italic; white-space: pre-wrap; }
.reactions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.reactions button { min-width: 44px; height: 36px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); font-size: 17px; display: inline-flex; align-items: center; gap: 4px; transition: transform .1s; }
.reactions button b { font-size: 13px; color: var(--text-2); }
.reactions button.on { background: color-mix(in srgb, var(--me) 28%, var(--surface-2)); box-shadow: inset 0 0 0 1.5px var(--me); }
.reactions button.pop { animation: pop .35s; }
@keyframes pop { 40% { transform: scale(1.35); } }
.comments { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.comment .bubble { background: var(--surface-2); padding: 8px 12px; border-radius: 4px 14px 14px 14px; }
.comment .bubble b { font-size: 12.5px; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { min-height: 40px; padding: 8px 12px; font-size: 14.5px; border-radius: 12px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 46px; display: block; margin-bottom: 8px; }

/* ---------- sheet / modal ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: #15171c; border-radius: 26px 26px 0 0; padding: 8px 18px calc(var(--safe-b) + 22px); transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.9,.25,1); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet h2 { margin-bottom: 14px; }
.sheet.tall { min-height: 85dvh; }
.confirm-text { font-size: 17px; margin: 4px 0 20px; }
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 14px; font-size: 16px; font-weight: 600; text-align: left; width: 100%; }
.menu-list button:active, .menu-list a:active { background: var(--surface-2); }
.menu-list .mi { font-size: 24px; width: 32px; text-align: center; }
.menu-list small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }

.toast-host { position: fixed; z-index: 200; left: 0; right: 0; top: calc(var(--safe-t) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #2b2f39; color: var(--text); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toastIn .3s; max-width: 90vw; }
.toast.good { background: #134e2a; } .toast.bad { background: #5b1a1a; }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } }

/* ---------- workout ---------- */
.wo-head { position: sticky; top: 0; z-index: 20; margin: calc(-1 * (var(--safe-t) + 14px)) -16px 0; padding: calc(var(--safe-t) + 10px) 16px 10px; background: rgba(11,12,15,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: flex; gap: 10px; align-items: center; }
.wo-head input { min-height: 42px; font-weight: 700; font-size: 17px; background: transparent; padding: 8px; }
.wo-meta { display: flex; gap: 16px; padding: 8px 2px 14px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.wo-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.ex-card { background: var(--surface); border-radius: var(--r); padding: 14px 12px 10px; margin-bottom: 12px; }
.ex-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.ex-head .ex-name { font-size: 17px; font-weight: 750; color: var(--me); text-align: left; flex: 1; font-family: var(--font-round); }
.suggest { margin: 8px 4px 2px; font-size: 13.5px; color: #fde68a; background: rgba(251,191,36,.1); padding: 8px 10px; border-radius: 10px; }
.set-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-top: 6px; }
.set-table th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 4px; text-align: center; }
.set-table td { padding: 0 3px; text-align: center; }
.set-table tr td:first-child { width: 38px; } .set-table tr td:last-child { width: 50px; }
.set-table .prev { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.set-table input { min-height: 42px; padding: 6px 4px; text-align: center; font-weight: 700; font-size: 17px; border-radius: 11px; font-variant-numeric: tabular-nums; }
.set-no { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); font-weight: 800; font-size: 14px; color: var(--text-2); }
.set-no.wu { color: var(--gold); }
.check { width: 44px; height: 42px; border-radius: 11px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.check svg { width: 22px; height: 22px; stroke: var(--muted); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
tr.done .check { background: var(--good); }
tr.done .check svg { stroke: #fff; }
tr.done input { background: rgba(34,197,94,.13); }
.ex-actions { display: flex; gap: 8px; padding: 4px 4px 2px; }
.ex-actions button { flex: 1; min-height: 38px; border-radius: 11px; background: var(--surface-2); font-size: 14px; font-weight: 650; color: var(--text-2); }
.rest-bar { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 14px); max-width: 616px; margin: 0 auto; background: #20242c; border-radius: 20px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.08); }
.rest-bar .rest-time { font-family: var(--font-round); font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 82px; }
.rest-bar .rest-track { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--me); border-radius: 0 0 0 20px; transition: width .25s linear; }
.plates { display: flex; gap: 4px; align-items: center; justify-content: center; margin: 16px 0; min-height: 110px; }
.plates .bar { width: 50px; height: 12px; background: #9aa0aa; border-radius: 3px; }
.plates .plate { border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #111; writing-mode: vertical-rl; }

/* ---------- picker ---------- */
.picker-list { margin-top: 12px; }
.picker-cat { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 4px 6px; }
.picker-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border-radius: 14px; text-align: left; }
.picker-item:active { background: var(--surface-2); }
.picker-item .pi { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.picker-item b { display: block; font-size: 15.5px; }
.picker-item small { color: var(--muted); }

/* ---------- celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 150; background: radial-gradient(circle at 50% 20%, #3a1630 0%, var(--bg) 60%); overflow-y: auto; padding: calc(var(--safe-t) + 40px) 20px calc(var(--safe-b) + 30px); text-align: center; animation: fadeIn .4s; }
@keyframes fadeIn { from { opacity: 0; } }
.celebrate .boom { font-size: 84px; animation: boom .7s cubic-bezier(.2,1.6,.4,1); display: inline-block; }
@keyframes boom { from { transform: scale(0) rotate(-30deg); } }
.celebrate h1 { font-size: 32px; margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 22px 0; }
.tile { background: var(--surface); border-radius: 16px; padding: 14px 10px; text-align: center; }
.tile b { display: block; font-family: var(--font-round); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pr-card { background: linear-gradient(135deg, rgba(251,191,36,.25), rgba(251,191,36,.06)); border: 1.5px solid rgba(251,191,36,.5); border-radius: 18px; padding: 14px 16px; text-align: left; margin-top: 10px; animation: slideUp .5s backwards; }
.pr-card .pr-k { font-size: 12px; font-weight: 800; color: var(--gold); letter-spacing: .08em; }
.pr-card b { font-size: 18px; display: block; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.badge-new { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface); border-radius: 18px; padding: 14px; min-width: 110px; animation: boom .6s backwards; }
.badge-new .be { font-size: 42px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* ---------- boxing timer ---------- */
.box-screen { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 16px) 20px calc(var(--safe-b) + 24px);
  background: var(--bg); transition: background .5s; text-align: center; }
.box-screen.round { background: radial-gradient(circle at 50% 40%, #4a1015 0%, #120608 75%); }
.box-screen.rest { background: radial-gradient(circle at 50% 40%, #0f3a22 0%, #06120b 75%); }
.box-screen.ready { background: radial-gradient(circle at 50% 40%, #47370b 0%, #120e04 75%); }
.box-screen.warn .box-time { color: #fde047; animation: blink .5s infinite; }
.box-phase { font-family: var(--font-round); font-size: 22px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.box-ring { position: relative; width: min(78vw, 360px); aspect-ratio: 1; }
.box-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.box-ring circle { fill: none; stroke-width: 10; }
.box-ring .bg { stroke: rgba(255,255,255,.08); }
.box-ring .fg { stroke: #fff; stroke-linecap: round; }
.box-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-round); font-size: min(22vw, 100px); font-weight: 900; font-variant-numeric: tabular-nums; }
.combo { min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.combo .c-big { font-family: var(--font-round); font-size: 46px; font-weight: 900; letter-spacing: .02em; animation: boom .35s; }
.combo .c-small { color: rgba(255,255,255,.7); font-size: 16px; margin-top: 4px; }
.box-controls { display: flex; gap: 14px; justify-content: center; }
.box-controls .icon-btn { width: 66px; height: 66px; border-radius: 22px; font-size: 26px; background: rgba(255,255,255,.12); }
.combo-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; }
.combo-legend div { background: var(--surface-2); border-radius: 10px; padding: 6px 4px; text-align: center; }
.combo-legend b { font-family: var(--font-round); font-size: 16px; display: block; }

/* ---------- leaderboard / challenges ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 18px 0 8px; }
.podium .p { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podium .p .name { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 14px 14px 4px 4px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 10px; font-family: var(--font-round); font-weight: 900; font-size: 26px; }
.podium .block small { font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.podium .crown { font-size: 26px; margin-bottom: -6px; animation: bob 2.4s ease-in-out infinite; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.board-row:last-child { border-bottom: 0; }
.board-row .rank { width: 22px; font-weight: 800; color: var(--muted); text-align: center; font-family: var(--font-round); }
.board-row .val { font-family: var(--font-round); font-size: 22px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.board-row .val small { font-family: var(--font); font-size: 11px; color: var(--muted); display: block; font-weight: 600; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- progress ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tiles .tile { text-align: left; padding: 14px 12px; }
.stat-tiles .tile b { font-size: 22px; }
.heat-wrap { overflow-x: auto; scrollbar-width: none; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: 16px repeat(7, auto); grid-auto-columns: minmax(13px, 1fr); gap: 3px; min-width: 100%; }
.heat .cell { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); min-width: 12px; position: relative; }
.heat .m { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: visible; font-weight: 600; }
.heat .cell.today { box-shadow: 0 0 0 1.5px var(--text-2); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--surface-3); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .lbl { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; background: #2b2f39; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.5); transform: translate(-50%, calc(-100% - 12px)); z-index: 5; }
.chart-tip b { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.chart-tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hbar { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 10px; font-size: 14px; margin: 7px 0; }
.hbar .track { height: 14px; }
.hbar .track i { display: block; height: 100%; background: var(--me); border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge { background: var(--surface); border-radius: 16px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.badge .be { font-size: 34px; }
.badge b { font-size: 13px; line-height: 1.2; }
.badge small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.badge.locked .be { filter: grayscale(1); opacity: .35; }
.badge.locked b { color: var(--muted); }
.badge .progress { width: 100%; height: 4px; margin-top: 4px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.list-row b { display: block; font-size: 15.5px; }
.list-row small { color: var(--muted); font-size: 13px; }
.list-row .right { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; }
.month-h { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 4px 4px; }
.goal-big { font-family: var(--font-round); font-size: 34px; font-weight: 900; }
.sets-table { width: 100%; font-size: 14.5px; border-collapse: collapse; margin-top: 8px; }
.sets-table td { padding: 6px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sets-table td:first-child { color: var(--muted); width: 36px; }

/* ---------- coach ---------- */
.coach-hero { display: flex; gap: 14px; align-items: center; }
.coach-bot { width: 64px; height: 64px; border-radius: 22px; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 36px; flex: none; box-shadow: 0 10px 30px -10px rgba(255,45,122,.8); }
.soon { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.12); color: #ffd1c2; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 12px; max-height: 340px; overflow-y: auto; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: 15px; white-space: pre-wrap; animation: slideUp .3s; }
.msg.me { align-self: flex-end; background: var(--me); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.chat-form { display: flex; gap: 8px; }

/* ---------- misc ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r); min-height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.offline-pill { position: fixed; z-index: 70; top: calc(var(--safe-t) + 6px); left: 50%; transform: translateX(-50%); background: #5b4a12; color: #fde68a; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 99px; }
.weekday-row { display: flex; gap: 6px; }
.weekday-row button { flex: 1; height: 42px; border-radius: 12px; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.weekday-row button.on { background: var(--me); color: #fff; }
.tpl-item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tpl-item .grow b { display: block; font-size: 15px; }
.tpl-item input { width: 64px; min-height: 40px; padding: 6px; text-align: center; font-weight: 700; }
.kbd-hint { font-size: 12px; color: var(--muted); }
.install-steps { padding-left: 20px; margin: 8px 0 0; color: var(--text-2); }
.install-steps li { margin: 6px 0; }
.demo-bar { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 92px); display: flex; align-items: center; gap: 8px;
  background: rgba(60, 48, 10, .95); color: #fde68a; padding: 6px 8px 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.5); white-space: nowrap; }
.demo-bar button { border-radius: 50%; padding: 2px; opacity: .55; }
.demo-bar button.on { opacity: 1; box-shadow: 0 0 0 2px #fde68a; }
@media (min-width: 700px) { #app { padding-top: 30px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
