/* IRONly Mini App — дизайн-система по UX-спецификациям 1.0–2.0.
   Синий — выбор пользователя, мятный — только совет IRONly (UX 2.0).
   Цвета — токены; тёмная тема по системе или по VK (data-theme). */
:root {
  --bg: #f5f7fa;          /* canvas */
  --card: #ffffff;        /* surface */
  --text: #161b25;        /* ink */
  --muted: #758093;
  --line: #e7ebf1;
  --accent: #2789ed;      /* blue */
  --accent-text: #ffffff;
  --accent-soft: #eaf4ff; /* blue-soft: выбранные состояния */
  --positive: #1f9d55;
  --negative: #e5484d;
  --stop: #c74a52;        /* «Стоп» и остановка — спокойный красный только здесь */
  --stop-soft: #fbeaeb;
  --recommend: #0d9c86;      /* совет IRONly: текст и обводка */
  --recommend-soft: #e8faf5; /* совет IRONly: подложка — не выбрано */
  --warn-soft: #fff6e5;
  --chip: #eef1f5;
  --chart: #2789ed;
  --muscle: #2789ed;
  --body: #e9edf2;
  --body-line: #c9d1dc;
  --shadow: 0 1px 3px rgba(22, 27, 37, 0.06);
  --r-card: 18px;
  --r-btn: 13px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1117;
    --card: #1a1f27;
    --text: #e9edf3;
    --muted: #8f99ab;
    --line: #2a313c;
    --accent: #4a9df8;
    --accent-soft: #1b2b40;
    --stop: #e07a81;
    --stop-soft: #3a2226;
    --recommend: #4cc9b4;
    --recommend-soft: #12302b;
    --warn-soft: #33291a;
    --chip: #252c36;
    --chart: #4a9df8;
    --muscle: #4a9df8;
    --body: #2a313c;
    --body-line: #3a4350;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1117;
  --card: #1a1f27;
  --text: #e9edf3;
  --muted: #8f99ab;
  --line: #2a313c;
  --accent: #4a9df8;
  --accent-soft: #1b2b40;
  --stop: #e07a81;
  --stop-soft: #3a2226;
  --recommend: #4cc9b4;
  --recommend-soft: #12302b;
  --warn-soft: #33291a;
  --chip: #252c36;
  --chart: #4a9df8;
  --muscle: #4a9df8;
  --body: #2a313c;
  --body-line: #3a4350;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
}
/* Под нижней панелью разделов — запас, чтобы она не закрывала последний элемент. */
body.has-tabbar main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 14px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 8px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; padding: 40px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-label { font-size: 15px; font-weight: 600; color: var(--muted); margin: 18px 2px 8px; }

.card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: var(--gutter);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* Шапка внутренних экранов: «‹» слева, заголовок по центру, действие справа. */
.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 4px;
  margin: 0 -6px 10px;
  min-height: 44px;
}
.topbar .title { font-size: 17px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar > :last-child:not(.title) { justify-self: end; }
/* «‹» — первая кнопка шапки на всех экранах. */
.topbar .back, .topbar > .icon-btn:first-child { font-size: 30px; line-height: 1; color: var(--accent); font-weight: 300; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 16px; font-size: 16px; }

/* Кнопки */
button, .btn {
  font: inherit;
  border: 0;
  border-radius: var(--r-btn);
  padding: 12px 14px;
  background: var(--chip);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-positive { background: var(--positive); color: #fff; font-weight: 600; }
.btn-negative { color: var(--negative); }
.btn-link { background: none; color: var(--accent); padding: 8px 4px; font-weight: 500; }
.btn-block { display: block; width: 100%; margin-top: 8px; }
.btn-big { padding: 16px; font-size: 17px; }
.btn-soft { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* Зона нажатия не меньше 44×44, даже если значок маленький. */
.icon-btn {
  background: none;
  padding: 6px 8px;
  font-size: 20px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  color: var(--text);
}
.btn-link.btn-negative { color: var(--negative); }

/* Пикеры */
.picker { margin: 12px 0 4px; }
.picker-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; font-size: 24px; padding: 0; flex: none; border-radius: 50%; }
.stepper .value {
  flex: 1;
  /* Без min-width: 0 поле ввода в flex не сжимается и выталкивает «+» за край. */
  min-width: 0;
  width: 100%;
  text-align: center;
  font: inherit;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 6px 0;
}
.stepper .value:focus { outline: 2px solid var(--accent); }
.sheet .segmented button.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 15px;
  background: var(--chip);
}
.chip.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll .chip { flex: none; white-space: nowrap; }
.chips.scroll::-webkit-scrollbar { display: none; }

.inputs { display: flex; gap: 10px; margin-top: 8px; }
.inputs label { flex: 1; }
input[type="text"], input[type="number"], input[type="search"], input[type="datetime-local"], select {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--card);
  color: var(--text);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--chip); border-radius: var(--r-btn); padding: 0 14px; margin-bottom: 12px;
}
.search input { border: 0; background: none; padding: 13px 0; font-size: 16px; }
.search input:focus { outline: none; }
.search svg { flex: none; color: var(--muted); }

