/* Plates — workout log. Dark rubber-floor theme with competition-plate colours. */
:root {
  color-scheme: dark;
  --bg: #16171a;          /* rubber floor */
  --surface: #1f2024;
  --surface-2: #26282d;
  --surface-3: #303238;
  --line: #34363d;
  --ink: #ece8dd;         /* chalk */
  --ink-2: #a9a597;
  --ink-3: #77746b;
  --pull: #3987e5;        /* 20 kg blue */
  --squat: #d95926;       /* 25 kg red */
  --push: #199e70;        /* 10 kg green */
  --deadlift: #c98500;    /* 15 kg yellow */
  --gold: #f2c230;
  --danger: #ff7a66;
  --day: var(--pull);
  --heat-1: #184f95; --heat-2: #256abf; --heat-3: #3987e5; --heat-4: #6da7ec; --heat-5: #9ec5f4;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
  --fast: 120ms;
  --med: 180ms;
}
[data-day="pull"] { --day: var(--pull); }
[data-day="squat"] { --day: var(--squat); }
[data-day="push"] { --day: var(--push); }
[data-day="deadlift"] { --day: var(--deadlift); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--text); font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
  -webkit-user-select: none; user-select: none;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

#app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }
#app.in-session { padding-bottom: calc(var(--safe-b) + 120px); }

/* ---------- boot ---------- */
.boot { min-height: 70dvh; display: grid; place-items: center; }
.boot-bar { width: 160px; height: 8px; border-radius: 4px; background: var(--ink); position: relative; }
.boot-bar i { position: absolute; top: 50%; width: 10px; border-radius: 3px; transform: translateY(-50%) scaleY(0);
  animation: plateIn 600ms cubic-bezier(.2,.9,.3,1.3) infinite alternate; }
.boot-bar i:nth-child(1) { left: 10px; height: 48px; background: var(--squat); }
.boot-bar i:nth-child(2) { left: 24px; height: 40px; background: var(--pull); animation-delay: 80ms; }
.boot-bar i:nth-child(3) { right: 10px; height: 48px; background: var(--squat); }
.boot-bar i:nth-child(4) { right: 24px; height: 40px; background: var(--pull); animation-delay: 80ms; }
@keyframes plateIn { to { transform: translateY(-50%) scaleY(1); } }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 10px; }
.topbar h1 { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 0; letter-spacing: 0.01em; flex: 1; line-height: 1; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.on { color: var(--day); }

/* ---------- home ---------- */
.hero { position: relative; padding: 18px 18px 20px; border-radius: var(--r-lg); background: var(--surface);
  overflow: hidden; border: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--day); }
.hero-kicker { color: var(--ink-2); font-size: 15px; margin: 0 0 2px; }
.hero-day { font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 0.9; margin: 2px 0 4px;
  color: var(--day); letter-spacing: -0.005em; }
.hero-sub { color: var(--ink-2); font-size: 15px; margin: 0; min-height: 1.4em; }
.hero-hint { margin: 10px 0 0; font-size: 14px; color: var(--ink); background: var(--surface-2); padding: 10px 12px; border-radius: var(--r-sm); }
.day-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 14px; }
.day-pick button { position: relative; overflow: hidden; padding: 12px 2px 9px; border-radius: 12px; background: var(--surface-2); font-weight: 600; font-size: 14px;
  border: 2px solid transparent; transition: transform var(--fast), border-color var(--fast); white-space: nowrap; }
.day-pick button::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.day-pick button small { display: block; color: var(--ink-3); font-weight: 500; font-size: 11px; margin-top: 1px; }
.day-pick button[aria-pressed="true"] { border-color: var(--day); background: color-mix(in srgb, var(--day) 18%, var(--surface-2)); }
.day-pick button:active { transform: scale(0.96); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--day); margin-right: 5px; vertical-align: 1px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; border-radius: 16px;
  font-weight: 700; font-size: 18px; transition: transform var(--fast), filter var(--fast); }
