/* ============================================================
   Подход — светлая тема в духе Apple: много воздуха, крупная
   типографика, один яркий акцент (лайм), мягкие карточки.
   Подключается после styles.css и перекрывает тёмные правила.
   ============================================================ */

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "Inter", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* мягкое световое пятно сверху вместо тёмного свечения */
body::before {
  background:
    radial-gradient(60% 42% at 50% -6%, rgba(201, 242, 39, 0.35), transparent 70%),
    radial-gradient(40% 30% at 92% 4%, rgba(120, 190, 255, 0.16), transparent 70%);
  height: 46vh;
  inset: -14% -30% auto -30%;
}

#app { max-width: 520px; }

/* ---------- типографика ---------- */

.topbar { padding: 22px var(--pad) 8px; }
.topbar h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.hero { padding: 26px var(--pad) 6px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand svg { width: 15px; height: 15px; color: var(--accent-deep); }
.hero h1 {
  margin: 16px 0 14px;
  font-size: 42px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.055em;
}
.hero p { margin: 0; font-size: 15px; line-height: 1.45; max-width: 32ch; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 10px;
  padding: 0 2px;
}
.section-title h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-deep);
  font: 600 13px/1 inherit;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.dim { color: var(--dim); }

/* ---------- карточки ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 12px;
}
.card-tight { padding: 14px 16px; }

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.kv:first-child { border-top: 0; padding-top: 0; }
.kv .k { color: var(--muted); font-size: 13.5px; }
.kv .v { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }

.big-stat { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 14px; }
.big-stat .v { font-size: 56px; font-weight: 800; letter-spacing: -0.06em; line-height: 0.9; }
.big-stat .u { font-size: 17px; font-weight: 600; color: var(--muted); }

/* ---------- кнопки ---------- */

.btn {
  width: 100%;
  min-height: 54px;
  border-radius: 17px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  margin-top: 10px;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 19px; height: 19px; }

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -16px rgba(140, 190, 0, 0.9);
}
.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn-quiet { background: transparent; color: var(--muted); box-shadow: none; }
.btn-danger {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.22);
  box-shadow: none;
}
.btn-sm { min-height: 40px; font-size: 14px; border-radius: 13px; margin-top: 0; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  background: transparent;
}
.icon-btn:active { background: var(--card-2); }

/* ---------- статистика ---------- */