/* Списки */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.list .tap { flex: 1; min-width: 0; background: none; text-align: left; padding: 0; border-radius: 0; }
.list li.current, .list li.current .tap { color: var(--accent); font-weight: 600; }
.list li.divider { padding: 14px 0 4px; border-bottom: 0; }

/* Плитки групп мышц на стартовом экране каталога */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.tile {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 12px 4px;
  text-align: center;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.tile-icon { font-size: 26px; line-height: 1.2; margin-bottom: 2px; }
.plan-hint { margin: 0 0 10px; }

/* ───────── Нижняя панель разделов ───────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar .tabs { display: flex; width: 100%; max-width: 560px; }
.tab {
  flex: 1; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); font-size: 12px; font-weight: 500; border-radius: 10px;
}
.tab svg { width: 26px; height: 26px; }
.tab.active { color: var(--accent); }

/* ───────── Главная ───────── */
.home-head { display: flex; align-items: center; justify-content: space-between; }
.home-head h1 { margin: 6px 0 2px; }
.hero { display: flex; gap: 8px; align-items: stretch; position: relative; overflow: hidden; }
.hero-body { flex: 1; min-width: 0; z-index: 1; }
.hero-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.hero-meta { color: var(--muted); margin: 0 0 14px; }
.hero-figure { width: 120px; flex: none; margin: -8px -8px 0 0; }
.hero-figure svg { width: 100%; height: auto; display: block; }
.hero .btn-primary { margin-top: 2px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  background: var(--card); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); position: relative;
}
.quick b { font-size: 17px; margin-top: 8px; }
.quick .muted { font-size: 13px; line-height: 1.3; padding-right: 14px; }
.quick .chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 22px; }
.round-icon {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.round-icon svg { width: 22px; height: 22px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin-top: 12px; }
.week span { font-size: 13px; color: var(--muted); }
.week i {
  display: grid; place-items: center; margin: 6px auto 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--chip); color: transparent; font-style: normal;
}
.week i::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: 0.6; }
.week i.done { background: var(--accent); }
.week i.done::after { content: '✓'; width: auto; height: auto; background: none; color: #fff; opacity: 1; font-size: 15px; font-weight: 700; }
.week i.today { box-shadow: inset 0 0 0 2px var(--accent); }
.nav-list { padding: 4px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none;
  padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line);
}
.nav-item:last-child { border-bottom: 0; }
.nav-item .grow b { display: block; font-weight: 600; }
.nav-item .grow span { font-size: 13px; color: var(--muted); }
.nav-item .chev { color: var(--muted); font-size: 22px; }
.square-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--chip); color: var(--text);
}
.square-icon svg { width: 22px; height: 22px; }

/* ───────── «Что тренируем?» ───────── */
.muscle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muscle {
  position: relative; background: var(--card); border-radius: var(--r-card); padding: 10px 8px 12px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); text-align: center; font-weight: 600; font-size: 16px;
}
.muscle svg { width: 100%; max-width: 132px; height: 92px; display: block; margin: 0 auto 6px; }
.muscle.active { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.check {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; background: var(--card);
}
.active > .check, .check.on { background: var(--accent); box-shadow: none; }
.active > .check::after, .check.on::after { content: '✓'; color: #fff; font-size: 15px; font-weight: 700; }
.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.extra {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--card);
  border-radius: var(--r-card); padding: 12px 44px 12px 12px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  font-weight: 500; min-height: 56px;
}
.extra .check { top: 50%; transform: translateY(-50%); }
.extra.active { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.extra .ico { font-size: 22px; }
.setting-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card);
  border-radius: var(--r-card); padding: 14px 16px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); margin-top: 12px;
}
.setting-row .grow { font-weight: 500; }
.setting-row .chev { color: var(--muted); font-size: 22px; }
.setting-row .ico { color: var(--accent); display: grid; place-items: center; }
.setting-row .ico svg { width: 24px; height: 24px; }