.btn:active { transform: scale(0.97); filter: brightness(1.1); }
.btn-day { background: var(--day); color: #101113; }
.btn-chalk { background: var(--ink); color: #16171a; }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger.armed { background: var(--danger); color: #16171a; }
.btn-sm { min-height: 44px; font-size: 15px; border-radius: 12px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.week { margin-top: 16px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; }
.week h2 { margin: 0; font-size: 16px; font-weight: 600; }
.week p { margin: 0; color: var(--ink-2); font-size: 14px; }
.streak { grid-row: span 2; text-align: right; }
.streak .num { font-size: 46px; font-weight: 900; line-height: 0.9; display: block; }
.streak small { color: var(--ink-2); font-size: 12px; }
.mini-bar { grid-column: 1 / -1; display: flex; align-items: center; height: 46px; margin-top: 6px; position: relative; }
.mini-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; transform: translateY(-50%);
  background: var(--surface-3); border-radius: 3px; }
.mini-bar .plates { position: relative; display: flex; align-items: center; gap: 4px; padding-left: 18px; }
.mini-plate { width: 13px; height: 42px; border-radius: 4px; background: var(--surface-3); border: 1.5px dashed var(--ink-3); }
.mini-plate.done { border: 0; background: var(--c, var(--pull)); animation: pop 240ms cubic-bezier(.2,.9,.3,1.4) both; }
.mini-plate.done[data-day="squat"] { --c: var(--squat); }
.mini-plate.done[data-day="push"] { --c: var(--push); }
.mini-plate.done[data-day="deadlift"] { --c: var(--deadlift); }
.mini-plate.done[data-day="pull"] { --c: var(--pull); }
@keyframes pop { from { transform: scaleY(0.2); opacity: 0; } to { transform: none; opacity: 1; } }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-h h2 { font-family: var(--display); font-size: 24px; font-weight: 800; margin: 0; letter-spacing: 0.01em; }
.section-h .link { color: var(--ink-2); font-size: 14px; padding: 8px 0; }

.sess-card { display: grid; grid-template-columns: 6px 1fr auto; gap: 0 14px; width: 100%; text-align: left;
  padding: 14px 14px 14px 0; border-radius: var(--r-md); background: var(--surface); margin-bottom: 8px; overflow: hidden;
  transition: transform var(--fast); }
.sess-card:active { transform: scale(0.985); }
.sess-card .stripe { background: var(--day); border-radius: 0 3px 3px 0; grid-row: span 2; }
.sess-card .t { font-weight: 600; }
.sess-card .d { color: var(--ink-2); font-size: 13px; text-align: right; }
.sess-card .meta { grid-column: 2 / 4; color: var(--ink-2); font-size: 13px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-pill { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 12px;
  font-weight: 700; color: #16171a; background: var(--gold); }
.empty { color: var(--ink-2); padding: 18px; border-radius: var(--r-md); background: var(--surface); text-align: center; }

/* ---------- logger ---------- */
.log-head { position: sticky; top: 0; z-index: 5; margin: calc(-1 * (var(--safe-t) + 12px)) -16px 0;
  padding: calc(var(--safe-t) + 8px) 12px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.log-head-row { display: flex; align-items: center; gap: 4px; }
.log-title { flex: 1; min-width: 0; }
.log-title b { display: block; font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1; color: var(--day); }
.log-title span { color: var(--ink-2); font-size: 13px; }
.finish-btn { padding: 10px 16px; min-height: 44px; border-radius: 12px; background: var(--surface-2); font-weight: 700; }
.finish-btn:active { transform: scale(0.96); }
.net { font-size: 12px; color: var(--gold); padding: 4px 4px 0; }

.slots { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 2px 4px; margin: 0 -4px;
  scroll-snap-type: x proximity; }
.slots::-webkit-scrollbar { display: none; }
.slot-chip { flex: none; scroll-snap-align: center; padding: 8px 12px 7px; border-radius: 12px; background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-2); border: 1.5px solid transparent; display: flex; align-items: center; gap: 7px;
  transition: background var(--fast), color var(--fast), border-color var(--fast); }
.slot-chip .pips { display: flex; gap: 2px; }
.slot-chip .pips i { width: 4px; height: 12px; border-radius: 2px; background: var(--surface-3); }
.slot-chip .pips i.on { background: var(--day); }
.slot-chip.cur { color: var(--ink); border-color: var(--day); background: var(--surface-2); }
.slot-chip.done:not(.cur) { color: var(--ink); }

.slot-card { margin-top: 10px; }
.slot-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; margin: 4px 2px 2px; }
.tier { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tier.primary { background: color-mix(in srgb, var(--day) 22%, var(--surface-2)); color: var(--ink); }
.ex-swap { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 2px 8px; }
.ex-swap .ex-name { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; flex: 1; letter-spacing: 0.005em; }
.ex-swap .swap-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.ex-swap .swap-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ex-swap:active .swap-ico { background: var(--surface-3); }

.lastline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 2px 0 12px; font-size: 13px; color: var(--ink-2); }
.lastline .chip { padding: 4px 8px; border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; }
.lastline .chip.w { color: var(--ink-3); font-weight: 500; }
.lastline .chip.used { opacity: 0.4; text-decoration: line-through; }

.entry { border-radius: var(--r-lg); background: var(--surface); padding: 14px 12px 12px; border: 1px solid var(--line); }
.plate-viz { height: 66px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; position: relative; }
.plate-viz .bar { position: absolute; left: 6%; right: 6%; top: 50%; height: 7px; transform: translateY(-50%); background: var(--ink-3); border-radius: 3px; }
.plate-viz .side { position: relative; display: flex; align-items: center; gap: 2px; }
.plate-viz .side.l { flex-direction: row-reverse; margin-right: 34%; }
.plate-viz .side.r { margin-left: 0; }
.plate-viz .collar { width: 6px; height: 22px; border-radius: 2px; background: var(--ink-2); }
.pl { border-radius: 3px; animation: pop 160ms cubic-bezier(.2,.9,.3,1.4) both; }
.pl[data-kg="25"] { width: 13px; height: 64px; background: var(--squat); }
.pl[data-kg="20"] { width: 12px; height: 64px; background: var(--pull); }
.pl[data-kg="15"] { width: 11px; height: 54px; background: var(--deadlift); }
.pl[data-kg="10"] { width: 10px; height: 45px; background: var(--push); }
.pl[data-kg="5"] { width: 8px; height: 34px; background: var(--ink); }
.pl[data-kg="2.5"] { width: 7px; height: 27px; background: var(--squat); }
.pl[data-kg="1.25"] { width: 6px; height: 22px; background: #b9bcc4; }
.plate-note { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: 12px; color: var(--ink-3); }
.plate-viz { margin-bottom: 20px; }
.equip-note { text-align: center; color: var(--ink-3); font-size: 13px; height: 22px; }

.stepper { display: grid; grid-template-columns: 54px 50px 1fr 50px 54px; align-items: center; gap: 6px; }
.stepper.reps { grid-template-columns: 72px 1fr 72px; margin-top: 8px; }
.step { height: 58px; border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 17px;
  transition: transform 90ms, background 90ms; display: grid; place-items: center; }
.step.big { font-size: 26px; font-weight: 600; }
.step.fine { font-size: 14px; color: var(--ink-2); }
.step:active { transform: scale(0.92); background: var(--surface-3); }
.val { text-align: center; padding: 2px 0; border-radius: 12px; min-width: 0; overflow: hidden; }
.stepper:not(.reps) .val .num[data-len="4"] { font-size: 54px; }
.stepper:not(.reps) .val .num[data-len="5"] { font-size: 44px; }
.stepper:not(.reps) .val .num[data-len="6"] { font-size: 38px; }
.compact .stepper:not(.reps) .val .num[data-len="5"], .compact .stepper:not(.reps) .val .num[data-len="6"] { font-size: 34px; }
.val:active { background: var(--surface-2); }
.val .num { display: block; font-size: 62px; font-weight: 900; line-height: 0.95; }
.val small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.reps .val .num { font-size: 52px; }
.bump { animation: bump 140ms ease-out; }
@keyframes bump { 40% { transform: scale(1.07); } }

.entry-foot { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 12px 0 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; position: relative; }
.seg button { position: relative; z-index: 1; padding: 10px 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: color var(--fast); }
.seg button[aria-pressed="true"] { color: #16171a; }
.seg .knob { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; background: var(--ink);
  transition: transform var(--med) cubic-bezier(.3,.8,.3,1); }
.seg[data-pos="1"] .knob { transform: translateX(100%); }
.e1 { text-align: right; min-width: 92px; }
.e1 small { display: block; font-size: 12px; color: var(--ink-3); }
.e1 .num { font-size: 26px; font-weight: 800; line-height: 1; }
.e1.pr .num { color: var(--gold); }
.e1.pr small { color: var(--gold); font-weight: 700; }

.log-btn { position: relative; overflow: hidden; min-height: 64px; font-size: 20px; font-family: var(--display); font-weight: 800;
  letter-spacing: 0.02em; }
.log-btn .ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.45); transform: scale(0); pointer-events: none;
  animation: ripple 420ms ease-out forwards; }
@keyframes ripple { to { transform: scale(3); opacity: 0; } }
.log-btn.pr-ready { box-shadow: 0 0 0 2px var(--gold), 0 0 24px -4px var(--gold); }

.sets { margin-top: 12px; }
.set-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 12px 12px; border-radius: var(--r-md); background: var(--surface); margin-bottom: 6px; transition: transform var(--fast); }
.set-row:active { transform: scale(0.985); }
.set-row.enter { animation: slideIn 200ms cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes slideIn { from { transform: translateY(-8px) scale(0.98); opacity: 0; } }
.set-row .n { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--ink-3); text-align: center; }
.set-row.warm .n { font-size: 14px; font-family: var(--text); font-weight: 700; }
.set-row .wr { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; }
.set-row .wr small { font-family: var(--text); font-size: 13px; color: var(--ink-2); font-weight: 500; margin-left: 6px; }
.set-row.warm .wr { color: var(--ink-2); font-size: 22px; }
.set-row .note { display: block; font-size: 13px; color: var(--ink-2); font-family: var(--text); font-weight: 400; margin-top: 3px; }
.set-row .right { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; }
.set-row.pending { opacity: 0.6; }
.set-row.pr { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 70%, transparent); }

.next-btn { margin-top: 14px; }
.slot-nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 14px; }
.slot-nav .btn-ghost { padding: 0 18px; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 40; animation: fade var(--med) both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 16px calc(var(--safe-b) + 18px);
  animation: sheetUp 200ms cubic-bezier(.2,.9,.3,1) both; border-top: 1px solid var(--line); overscroll-behavior: contain; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: 0; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 10px; }
