:root {
  --bg: #07090e;
  --panel: #0d121b;
  --panel-2: #121926;
  --line: #1c2534;
  --text: #e6edf7;
  --muted: #7b889d;
  --accent: #27e1c1;
  --accent-2: #ff2e88;
  --accent-glow: rgba(39, 225, 193, .28);
  --warn: #ffd23f;
  --good: #1fe08f;
  --bad: #ff8a3d;
  --crit: #ff4f6d;
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 120px), var(--panel);
  --card-border: rgba(255, 255, 255, .07);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 14px 32px -14px rgba(0, 0, 0, .7);
  --tabbar: 62px;
  --radius: 14px;
  --head: 'Oxanium', 'Segoe UI', sans-serif;
  --body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); font: 15px/1.45 var(--body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
/* Фоновое свечение: бирюза слева сверху, розовый справа — глубина вместо плоского чёрного */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 380px at 0% -5%, rgba(39, 225, 193, .09), transparent 70%),
    radial-gradient(520px 360px at 105% 0%, rgba(255, 46, 136, .07), transparent 70%);
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(var(--tabbar) + 96px + env(safe-area-inset-bottom));
}

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.logo { font: 700 20px/1 var(--head); letter-spacing: .12em; }
.logo span { color: var(--accent-2); text-shadow: 0 0 14px rgba(255, 46, 136, .55); }
.readiness { text-align: right; }
.readiness .label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.readiness b { font: 700 22px/1.1 var(--head); color: var(--accent); }

/* ---------- mode switch ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.seg-btn { padding: 8px 0; border-radius: 9px; color: var(--muted); font: 600 13px var(--head); letter-spacing: .06em; text-transform: uppercase; transition: background .2s, color .2s; }
.seg-btn.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px #2a3850; }

/* ---------- body scanner ---------- */
.scanner {
  position: relative;
  margin-top: 12px;
  padding: 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 35%, #0f1d2a 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 15px, #0e1520 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, #0e1520 15px 16px),
    var(--panel);
}
/* HUD-уголки сканера */
.scanner::after {
  content: ''; position: absolute; inset: 8px; pointer-events: none; opacity: .7;
  --c: linear-gradient(var(--accent), var(--accent));
  background:
    var(--c) top left / 14px 2px no-repeat, var(--c) top left / 2px 14px no-repeat,
    var(--c) top right / 14px 2px no-repeat, var(--c) top right / 2px 14px no-repeat,
    var(--c) bottom left / 14px 2px no-repeat, var(--c) bottom left / 2px 14px no-repeat,
    var(--c) bottom right / 14px 2px no-repeat, var(--c) bottom right / 2px 14px no-repeat;
}
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
figure { margin: 0; }
figure svg { display: block; width: 100%; height: auto; overflow: visible; }
figcaption { text-align: center; font: 600 10px var(--head); letter-spacing: .3em; color: var(--muted); margin-top: 2px; }