/* ───────── План тренировки ───────── */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px;
  background: var(--chip); font-size: 15px; font-weight: 500;
}
.pill svg { width: 18px; height: 18px; color: var(--muted); }
.program-name { color: var(--muted); font-size: 14px; margin: 4px 0 4px; }
.plan-list { list-style: none; margin: 8px 0 0; padding: 0; }
.plan-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.plan-row .num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--chip); display: grid; place-items: center;
  font-weight: 600; color: var(--muted); flex: none;
}
.plan-row .grow b { display: block; font-weight: 600; font-size: 16px; line-height: 1.25; }
.plan-row .grow span { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.plan-row.flash { animation: flash 1.2s ease-out; border-radius: 12px; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .plan-row.flash { animation: none; } }
.dots-btn { font-size: 22px; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.more-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--chip);
  border-radius: var(--r-btn); padding: 14px 16px; margin-top: 4px; color: var(--muted); font-weight: 500;
}
.more-row .grow { color: var(--muted); }
.add-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; color: var(--accent); font-weight: 600; padding: 16px 2px; border-top: 1px solid var(--line); border-radius: 0; margin-top: 8px; font-size: 17px; }
.add-row .plus { font-size: 26px; font-weight: 400; line-height: 1; }
/* Главная кнопка экрана — всегда под пальцем, даже в длинном списке */
.sticky-cta {
  position: sticky; bottom: 0; margin: 4px calc(-1 * var(--gutter)) 0;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 26%);
}

/* Нижнее меню (действия строки, список упражнений) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 22, 0.42); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
  background: var(--card); border-radius: 22px 22px 0 0; padding: 8px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
}
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { margin: 0 0 8px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; background: none; text-align: left;
  padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 17px;
}
.sheet-item:last-child { border-bottom: 0; }
.sheet-item.danger { color: var(--stop); }
.sheet-item .ico { width: 26px; text-align: center; }
.sheet-item .grow small { display: block; color: var(--muted); font-size: 13px; }
.sheet-item.current { color: var(--accent); font-weight: 600; }
.sheet-item .badge { font-size: 14px; }

/* ───────── Замена упражнения ───────── */
.instead { display: flex; align-items: center; gap: 12px; background: var(--chip); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 12px; }
.instead .grow { font-size: 16px; }
.instead b { font-weight: 700; }
.instead .thumb { width: 72px; height: 54px; }
.thumb { width: 84px; height: 64px; flex: none; border-radius: 12px; background: var(--chip); display: grid; place-items: center; overflow: hidden; font-size: 26px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.alt {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card);
  border-radius: var(--r-card); padding: 10px 50px 10px 10px; margin-bottom: 10px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.alt .check { top: 50%; transform: translateY(-50%); right: 14px; }
.alt.active { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.alt.taken { opacity: 0.55; }
.alt b { display: block; font-size: 16px; font-weight: 600; }
.alt span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ───────── Активная тренировка ───────── */
.ex-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px; }
.ex-top { display: flex; gap: 14px; align-items: center; }
.ex-top .thumb { width: 132px; height: 100px; background: var(--chip); }
.ex-top .grow { display: flex; flex-direction: column; gap: 8px; }
.technique { background: none; color: var(--accent); padding: 0; text-align: left; font-weight: 600; font-size: 16px; }
.ex-prev { color: var(--muted); font-size: 15px; }
.ex-prev b { color: var(--text); font-variant-numeric: tabular-nums; }
.sets-head { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; }
.sets-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.set-track { display: flex; align-items: flex-start; justify-content: space-between; position: relative; margin: 0 10px 6px; }
.set-track::before { content: ''; position: absolute; left: 14px; right: 14px; top: 13px; height: 2px; background: var(--line); }
.set-track .fill { position: absolute; left: 14px; top: 13px; height: 2px; background: var(--accent); }
.set-dot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; padding: 0; min-width: 28px; z-index: 1; font-size: 14px; color: var(--muted); }
.set-dot i { width: 28px; height: 28px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); display: grid; place-items: center; font-style: normal; }
.set-dot.done i { background: var(--accent); box-shadow: none; color: #fff; font-weight: 700; }
.set-dot.done i::after { content: '✓'; }
.set-dot.now i { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 6px var(--card); background: var(--accent); }
.set-dot.extra i { box-shadow: inset 0 0 0 2px var(--accent); }
.set-dot small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-dot.editing i { outline: 3px solid var(--accent-soft); }
.values { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 12px 0; }
.value-card { border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 10px; text-align: center; background: var(--card); }
.value-card.wide { grid-column: 1 / -1; }
.value-card .picker-label { margin-bottom: 2px; }
.value-card input {
  width: 100%; text-align: center; border: 0; background: none; color: var(--text); font: inherit;
  font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0; letter-spacing: -0.02em;
}
.value-card input:focus { outline: 2px solid var(--accent); border-radius: 10px; }
.value-card .pm { display: flex; justify-content: center; gap: clamp(8px, 4vw, 22px); margin-top: 6px; }
.value-card .pm button { width: 52px; height: 52px; border-radius: 50%; font-size: 26px; padding: 0; }
.value-card .bw { margin-top: 8px; background: none; color: var(--accent); font-size: 14px; padding: 4px; }
.value-card .bw.on { font-weight: 700; }
.rest-card { display: flex; align-items: center; gap: 12px; }
.rest-card .round-icon { background: var(--chip); color: var(--text); }
.rest-card .grow span { display: block; color: var(--muted); font-size: 14px; }
.rest-card .grow b { font-size: 26px; font-variant-numeric: tabular-nums; }
.rest-card.over .grow b { color: var(--positive); }
.next-card { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--card); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; font-size: 16px; }
.next-card .chev { color: var(--muted); font-size: 22px; }
.ex-links { display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }
.ex-links .btn-link { min-height: 44px; font-size: 14px; padding: 8px 2px; }
.muted-link { color: var(--muted); }
.btn-negative.strong { font-weight: 600; }
.cardio-result { font-size: 17px; margin: 4px 0 2px; }
.cardio-result b { font-variant-numeric: tabular-nums; }
.time-input { flex: 1; }
.time-input .row { gap: 4px; }
.time-input input { flex: 1; min-width: 0; text-align: center; }
.time-sep { font-size: 20px; font-weight: 600; color: var(--muted); }
.technique-view { text-align: center; }
.technique-view img { width: 100%; max-height: 50vh; object-fit: contain; }