.sheet h3 { font-family: var(--display); font-size: 28px; font-weight: 800; margin: 2px 0 10px; line-height: 1; }
.sheet .sub { color: var(--ink-2); font-size: 14px; margin: -4px 0 12px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label, .field .lbl { font-size: 14px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
.input:focus { border-color: var(--ink-2); }
textarea.input { min-height: 84px; resize: vertical; }
.big-input { font-family: var(--display); font-size: 44px; font-weight: 800; text-align: center; padding: 8px; }
.ex-list { display: grid; gap: 4px; margin: 8px 0 12px; }
.ex-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 12px; border-radius: 12px;
  background: var(--surface-2); font-size: 16px; font-weight: 500; }
.ex-item:active { background: var(--surface-3); }
.ex-item .nm { flex: 1; }
.ex-item .eq { font-size: 12px; color: var(--ink-3); }
.ex-item.sel { box-shadow: inset 0 0 0 2px var(--day); font-weight: 700; }
.ex-item .hide { color: var(--ink-3); font-size: 13px; padding: 4px 8px; margin: -4px -6px -4px 0; border-radius: 8px; }
.group-h { font-size: 13px; color: var(--ink-3); margin: 14px 2px 2px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compact .stepper { grid-template-columns: 48px 44px 1fr 44px 48px; }
.compact .step { height: 50px; }
.compact .val .num { font-size: 44px; }
.compact .stepper.reps { grid-template-columns: 64px 1fr 64px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row .t { font-weight: 600; }
.toggle-row .s { color: var(--ink-2); font-size: 13px; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: var(--surface-3); position: relative; flex: none; transition: background var(--fast); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink-2);
  transition: transform var(--med) cubic-bezier(.3,.8,.3,1), background var(--fast); }
.switch[aria-checked="true"] { background: var(--push); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--ink); }
.mini-step { display: flex; align-items: center; gap: 4px; }
.mini-step button { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); font-weight: 700; }
.mini-step span { min-width: 52px; text-align: center; font-weight: 700; }