.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 4px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 14px 13px;
  box-shadow: var(--shadow);
}
.stat .v {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
}
.stat .k {
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- списки ---------- */

.list { display: flex; flex-direction: column; gap: 8px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.item:active { background: #fafafb; }

.date-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--card-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.date-badge .d { font-size: 17px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.date-badge .m {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 3px;
}

.item-main { flex: 1; min-width: 0; }
.item-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.item-side {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

/* ---------- чипы ---------- */

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 9px 14px;
  min-height: 38px;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }

/* ---------- навигация ---------- */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  max-width: none;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  transition: color 0.15s ease;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--text); }
.nav a.on svg { color: var(--text); }

/* ---------- формы и подходы ---------- */

input, textarea {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus { border-color: var(--line-2); background: #fff; }

.title-input { width: 100%; font-size: 22px; font-weight: 750; letter-spacing: -0.03em; background: transparent; border: 0; padding: 6px 2px; }

.num-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  margin: 12px 0;
}
.num-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 6px 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.num-unit { font-size: 13px; font-weight: 600; color: var(--dim); white-space: nowrap; }

input::placeholder, textarea::placeholder { color: var(--dim); font-weight: 500; }

.setrow input {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  height: 46px;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.setrow input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(201, 242, 39, 0.25); }

/* Закрытый подход: фон остаётся лаймовым, но цифры должны читаться. */
.setrow.done input {
  color: var(--text);
  border-color: rgba(160, 200, 20, 0.45);
  background: rgba(201, 242, 39, 0.14);
}
.setrow.done .setnum { color: var(--accent-deep); }

.link-btn.accent { color: var(--accent-deep); }
.link-btn.accent:hover { color: #3f6100; }

/* Лайм на белом читается плохо — текстовые акценты уводим в тёмно-оливковый. */
.card-links .link-btn:not(.accent) { color: var(--accent-deep); }
.live { color: var(--accent-deep); }

.check {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check svg { width: 19px; height: 19px; }
.check.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px -12px rgba(150, 200, 0, 0.9);
}

.setdel { color: var(--dim); }

/* ---------- шиты ---------- */

.sheet-backdrop { background: rgba(20, 20, 26, 0.32); backdrop-filter: blur(6px); }
.sheet-inner {
  background: var(--card);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 60px -30px rgba(0, 0, 0, 0.4);
}
.sheet-head { padding: 18px var(--pad) 8px; }
.sheet-head h3 { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; }
.sheet-body { padding: 6px var(--pad) calc(20px + env(safe-area-inset-bottom)); }
.sheet-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.sheet-search input { flex: 1; background: transparent; border: 0; padding: 0; font-size: 15px; }

.pick {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.pick:last-child { border-bottom: 0; }
.pick .n { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.pick .g { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; text-transform: none; letter-spacing: 0; }
.pick .plus { color: var(--accent-deep); font-size: 20px; font-weight: 500; }
.accent-pick {
  background: linear-gradient(180deg, rgba(201, 242, 39, 0.22), rgba(201, 242, 39, 0.06));
  border: 1px solid rgba(160, 200, 20, 0.4);
  border-radius: 18px;
  padding: 14px 14px;
  margin-bottom: 6px;
}
.accent-pick .plus { color: var(--text); }

.tpl-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.tpl-row .pick { border-bottom: 0; flex: 1; }
.tpl-del { opacity: 0.5; }

/* ---------- прогресс: новые блоки ---------- */

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.balance-row { margin: 10px 0; }
.balance-row:first-child { margin-top: 0; }
.balance-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.balance-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--card-2);
  overflow: hidden;
}
.balance-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.3s ease;
}

.hm {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0 4px;
}
.hm-cell { width: 12px; height: 12px; border-radius: 4px; background: #ececef; }
.hm-cell.l1 { background: #e6f7ae; }
.hm-cell.l2 { background: #d3ef55; }
.hm-cell.l3 { background: #a9d400; }

.goal { margin: 12px 0; }
.goal:first-child { margin-top: 0; }
.goal-sub { margin-top: 7px; font-size: 12px; color: var(--dim); }
.link-inline {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-deep);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.weight-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 72px;
  margin-top: 12px;
}
.weight-chart i {
  flex: 1 1 0;
  max-width: 26px;
  min-width: 6px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), rgba(201, 242, 39, 0.35));
  display: block;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-item {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.badge-item.on {
  background: #f6ffd9;
  border-color: rgba(160, 200, 20, 0.55);
  color: #33440a;
}

.tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f7fbe9;
  border: 1px solid rgba(160, 200, 20, 0.3);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #33440a;
  margin-bottom: 12px;
}
.tip svg { width: 17px; height: 17px; margin-top: 1px; color: #6f9400; flex: 0 0 auto; }

.up { color: #3d8b00; }
.down { color: #c23b2f; }

/* переключатель */
.switch {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #e5e5ea;
  position: relative;
  transition: background 0.18s ease;
  flex: 0 0 auto;
}
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(20px); }

/* ---------- настройки ---------- */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.setting-row:first-child { border-top: 0; }
.setting-row .t { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; }
.setting-row .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.setting-row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.sec-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.about {
  margin: 26px 4px 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  text-align: center;
}

/* ---------- отдых и тосты ---------- */

.restbar {
  background: var(--text);
  color: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.6);
}
.restbar b, .restbar .v { color: var(--accent); }

.toast {
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 36px -20px rgba(0, 0, 0, 0.55);
}

/* ---------- пустые состояния ---------- */

.empty { color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; padding: 26px 10px; }
.empty .big { color: var(--line-2); margin-bottom: 10px; }
.empty .big svg { width: 34px; height: 34px; margin: 0 auto; }

.steps {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 12px;
}
.step { display: flex; gap: 12px; padding: 15px 16px; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 1px;
}
.step-t { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
.step-d { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* ---------- режим одной руки ---------- */


/* ============================================================
   Тёмная тема: те же токены, другие значения. Включается
   атрибутом data-theme="dark" на <html>.
   ============================================================ */

html[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-2: #111114;
  --card: #17171a;
  --card-2: #222227;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #f4f4f7;
  --muted: #a0a0a8;
  --dim: #6b6b74;
  --accent-deep: #d7ff3e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 36px -24px rgba(0, 0, 0, 0.9);
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(60% 42% at 50% -6%, rgba(201, 242, 39, 0.18), transparent 70%),
    radial-gradient(40% 30% at 92% 4%, rgba(90, 150, 255, 0.12), transparent 70%);
}
html[data-theme="dark"] .nav { background: rgba(12, 12, 14, 0.84); border-top-color: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .chip.on { background: var(--accent); border-color: var(--accent); color: #0b0b0f; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus { background: var(--card); }
html[data-theme="dark"] .restbar { background: #1e1e23; color: var(--text); }
html[data-theme="dark"] .toast { background: #26262c; color: var(--text); }
html[data-theme="dark"] .setrow.done input { background: rgba(201, 242, 39, 0.16); }
html[data-theme="dark"] .card { border-color: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .keypad { background: rgba(16, 16, 19, 0.94); }

/* ---------- суперсеты, дропсеты, план ---------- */

.ss-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 10px;
  font-weight: 800;
  vertical-align: 1px;
}
.card-links-sub { display: flex; gap: 16px; margin-top: 6px; }
.card-links-sub .link-btn { font-size: 12.5px; color: var(--muted); }
.setrow.drop .setnum { color: var(--accent-deep); }
.setrow.drop input { border-style: dashed; }

.plan-card { padding: 4px 0; }
.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.plan-row:first-child { border-top: 0; }
.plan-row .t { font-size: 14px; font-weight: 600; color: var(--muted); }
.plan-select {
  border: 0;
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  min-width: 150px;
}

/* ---------- цифровая клавиатура ---------- */

.keypad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  gap: 8px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.keypad[hidden] { display: none; }
.keypad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 1;
}
.keypad-keys button,
.keypad-side button {
  border: 0;
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  padding: 12px 0;
  border-radius: 14px;
}
.keypad-keys button:active,
.keypad-side button:active { transform: scale(0.97); }
.keypad-side { display: flex; flex-direction: column; gap: 6px; width: 88px; }
.keypad-side button { font-size: 13.5px; }
.keypad-done { background: var(--accent) !important; color: #0b0b0f !important; font-weight: 700 !important; }
body.keypad-open { padding-bottom: 0; }

.plan-select, .plan-select option { text-transform: none; letter-spacing: 0; }

select.plan-select, select.plan-select option { text-transform: none !important; }

/* ---------- карта тела ---------- */
.bodymap { padding: 16px 14px 12px; }
.bm-num { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.bm-num .dim { color: var(--muted); font-weight: 700; font-size: 18px; }
.bm-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.bm-figs { display: flex; justify-content: center; gap: 4px; margin: 8px 0 0; }
.bm-figs figure { margin: 0; flex: 1 1 0; max-width: 132px; }
.bm-figs svg { width: 100%; height: auto; display: block; }
.bm-figs figcaption { text-align: center; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.fig .mz { fill: var(--bm-base); stroke: none; transition: fill 0.35s ease; }
.fig .mz.mbody { fill: var(--bm-mute); }
.fig .mz.v0 { fill: var(--bm-base); }
.fig .mz.v1 { fill: #e8f6ae; }
.fig .mz.v2 { fill: #d8f36a; }
.fig .mz.v3 { fill: #c9f227; }
.fig .mz.v4 { fill: #9ecb00; }
.bm-legend { display: grid; gap: 7px; margin-top: 12px; }
.bm-row { display: grid; grid-template-columns: 76px 54px 1fr; align-items: center; gap: 8px; font-size: 12.5px; }
.bm-name { color: var(--muted); }
.bm-val { font-variant-numeric: tabular-nums; font-weight: 650; }
.bm-bar { display: block; height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.bm-bar b { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

html[data-theme="dark"] .fig .mz.v1 { fill: rgba(215, 255, 62, 0.28); }
html[data-theme="dark"] .fig .mz.v2 { fill: rgba(215, 255, 62, 0.55); }
html[data-theme="dark"] .fig .mz.v3 { fill: rgba(215, 255, 62, 0.85); }
html[data-theme="dark"] .fig .mz.v4 { fill: #d7ff3e; }

/* таймер отдыха выезжает снизу */
.restbar { transform: translate(-50%, 140%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1); }
.restbar.on { transform: translate(-50%, 0); }

.restbar .time { color: var(--accent); }
.restbar .label { color: rgba(255, 255, 255, 0.6); letter-spacing: 0.14em; }
.restbar .fill { background: rgba(255, 255, 255, 0.22); }
.restbar .acts button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 12px;
}
.restbar .acts button:active { background: rgba(255, 255, 255, 0.24); }
html[data-theme="dark"] .restbar { background: #1e1e23; color: var(--text); }
html[data-theme="dark"] .restbar .label { color: var(--muted); }
html[data-theme="dark"] .restbar .time { color: var(--accent); }

/* базовые цвета анатомических фигур */
:root { --bm-base: #e5e8eb; --bm-mute: #dadde1; }
html[data-theme="dark"] { --bm-base: #2d2d34; --bm-mute: #26262c; }

.ton-joke { margin-top: 6px; font-size: 13px; color: var(--accent-deep); font-weight: 650; }
html[data-theme="dark"] .ton-joke { color: var(--accent); }

/* кнопка «Не сохранять» — заметная, но не как основной акцент */
.btn.btn-danger-outline {
  margin-top: 10px;
  background: transparent;
  color: #d92d20;
  border: 1px solid rgba(217, 45, 32, 0.32);
  box-shadow: none;
}
.btn.btn-danger-outline:active { background: rgba(217, 45, 32, 0.08); }
html[data-theme="dark"] .btn.btn-danger-outline {
  color: #ff7a6e;
  border-color: rgba(255, 122, 110, 0.38);
}

/* ---------- добивка объёма ---------- */
.bm-actions { margin-top: 14px; }
.bm-actions .btn { margin-top: 0; }
.bm-done {
  display: block; text-align: center; font-size: 13.5px; font-weight: 600;
  color: var(--accent-deep); padding: 10px 0 2px;
}
.topup-list { margin: 14px 0 18px; }
.topup-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.topup-row:last-child { border-bottom: 0; }
.topup-name { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.topup-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.topup-side { font-size: 14px; font-weight: 700; white-space: nowrap; }
html[data-theme="dark"] .bm-done { color: #d7ff3e; }

/* ---------- замеры ---------- */
.remind { border: 1px solid rgba(201, 242, 39, 0.55); background: #f7ffe0; }
.remind-title { font-size: 15.5px; font-weight: 750; letter-spacing: -0.015em; }
.remind-sub { font-size: 13px; color: var(--muted); margin: 4px 0 10px; line-height: 1.35; }
.remind .btn { margin-top: 0; }
.measure-field { margin-bottom: 12px; }
.measure-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
html[data-theme="dark"] .remind { background: #1d2410; border-color: rgba(215, 255, 62, 0.35); }

/* ---------- замеры по группам и колесо ---------- */
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row .btn { flex: 1; margin-top: 0; }
.measure-group { margin-top: 10px; }
.measure-group + .measure-group { margin-top: 6px; }
.measure-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.measure-row:last-of-type { border-bottom: 0; }
.measure-name { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.measure-prev { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.measure-add { min-width: 104px; margin-top: 0; }

.picker {
  position: relative; height: 220px; margin: 6px 0 16px;
  border-radius: 16px; background: var(--card-2, #f2f2f5); overflow: hidden;
}
.picker-band {
  position: absolute; left: 10px; right: 10px; top: 88px; height: 44px;
  border-radius: 12px; background: rgba(201, 242, 39, 0.16);
  border-top: 1px solid rgba(201, 242, 39, 0.5);
  border-bottom: 1px solid rgba(201, 242, 39, 0.5);
  pointer-events: none; z-index: 2;
}
.picker-scroll {
  position: absolute; inset: 0; overflow-y: auto; z-index: 1;
  padding: 88px 0; scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.picker-scroll::-webkit-scrollbar { display: none; }
.picker-item {
  display: block; width: 100%; height: 44px; line-height: 44px;
  text-align: center; font-size: 20px; font-weight: 650; letter-spacing: -0.02em;
  color: var(--muted); background: none; border: 0; scroll-snap-align: center;
  font-variant-numeric: tabular-nums;
}
.picker-item.on { color: var(--text); }
html[data-theme="dark"] .picker { background: #222227; }
html[data-theme="dark"] .picker-band { background: rgba(215, 255, 62, 0.14); border-color: rgba(215, 255, 62, 0.45); }

/* ---------- управление списком добивки ---------- */
.topup-item { border-bottom: 1px solid var(--line); }
.topup-item:last-child { border-bottom: 0; }
.topup-item .topup-row { border-bottom: 0; padding-bottom: 6px; }
.topup-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 0 10px; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.step-btn {
  width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card-2, #f2f2f5); color: var(--text);
  font-size: 19px; font-weight: 700; line-height: 1; display: grid; place-items: center;
}
.step-btn:active { background: rgba(201, 242, 39, 0.22); }
.step-val { font-size: 13.5px; font-weight: 650; min-width: 96px; }
html[data-theme="dark"] .step-btn { background: #26262c; border-color: rgba(255,255,255,0.12); }

/* ---------- карточка замеров ---------- */
.weight-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.weight-val { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px; }
.weight-head .btn { margin-top: 0; }
.measure-add {
  min-width: 104px; height: 40px; border-radius: 13px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font-size: 14px; font-weight: 650;
}
.measure-add.filled { background: rgba(201, 242, 39, 0.18); border-color: rgba(201, 242, 39, 0.5); }
.measure-add:active { transform: scale(0.97); }
html[data-theme="dark"] .measure-add.filled { background: rgba(215, 255, 62, 0.14); border-color: rgba(215, 255, 62, 0.4); }
.card .btn-accent { margin-top: 14px; }

.weight-val { white-space: nowrap; font-size: 21px; }
.weight-head > div:first-child { min-width: 0; }
.weight-head .btn { flex: 0 0 auto; min-width: 152px; }

.weight-head { display: block; }
.weight-label { font-size: 12.5px; color: var(--muted); }
.weight-val { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; margin-top: 2px; white-space: nowrap; }
.weight-head + .btn { margin-top: 12px; }

.picker-scale { text-align: center; font-size: 12px; color: var(--muted); margin: -8px 0 14px; }

/* ---------- импорт и свои упражнения ---------- */
.import-area {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 150px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card-2, #f2f2f5);
  padding: 12px 14px; font: inherit; font-size: 14px; color: var(--text); margin: 10px 0;
}
.import-area:focus { outline: none; border-color: rgba(201, 242, 39, 0.7); }
.import-report { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.import-line { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.import-line.ok { color: #3d8b00; font-weight: 650; }
.import-line.bad { color: #c23b2f; }
html[data-theme="dark"] .import-area { background: #222227; }

.catalog-tools { margin: 10px 0 2px; text-align: right; }
