:root {
  --bg: #0e0f11;
  --surface: #17191c;
  --surface-2: #202328;
  --line: #2a2e34;
  --text: #f2f2ef;
  --muted: #8d929b;
  --faint: #5b6068;
  --accent: #d4ff3a;
  --accent-ink: #141a00;
  --accent-soft: rgba(212, 255, 58, .12);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .12);
  --danger: #ff5d5d;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --drawer: cubic-bezier(.32, .72, 0, 1);
  --r: 16px;
  --tabs-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
}
body.resting { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 96px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.num, input[inputmode] { font-variant-numeric: tabular-nums; }

main { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 16px) 16px 0; }

/* ---------- заголовки ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.top h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 800; }
.top .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 26px 0 10px; }

/* ---------- карточки ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.hero { padding: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 15px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.daytag { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 900; font-size: 20px; flex: none; }
.daytag.d { background: var(--surface-2); color: var(--text); }

/* ---------- кнопки ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 17px;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
.btn:active, .pill:active, .chk:active, .seg button:active, .wkday:active, .tabs button:active, .lnk:active { transform: scale(.97); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); min-height: 48px; font-weight: 600; }
.btn.sm { min-height: 42px; font-size: 15px; border-radius: 12px; }
.lnk { color: var(--accent); font-weight: 600; font-size: 15px; padding: 8px 0; transition: transform 160ms var(--ease); }
.pill { min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 14px;
  transition: transform 160ms var(--ease); }
.pill-accent { background: var(--accent); color: var(--accent-ink); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--surface); padding: 5px; border-radius: 14px; }
.seg button { min-height: 44px; border-radius: 10px; font-weight: 700; color: var(--muted); transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease); }
.seg button.on { background: var(--surface-2); color: var(--text); }

/* ---------- неделя ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wkday { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 9px; border-radius: 12px; background: var(--surface);
  font-size: 12px; color: var(--muted); transition: transform 160ms var(--ease), background 160ms var(--ease); position: relative; }
.wkday b { font-size: 16px; color: var(--text); font-weight: 700; }
.wkday.today { outline: 1.5px solid var(--faint); outline-offset: -1.5px; }
.wkday .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; border: 1.5px solid transparent; }
.wkday.plan .dot { border-color: var(--muted); }
.wkday.didit .dot { background: var(--accent); border-color: var(--accent); }
.wkday.didit b { color: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.exlist { list-style: none; padding: 0; margin: 14px 0 18px; }
.exlist li { border-top: 1px solid var(--line); }
.exlist li button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; font-size: 15px; text-align: left; transition: transform 160ms var(--ease); }
.exlist li button:active { transform: scale(.98); }
.exlist img { width: 48px; height: 36px; object-fit: cover; border-radius: 8px; background: #fff; flex: none; }
.exlist li span:first-of-type { flex: 1; }
.exlist li span:last-child { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.note { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; background: var(--surface); color: var(--muted); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- тренировка ---------- */
.wbar { position: sticky; top: 0; z-index: 5; margin: 0 -16px 12px; padding: calc(env(safe-area-inset-top) + 10px) 16px 12px;
  background: rgba(14, 15, 17, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.wbar .t { flex: 1; min-width: 0; }
.back { width: 40px; height: 44px; margin-left: -8px; display: grid; place-items: center; border-radius: 12px; flex: none; transition: transform 160ms var(--ease); }
.back:active { transform: scale(.92); background: var(--surface-2); }
.back svg { width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wbar .t b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbar .t span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wbar .btn { width: auto; padding: 0 18px; min-height: 42px; font-size: 15px; }
main.wk { padding-top: 0; }

.ex { background: var(--surface); border-radius: var(--r); padding: 16px 12px 12px; margin-bottom: 12px; transition: box-shadow 200ms var(--ease); }
.ex.complete { box-shadow: inset 0 0 0 1.5px rgba(212, 255, 58, .35); }
.ex-h { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px; }
.ex-h h3 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.ex-h .cnt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 3px; }
.ex-meta { font-size: 13px; color: var(--muted); padding: 3px 4px 0; }
.ex-tip { font-size: 13px; color: var(--muted); padding: 8px 4px 0; line-height: 1.45; }
.hint { margin: 10px 4px 4px; font-size: 13.5px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); line-height: 1.4; }
.hint.up { background: var(--accent-soft); color: var(--accent); }
.hint.hold { background: var(--warn-soft); color: var(--warn); }

.sets { margin-top: 10px; }
.set, .set-h { display: grid; grid-template-columns: 26px minmax(54px, 1fr) 76px 64px 48px; gap: 8px; align-items: center; padding: 4px; border-radius: 12px; }
.set-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding-bottom: 2px; }
.set-h span:nth-child(3), .set-h span:nth-child(4) { text-align: center; }
.set { transition: background 200ms var(--ease); }
.set.done { background: var(--accent-soft); }
.set .n { font-weight: 800; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.set .prev { font-size: 14px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inp { width: 100%; height: 46px; border-radius: 10px; border: 1.5px solid transparent; background: var(--surface-2); text-align: center;
  font-size: 19px; font-weight: 700; outline: none; transition: border-color 160ms var(--ease); -webkit-appearance: none; appearance: none; }
.inp:focus { border-color: var(--accent); }
.inp::placeholder { color: var(--faint); font-weight: 600; }
.inp.ghost { display: grid; place-items: center; font-size: 12px; color: var(--faint); font-weight: 600; background: transparent; }
.set.done .inp { background: transparent; }
.chk { width: 48px; height: 46px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; transition: transform 160ms var(--ease), background 160ms var(--ease); }
.chk svg { width: 22px; height: 22px; stroke: var(--faint); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: stroke 160ms var(--ease); }
.set.done .chk { background: var(--accent); }
.set.done .chk svg { stroke: var(--accent-ink); animation: pop 260ms var(--ease); }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

.ex-f { display: flex; gap: 8px; margin-top: 8px; padding: 0 4px; align-items: center; }
.ex-f .pill { flex: none; }
.ex-f input { flex: 1; min-width: 0; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 14px; outline: none; padding: 0 8px; }
.ex-f input:focus { background: var(--surface-2); color: var(--text); }

details.warm { background: var(--surface); border-radius: var(--r); margin-bottom: 12px; }
details.warm summary { list-style: none; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; cursor: pointer; }
details.warm summary::-webkit-details-marker { display: none; }
details.warm summary span { color: var(--muted); font-weight: 500; font-size: 14px; }
.chkline { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 15px; width: 100%; text-align: left; }
.chkline .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--faint); flex: none; display: grid; place-items: center; transition: background 160ms var(--ease), border-color 160ms var(--ease); }
.chkline.on .box { background: var(--accent); border-color: var(--accent); }
.chkline.on .box::after { content: ""; width: 10px; height: 6px; border: 2.5px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.chkline.on { color: var(--muted); }

/* ---------- таймер отдыха ---------- */
.rest { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px); z-index: 20;
  max-width: 536px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; border-radius: 18px;
  background: #23272d; box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: up 320ms var(--drawer); }
.rest[hidden] { display: none; }
.rest.over { background: var(--accent); color: var(--accent-ink); }
.rest.over .pill { background: rgba(0,0,0,.12); color: var(--accent-ink); }
.ring { width: 44px; height: 44px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: rgba(255,255,255,.1); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke-dashoffset 250ms linear; }
.rest.over .ring-fg { stroke: var(--accent-ink); }
.rest-txt { flex: 1; line-height: 1.1; }
.rest-txt small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.rest-txt b { font-size: 24px; font-variant-numeric: tabular-nums; }
@keyframes up { from { transform: translateY(120%); } to { transform: none; } }

/* ---------- таб-бар ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14, 15, 17, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--faint); font-size: 11px; font-weight: 600;
  transition: color 160ms var(--ease), transform 160ms var(--ease); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--text); }
.tabs button.on svg { stroke: var(--accent); }

/* ---------- история / прогресс ---------- */
.hist { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--surface); border-radius: var(--r); padding: 14px; margin-bottom: 10px; transition: transform 160ms var(--ease); }
.hist:active { transform: scale(.985); }
.hist .t { flex: 1; min-width: 0; }
.hist .t b { display: block; font-size: 16px; }
.hist .t span { font-size: 13px; color: var(--muted); }
.hist .arrow { color: var(--faint); font-size: 20px; }
.month { font-size: 13px; color: var(--muted); margin: 22px 4px 10px; text-transform: capitalize; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 12px; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: url(#g); }
.chart .pt { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .last { fill: var(--accent); }
.chart .vl { fill: var(--text); font-size: 12px; font-weight: 700; }

select.sel { width: 100%; height: 48px; border-radius: 12px; background: var(--surface-2); border: 0; padding: 0 14px; font-size: 16px; font-weight: 600; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.sess { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sess span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.pr { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pr b { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- настройки ---------- */
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; }
.field label { font-size: 15px; }
.field label small { display: block; color: var(--muted); font-size: 12px; }
.field input { width: 92px; height: 42px; border-radius: 10px; border: 0; background: var(--surface-2); text-align: center; font-size: 17px; font-weight: 700; outline: none; }
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 4px; }
.days button { height: 42px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--muted); transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease); }
.days button.on { background: var(--accent); color: var(--accent-ink); }
.days button:active { transform: scale(.95); }

.pex { border-top: 1px solid var(--line); padding: 12px 0; }
.pex .nm { width: 100%; background: transparent; border: 0; font-size: 16px; font-weight: 700; outline: none; padding: 4px 0; }
.pex .nm:focus { color: var(--accent); }
.pex .grid4 { display: grid; grid-template-columns: 1.3fr .8fr .8fr .8fr .9fr; gap: 6px; margin-top: 6px; }
.pex .grid4 label { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; display: flex; flex-direction: column; gap: 3px; }
.pex .grid4 input, .pex .grid4 select { color: var(--text); height: 38px; border-radius: 8px; border: 0; background: var(--surface-2); text-align: center; font-size: 15px; font-weight: 600; outline: none; width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
.pex .grid4 select { text-align-last: center; font-size: 13px; }
.pex .tipin { width: 100%; margin-top: 6px; background: transparent; border: 0; font-size: 13px; color: var(--muted); outline: none; padding: 4px 0; }
.pex .acts { display: flex; gap: 14px; margin-top: 4px; }
.pex .acts button { font-size: 13px; color: var(--faint); padding: 4px 0; }
.pex .acts button.del { color: var(--danger); opacity: .8; }

/* ---------- шторка / тост ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: fade 240ms var(--ease); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px); animation: up 380ms var(--drawer); max-width: 560px; margin: 0 auto; }
.sheet-body::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-body h3 { font-size: 22px; margin: 4px 0 6px; letter-spacing: -.01em; }
.sheet-body p { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.sheet-body .btn + .btn { margin-top: 8px; }
.sheet-body textarea { width: 100%; min-height: 120px; border-radius: 12px; border: 0; background: var(--surface-2); padding: 12px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; margin-bottom: 10px; }
@keyframes fade { from { opacity: 0; } }
.big { font-size: 44px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }

.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg);
  font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; animation: drop 260ms var(--ease); max-width: calc(100% - 32px); text-align: center; }
.toast[hidden] { display: none; }
@keyframes drop { from { transform: translate(-50%, -140%); } }

/* ---------- режим «одно упражнение» ---------- */
.fprog { display: flex; gap: 5px; margin: 2px 0 14px; }
.fseg { flex: 1; height: 22px; position: relative; display: flex; align-items: center; }
.fseg::after { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.fseg.cur::after { background: var(--faint); }
.fseg i { position: relative; z-index: 1; display: block; height: 6px; border-radius: 3px; background: var(--accent); transition: width 300ms var(--ease); }

.fcard { background: var(--surface); border-radius: 22px; padding: 16px; margin-bottom: 12px; }
.fcard.from-r { animation: fromR 320ms var(--ease); }
.fcard.from-l { animation: fromL 320ms var(--ease); }
@keyframes fromR { from { opacity: 0; transform: translateX(28px); } }
@keyframes fromL { from { opacity: 0; transform: translateX(-28px); } }
.fc-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fc-top span:last-child { text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fc-name { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 6px 0 12px; font-weight: 800; text-transform: none; color: var(--text); }

.media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #fff; transition: transform 160ms var(--ease); }
.media:active { transform: scale(.98); }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.media img.b { animation: swap 2.6s infinite; }
@keyframes swap { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.media-l { position: absolute; left: 10px; bottom: 10px; background: rgba(14, 15, 17, .82); color: var(--text); font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 999px; }

.fpanel { margin-top: 14px; }
.fset-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.fset-h > b { font-size: 20px; }
.fset-h > b span { color: var(--muted); font-weight: 600; }
.fset-h > span { font-size: 13px; color: var(--muted); text-align: right; }
.fset-h > span b { color: var(--text); font-variant-numeric: tabular-nums; }

.stp { display: grid; grid-template-columns: 68px 1fr 68px; gap: 8px; margin-bottom: 8px; }
.stp > button { height: 64px; border-radius: 16px; background: var(--surface-2); font-size: 32px; font-weight: 500; color: var(--text); transition: transform 120ms var(--ease), background 160ms var(--ease); }
.stp > button:active { transform: scale(.93); background: var(--line); }
.stp label { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; background: var(--bg); }
.stp-in { width: 100%; border: 0; background: transparent; text-align: center; font-size: 40px; font-weight: 800; letter-spacing: -.02em; outline: none; padding: 0; height: 46px; font-variant-numeric: tabular-nums; }
.stp-in::placeholder { color: var(--faint); }
.stp small { font-size: 12px; color: var(--muted); margin-top: -2px; }
.stp label.bump .stp-in { animation: bump 180ms var(--ease); }
@keyframes bump { 50% { transform: scale(1.08); } }
.btn.xl { min-height: 64px; font-size: 19px; margin-top: 6px; border-radius: 16px; }

.fdone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 10px; text-align: center; }
.fdone-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; animation: pop 320ms var(--ease); }
.fdone-ic svg { width: 28px; height: 28px; stroke: var(--accent-ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fdone b { font-size: 19px; }
.fdone span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; transition: transform 160ms var(--ease), background 160ms var(--ease); }
.chip em { font-style: normal; color: var(--faint); }
.chip.done { background: var(--accent-soft); color: var(--accent); }
.chip.done em { color: var(--accent); opacity: .6; }
.chip.cur { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.chip.add { padding: 0 14px; font-size: 18px; }
.chip:active { transform: scale(.95); }

.fnav { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fnav .pill { min-height: 44px; }
.fnav .pill:disabled { opacity: .3; }

.restfull { position: fixed; inset: 0; z-index: 40; background: rgba(14, 15, 17, .97); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(env(safe-area-inset-top) + 20px) 24px calc(env(safe-area-inset-bottom) + 24px); animation: fade 240ms var(--ease); }
.restfull[hidden] { display: none; }
.restfull > small { font-size: 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.rf-ring { position: relative; width: min(64vw, 260px); aspect-ratio: 1; }
.rf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rf-ring circle { fill: none; stroke-width: 10; }
.rf-ring .ring-fg { stroke-dasharray: 565.5; }
.rf-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 60px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rf-next { color: var(--muted); font-size: 16px; text-align: center; min-height: 22px; }
.restfull .btn { max-width: 320px; }
.restfull.over > small { color: var(--accent); }
.restfull.over .rf-ring b { color: var(--accent); }

.tech-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.tech-imgs figure { margin: 0; }
.tech-imgs img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 12px; display: block; }
.tech-imgs figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.steps { margin: 0 0 16px; padding-left: 22px; }
.steps li { margin-bottom: 8px; font-size: 15px; line-height: 1.45; }
.steps li::marker { color: var(--accent); font-weight: 800; }
a.btn { text-decoration: none; }

/* ---------- мышцы ---------- */
.bodymap { width: 100%; height: auto; display: block; max-height: 440px; }
.bm-base { fill: #2a2d33; }
.bm { fill: #3a3e45; cursor: pointer; transition: fill 200ms var(--ease), fill-opacity 200ms var(--ease); stroke: var(--surface); stroke-width: 1.5; }
.bm.hot { fill: var(--accent); }
.bm.on { fill: var(--accent); fill-opacity: 1; stroke: var(--text); stroke-width: 2; }
.bm-l { fill: var(--faint); font-size: 11px; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.mchips .chip { min-height: 40px; }
.mx { display: flex; align-items: stretch; gap: 10px; background: var(--surface); border-radius: 16px; padding: 10px; margin-bottom: 8px; transition: box-shadow 200ms var(--ease); }
.mx.on { box-shadow: inset 0 0 0 1.5px rgba(212, 255, 58, .5); }
.mx-img { width: 76px; flex: none; border-radius: 10px; overflow: hidden; background: #fff; display: grid; place-items: center; min-height: 64px; }
.mx-img img { width: 100%; height: 100%; object-fit: cover; }
.mx-img span { color: #111; font-size: 20px; }
.mx-main { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.mx-main b { font-size: 15.5px; line-height: 1.25; }
.mx-main span { font-size: 13px; color: var(--muted); }
.mx-main .prev { color: var(--faint); font-variant-numeric: tabular-nums; }
.mx-main .also { color: var(--faint); font-size: 12px; }
.mx-chk { width: 44px; flex: none; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; align-self: center; height: 44px; transition: background 160ms var(--ease), transform 160ms var(--ease); }
.mx-chk:active { transform: scale(.92); }
.mx-chk svg { width: 20px; height: 20px; stroke: var(--faint); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mx.on .mx-chk { background: var(--accent); }
.mx.on .mx-chk svg { stroke: var(--accent-ink); }
.mbar { position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px); margin-top: 14px; z-index: 4; }
.mbar .btn { box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.mbar .btn:disabled { background: var(--surface-2); color: var(--muted); }
#mlist { scroll-margin-top: 12px; }
.tabs button span { white-space: nowrap; }

/* ---------- компьютер: шире, в две колонки ---------- */
.desk-only { display: none; }
@media (min-width: 900px) {
  .desk-only { display: block; }
  .mob-only { display: none; }
  main { max-width: min(70vw, 1400px); padding-left: 24px; padding-right: 24px; }
  .wbar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .top h1 { font-size: 36px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .col > h2:first-child, .col > .desk-only:first-child > h2:first-child { margin-top: 0; }
  .settings-cols { grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); }
  .days-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-content: start; }
  .days-grid h2 { margin-top: 0; }
  .muscles-cols { grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); }
  .muscles-cols .mleft { position: sticky; top: 16px; }
  .muscles-cols .col:last-child > h2:first-of-type { margin-top: 0; }
  .muscles-cols .empty { padding-top: 120px; }
  .exlist { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .week { gap: 10px; }
  main.history { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; align-content: start; }
  main.history > .top, main.history > .stats, main.history > .month, main.history > .empty { grid-column: 1 / -1; }
  main.today .card.hero { padding: 28px; }
  .chart { max-height: 320px; }

  .fcard { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 28px; padding: 24px;
    grid-template-areas: "top top" "name name" "media panel" "hint panel" "chips panel" ". panel"; grid-template-rows: auto auto auto auto auto 1fr; }
  .fcard > .fc-top { grid-area: top; }
  .fcard > .fc-name { grid-area: name; font-size: 32px; }
  .fcard > .media, .fcard > .lnk { grid-area: media; align-self: start; }
  .fcard > .hint { grid-area: hint; margin-left: 0; margin-right: 0; }
  .fcard > .fpanel { grid-area: panel; margin-top: 0; }
  .fcard > .chips { grid-area: chips; }
  .fcard .media { aspect-ratio: 4 / 3; }
  .rest, .tabs { max-width: none; }
  .sheet-body { border-radius: 22px 22px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .media img.b { animation: none; opacity: 0; }
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
@media (max-width: 360px) {
  .set, .set-h { grid-template-columns: 22px minmax(40px, 1fr) 66px 56px 44px; gap: 6px; }
}