/* ---------- rest timer ---------- */
.rest { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 30; max-width: 536px; margin: 0 auto;
  border-radius: 18px; background: var(--surface-3); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: sheetUp 180ms cubic-bezier(.2,.9,.3,1) both; }
.rest-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--day) 30%, transparent); transition: width 1s linear; }
.rest-row { position: relative; display: grid; grid-template-columns: 56px 1fr 56px 64px; align-items: center; gap: 4px; padding: 6px; }
.rest-btn { height: 48px; border-radius: 12px; font-weight: 700; color: var(--ink-2); }
.rest-btn:active { background: rgba(255,255,255,0.08); }
.rest-skip { color: var(--ink); }
.rest-mid { text-align: center; }
.rest-label { display: block; font-size: 12px; color: var(--ink-2); }
.rest-time { font-family: var(--display); font-weight: 900; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.rest.done { background: var(--day); color: #16171a; animation: pulse 700ms ease-in-out 3; }
.rest.done .rest-label, .rest.done .rest-btn { color: #16171a; }
@keyframes pulse { 50% { transform: scale(1.03); } }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); }
.tabbar button { display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current="page"] { color: var(--ink); }

/* ---------- toast / PR ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px);
  background: var(--ink); color: #16171a; font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 12px;
  animation: drop 160ms cubic-bezier(.2,.9,.3,1.2) both; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
@keyframes drop { from { transform: translate(-50%, -14px); opacity: 0; } }
.pr-banner { position: fixed; left: 16px; right: 16px; top: 34%; z-index: 55; max-width: 420px; margin: 0 auto; text-align: center; pointer-events: none;
  background: var(--gold); color: #16171a; border-radius: 22px; padding: 16px 18px 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  animation: prIn 320ms cubic-bezier(.2,1.2,.3,1) both; }
.pr-banner.out { animation: prOut 180ms ease-in forwards; }
.pr-banner b { display: block; font-family: var(--display); font-weight: 900; font-size: 46px; line-height: 0.95; }
.pr-banner span { display: block; font-weight: 600; font-size: 16px; margin-top: 4px; }
.pr-banner em { font-style: normal; display: block; font-family: var(--display); font-size: 30px; font-weight: 800; margin-top: 6px; }
@keyframes prIn { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } }
@keyframes prOut { to { transform: scale(0.9); opacity: 0; } }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 54; }

/* ---------- summary ---------- */
.summary { margin-top: 8px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.summary-top { padding: 22px 20px 18px; background: var(--day); color: #101113; }
.summary-top p { margin: 0; font-weight: 600; opacity: 0.8; }
.summary-top h2 { margin: 2px 0 0; font-family: var(--display); font-weight: 900; font-size: 54px; line-height: 0.9; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.stat { background: var(--surface); padding: 16px 18px; }
.stat .num { font-size: 40px; font-weight: 900; line-height: 1; display: block; }
.stat small { color: var(--ink-2); font-size: 13px; }
.stat.gold .num { color: var(--gold); }
.summary-body { padding: 16px 18px 20px; }
.summary-body h3 { font-size: 15px; color: var(--ink-2); font-weight: 600; margin: 4px 0 8px; }
.sum-ex { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sum-ex:last-child { border-bottom: 0; }
.sum-ex span:last-child { color: var(--ink-2); white-space: nowrap; }
.sum-pr { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.sum-pr .pr-pill { flex: none; }

/* ---------- progress ---------- */
.card { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); padding: 16px; margin-bottom: 14px; }
.card h2 { font-family: var(--display); font-size: 26px; font-weight: 800; margin: 0 0 4px; letter-spacing: 0.01em; }
.card .desc { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tile { background: var(--surface); border-radius: var(--r-md); padding: 12px; border: 1px solid var(--line); }
.tile .num { font-size: 30px; font-weight: 900; line-height: 1; display: block; white-space: nowrap; }
.tile small { color: var(--ink-2); font-size: 12px; }
.chart-wrap { position: relative; margin-top: 8px; touch-action: pan-y; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.chart-wrap .axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--text); }
.chart-wrap .grid line { stroke: var(--surface-3); stroke-width: 1; }
.chart-wrap .s1 { stroke: var(--pull); }
.chart-wrap .s2 { stroke: var(--deadlift); }
.chart-wrap .lbl { font-size: 12px; font-weight: 600; fill: var(--ink); font-family: var(--text); }
.chart-wrap .xh { stroke: var(--ink-3); stroke-width: 1; }
.tip { position: absolute; top: 0; z-index: 2; pointer-events: none; background: var(--surface-3); border-radius: 10px; padding: 8px 10px;
  font-size: 13px; line-height: 1.35; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.tip b { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 6px; }
.chart-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.chart-stats div { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.chart-stats .num { font-size: 24px; font-weight: 800; display: block; line-height: 1; }
.chart-stats small { color: var(--ink-2); font-size: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.tbl td.r, .tbl th.r { text-align: right; }
.text-btn { color: var(--ink-2); font-size: 14px; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.seg-sm { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.seg-sm button { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg-sm button[aria-pressed="true"] { background: var(--ink); color: #16171a; }

.vol { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: 13px; }
.vol th { font-weight: 500; color: var(--ink-3); font-size: 11px; text-align: center; padding: 0 0 2px; }
.vol th.m { text-align: left; color: var(--ink-2); font-size: 13px; width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vol td { height: 30px; border-radius: 6px; text-align: center; font-weight: 700; font-family: var(--display); font-size: 16px; background: var(--surface-2); color: var(--ink); }
.vol td.z { color: var(--ink-3); font-weight: 500; }
.vol td.h1 { background: var(--heat-1); } .vol td.h2 { background: var(--heat-2); } .vol td.h3 { background: var(--heat-3); }
.vol td.h4 { background: var(--heat-4); color: #101113; } .vol td.h5 { background: var(--heat-5); color: #101113; }
.vol tr.cur-col td:last-child { outline: 1px solid var(--ink-3); }
.scale { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.scale .sc-l { flex-basis: 100%; }
.scale .sc { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.scale i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); gap: 3px; --cell: 13px; justify-content: start; }
.heat button { width: var(--cell); height: var(--cell); border-radius: 3px; background: var(--surface-2); padding: 0; }
.heat button.h1 { background: var(--heat-1); } .heat button.h2 { background: var(--heat-2); } .heat button.h3 { background: var(--heat-3); }
.heat button.h4 { background: var(--heat-4); } .heat button.h5 { background: var(--heat-5); }
.heat button.out { visibility: hidden; }
.heat button.today { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.heat button.sel { box-shadow: 0 0 0 2px var(--ink); }
.heat-wrap { display: grid; grid-template-columns: auto 1fr; gap: 6px; }
.heat-days { width: 18px; display: grid; grid-template-rows: repeat(7, 13px); gap: 3px; font-size: 10px; color: var(--ink-3); line-height: 13px; }
.heat-months { position: relative; height: 16px; font-size: 11px; color: var(--ink-3); margin-left: 24px; }
.heat-months span { position: absolute; top: 0; }
.heat-info { min-height: 44px; margin-top: 10px; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.pr-list .row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.pr-list .row:last-child { border-bottom: 0; }
.pr-list .nm { font-weight: 600; }
.pr-list .big { font-family: var(--display); font-weight: 800; font-size: 22px; text-align: right; line-height: 1; }
.pr-list .sm { color: var(--ink-2); font-size: 13px; }
.pr-list .sm.r { text-align: right; }

/* ---------- detail ---------- */
.detail-ex { margin-bottom: 14px; }
.detail-ex h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.detail-ex h3 small { color: var(--ink-3); font-weight: 500; font-size: 13px; margin-left: 6px; }
.notes-box { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; color: var(--ink-2); font-size: 15px; white-space: pre-wrap; margin-bottom: 14px; }

@media (max-width: 380px) {
  .stepper { grid-template-columns: 50px 44px 1fr 44px 50px; gap: 5px; }
  .step { font-size: 15px; }
  .step.fine { font-size: 13px; }
  .stepper:not(.reps) .val .num[data-len="4"] { font-size: 46px; }
  .stepper:not(.reps) .val .num[data-len="5"] { font-size: 38px; }
  .stepper:not(.reps) .val .num[data-len="6"] { font-size: 32px; }
}
@media (min-width: 420px) {
  .hero-day { font-size: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