/* Подходы прошлой тренировки и правка */
.sets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.set {
  padding: 6px 11px;
  border-radius: 10px;
  background: var(--chip);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.set.best { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
button.set { min-height: 36px; line-height: 1.2; }
.set.editing { outline: 2px solid var(--accent); outline-offset: 1px; }
.edit-banner { margin: 10px 0 0; }
.set.add-set { background: none; border: 1px dashed var(--muted); color: var(--muted); }
.set-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.set-form label input, input[type="datetime-local"] { box-sizing: border-box; font-size: 16px; }

/* Предупреждение перед завершением: что не попадёт в историю. */
.warn-card { border-left: 4px solid #f5a524; margin-top: 8px; }
.warn-card p { margin: 0 0 4px; }
.reopen { margin-top: 12px; }

.stats { display: flex; gap: 12px; }
.stat { flex: 1; background: var(--card); border-radius: var(--r-card); padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; }

.banner {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: var(--r-card);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.banner b { color: var(--accent); }

.badge { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fav { color: #f5a524; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: rgba(22, 27, 37, 0.92);
  color: #fff;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 15px;
  z-index: 30;
  display: flex; align-items: center; gap: 12px; width: max-content;
}
.toast[hidden] { display: none; }
.toast.error { background: var(--negative); }
.toast-action {
  background: none;
  color: #8ec5ff;
  font-weight: 600;
  padding: 6px 4px;
  min-height: 36px;
  white-space: nowrap;
}

/* ───────── История ───────── */
.history-item { display: block; width: 100%; text-align: left; color: inherit; font: inherit; }
.list li.col { flex-direction: column; align-items: stretch; gap: 0; }
.calendar .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calendar .cal-head b { font-size: 19px; }
.calendar .cal-head button { background: none; color: var(--text); font-size: 26px; padding: 4px 12px; min-height: 44px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.cal-grid .dow { font-size: 13px; color: var(--muted); padding-bottom: 6px; }
.cal-day {
  position: relative; background: none; padding: 0; height: 44px; border-radius: 50%; font-size: 17px;
  width: 44px; margin: 0 auto; font-variant-numeric: tabular-nums;
}
.cal-day.has::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.cal-day.sel { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.sel.has::after { background: #fff; }
.cal-day.today:not(.sel) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day:disabled { opacity: 1; color: var(--muted); }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 2px 10px; }
.hist-head h2 { margin: 0; font-size: 22px; }
.hist-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card);
  border-radius: var(--r-card); padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.hist-row .square-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 24px; }
.hist-row b { display: block; font-weight: 600; font-size: 16px; }
.hist-row .meta { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.hist-row .chev { color: var(--muted); font-size: 22px; }

/* ───────── Прогресс ───────── */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--chip); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.segmented button { background: none; padding: 10px; border-radius: 11px; font-weight: 500; color: var(--muted); }
.segmented button.active { background: var(--accent); color: #fff; font-weight: 600; }
.metric-label { color: var(--muted); font-size: 15px; margin: 0 0 2px; }
.metric-big { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0; font-variant-numeric: tabular-nums; }
.metric-delta { font-weight: 600; margin: 2px 0 6px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpis .stat { display: flex; flex-direction: column; gap: 2px; }
.good { color: var(--positive); }
.bad { color: var(--negative); }
.pr-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.pr-card .square-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }

/* Графики: один цвет, тонкие марки, волосяная ось */
.chart { position: relative; margin-top: 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.dash { stroke-dasharray: 3 4; }
.chart .mark { fill: var(--chart); transition: opacity 0.1s; }
.chart .mark.soft { fill: var(--chart); opacity: 0.22; }
.chart .mark.hover { opacity: 0.75; }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart); fill-opacity: 0.12; }
.chart .dot { fill: var(--chart); stroke: var(--card); stroke-width: 2; }
.chart .dot.hover { r: 6; }
.chart .axis { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .value { font-size: 12px; font-weight: 600; fill: var(--text); }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { stroke: var(--chart); stroke-width: 1; }
.chart-tip {
  position: absolute;
  top: -6px;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(22, 27, 37, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
}
.chart-table { margin-top: 6px; }
.chart-table summary { font-size: 13px; color: var(--muted); cursor: pointer; padding: 4px 0; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 0; }
.chart-table td { padding: 5px 0; border-top: 1px solid var(--line); }
.chart-table td:last-child, .chart-table th:last-child { text-align: right; }

/* Горизонтальные полосы: длина — величина, значение у конца */
.bar-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: 30% 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; height: 10px; }
.bar-fill { display: block; height: 10px; background: var(--chart); border-radius: 0 4px 4px 0; }
.bar-value { color: var(--muted); font-variant-numeric: tabular-nums; }

/* «Прошлый раз» в карточке упражнения — главная подсказка во время подхода */
.ref { font-size: 17px; margin: 2px 0 6px; }
.ref b { font-variant-numeric: tabular-nums; }
.steps { margin: 0 0 4px; padding-left: 20px; line-height: 1.45; }
.steps li { margin-bottom: 6px; }

/* Иллюстрация упражнения (img/ex/<slug>.webp, прозрачный фон) */
.ex-illustration { aspect-ratio: 4 / 3; height: 170px; margin: 2px auto 6px; }
.ex-illustration img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Анимация — на своём светлом фоне (без прозрачности): квадрат со скруглением, в обеих темах. */
.ex-illustration.anim { aspect-ratio: 1; height: 220px; }
.ex-illustration.anim img { border-radius: 14px; }

/* Мои данные, настройки */
.nav-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; color: inherit; font: inherit; }
textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  resize: vertical;
  margin-top: 8px;
}
.file-btn {
  display: block;
  box-sizing: border-box;
  text-align: center;
  border-radius: var(--r-btn);
  padding: 12px 14px;
  background: var(--chip);
  cursor: pointer;
}
.empty { text-align: center; padding: 28px 16px; }
.empty .big { font-size: 40px; margin-bottom: 6px; }

/* ───────── Сессия тренировки: «Стоп», список упражнений, правка подхода ───────── */
/* Шапка тренировки не уезжает: «Стоп» виден при любой прокрутке. */
.topbar.session {
  grid-template-columns: 64px 1fr 64px; position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: env(safe-area-inset-top) 6px 0; margin: 0 calc(-1 * var(--gutter)) 10px;
}
.title-btn { background: none; padding: 6px 4px; min-height: 44px; font-size: 17px; font-weight: 600; color: var(--text); }
.title-btn span { color: var(--muted); font-size: 14px; }
.stop-btn {
  background: var(--stop-soft); color: var(--stop); font-weight: 700; font-size: 15px;
  padding: 10px 12px; min-height: 44px; min-width: 60px; border-radius: 12px;
}
.ex-name { display: flex; align-items: flex-start; gap: 8px; }
.ex-name h2 { flex: 1; margin: 0 0 8px; }
.ex-name .dots-btn { margin: -8px -8px 0 0; }
.sess-list { margin: 4px 0 8px; }
.sess-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.sess-row:last-child { border-bottom: 0; }
.sess-row > button.grow {
  display: flex; align-items: center; gap: 12px; background: none; text-align: left; padding: 12px 2px;
  border-radius: 0; min-height: 56px; font-size: 16px;
}
.sess-row .num { width: 22px; color: var(--accent); font-weight: 700; flex: none; text-align: center; }
.sess-row .grow b { display: block; font-weight: 600; }
.sess-row .grow small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.sess-row.current .grow b { color: var(--accent); }
.sess-row.closed .grow b { color: var(--muted); }
.sess-row .badge { font-size: 14px; flex: none; }
.edit-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.edit-row > span { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.edit-row input {
  width: 84px; text-align: center; font-size: 20px; font-weight: 700; padding: 8px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--text);
}
.edit-row b { min-width: 40px; text-align: center; font-size: 20px; }
.pm-btn { width: 48px; height: 48px; padding: 0; border-radius: 50%; font-size: 22px; flex: none; }
.status-tag {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border-radius: 8px; padding: 2px 8px; margin-left: 4px; vertical-align: middle;
}
.status-tag.stopped { color: var(--stop); background: var(--stop-soft); }
.hist-row .status-tag { margin: 4px 0 0; align-self: flex-start; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 4px 10px; margin-bottom: 8px;
}
.instead small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.done-mark {
  width: 96px; height: 96px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 44px; margin: 8px auto 12px;
}
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 12px; }
.done-stats > div {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 6px;
  text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.done-stats b { font-size: 26px; font-weight: 800; }
.done-stats span { color: var(--muted); font-size: 13px; }
.soft-card { background: var(--accent-soft); box-shadow: none; }
.soft-card b { color: var(--accent); }

/* ───────── UX 2.0: совет и выбор, цель, условия, управление тренировкой ───────── */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.topbar.steps { grid-template-columns: 76px 1fr 76px; }
.topbar .step { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.rec-hero .hero { align-items: center; }
.spark {
  width: 76px; height: 76px; flex: none; border-radius: 20px; background: var(--accent-soft); color: var(--text);
  display: grid; place-items: center; font-size: 30px;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 10px; padding: 4px 10px;
}
.live-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live-badge.paused { color: var(--muted); background: var(--chip); }

/* Совет — мятный и без ✓; выбор — синий с ✓ и подписью. Цвет не единственный признак. */
.muscle { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.muscle .m-name { font-size: 16px; }
.muscle .m-badge { min-height: 22px; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 3px 8px; }
.muscle .m-badge.on { color: var(--accent); background: var(--card); }
.muscle .m-badge.rec { color: var(--recommend); background: var(--card); }
.muscle.recommended { background: var(--recommend-soft); box-shadow: inset 0 0 0 2px var(--recommend); }
.muscle.recommended .check { box-shadow: inset 0 0 0 2px var(--recommend); background: var(--card); }
.tip-card {
  display: flex; gap: 12px; align-items: flex-start; background: var(--recommend-soft); border-radius: var(--r-card);
  padding: 14px; margin: 0 0 14px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--recommend) 30%, transparent);
}
.tip-card b { display: block; color: var(--recommend); font-size: 15px; }
.tip-card p { margin: 4px 0 6px; font-size: 14px; color: var(--muted); }
.tip-card.compact { display: block; font-size: 14px; color: var(--recommend); font-weight: 500; }
.tip-ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--card); color: var(--recommend); font-weight: 700;
}
.tip-link { background: none; padding: 4px 0; color: var(--recommend); font-weight: 700; font-size: 15px; min-height: 32px; }
.tip-done { color: var(--recommend); font-weight: 600; font-size: 14px; }

.notice { background: var(--warn-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 12px 0 0; line-height: 1.4; }

.plan-name { background: none; text-align: left; padding: 0; border-radius: 0; min-width: 0; }
.row-act { width: 40px; height: 40px; font-size: 18px; color: var(--muted); flex: none; }
.btn-outline { background: var(--card); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.btn-stop { background: var(--stop-soft); color: var(--stop); font-weight: 700; }
.soft-note { background: var(--chip); box-shadow: none; }
.soft-note p { margin: 6px 0 0; }

.progress-card { background: var(--accent-soft); box-shadow: none; }
.pc-title { display: block; font-size: 18px; }
.pc-line { color: var(--muted); margin: 10px 0 6px; }
.bar { height: 6px; border-radius: 3px; background: var(--card); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.menu-chip { background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 12px; min-height: 40px; flex: none; }
.pos-btn { background: none; color: var(--muted); font-weight: 600; font-size: 15px; min-height: 44px; padding: 6px 8px; }
.act-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.act-row button { background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; padding: 12px 6px; min-height: 48px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 22%);
}
.bottom-bar button { min-height: 52px; font-size: 16px; white-space: nowrap; padding-left: 8px; padding-right: 8px; }

/* ───────── UX 2.1: план сразу, настройки на той же странице ───────── */
.draft-card { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.draft-card b { color: var(--accent); font-size: 16px; }
.draft-card p { margin: 4px 0 12px; font-size: 14px; color: var(--muted); }
.draft-card p:last-child { margin-bottom: 0; }
.change-groups { display: inline-block; padding: 2px 0; margin: -2px 0 6px; font-weight: 600; min-height: 36px; }
.plan-settings { margin-top: 16px; scroll-margin-top: 12px; }
.plan-settings h2 { margin: 0; }
.plan-settings .light { font-weight: 400; color: var(--muted); }
.set-label { font-weight: 700; font-size: 15px; margin: 16px 0 8px; }
.plan-settings .segmented { margin: 0; }
.plan-settings .segmented button.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice-grid button {
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; padding: 12px 8px; min-height: 48px;
  box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px;
}
.choice-grid button.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.plan-dock { padding-top: 14px; }
.dock-toggles { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 8px; margin-bottom: 10px; }
.dock-toggles button {
  background: var(--card); color: var(--accent); font-weight: 600; font-size: 14px; padding: 10px 6px; min-height: 44px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); border-radius: 14px; white-space: nowrap;
}

/* ───────── онбординг 1.0: первый запуск, пустой вес, вопрос о нагрузке ───────── */
.quick-start { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.quick-start .eyebrow { color: var(--accent); }
.value-card.unknown { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.value-card.unknown .picker-label { color: var(--accent); font-weight: 600; }
.value-card.body-weight { display: flex; flex-direction: column; justify-content: center; }
.value-card .bw-title { font-size: 26px; font-weight: 800; margin: 8px 0 4px; }
.feedback-card h2 { margin: 0 0 12px; }
.feedback-card .choice-grid button { min-height: 48px; font-weight: 600; }

/* ───────── UX 3.1: S1 → S2 → S3, одна главная кнопка на экране ───────── */
.root-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 0 0 14px; }
.root-head .title { font-size: 17px; font-weight: 700; text-align: center; }
.root-head > :last-child { justify-self: end; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.logo span { color: var(--accent); }
.section-head { margin: 18px 2px 10px; align-items: baseline; }
.section-head h2 { margin: 0; font-size: 18px; }
.dot-note { color: var(--muted); font-size: 13px; margin: 12px 2px 0; padding-left: 14px; position: relative; line-height: 1.4; }
.dot-note::before { content: ''; position: absolute; left: 2px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--recommend); }
.dot-note.warn::before { background: var(--accent); }
.dot-note.warn { color: var(--text); }

/* Группы мышц: компактная сетка 2×3. Совет — мятный с подписью, выбор — синий с ✓. */
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcard {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 84px; padding: 10px 12px; text-align: left;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); color: var(--text);
}
.mcard .m-fig { width: 40px; flex: none; }
.mcard .m-fig svg { width: 40px; height: 54px; display: block; }
.mcard .m-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcard b { font-size: 16px; }
.mcard .m-rec { color: var(--recommend); font-size: 12px; font-weight: 600; }
.mcard.wide { grid-column: 1 / -1; }
.mcard .m-sub { color: var(--muted); font-size: 13px; line-height: 1.3; }
.mcard .m-check { position: absolute; top: 8px; right: 10px; color: var(--accent); font-weight: 800; }
.mcard.recommended { background: var(--recommend-soft); box-shadow: inset 0 0 0 1.5px var(--recommend); }
.mcard.active { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.mgrid.locked .mcard { opacity: 0.6; }
.banner-row, .quick-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 18px; padding: 14px 16px;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text);
}
.banner-row b, .quick-row b { display: block; font-size: 15px; }
.banner-row span, .quick-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.quick-row { background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.qr-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.is-disabled { opacity: 0.45; }
body.has-tabbar .sticky-cta.above-tabbar { bottom: calc(64px + env(safe-area-inset-bottom)); }
body.has-tabbar main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* План: метки, компактные строки с «•••», низ с временем, инвентарём и ⚙. */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }
.chip { background: var(--chip); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.row-dots { width: 44px; height: 44px; color: var(--muted); font-size: 16px; letter-spacing: 1px; flex: none; }
.muted-link { color: var(--muted); }
.dock-toggles { grid-template-columns: 1fr 1fr 52px; }
.dock-gear { font-size: 22px; }

/* Подход: «Пауза / Выйти» в шапке, сегменты прогресса, техника — по запросу. */
.exit-chip { background: var(--chip); color: var(--text); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 12px; min-height: 40px; white-space: nowrap; }
.topbar.session { grid-template-columns: 44px 1fr auto; }
.pos-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 2px; }
.segbar { display: flex; gap: 4px; margin: 6px 0 14px; }
.segbar i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.segbar i.done { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.segbar i.now { background: var(--accent); }
.ex-sub { color: var(--muted); margin: 2px 0 12px; font-size: 14px; }
.howto { margin: 12px 0 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px; }
.howto summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.howto[open] summary { margin-bottom: 10px; }
.row-more { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; color: var(--muted);
  font-size: 14px; padding: 12px 2px 0; text-align: left; min-height: 44px; }
.row-more span { color: var(--accent); font-weight: 800; letter-spacing: 1px; }
.btn-link.inline { padding: 0; font-size: inherit; }
.workout-dock .btn-soft { margin-top: 8px; }

/* Итог: факт, а не план; «Как нагрузка?» — необязательно. */
.done-mark.small { width: 56px; height: 56px; font-size: 26px; margin: 4px 0 12px; border-radius: 16px; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-pair > div { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.stat-pair b { display: block; font-size: 26px; }
.stat-pair span { color: var(--muted); font-size: 13px; }
.feedback-block { margin: 18px 0 0; }
.feedback-block h2 { margin: 0 0 4px; }
.three-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.three-grid button { min-height: 56px; font-weight: 600; font-size: 14px; padding: 8px 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Узкий экран и крупный шрифт: значения и шапка не вылезают за край. */
@media (max-width: 360px) {
  .values { gap: 8px; }
  .value-card { padding: 10px 6px; }
  .value-card .pm button { width: 46px; height: 46px; font-size: 22px; }
  .title-btn { font-size: 15px; }
  .topbar.session { grid-template-columns: 44px 1fr auto; }
  .act-row button { font-size: 13px; padding: 10px 4px; }
  .spark { width: 60px; height: 60px; font-size: 24px; }
  .bottom-bar button { font-size: 15px; }
  .topbar.steps { grid-template-columns: 64px 1fr 64px; }
  .topbar .step { font-size: 11px; }
  .dock-toggles button, .choice-grid button { font-size: 13px; padding-left: 4px; padding-right: 4px; }
}

/* Ограничения (docs/restrictions): строка под планом, карточки, форма */
.restr-row { gap: 10px; margin: 12px 0 0; padding: 14px 16px; min-height: 48px; }
.restr-row > span:first-child { color: var(--accent); font-size: 18px; }
.restr-card.paused { opacity: 0.72; }
.restr-card .row > .chip { min-height: 0; flex: none; }
.restr-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.restr-actions .btn-link { padding: 10px 0; min-height: 44px; }
.restr-block { margin-top: 12px; }
.restr-block .chip { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.restr-block .set-label:first-of-type { margin-top: 12px; }
.radio-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 6px 0 0;
  padding: 12px 14px; border-radius: var(--r-btn); background: var(--chip); color: var(--text);
  text-align: left; font: inherit; font-size: 15px;
}
.radio-row.active { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.radio-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); }
.radio-row.active .radio-dot { box-shadow: inset 0 0 0 5px var(--accent); }
.restr-ban-list { max-height: 46vh; overflow-y: auto; margin: 4px 0 8px; }

/* Ограничения в плане и тренировке (этап 4): сводка, предупреждение, исключённые */
.restr-summary {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 14px;
  border-radius: 14px; background: var(--accent-soft); font-size: 14px; line-height: 1.35;
}
.compat-warn {
  display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 0; padding: 8px 10px;
  border-radius: 10px; background: var(--warn-soft); font-size: 13px; line-height: 1.35; color: var(--text);
}
.compat-warn .cw-text { flex: 1; min-width: 0; }
.plan-name .compat-warn span { display: inline; color: inherit; font-size: inherit; }
.compat-warn.excluded { background: var(--stop-soft); }
.compat-warn .btn-link { flex: none; font-size: 13px; min-height: 32px; }
.plan-name .compat-warn { white-space: normal; }
.compat-tag { font-style: normal; color: #b26a00; }
.excluded-list { margin: 10px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.excluded-list summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.excluded-list ul { list-style: none; margin: 8px 0 0; padding: 0; }
.excluded-list li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.excluded-list li span { display: block; color: var(--muted); font-size: 13px; }