polygon { stroke-linejoin: round; }
polygon.bone { fill: #161e2b; stroke: #243045; stroke-width: .4; }
polygon.mus {
  stroke-width: .45;
  cursor: pointer;
  transition: fill .6s ease, stroke .6s ease, fill-opacity .6s ease;
}
polygon.mus.hot { filter: url(#glow); }
polygon.mus.sel { stroke: #fff !important; stroke-width: 1.1; }
polygon.mus.pulse { animation: pulse 1s ease-out; }
@keyframes pulse {
  0%   { stroke: #fff; stroke-width: 2.2; fill-opacity: 1; }
  100% { stroke-width: .45; }
}

.scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 60px;
  background: linear-gradient(180deg, transparent, rgba(39, 225, 193, .08) 70%, rgba(39, 225, 193, .35) 98%, transparent);
  animation: scan 4.5s linear infinite;
  pointer-events: none;
}
@keyframes scan { from { transform: translateY(-60px); } to { transform: translateY(520px); } }
@media (prefers-reduced-motion: reduce) { .scanline { display: none; } polygon.mus { transition: none; } polygon.mus.pulse, .timer.done { animation: none; } }

/* Отклик на нажатие: кнопка чуть «проседает» под пальцем */
@media (prefers-reduced-motion: no-preference) {
  .cta, .btn2, .add-ex, .chips button, .tag, .cats button, .tabbar button, .timer button, .rec-card, .goal-opt, .row-btn, .wk-focus, .ex-item {
    transition: transform .12s ease, color .2s, background-color .2s, border-color .2s;
  }
  :is(.cta, .btn2, .add-ex, .chips button, .tag, .cats button, .tabbar button, .timer button):active:not(:disabled) { transform: scale(.96); }
  :is(.rec-card, .goal-opt, .row-btn, .wk-focus, .ex-item):active { transform: scale(.985); }
}

/* ---------- legend + simulation ---------- */
.legend { margin: 10px 2px 0; }
.legend-bar { height: 6px; border-radius: 3px; }
.legend-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

.sim { display: grid; grid-template-columns: auto 1fr 64px; align-items: center; gap: 10px; margin: 12px 2px 0; font-size: 13px; color: var(--muted); }
.sim.off { opacity: .35; pointer-events: none; }
.sim output { text-align: right; color: var(--text); font: 600 13px var(--head); }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- cards ---------- */
.card { margin-top: 14px; padding: 14px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.card h2 { margin: 0 0 10px; font: 600 13px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card h3 { margin: 0; font: 700 20px/1.2 var(--head); }
.hint { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }

.big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 8px; }
.big b { font: 700 34px/1 var(--head); }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; transition: width .6s ease; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 10px; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { padding: 6px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
button.tag:active { border-color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.summary-row { margin: 6px 0 0; font-size: 14px; }
.summary-row b { font-weight: 600; }

/* ---------- logger ---------- */
.picker { width: 100%; text-align: left; padding: 12px 14px; background: var(--panel-2); border: 1px solid #263248; border-radius: 12px; }
.picker-name { display: block; font: 600 17px var(--head); }
.picker-name::after { content: ' ▾'; color: var(--muted); }
.picker-tags { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.last { font-size: 13px; color: var(--muted); margin: 8px 2px 0; min-height: 1em; }

.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.st-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px 2px; }
.st-row { display: grid; grid-template-columns: 40px 1fr 40px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.st-row button { height: 46px; font-size: 22px; color: var(--accent); }
.st-row button:active { background: #18222f; }
.st-row input { width: 100%; min-width: 0; text-align: center; background: none; border: 0; outline: none; font: 700 22px var(--head); }

.rpe { margin-top: 12px; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.chips button { padding: 8px 0 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; font: 700 16px/1.1 var(--head); }
.chips button small { display: block; font: 500 10px var(--body); color: var(--muted); margin-top: 2px; }
.chips button.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent); }

.cta {
  width: 100%; margin-top: 14px; padding: 15px 0; border-radius: 12px;
  background: linear-gradient(90deg, #13c9a9, #27e1c1); color: #031712;
  font: 700 15px var(--head); letter-spacing: .14em;
  box-shadow: 0 0 22px rgba(39, 225, 193, .25);
}
.cta:active { transform: scale(.99); }
.cta:disabled { opacity: .5; }

/* ---------- today ---------- */
.ex-group { padding: 10px 0; border-top: 1px solid var(--line); }
.ex-group:first-child { border-top: 0; padding-top: 0; }
.ex-group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ex-group-head b { font-weight: 600; }
.ex-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ex-sets span { padding: 3px 8px; background: var(--panel-2); border-radius: 6px; font: 600 13px var(--head); }
.undo { color: var(--muted); font-size: 13px; padding: 4px 6px; }
.demo-btn { margin-top: 10px; padding: 10px 14px; border: 1px solid #2a3850; border-radius: 10px; color: var(--accent); }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(2, 4, 8, .7); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet {
  width: 100%; max-width: 520px; height: 82vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; gap: 8px; }
.sheet-head input { flex: 1; min-width: 0; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; outline: none; }
.ghost { color: var(--muted); padding: 0 6px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.cats button { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.cats button.active { border-color: var(--accent); color: var(--accent); }
.ex-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ex-item { display: block; width: 100%; text-align: left; padding: 11px 4px; border-top: 1px solid var(--line); }
.ex-item b { display: block; font-weight: 600; }
.ex-item span { font-size: 12px; color: var(--muted); }
.ex-section { font: 600 11px var(--head); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; padding: 10px 4px 4px; }

/* ---------- rest timer ---------- */
.timer {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px;
  background: #0f1622; border: 1px solid #263248; border-radius: 999px; z-index: 15;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.timer.done { border-color: var(--accent); box-shadow: 0 0 24px rgba(39, 225, 193, .35); animation: timer-done 1s ease-out 3; }
@keyframes timer-done {
  from { box-shadow: 0 0 0 0 rgba(39, 225, 193, .55), 0 0 24px rgba(39, 225, 193, .35); }
  to { box-shadow: 0 0 0 16px rgba(39, 225, 193, 0), 0 0 24px rgba(39, 225, 193, .35); }
}
.ring { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #1c2534; stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113.1; transition: stroke-dashoffset .25s linear; }
.timer-text { min-width: 62px; }
.timer-label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.timer-text b { font: 700 18px/1 var(--head); }
.timer button { padding: 8px 10px; border-radius: 999px; background: var(--panel-2); font: 600 13px var(--head); }

.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -140%);
  max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 10px; background: #1a2333; border: 1px solid #2a3850;
  font-size: 14px; transition: transform .3s ease, opacity .3s ease; z-index: 30;
  opacity: 0; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.foot { margin: 18px 4px 0; font-size: 12px; color: var(--muted); }

/* ---------- tabs ---------- */
.small { font-size: 12px; }
.eyebrow { margin: 0 0 4px; font: 600 11px var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(9, 12, 19, .72); border-top: 1px solid var(--card-border);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
}
/* Светящаяся черта над активной вкладкой — переезжает между вкладками (--tab-i ставит render) */
.tabbar::before {
  content: ''; position: absolute; top: -1px; left: 0; width: calc(100% / 4); height: 2px;
  background: linear-gradient(90deg, transparent calc(50% - 18px), var(--accent) calc(50% - 18px), var(--accent) calc(50% + 18px), transparent calc(50% + 18px));
  filter: drop-shadow(0 0 6px var(--accent));
  transform: translateX(calc(var(--tab-i, 0) * 100%));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.tabbar button.active svg { filter: drop-shadow(0 0 6px rgba(39, 225, 193, .6)); }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font: 600 11px var(--head); letter-spacing: .06em; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar svg circle { fill: currentColor; stroke: none; }
.tabbar button.active { color: var(--accent); }
.tab-live {
  position: absolute; top: 6px; left: calc(50% + 10px);
  padding: 1px 6px; border-radius: 999px; background: var(--accent-2); color: #fff;
  font: 700 10px/1.4 var(--head); letter-spacing: .02em;
}

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.tile { padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.tile-label { display: block; font-size: 12px; color: var(--muted); }
.tile-value { display: block; font: 700 21px/1.25 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { display: block; font: 600 12px var(--head); margin-top: 2px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }

/* ---------- list rows ---------- */
.row-btn, .hist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 10px 2px; border-top: 1px solid var(--line);
}
.card h2 + .row-btn, .card h2 + .hist-row { border-top: 0; padding-top: 2px; }
.row-btn > span:first-child, .hist-row > span:first-child { min-width: 0; flex: 1; }
.row-btn b, .hist-row b { display: block; font-weight: 600; }
.row-btn small, .hist-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.row-btn:active { background: var(--panel-2); }
.row-meta { flex: none; text-align: right; font: 600 14px var(--head); color: var(--text); }
.row-meta small { font: 500 11px var(--body); }
.ex-row .spark { flex: none; }

/* ---------- active workout ---------- */
.wk-head { border-color: #2a3850; background: linear-gradient(160deg, #101a28, var(--panel) 60%); }
.wk-row { display: flex; justify-content: space-between; align-items: baseline; }
.wk-row h2 { margin: 0; color: var(--accent); }
/* Живая точка у идущей тренировки */
.wk-head:not(.past) .wk-row h2::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 1px;
  border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2);
}
@media (prefers-reduced-motion: no-preference) {
  .wk-head:not(.past) .wk-row h2::before { animation: live 1.6s ease-in-out infinite; }
}
@keyframes live { 50% { opacity: .35; box-shadow: 0 0 2px var(--accent-2); } }
.wk-clock { font: 700 28px/1 var(--head); font-variant-numeric: tabular-nums; }
.wk-stats { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.wk-stats b { color: var(--text); font: 700 16px var(--head); }
.wk-muscles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag.small { padding: 3px 8px; font-size: 12px; }

.ex-card { padding: 0; overflow: hidden; }
.ex-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 14px; }
.ex-card-head b { display: block; font: 600 16px var(--head); }
.ex-card-head small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.ex-count { flex: none; font: 600 12px var(--head); color: var(--muted); }
.ex-count.done { color: var(--accent); }
/* Начатое упражнение — бирюзовая кромка слева */
.ex-card:has(.ex-count.done) { box-shadow: inset 3px 0 0 var(--accent), var(--card-shadow); }
.ex-card > .ex-sets { padding: 0 14px 12px; margin-top: -4px; }
.ex-card.open { border-color: #2a3850; padding-bottom: 14px; }
.ex-card.open > *:not(.ex-card-head) { margin-left: 14px; margin-right: 14px; }
.ex-card.open .cta { width: calc(100% - 28px); }
.ex-prev { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.note { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); }
.note span { flex: 1; }
.note.good { border-color: #1d4a40; }
.note.warn { border-color: #5a3a1c; }
.note button { flex: none; padding: 6px 10px; border-radius: 8px; background: #16302b; color: var(--accent); font: 600 12px var(--head); }
.set-rows { list-style: none; padding: 0; margin-top: 10px; margin-bottom: 0; }
.set-rows li { display: grid; grid-template-columns: 22px 1fr auto 34px; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.set-rows li:first-child { border-top: 0; }
.set-rows .n { color: var(--muted); font: 600 13px var(--head); }
.set-rows b { font: 600 15px var(--head); }
.rpe-tag { font-size: 12px; color: var(--muted); }
.del { height: 30px; border-radius: 8px; color: var(--muted); }
.del.armed { background: #3a1620; color: var(--crit); }
.ex-best { margin-top: 8px; margin-bottom: 0; font-size: 13px; color: var(--text); }

.add-ex { width: 100%; margin-top: 14px; padding: 14px 0; border: 1px dashed #2f3d55; border-radius: 12px; color: var(--accent); font: 700 14px var(--head); letter-spacing: .12em; }
.add-ex:active { background: var(--panel); }
.cta.finish { background: linear-gradient(90deg, #d42a7c, #ff2e88); color: #fff; box-shadow: 0 0 22px rgba(255, 46, 136, .25); }
.cta.armed { background: var(--warn); color: #1d1600; box-shadow: none; }
.link-danger, .link-muted { display: block; width: 100%; margin-top: 10px; padding: 10px 0; font-size: 13px; text-align: center; color: var(--muted); }
.link-danger { color: #c45a6e; }
.link-danger.armed, .link-muted.armed { color: var(--crit); font-weight: 600; }

/* ---------- tips & records ---------- */
.tip { padding: 10px 0; border-top: 1px solid var(--line); }
.card h2 + .tip { border-top: 0; padding-top: 0; }
.tip b { font-weight: 600; }
.tip p { margin: 3px 0 0; font-size: 14px; color: #b9c4d6; }

/* ---------- overlay ---------- */
body.locked { overflow: hidden; }
.overlay { position: fixed; inset: 0; z-index: 18; overflow-y: auto; background: var(--bg); overscroll-behavior: contain; }
.overlay-panel { position: relative; max-width: 520px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.overlay-close { position: absolute; z-index: 2; /* выше блоков, которые въезжают анимацией: у них на время анимации свой слой */ top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2); color: var(--muted); }
.ov-title { margin: 0; padding-right: 44px; font: 700 26px/1.15 var(--head); }
.ov-actions { margin-top: 16px; }
.ghost-cta { background: var(--panel-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.figures.mini { max-width: 280px; margin: 0 auto; }

/* ---------- charts ---------- */
.chart { position: relative; min-height: 40px; margin: 4px -4px 6px; }
.ch-host { position: relative; }
.ch-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ch-grid { stroke: #1a2231; stroke-width: 1; shape-rendering: crispEdges; }
.ch-axis { fill: var(--muted); font: 500 10px var(--body); font-variant-numeric: tabular-nums; }
.ch-label { fill: var(--text); font: 600 11px var(--head); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--accent); fill-opacity: .1; stroke: none; }
.ch-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.ch-dot-focus { fill: #fff; stroke: var(--accent); stroke-width: 2; pointer-events: none; }
.ch-cross { stroke: #3a4a63; stroke-width: 1; pointer-events: none; }
.ch-bar { fill: var(--accent); transition: fill .15s; }
.ch-bar-dim { fill: #1a7d6e; }
.ch-hit { fill: transparent; }
.ch-bar-g { outline: none; cursor: pointer; }
.ch-bar-g:hover .ch-bar, .ch-bar-g:focus .ch-bar { fill: #6ff3da; }
.ch-tip {
  position: absolute; z-index: 3; pointer-events: none; min-width: 110px; max-width: 240px;
  padding: 8px 10px; border-radius: 10px; background: #1a2333; border: 1px solid #2a3850;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45); font-size: 12px;
}
.ch-tip-title { color: var(--muted); margin-bottom: 3px; }
.ch-tip-row { display: flex; gap: 6px; align-items: baseline; }
.ch-tip-row b { font: 700 13px var(--head); color: var(--text); }
.ch-tip-row span { color: var(--muted); }
.spark-line { fill: none; stroke: #4b5a72; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }

/* ---------- heatmap ---------- */
.cal-sub { margin: -4px 0 10px; }
.heat-wrap { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 2px; font-size: 9px; color: var(--muted); align-items: center; }
.heat-host { position: relative; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); gap: 2px; }
.heat-cell { aspect-ratio: 1; border-radius: 3px; background: #141b27; cursor: pointer; outline: none; }
.heat-cell:hover, .heat-cell:focus { box-shadow: 0 0 0 1.5px #e6edf7 inset; }
.heat-cell.future { background: transparent; box-shadow: inset 0 0 0 1px #131a25; cursor: default; }
.heat-legend { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 8px; font-size: 11px; color: var(--muted); }
.heat-legend i { width: 11px; height: 11px; border-radius: 2px; background: #141b27; }
.heat-legend span:first-child { margin-right: 3px; }
.heat-legend span:last-child { margin-left: 3px; }

/* ---------- muscle balance ---------- */
.bal-group { margin: 12px 0 2px; font: 600 11px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bal-row { display: grid; grid-template-columns: 128px 1fr 58px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.bal-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal-track { position: relative; height: 8px; border-radius: 4px; background: #16202d; }
.bal-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.bal-track em { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); opacity: .55; border-radius: 1px; }
.bal-val { font: 600 13px var(--head); text-align: right; white-space: nowrap; }
.bal-val small { color: var(--muted); font-weight: 500; }
.bal-flag { display: block; font: 600 10px var(--body); }
.bal-flag.low { color: var(--warn); }
.bal-flag.high { color: var(--crit); }

/* ---------- picker ---------- */
.eqs { padding-top: 0; }
.eqs button { font-size: 12px; padding: 5px 10px; }
.ex-item.in b::after { content: ' ✓'; color: var(--accent); }

/* ---------- muscle picking ---------- */
svg.tappable { cursor: pointer; }
.tags.sib { margin: 8px 0 4px; }
.tag.active { border-color: var(--accent); color: var(--accent); }

/* ---------- editing a workout ---------- */
.wk-head.past { background: linear-gradient(160deg, #1a1626, var(--panel) 60%); border-color: #3a2f55; }
.wk-head.past h2 { color: #b9a4ff; }
.wk-when { font: 600 14px var(--head); color: var(--text); }
.set-rows li { cursor: pointer; border-radius: 8px; }
.set-rows li.editing { background: #16302b; box-shadow: inset 0 0 0 1px var(--accent); padding-left: 6px; padding-right: 2px; }
.cta.save { background: linear-gradient(90deg, #8a6cff, #b9a4ff); color: #120a2a; box-shadow: 0 0 22px rgba(170, 140, 255, .25); }
.tap-hint { margin: 8px 0 0; text-align: center; }
.ex-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.ex-actions button { padding: 8px 4px; font-size: 13px; color: var(--muted); }
.ex-actions button:last-child { color: #c45a6e; }
.ex-actions button.armed { color: var(--crit); font-weight: 600; }
/* Правка, повтор и удаление в итогах — второстепенные: строкой под «Готово» */
.sum-tools { display: flex; justify-content: center; gap: 6px 18px; flex-wrap: wrap; margin-top: 12px; }
.sum-tools button { padding: 8px 4px; font-size: 13px; color: var(--muted); }
.sum-tools .danger { color: #c45a6e; }
.sum-tools button.armed { color: var(--crit); font-weight: 600; }
.hist-hint { margin: -4px 0 4px; }

/* ---------- summary actions ---------- */
.ov-row { display: flex; gap: 8px; margin: 12px 0 4px; }
.btn2 { flex: 1; padding: 9px 6px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font: 600 13px var(--body); }
.btn2.danger { color: #e0697f; }
.btn2.armed { background: #3a1620; color: var(--crit); border-color: #5a2030; font-size: 12px; }

/* ---------- forms ---------- */
.form label { display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.form label:first-child { border-top: 0; }
.form label span { color: var(--muted); font-size: 14px; }
.form input { width: 100%; min-width: 0; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; outline: none; color-scheme: dark; font: 600 15px var(--head); }
.form input:focus { border-color: var(--accent); }

/* ---------- goals ---------- */
.goal-strip { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 12px 14px; text-align: left; background: linear-gradient(120deg, #10202a, var(--panel) 70%); border: 1px solid #1f3a44; border-radius: var(--radius); }
.goal-strip > span:first-child { flex: 1; min-width: 0; }
.goal-strip small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.goal-strip b { display: block; font: 700 17px/1.25 var(--head); color: var(--accent); }
.goal-strip.empty { border-style: dashed; border-color: #2f5560; }
.goal-strip.empty small { text-transform: none; letter-spacing: 0; font-size: 12.5px; margin-top: 2px; }
.goal-strip i { font-style: normal; font-size: 22px; color: var(--muted); }
.goal-nums { flex: none; text-align: right; font: 600 12px/1.45 var(--head); color: var(--text); }
.ex-goal { margin: 6px 0 0; font-size: 12.5px; color: var(--accent); opacity: .9; }

.goal-opts { display: grid; gap: 8px; margin-top: 12px; }
.goal-opt { display: block; width: 100%; text-align: left; padding: 11px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.goal-opt b { display: block; font: 600 16px var(--head); }
.goal-opt small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.goal-opt.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #0f1f24; }
.goal-opt.active b { color: var(--accent); }
.chips.c3 { grid-template-columns: repeat(3, 1fr); }
.chips.c3 button { font-size: 14px; padding: 9px 4px 7px; }

.param-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid var(--line); }
.param-row span { color: var(--muted); font-size: 14px; }
.param-row b { flex: none; font: 600 15px var(--head); text-align: right; }
.param-row b small { display: block; font: 600 10px var(--body); color: #b9a4ff; text-transform: uppercase; letter-spacing: .08em; }
.param-row.custom b { color: #b9a4ff; }
.param-edit { padding: 10px 0; border-top: 1px solid var(--line); }
.param-name { display: block; font-size: 14px; margin-bottom: 8px; }
.param-inputs { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.param-inputs input { flex: 1; min-width: 0; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--accent); border-radius: 10px; outline: none; color-scheme: dark; font: 700 18px var(--head); text-align: center; }
.param-inputs span { color: var(--muted); }

.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal-head > span { min-width: 0; }
.goal-head h2 { margin-bottom: 4px; }
.goal-name { display: block; font: 700 20px/1.2 var(--head); color: var(--accent); }
.goal-head small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.goal-head .btn2 { flex: none; padding: 8px 12px; }
.lifts { margin-top: 10px; }
.lift-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.lift-main { flex: 1; min-width: 0; }
.lift-main b { display: block; font: 600 14px var(--head); }
.lift-main small { display: block; font-size: 12px; color: var(--muted); margin: 1px 0 6px; }
.lift-row .del, .body-entries .del { flex: none; width: 32px; height: 32px; color: var(--muted); }
.lift-add { display: grid; grid-template-columns: 1fr 76px 44px; gap: 6px; margin-top: 10px; }
.lift-add select, .lift-add input, .body-log input { min-width: 0; padding: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); color-scheme: dark; font: 500 14px var(--body); outline: none; }
.lift-add input, .body-log input { font: 600 15px var(--head); }
.lift-add .btn2 { font-size: 18px; padding: 0; }
.body-log { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.body-log .btn2 { padding: 0 16px; }
.body-entries { margin-top: 10px; font-size: 13px; }
.body-entries .hist-row { align-items: center; }
.chips.c2 { grid-template-columns: 1fr 1fr; margin-bottom: 2px; }
.chips.c2 button { font-size: 15px; padding: 10px 4px; }

/* ---------- body measurements ---------- */
.tiles.t3 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tiles.t3 .tile { padding: 8px 9px; }
.tiles.t3 .tile-value { font-size: 17px; }
.tiles.t3 .delta { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value small { font: 600 11px var(--body); color: var(--muted); }
.tile-btn { display: block; width: 100%; text-align: left; }
.tile-btn.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tile-btn.active .tile-label { color: var(--accent); }
.tile-btn.empty { border-style: dashed; background: transparent; }
.tile-btn.empty .tile-value { color: var(--muted); }
.body-why { margin: -2px 0 0; }
.link-muted.body-all { margin-top: 4px; padding: 8px 0; color: var(--accent); font-weight: 600; }
.link-muted.more { margin-top: 4px; padding: 8px 0; color: var(--accent); font-weight: 600; }
.measure-form .helper { font-style: normal; font-size: 11px; font-weight: 500; color: #b9a4ff; }
.body-more { margin-top: 10px; }
.body-more summary, .body-entries summary { color: var(--muted); cursor: pointer; padding: 4px 0; font-size: 13px; }
.measure-form label { grid-template-columns: 1fr 104px; }
.measure-form label span { color: var(--text); }
.measure-form label small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.measure-form input { padding: 9px 6px; text-align: center; }
.measure-form input::placeholder { font: 500 12.5px var(--body); }
.btn2.wide { display: block; width: 100%; margin-top: 10px; padding: 11px 6px; color: var(--accent); }
.week-metrics { display: grid; grid-template-columns: repeat(4, 1fr); padding: 2px 0 6px; overflow: visible; }
.week-metrics button { padding: 6px 2px; font-size: 12.5px; text-align: center; white-space: nowrap; }
.ch-ref { stroke: var(--text); stroke-opacity: .45; stroke-width: 1.5; stroke-dasharray: 4 4; }
.ch-ref-label { fill: var(--text); fill-opacity: .7; }

/* ---------- live feedback ---------- */
.set-fb { margin: 8px 0 0; padding: 7px 10px; border-radius: 9px; font-size: 13px; line-height: 1.35; background: var(--panel-2); }
.set-fb.good { color: var(--good); background: #0e1f1a; }
.set-fb.warn { color: var(--warn); background: #241f0e; }
.set-fb.info { color: var(--text); }
.tag.over { border-color: var(--warn); color: var(--warn); }

/* ---------- workout type ---------- */
.wk-focus { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; text-align: left; }
.wk-focus b { color: var(--accent); font: 600 14px var(--head); }
.wk-focus i { flex: none; font-style: normal; color: var(--muted); font-size: 12px; }
.wk-stats { flex-wrap: wrap; row-gap: 4px; }
.wk-skip { margin: 6px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--warn); }
.rec-card { display: block; width: 100%; margin-top: 14px; padding: 12px 14px; text-align: left; border-radius: var(--radius); background: linear-gradient(120deg, #10202a, var(--panel) 75%); border: 1px solid var(--accent); }
.rec-card small { display: block; font: 600 11px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.rec-card b { display: block; font: 700 20px/1.25 var(--head); margin-top: 2px; }
.rec-card span { display: block; font-size: 13px; color: #b9c4d6; margin-top: 2px; }
.focus-note { margin-top: 4px !important; }
.focus-note.good { color: var(--good) !important; }
.focus-note.warn { color: var(--warn) !important; }
.focus-groups { margin-bottom: 8px; }
.focus-groups button { display: flex; align-items: center; justify-content: center; gap: 2px; }
.focus-groups .dot { margin-right: 4px; }
.focus-other { margin-top: 14px; }
.btn2.active { border-color: var(--accent); color: var(--accent); }

/* ---------- muscle map in workout ---------- */
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.map-head h2 { margin: 0; }
.link-inline { padding: 2px 0; font-size: 13px; color: var(--accent); }
.seg-sm .seg-btn { padding: 6px 0; font-size: 12px; }
.figures.wk-figs { max-width: 240px; margin: 10px auto 0; }
.map-hint { margin-top: 10px; text-align: center; }
.map-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tag.in { border-color: #1d4a40; color: var(--accent); }
.tag.in::after { content: ' ✓'; }

/* ---------- cardio ---------- */
.cardio-card .set-rows { margin-top: 0; margin-bottom: 10px; }
.cardio-card .set-rows li { grid-template-columns: 22px auto 1fr 34px; }
.cardio-card .rpe-tag { text-align: right; }
.cardio-acts button { font-size: 13px; padding: 9px 2px 8px; }
.st-row.st-one { grid-template-columns: 1fr; }
.st-row.st-one input { height: 46px; font-size: 20px; }
.st-row.st-one input::placeholder { font: 500 13px var(--body); color: var(--muted); }
.cardio-int button { font-size: 14px; padding: 9px 4px 7px; }
.cardio-week { margin-top: 10px; text-align: center; }
.link-muted.add-cardio { margin-top: 6px; color: var(--accent); }
.cardio-sum { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cardio-sum-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cardio-sum-head span { font-size: 13px; color: var(--muted); }
.cardio-sum-head b { font: 700 18px var(--head); }
.cardio-sum-head small { font: 500 12px var(--body); color: var(--muted); }
.cardio-sum .hint { margin-top: 6px; }

/* ---------- подбадривания ---------- */
/* Баннер: стекло с градиентной кромкой, цвет кромки и заголовка — по событию */
.cheer {
  --c1: var(--accent); --c2: var(--accent-2); --glow: rgba(39, 225, 193, .32);
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 29;
  width: min(488px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid transparent; border-radius: 16px; overflow: hidden; cursor: pointer;
  background: linear-gradient(rgba(12, 17, 26, .95), rgba(12, 17, 26, .95)) padding-box, linear-gradient(120deg, var(--c1), var(--c2)) border-box;
  box-shadow: 0 14px 36px -12px var(--glow), 0 2px 10px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.cheer.record { --c1: #ffe27a; --c2: #ff9d2e; --glow: rgba(255, 196, 61, .5); }
.cheer.target, .cheer.beat { --c1: var(--accent); --c2: #6fb6ff; }
.cheer.norm { --c1: var(--good); --c2: var(--accent); --glow: rgba(31, 224, 143, .32); }
.cheer.milestone { --c1: var(--accent-2); --c2: #8a6cff; --glow: rgba(255, 46, 136, .32); }
.cheer.info { --c1: #6fb6ff; --c2: #8a6cff; --glow: rgba(111, 182, 255, .28); }
/* Блик пробегает по баннеру один раз */
.cheer::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .13) 50%, transparent 70%);
}
.cheer.glint::after { animation: glint 1.1s .2s ease-out; }
@keyframes glint { to { transform: translateX(110%); } }
.cheer-ico, .hero-ico {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  font-size: 22px; font-style: normal; line-height: 1;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 22px -4px var(--glow);
}
.cheer.record .cheer-ico { animation: trophy .9s cubic-bezier(.2, .8, .2, 1.4); }
@keyframes trophy { from { transform: scale(.4) rotate(-18deg); } 60% { transform: scale(1.15) rotate(6deg); } }
.cheer-body, .hero > div { min-width: 0; }
.cheer-body b, .hero b {
  display: block; font: 700 15px/1.2 var(--head); letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cheer-body span, .hero span { display: block; margin-top: 3px; font-size: 13px; line-height: 1.35; color: #c9d3e3; }
@media (prefers-reduced-motion: reduce) { .cheer.glint::after, .cheer.record .cheer-ico { animation: none; } }

/* Заголовок итогов — тот же стиль, но в потоке страницы */
.hero {
  --c1: var(--accent); --c2: var(--accent-2); --glow: rgba(39, 225, 193, .3);
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 16px;
  border: 1px solid transparent;
  background: linear-gradient(160deg, #101a28, var(--panel) 70%) padding-box, linear-gradient(120deg, var(--c1), var(--c2)) border-box;
  box-shadow: 0 12px 30px -16px var(--glow);
}
.hero.record { --c1: #ffe27a; --c2: #ff9d2e; --glow: rgba(255, 196, 61, .55); }
.hero.beat { --c1: var(--accent); --c2: #6fb6ff; }
.hero.norm { --c1: var(--good); --c2: var(--accent); }
.hero b { font-size: 17px; }

/* Золото рекордов */
.card.records { border-color: rgba(255, 196, 61, .35); background: linear-gradient(160deg, rgba(255, 196, 61, .08), transparent 60%), var(--card-bg); box-shadow: var(--card-shadow), 0 0 26px -12px rgba(255, 196, 61, .5); }
.card.records h2 { color: #ffd25e; }

/* «Получилось» в итогах: зелёная кромка, с рекордами — золотая */
.card.wins { border-color: rgba(31, 224, 143, .28); background: linear-gradient(160deg, rgba(31, 224, 143, .06), transparent 60%), var(--card-bg); }
.card.wins:not(.records) h2 { color: var(--good); }
.win { display: flex; gap: 10px; margin: 0; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: #b9c4d6; }
.card h2 + .win { border-top: 0; padding-top: 0; }
.win i { flex: none; width: 20px; font-style: normal; text-align: center; color: var(--good); }
.win b { font-weight: 600; color: var(--text); }
.wins-more summary { padding: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--good); cursor: pointer; list-style: none; }
.wins-more summary::-webkit-details-marker { display: none; }
.wins-more[open] summary { display: none; }
.ex-best.rec { color: #ffd25e; font-weight: 600; text-shadow: 0 0 14px rgba(255, 196, 61, .35); }

/* Подход лучше того же подхода в прошлый раз */
.set-rows .up { margin-left: 6px; font: 700 10px/1 var(--head); font-style: normal; color: var(--good); vertical-align: 2px; text-shadow: 0 0 8px rgba(31, 224, 143, .6); }
.note.target { border-color: #1d3f4a; }
.note.target button { background: #142a33; }

/* Полоса плана в шапке тренировки */
.plan-prog { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.plan-prog span { font: 600 11px var(--head); letter-spacing: .12em; text-transform: uppercase; }
.plan-prog b { font: 700 13px var(--head); color: var(--text); }
.plan-bar { flex: 1; display: flex; gap: 4px; }
.plan-bar i { flex: 1; height: 6px; border-radius: 3px; background: #1c2534; transition: background .3s, box-shadow .3s; }
.plan-bar i.on { background: linear-gradient(90deg, #13c9a9, var(--accent)); box-shadow: 0 0 10px rgba(39, 225, 193, .45); }
.plan-prog.full .plan-bar i.on { background: linear-gradient(90deg, #d42a7c, var(--accent-2)); box-shadow: 0 0 10px rgba(255, 46, 136, .45); }
.plan-prog.full b { color: var(--accent-2); }

/* Неделя точками на стартовом экране */
.week-strip { margin: -2px 0 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.wk-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.wk-days span { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wk-days i { width: 12px; height: 12px; border-radius: 50%; background: #1c2534; box-shadow: inset 0 0 0 1px #263248; }
.wk-days .on i { background: radial-gradient(circle at 35% 30%, #8ff5e2, var(--accent)); box-shadow: 0 0 12px rgba(39, 225, 193, .6); }
.wk-days .today i { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.wk-days .future { opacity: .45; }
.wk-days small { font: 600 10px var(--head); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.wk-days .today small { color: var(--text); }
.week-strip p { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.week-strip p b { font: 700 15px var(--head); color: var(--text); }
.week-strip p b.ok { color: var(--accent); }
.week-strip .streak { color: #ffb36b; font-weight: 600; }

/* Последние секунды отдыха: таймер пульсирует розовым */
.timer.final { border-color: var(--accent-2); animation: final-beat 1s ease-in-out infinite; }
.timer.final .ring-fg { stroke: var(--accent-2); }
@keyframes final-beat { 50% { box-shadow: 0 0 0 6px rgba(255, 46, 136, .18), 0 8px 30px rgba(0, 0, 0, .5); } }
@media (prefers-reduced-motion: reduce) { .timer.final { animation: none; } }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 41; }

/* ---------- ИИ-тренер ---------- */
.coach-head { background: linear-gradient(150deg, rgba(138, 108, 255, .14), transparent 55%), var(--card-bg); border-color: rgba(138, 108, 255, .3); }
.coach-id { display: flex; gap: 12px; align-items: center; }
.coach-id h2 { margin: 0 0 2px; color: #c9b8ff; }
.coach-id p { margin: 0; font-size: 13px; color: #b9c4d6; }
.coach-ava {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font: 700 22px/1 var(--head); font-style: normal; color: #fff;
  background: conic-gradient(from 210deg, #8a6cff, var(--accent), var(--accent-2), #8a6cff); box-shadow: 0 0 24px -4px rgba(138, 108, 255, .7);
}
.coach-quota { margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 13px; color: var(--muted); }
.coach-quota b { color: var(--text); font-family: var(--head); }
.coach-quota.empty { color: var(--warn); }
.coach-chat { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cb { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.cb p { margin: 0; }
.cb p + p { margin-top: 6px; }
.cb .cb-li { position: relative; padding-left: 14px; }
.cb .cb-li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.cb.me { align-self: flex-end; background: linear-gradient(135deg, #13c9a9, #1fa991); color: #03201a; border-bottom-right-radius: 4px; font-weight: 500; white-space: pre-wrap; }
.cb.coach { align-self: flex-start; background: var(--card-bg); border: 1px solid rgba(138, 108, 255, .28); border-bottom-left-radius: 4px; box-shadow: 0 10px 26px -18px rgba(138, 108, 255, .8); }
.cb.err { align-self: center; max-width: 100%; background: transparent; border: 1px dashed #5a3a1c; color: var(--warn); font-size: 13px; text-align: center; }
.cb.typing { display: flex; gap: 5px; padding: 14px 16px; }
.cb.typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9a4ff; animation: typing 1.2s ease-in-out infinite; }
.cb.typing i:nth-child(2) { animation-delay: .15s; }
.cb.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .cb.typing i { animation: none; opacity: .7; } }
.coach-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 14px; padding-bottom: 2px; scrollbar-width: none; }
.coach-chips button { flex: none; max-width: 260px; padding: 8px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid #2f2a50; color: #c9b8ff; font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach-input { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; padding: 8px; border-radius: 16px; background: var(--panel); border: 1px solid #2a3850; }
.coach-input:focus-within { border-color: #8a6cff; box-shadow: 0 0 0 3px rgba(138, 108, 255, .18); }
.coach-input textarea { flex: 1; min-width: 0; resize: none; background: none; border: 0; outline: none; color: var(--text); font: 15px/1.4 var(--body); padding: 6px 4px; }
.coach-input.off { opacity: .6; }
.coach-send { flex: none; width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #8a6cff, var(--accent-2)); color: #fff; font-size: 17px; box-shadow: 0 0 18px -4px rgba(138, 108, 255, .8); }
.coach-send:disabled { opacity: .4; box-shadow: none; }
.coach-meta { display: flex; justify-content: space-between; align-items: center; margin: 6px 4px 0; }

.pro-card { border-color: rgba(255, 196, 61, .35); background: linear-gradient(160deg, rgba(255, 196, 61, .1), transparent 55%), var(--card-bg); }
.pro-card .eyebrow { color: #ffd25e; }
.pro-list { margin: 10px 0 0; padding: 0; list-style: none; }
.pro-list li { position: relative; padding: 4px 0 4px 22px; font-size: 14px; color: #c9d3e3; }
.pro-list li::before { content: '✦'; position: absolute; left: 0; color: #ffd25e; }
.cta.pro { background: linear-gradient(90deg, #ffb52e, #ffe27a); color: #2a1a00; box-shadow: 0 0 24px rgba(255, 196, 61, .35); }
.btn2.coach-build { display: block; width: 100%; margin-top: 10px; padding: 11px 6px; color: #c9b8ff; border-color: #3a2f55; }

/* Тренировка от тренера: сборка в выборе типа, предпросмотр, план в карточке упражнения */
.ai-build { border-color: rgba(138, 108, 255, .35); background: linear-gradient(150deg, rgba(138, 108, 255, .14), transparent 55%), var(--card-bg); }
.ai-build h2 { color: #c9b8ff; }
.ai-build textarea {
  display: block; width: 100%; margin-top: 10px; padding: 9px 10px; resize: none; border-radius: 12px; outline: none;
  background: var(--panel); border: 1px solid #2a3850; color: var(--text); font: 14px/1.4 var(--body);
}
.ai-build textarea:focus { border-color: #8a6cff; box-shadow: 0 0 0 3px rgba(138, 108, 255, .18); }
.cta.ai { background: linear-gradient(90deg, #8a6cff, var(--accent-2)); color: #fff; box-shadow: 0 0 22px rgba(138, 108, 255, .3); }
.ai-busy { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--panel-2); font-size: 13px; color: #c9b8ff; }
.ai-busy .dots { display: flex; gap: 5px; }
.ai-busy .dots i { width: 7px; height: 7px; border-radius: 50%; background: #b9a4ff; animation: typing 1.2s ease-in-out infinite; }
.ai-busy .dots i:nth-child(2) { animation-delay: .15s; }
.ai-busy .dots i:nth-child(3) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .ai-busy .dots i { animation: none; opacity: .7; } }
.ai-last { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-align: left; background: var(--panel-2); border: 1px solid #3a2f55; font-size: 13px; color: var(--text); }
.ai-last i { flex: none; font-style: normal; color: #c9b8ff; }
.ai-meta { margin: 8px 0 0; font: 600 13px var(--head); letter-spacing: .04em; color: #c9b8ff; }
.ai-plan { margin-top: 12px; }
.ai-ex { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; }
.ai-ex + .ai-ex { border-top: 1px solid var(--line); }
.ai-ex b { font-size: 14px; }
.ai-ex span { font-size: 13px; color: var(--accent); }
.ai-ex small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.btn2.ai-back { display: block; width: 100%; margin-top: 10px; padding: 11px 6px; }
.wk-ai { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: #b9c4d6; }
.wk-ai b { color: #c9b8ff; }
.ex-ai { margin: 4px 0 8px; font-size: 12.5px; line-height: 1.4; color: #c9b8ff; }
.note.target.ai { border-color: #3a2f55; }
.note.target.ai button { background: #221b3a; }

/* «Тренер, глянь»: кнопка в шапке тренировки, подсказка у подхода ниже цели, быстрые ответы */
.btn2.ai-check { display: block; width: 100%; margin-top: 10px; padding: 10px 6px; color: #c9b8ff; border-color: #3a2f55; }
.btn2.ai-check.busy { opacity: .7; }
.btn2.ai-check.ready { border-color: #8a6cff; box-shadow: 0 0 16px rgba(138, 108, 255, .3); }
.note.ai-nudge { border-color: #3a2f55; color: #d9cfff; }
.note.ai-nudge button { background: #221b3a; color: #c9b8ff; }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.check-chips button { padding: 7px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid #2f2a50; color: #c9b8ff; font-size: 13px; }
.check-drop { margin-top: 10px; }

/* Итоги: поделиться и вердикт */
.btn2.share { color: var(--accent); }
.btn2.ai { color: #c9b8ff; border-color: #3a2f55; }
.btn2.busy { animation: busy 1.2s ease-in-out infinite; }
@keyframes busy { 50% { opacity: .55; } }
.btn2.wide { width: 100%; margin-top: 8px; padding: 12px 0; }
.card.verdict { border-color: rgba(138, 108, 255, .35); background: linear-gradient(160deg, rgba(138, 108, 255, .12), transparent 60%), var(--card-bg); }
.card.verdict h2 { color: #c9b8ff; }
.card.verdict p { margin: 0; font-size: 14px; line-height: 1.5; }
.card.verdict p + p { margin-top: 6px; }
.card.verdict .cb-li { position: relative; padding-left: 14px; }
.card.verdict .cb-li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: #b9a4ff; }
.share-img { display: block; width: min(100%, 300px); margin: 14px auto 0; border-radius: 16px; border: 1px solid var(--card-border); box-shadow: 0 20px 50px -20px rgba(39, 225, 193, .45); }
.share-acts { text-align: center; }
a.cta { display: block; text-align: center; text-decoration: none; }

/* Техника упражнения: доля подхода на мышцы, подсказки, частая ошибка — раскрывается по тапу */
.ex-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ex-meta .ex-goal { margin: 0; }
.ex-tech-btn { flex: none; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--muted); }
.ex-tech-btn.on { color: var(--accent); border-color: rgba(39, 225, 193, .5); }
.ex-tech { margin-top: 10px; padding: 11px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.tech-load { display: grid; gap: 6px; }
.tech-load span { display: grid; grid-template-columns: 1fr 72px 36px; align-items: center; gap: 8px; font-size: 12.5px; }
.tech-load em { font-style: normal; color: var(--text); }
.tech-load i { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tech-load u { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.tech-load b { text-align: right; font: 600 12px var(--head); }
.tech-load .minor em, .tech-load .minor b { color: var(--muted); }
.tech-load .minor u { background: #36505c; }
.tech-note { margin: 7px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.tech-how { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.4; }
.tech-how li + li { margin-top: 3px; }
.tech-err { margin: 9px 0 0; font-size: 12.5px; line-height: 1.35; color: #ffb3a1; }
.tech-err span { display: block; margin-bottom: 2px; font: 600 10.5px var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Карточка мышцы: что на неё делал и откуда усталость */
.md-sub { margin: 16px 0 6px; font: 600 11px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.md-why { margin: 0 0 8px; font-size: 13.5px; line-height: 1.4; }
.md-hist { padding: 8px 0; border-top: 1px solid var(--line); }
.md-hist-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.md-hist-head b { font: 600 13px var(--head); }
.md-hist-head small { color: var(--muted); font-size: 12px; }
.md-hist-head span { margin-left: auto; font: 600 13px var(--head); color: var(--bad); }
.md-hist p { margin: 5px 0 0; }
.md-hist p span { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.md-hist p span i { font-style: normal; color: var(--muted); font-size: 12px; }
.md-hist p small { display: block; font-size: 12px; color: var(--muted); }
