/* Тема мини-приложения: неоморфные карточки + стекло на «парящих» элементах.
   Палитра — docs/superpowers/specs/2026-10-30-polish-design.md, раздел 1.
   Цветовые литералы живут только в блоках токенов (:root и тёмная тема),
   правила ниже берут цвета через var(--…) — это проверяет tests/test_webapp_theme.py. */

:root {
  --page: #d3d0cb;
  --bg: #e0ddd8;
  --hi: #f2efea;
  --lo: #b3afa8;
  --ink: #36322d;
  --mute: #5c5852;
  --accent: #45403a;
  --on-accent: var(--bg);
  --line: rgba(110, 102, 92, .22);
  --scrim: rgba(38, 35, 31, .32);
  --glass-hi: rgba(255, 252, 247, .55);
  --glass-lo: rgba(255, 252, 247, .18);
  --glass-edge: rgba(255, 252, 247, .7);
  --glass-shadow: rgba(54, 50, 45, .18);
  --work-bg: rgba(110, 102, 92, .14);
  --planned-bg: rgba(255, 252, 247, .55);
  --clash-lo: rgba(120, 100, 20, .35);
  --clash-hi: rgba(255, 252, 247, .55);

  /* графики */
  --blue: #2a78d6;
  --violet: #6250d6;
  --pink: #e87ba4;
  --aqua: #1baf7a;
  --live: #22c55e;
  --on-live: #0f2a18;
  --good: #255c3a;
  --bad: #952a43;
  /* жёлтый — только рамка поля БЖУ, тренировка в рабочий день, плашка «новый» */
  --yellow: #ffd84a;
  --on-yellow: #45403a;
  --press: #d6d3ce;
  --accent-press: #37332e;
  --primary-inset: rgba(0, 0, 0, .35);
  /* дни программы (bot/training/colors.py): заливка и буква на ней */
  --day-red: #cf3b30;
  --day-red-ink: #fffaf3;
  --day-blue: #2f70c6;
  --day-blue-ink: #fffaf3;
  --day-green: #1e8047;
  --day-green-ink: #fffaf3;
  --day-violet: #8951d6;
  --day-violet-ink: #fffaf3;
  --day-orange: #a95c28;
  --day-orange-ink: #fffaf3;
  --day-aqua: #1e7d80;
  --day-aqua-ink: #fffaf3;
  --day-magenta: #ca2f97;
  --day-magenta-ink: #fffaf3;
  --day-yellow: #8e6b0b;
  --day-yellow-ink: #fffaf3;
  --day-none: #777069;
  --day-none-ink: #fffaf3;
  /* шкала калорий: оттенок считает js/colors.js, яркость и насыщенность — здесь */
  --meter-l: 0.62;
  --meter-c: 0.16;

  --gutter: 16px;
  --tabbar-h: 64px;
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --vh: var(--tg-viewport-stable-height, 100vh);

  color-scheme: light;
}

/* Тёмная тема: в Telegram её включает js/theme.js (data-theme на <html>),
   в браузере (демо) — системная настройка. Значения в двух блоках одинаковые. */
:root[data-theme="dark"] {
  --page: #26231f;
  --bg: #2e2a26;
  --hi: #3a3530;
  --lo: #1a1815;
  --ink: #ece7e0;
  --mute: #a39b90;
  --accent: #e6dfd5;
  --on-accent: var(--bg);
  --line: rgba(236, 231, 224, .12);
  --scrim: rgba(0, 0, 0, .5);
  --glass-hi: rgba(236, 231, 224, .1);
  --glass-lo: rgba(236, 231, 224, .03);
  --glass-edge: rgba(236, 231, 224, .14);
  --glass-shadow: rgba(0, 0, 0, .4);
  --work-bg: rgba(0, 0, 0, .22);
  --planned-bg: rgba(236, 231, 224, .08);
  --clash-lo: rgba(90, 70, 0, .45);
  --clash-hi: rgba(255, 240, 180, .35);
  --good: #6cc28c;
  --bad: #f07a8e;
  --on-yellow: #2e2a26;
  --blue: #6aa8f0;
  --violet: #9d8cff;
  --pink: #f09ac0;
  --aqua: #45d39b;
  --on-live: #0f2a18;
  --press: #282521;
  --accent-press: #d3ccc1;
  --primary-inset: rgba(0, 0, 0, .3);
  /* дни программы (bot/training/colors.py): заливка и буква на ней */
  --day-red: #e0574d;
  --day-red-ink: #1e1b18;
  --day-blue: #4587de;
  --day-blue-ink: #1e1b18;
  --day-green: #1b984f;
  --day-green-ink: #1e1b18;
  --day-violet: #9e6ce5;
  --day-violet-ink: #1e1b18;
  --day-orange: #d06925;
  --day-orange-ink: #1e1b18;
  --day-aqua: #1b9498;
  --day-aqua-ink: #1e1b18;
  --day-magenta: #df49ad;
  --day-magenta-ink: #1e1b18;
  --day-yellow: #aa8213;
  --day-yellow-ink: #1e1b18;
  --day-none: #8e857b;
  --day-none-ink: #1e1b18;
  /* шкала калорий: оттенок считает js/colors.js, яркость и насыщенность — здесь */
  --meter-l: 0.74;
  --meter-c: 0.15;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #26231f;
    --bg: #2e2a26;
    --hi: #3a3530;
    --lo: #1a1815;
    --ink: #ece7e0;
    --mute: #a39b90;
    --accent: #e6dfd5;
    --on-accent: var(--bg);
    --line: rgba(236, 231, 224, .12);
    --scrim: rgba(0, 0, 0, .5);
    --glass-hi: rgba(236, 231, 224, .1);
    --glass-lo: rgba(236, 231, 224, .03);
    --glass-edge: rgba(236, 231, 224, .14);
    --glass-shadow: rgba(0, 0, 0, .4);
    --work-bg: rgba(0, 0, 0, .22);
    --planned-bg: rgba(236, 231, 224, .08);
    --clash-lo: rgba(90, 70, 0, .45);
    --clash-hi: rgba(255, 240, 180, .35);
    --good: #6cc28c;
    --bad: #f07a8e;
    --on-yellow: #2e2a26;
    --blue: #6aa8f0;
    --violet: #9d8cff;
    --pink: #f09ac0;
    --aqua: #45d39b;
    --on-live: #0f2a18;
    --press: #282521;
    --accent-press: #d3ccc1;
    --primary-inset: rgba(0, 0, 0, .3);
    /* дни программы (bot/training/colors.py): заливка и буква на ней */
    --day-red: #e0574d;
    --day-red-ink: #1e1b18;
    --day-blue: #4587de;
    --day-blue-ink: #1e1b18;
    --day-green: #1b984f;
    --day-green-ink: #1e1b18;
    --day-violet: #9e6ce5;
    --day-violet-ink: #1e1b18;
    --day-orange: #d06925;
    --day-orange-ink: #1e1b18;
    --day-aqua: #1b9498;
    --day-aqua-ink: #1e1b18;
    --day-magenta: #df49ad;
    --day-magenta-ink: #1e1b18;
    --day-yellow: #aa8213;
    --day-yellow-ink: #1e1b18;
    --day-none: #8e857b;
    --day-none-ink: #1e1b18;
    /* шкала калорий: оттенок считает js/colors.js, яркость и насыщенность — здесь */
    --meter-l: 0.74;
    --meter-c: 0.15;
    color-scheme: dark;
  }
}

/* Manrope (OFL, webapp/fonts/OFL.txt), переменный: один файл на набор символов покрывает 400–700.
   Файлы из npm @fontsource-variable/manrope@5.2.5, наборы cyrillic и latin. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Manrope", -apple-system, "SF Pro Text", system-ui, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  min-height: var(--vh);
  background: var(--page);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

/* ---------- поверхности ---------- */

.raised {
  background: var(--bg);
  border-radius: 24px;
  box-shadow: 6px 6px 12px var(--lo), -6px -6px 12px var(--hi);
}

.pressed {
  background: var(--bg);
  border-radius: 16px;
  box-shadow: inset 5px 5px 10px var(--lo), inset -5px -5px 10px var(--hi);
}

.glass {
  background: linear-gradient(135deg, var(--glass-hi), var(--glass-lo));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 var(--glass-lo),
              0 10px 30px var(--glass-shadow);
}

.tap { cursor: pointer; user-select: none; -webkit-user-select: none; }
/* карточка-кнопка вдавливается, строки списков и клетки — чуть бледнеют; размеры не меняются */
.raised.tap { transition: box-shadow 120ms; }
.raised.tap:active { box-shadow: inset 4px 4px 8px var(--lo), inset -4px -4px 8px var(--hi); }
.tap:not(.raised):active { opacity: .65; }

/* ---------- кнопки ----------
   .btn — выпуклая, .btn.primary — тёмная заливка, .btn.ghost — плоская.
   Размер задаёт отдельный класс (pill, send, start, x…); нажатие меняет только тень и фон. */
.btn {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 3px 3px 6px var(--lo), -3px -3px 6px var(--hi);
  transition: box-shadow 120ms, background-color 120ms;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 14px;
}
.btn:active { background: var(--press); box-shadow: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi); }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 3px 3px 6px var(--lo), -3px -3px 6px var(--hi); }
.btn.primary:active { background: var(--accent-press); box-shadow: inset 2px 2px 5px var(--primary-inset); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:active { background: var(--press); box-shadow: none; }
.btn:disabled { opacity: .55; }

/* ---------- каркас ---------- */

.app {
  min-height: var(--vh);
  display: flex;
  flex-direction: column;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(14px + var(--safe-top)) 22px 14px;
  border-radius: 0 0 26px 26px;
  border-top: none;
}
.hello { min-width: 0; flex: 1; }
.title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hello b { font-size: 18px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hello > span { font-size: 12px; color: var(--mute); display: block; min-height: 16px; }
.top-right { flex: none; display: flex; gap: 8px; align-items: center; }
/* таймер отдыха (js/timer.js): ширина не зависит от цифр, шапка не дёргается */
.top-timer { flex: none; display: flex; align-items: center; }
.top-timer:empty { display: none; }
.rest {
  min-width: 78px; height: 36px; padding: 0 12px; border-radius: 18px;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.rest.idle { color: var(--mute); }
/* готово: как .btn.primary, плюс значок ✓ в тексте — не только цвет */
.rest.done { background: var(--accent); color: var(--on-accent); box-shadow: 3px 3px 6px var(--lo), -3px -3px 6px var(--hi); }
.rest.done:active { background: var(--accent-press); box-shadow: inset 2px 2px 5px var(--primary-inset); }
.rest-sheet { text-align: center; }
.rest-big { font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; }
.rest-status { font-size: 13px; color: var(--mute); min-height: 18px; }
.rest-set { text-align: left; margin-top: 16px; }
.rest-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rest-custom { margin-top: 10px; }
.rest-custom input { text-align: right; font-variant-numeric: tabular-nums; }
.rest-set .set-notify { margin-top: 12px; }

/* метка дня программы: буква на цвете дня (класс .c-…) */
.dmark {
  flex: none; display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--dc, var(--day-none)); color: var(--dci, var(--day-none-ink));
  font-size: 11px; font-weight: 700; line-height: 1;
}
.dmark[hidden] { display: none; }

.avatar, .round {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; flex: none;
}

.view {
  flex: 1;
  padding: 18px var(--gutter) 0;
  min-width: 0;
}

.tabbar {
  position: sticky;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 5;
  margin: 22px var(--gutter) calc(12px + var(--safe-bottom));
  height: var(--tabbar-h);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-radius: 32px;
  user-select: none;
  -webkit-user-select: none;
}
.tab {
  font-size: 10px; color: var(--mute);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 64px; text-decoration: none;
}
.tab .ic {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 16px;
  border: 1px solid transparent;
  transition: width .2s, border-radius .2s;
}
.tab.active { color: var(--ink); font-weight: 600; }
.tab.active .ic { width: 56px; border-radius: 18px; }
.tab .ic.glass { box-shadow: inset 0 1px 0 var(--glass-edge), 0 2px 6px var(--glass-shadow); }

.demo-badge {
  position: fixed;
  right: var(--gutter);
  bottom: calc(12px + var(--safe-bottom) + var(--tabbar-h) + 10px);
  z-index: 6;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 10px;
  color: var(--accent);
  pointer-events: none;
}

/* ---------- общие блоки экранов ---------- */

.grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.card { padding: 16px; position: relative; }
.label { font-size: 12px; color: var(--mute); font-weight: 500; }
.big { font-size: 40px; font-weight: 700; letter-spacing: -1px; line-height: 1; margin-top: 10px; }
.big small { font-size: 14px; font-weight: 500; color: var(--mute); letter-spacing: 0; }
.mid { font-size: 28px; font-weight: 700; margin-top: 10px; }
.mid small { font-size: 13px; color: var(--mute); font-weight: 500; }
.sub { font-size: 11px; color: var(--mute); margin-top: 4px; }
.up, .down { font-size: 12px; color: var(--good); font-weight: 600; }
.section-title {
  font-size: 15px; font-weight: 600; margin: 26px 4px 12px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-title > span { font-size: 12px; color: var(--mute); font-weight: 500; }
.section-title:first-child { margin-top: 4px; }
.chips { display: flex; gap: 10px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 10px; margin-left: -4px; margin-right: -4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { font-size: 12px; padding: 8px 14px; border-radius: 14px; white-space: nowrap; }
.chip.glass { color: var(--ink); font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-edge), 0 2px 6px var(--glass-shadow); }
.plus {
  position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; font-weight: 400; color: var(--ink);
}
.chev { float: right; color: var(--mute); font-size: 16px; }
.stack > * + * { margin-top: 16px; }

/* переключатель (период и т. п.) */
.seg2 { display: flex; gap: 4px; padding: 4px; border-radius: 14px; }
.seg2 > * { flex: 1; text-align: center; padding: 7px; border-radius: 10px; font-size: 12px; color: var(--mute); border: 1px solid transparent; }
.seg2 > .on { color: var(--ink); font-weight: 600; background: var(--bg); box-shadow: 2px 2px 4px var(--lo), -2px -2px 4px var(--hi); }

.pill { font-size: 12px; padding: 7px 12px; border-radius: 12px; font-weight: 600; white-space: nowrap; }

.empty { color: var(--mute); font-size: 13px; text-align: center; padding: 28px 12px; }
.error { color: var(--bad); font-size: 13px; }
.error-card { padding: 18px; text-align: center; }
.error-card .error { margin: 6px 0 14px; }

/* ---------- графики ---------- */

.chart { padding: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.chart-head b { font-size: 22px; }
.chart-box { position: relative; width: 100%; min-height: 130px; }
.chart-box svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-empty {
  height: 130px; display: grid; place-items: center;
  color: var(--mute); font-size: 13px;
}
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .yl { font-size: 9px; fill: var(--mute); }
.chart .xl { font-size: 9px; fill: var(--mute); text-anchor: middle; }
.chart .goal { stroke: var(--accent); stroke-opacity: .45; stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .trend { stroke: var(--mute); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.bw-rate { margin-top: 8px; font-size: 13px; }
.meas-chips { margin: 10px -4px 4px; }
.meas-chips .chip { font-size: 12px; padding: 7px 11px; }
.meas-fields .field { margin-top: 10px; }
.meas-fields input { text-align: right; }
.meas-fields .field > span:last-child { flex: none; width: 26px; color: var(--mute); font-size: 13px; }
.bw-legend { color: var(--mute); margin-left: 6px; }
.bw-advice { margin-top: 8px; }
.bw-advice:empty { display: none; }
.bw-tip { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.bw-advice .btn { padding: 9px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.bw-undo { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; min-height: 40px; }
.chart .goal-l { font-size: 9px; fill: var(--accent); fill-opacity: .7; text-anchor: start; }
.chart .tag { font-size: 10px; font-weight: 700; fill: var(--on-live); }
.chart .pulse { animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7 } 100% { transform: scale(3.2); opacity: 0 } }
.chart .cursor { stroke: var(--accent); stroke-opacity: .45; stroke-width: 1; }
.chart .tip-bg { fill: var(--accent); fill-opacity: .92; }
.chart .tip { font-size: 10px; font-weight: 600; fill: var(--on-accent); }
.chart .tip-x { font-size: 9px; fill: var(--on-accent); fill-opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  .chart .pulse { animation: none; opacity: 0; }
  .btn, .raised.tap { transition: none; }
}

/* ---------- главный экран ---------- */

.left-note { font-size: 11px; color: var(--mute); margin-top: 6px; }
.bar { height: 8px; margin-top: 14px; border-radius: 8px; padding: 0; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px; background: var(--accent); }
.macros { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 11px; color: var(--mute); }
.macros > div { flex: 1; min-width: 0; }
/* тонкие полоски Б/Ж/У — только для полей с заданной целью */
.mbar { height: 4px; margin-top: 5px; border-radius: 4px; padding: 0; overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.macros b { color: var(--ink); font-size: 13px; display: block; font-variant-numeric: tabular-nums; }
.week { display: flex; justify-content: space-between; margin-top: 14px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 9px; color: var(--mute); }
.day.today { color: var(--ink); font-weight: 700; }
.dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; line-height: 1;
  box-shadow: inset 2px 2px 4px var(--lo), inset -2px -2px 4px var(--hi);
}
/* была тренировка — заливка цветом дня, буква контрастная */
.dot.on { background: var(--dc); color: var(--dci); box-shadow: 2px 2px 4px var(--lo), -2px -2px 4px var(--hi); }
/* в планах — пунктир и буква цветом дня */
.dot.plan { outline: 1.5px dashed var(--dc); outline-offset: -1.5px; color: var(--dc); }
.grid > .card { min-width: 0; }
[role="button"] { outline-offset: 2px; }

/* ---------- питание ---------- */

.food-input { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px; }
.food-input input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 16px; padding: 6px 0; }
.food-input input::placeholder, .field input::placeholder, .f input::placeholder { color: var(--mute); opacity: .7; }
.send { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; flex: none; }
.food-error { margin: 8px 6px 0; }
.hint { font-size: 11px; color: var(--mute); margin: 8px 6px 0; }
.food-res { margin-top: 16px; }
.food-res.busy { opacity: .7; }
button:disabled { cursor: default; }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.res-head > div:first-child { min-width: 0; }
.x ~ .res-head > div:first-child { padding-right: 34px; } /* место под ✕ */
.res-head b { font-size: 17px; overflow-wrap: anywhere; }
.res-head .g { font-size: 12px; color: var(--mute); margin-top: 3px; }
.kcal { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.1; flex: none; }
.kcal small { font-size: 11px; color: var(--mute); font-weight: 500; display: block; }
.food-res .seg2, .sheet .seg2 { margin-top: 14px; }
.food-res .seg2 > *, .sheet .seg2 > * { font-size: 13px; padding: 8px; }
.bju { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.bju.four { grid-template-columns: repeat(2, 1fr); }
/* рамка поля прозрачная, при правке — жёлтая */
.f { display: block; padding: 10px; border-radius: 14px; text-align: center; transition: box-shadow .15s; cursor: text; }
.f.edit { box-shadow: 0 0 0 2px var(--yellow), inset 5px 5px 10px var(--lo), inset -5px -5px 10px var(--hi); }
.f input { display: block; width: 100%; border: none; background: none; outline: none; text-align: center; font-size: 18px; font-weight: 700; padding: 0; }
.f span { font-size: 10px; color: var(--mute); }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions > button { flex: 1; padding: 13px; border-radius: 16px; font-size: 14px; font-weight: 600; text-align: center; }
.card-error { margin-top: 10px; }
.x { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--mute); }
.food-choice { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 16px; margin-top: 10px; }
.food-choice b { display: block; font-size: 14px; }
.food-choice span { font-size: 11px; color: var(--mute); }
.food-link { display: block; margin-top: 12px; padding: 6px 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
.field { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; margin-top: 14px; }
.field input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 16px; }
.field span { color: var(--mute); font-size: 13px; }
.food-today { margin-top: 20px; padding: 6px 16px; }
.food-li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.food-li:last-child { border-bottom: none; }
.food-li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.food-li > span:last-child { color: var(--mute); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.food-today .empty { padding: 16px 0 18px; }
.food-today .food-link { margin: 4px 0 10px; }

/* быстрое добавление: чипы фиксированной высоты, нажатие меняет только фон и тень */
.quick { margin-top: 14px; }
.q-group { margin-top: 4px; }
.q-title { font-size: 11px; font-weight: 600; color: var(--mute); margin: 0 6px; }
.quick .chips { margin-bottom: 0; padding-top: 6px; }
.quick .chip { height: 34px; line-height: 18px; padding: 8px 14px; }
/* место под строку отмены занято всегда: её появление не сдвигает «Сегодня» */
.undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 6px 0; min-height: 32px; font-size: 13px; }
.undo span { min-width: 0; overflow-wrap: anywhere; }
.undo .btn { padding: 6px 10px; border-radius: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.q-error { margin: 8px 6px 0; }
.tpl-items { margin-top: 10px; }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tpl-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tpl-row .field { width: 96px; flex: none; margin-top: 0; padding: 8px 10px; }
.tpl-row .btn { width: 32px; height: 32px; border-radius: 50%; color: var(--mute); flex: none; }
.tpl-add { margin-top: 14px; }
.q-pick { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.q-pick input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.q-pick span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.q-pick span:last-of-type { color: var(--mute); font-size: 12px; white-space: nowrap; }

/* нижний лист записи */
.sheet-back {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end;
  background: var(--scrim);
  overscroll-behavior: contain; touch-action: none;
  animation: sheet-fade .18s ease-out;
}
.sheet {
  width: 100%; border-radius: 26px 26px 0 0;
  padding: 10px var(--gutter) calc(18px + var(--safe-bottom));
  background: var(--bg);
  box-shadow: 0 -10px 30px var(--glass-shadow);
  animation: sheet-rise .22s ease-out;
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--lo); margin: 0 auto 14px; }
.sheet-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.sheet-row .field { flex: 1; margin-top: 0; }
.sheet-row .pill { padding: 12px 14px; border-radius: 14px; font-size: 13px; }
/* длинный лист (план тренировки) листается внутри */
.sheet.tall { max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.sheet-del { display: block; width: 100%; margin-top: 14px; padding: 13px; border-radius: 16px; font-weight: 600; color: var(--bad); }
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes sheet-rise { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .sheet-back, .sheet { animation: none; }
}

/* ---------- тренировки ---------- */

.notice { margin-bottom: 14px; font-size: 13px; }
.cal { padding: 16px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-head b { font-size: 17px; }
.arrows { display: flex; gap: 8px; }
.arrows button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.wd, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.wd div { font-size: 10px; color: var(--mute); text-align: center; margin-bottom: 4px; }
.d {
  aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center;
  font-size: 13px; font-weight: 500; position: relative; min-width: 0; color: var(--ink);
}
.d.pad { visibility: hidden; }
.d.busy { opacity: .55; }
/* работа — серая вдавленная */
.d.work {
  background: var(--work-bg); color: var(--mute);
  box-shadow: inset 3px 3px 6px var(--lo), inset -3px -3px 6px var(--hi);
}
/* тренировка была — выпуклая, цветом дня программы (класс .c-…) */
.d.done, .d.done_work {
  background: var(--dc, var(--day-none)); color: var(--dci, var(--day-none-ink)); font-weight: 700;
  box-shadow: 3px 3px 6px var(--lo), -3px -3px 6px var(--hi);
}
/* план с днём программы — рамка цветом дня (под буквой нет — цвет повторяет «Ближайшие») */
.d.planned.typed, .d.planned_work.typed { outline-color: var(--dc); }
/* тренировка в рабочий день — то же с кольцом внутри */
.d.done_work {
  box-shadow: inset 0 0 0 2px var(--ink), 3px 3px 6px var(--lo), -3px -3px 6px var(--hi);
}
/* в планах — пунктирная рамка: розовая, в рабочий день жёлтая поверх серой «работы» */
.d.planned, .d.planned_work { outline: 2px dashed var(--pink); outline-offset: -4px; }
.d.planned {
  background: var(--planned-bg);
  box-shadow: 3px 3px 6px var(--lo), -3px -3px 6px var(--hi);
}
.d.planned_work {
  outline-color: var(--yellow); outline-width: 2.5px;
  background: var(--work-bg);
  box-shadow: inset 3px 3px 6px var(--lo), inset -3px -3px 6px var(--hi);
}
.d.today::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; margin-left: -2px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--pink);
}
.d.today { font-weight: 700; }
/* график: день, изменённый вручную */
.d.ovr::before {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--violet);
}
.cal-error { margin-top: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 11px; color: var(--mute); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.legend .lg-work { background: var(--work-bg); }
.legend .lg-done { background: var(--day-none); }
.legend .lg-plan { outline: 2px dashed var(--pink); outline-offset: -2px; }
.legend .lg-clash { background: var(--day-none); box-shadow: inset 0 0 0 2px var(--ink); }
.legend .lg-off { box-shadow: inset 0 0 0 1px var(--lo); }
.legend .lg-ovr { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); vertical-align: 1px; }
.cal .hint { margin: 10px 0 0; }

.start { display: block; width: 100%; margin-top: 16px; padding: 16px; border-radius: 20px; text-align: center; font-weight: 700; font-size: 15px; }
.list { margin-top: 16px; padding: 6px 16px; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: none; }
.li > span { color: var(--mute); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.li.empty-li { color: var(--mute); justify-content: center; text-align: center; }
.collapsed { margin-top: 16px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.chev-r { color: var(--mute); }

/* выбор дня программы */
.wo-day { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 16px; margin-top: 12px; text-align: left; font-size: 15px; }
.wo-day .chip { font-size: 11px; padding: 5px 10px; }
.wo-error { margin: 12px 6px 0; }

/* доска упражнений */
.wo-list { margin-top: 0; }
.screen.busy .wo-board, .screen.busy .wo-add { opacity: .7; }
.wo-ex { border-bottom: 1px solid var(--line); }
.wo-ex:last-child { border-bottom: none; }
.wo-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; font-size: 13px; }
.wo-main { min-width: 0; }
.wo-main b { font-size: 14px; overflow-wrap: anywhere; }
.wo-main .g, .wo-ask .g { font-size: 12px; color: var(--mute); margin-top: 2px; }
.wo-vol { color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; flex: none; max-width: 55%; }
.wo-ex.done .wo-vol { color: var(--ink); font-weight: 600; }
.wo-list > .wo-row { border-bottom: 1px solid var(--line); }
.wo-total { color: var(--ink) !important; font-weight: 700; }
.wo-ex.open { padding-bottom: 14px; }
/* раскрытая карточка: заголовок с корзиной, подходы по строке, поля кг / повт. / подх. */
.wo-head { display: flex; align-items: center; gap: 8px; }
.wo-head .wo-row { flex: 1; min-width: 0; }
.wo-trash { flex: none; min-width: 40px; height: 36px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--bad); }
.wo-sets-list { margin: 0 0 4px; }
.wo-set { display: flex; align-items: center; gap: 4px; border-radius: 12px; }
.wo-set.on { background: var(--press); }
.wo-set-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 6px; text-align: left; font-size: 14px; font-variant-numeric: tabular-nums; }
.wo-set-n { width: 18px; color: var(--mute); font-size: 12px; text-align: right; }
.wo-fold-mark { margin-left: auto; padding-right: 10px; color: var(--mute); }
.wo-set-del { flex: none; width: 36px; height: 36px; color: var(--mute); font-size: 14px; }
.wo-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.wo-fields.edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wo-fields > label { display: block; }
.wo-fields > label[hidden] { display: none; }
.wo-fields > label > span:first-child { display: block; margin: 0 0 4px 4px; font-size: 11px; color: var(--mute); }
.wo-fields .field { margin-top: 0; padding: 10px 12px; }
.wo-fields .field input { text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wo-card-err { margin: 8px 4px 0; overflow-wrap: anywhere; }
.wo-btns { margin-top: 12px; }
/* добавить упражнение: поле и подсказки под ним */
.wo-add { margin-top: 0; }
.wo-sug { margin-top: 10px; padding-top: 4px; padding-bottom: 4px; }
.wo-sug-row { display: block; width: 100%; padding: 12px 4px; text-align: left; font-size: 14px; border-radius: 10px; overflow-wrap: anywhere; }
.wo-sug-row + .wo-sug-row { border-top: 1px solid var(--line); border-radius: 0; }
.wo-sug-all { color: var(--mute); }
.wo-sug-new { color: var(--accent); font-weight: 600; }
.wo-all-filter { position: sticky; top: -10px; z-index: 1; margin-top: 12px; background: var(--bg); }
.wo-all-list { margin-top: 8px; }
.wo-end { margin-top: 22px; }
.wo-cancel { color: var(--bad); }
.wo-note { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 13px; }
.wo-summary-text { white-space: pre-line; font-size: 14px; line-height: 1.5; margin-bottom: 14px; overflow-wrap: anywhere; }

/* рабочий график */
.shift .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.sch-start input { border: none; outline: none; padding: 8px 10px; border-radius: 12px; font-size: 14px; min-width: 0; }
.shift .sheet-del[hidden] { display: none; }
.sch-error { margin-top: 10px; }
.shift + .cal { margin-top: 16px; }
.wo-ex .wo-repeat { margin-top: 12px; padding: 9px 14px; font-size: 13px; }
.wo-ex .wo-repeat + .wo-repeat { margin-left: 8px; }
.wo-stall { color: var(--ink); }
/* плашка рекорда сверху экрана */
.rec-toast { position: fixed; top: 12px; left: 16px; right: 16px; z-index: 50; padding: 14px 16px; border-radius: 18px;
  background: var(--bg); color: var(--ink); font-weight: 700; font-size: 15px; white-space: pre-line; text-align: center;
  animation: rec-in .25s ease-out; }
@keyframes rec-in { from { transform: translateY(-16px); } }
@media (prefers-reduced-motion: reduce) { .rec-toast { animation: none; } }
/* лист «Блины» */
.pl-side { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.pl-side .g { font-size: 12px; color: var(--mute); }
.pl-side b { font-size: 22px; }
.pl-l { margin-top: 14px; }
.pl-warm { margin-top: 6px; }
.pl-warm .li { display: flex; justify-content: space-between; }

/* ---------- прогресс и рекорды ---------- */

.pr-period { margin-bottom: 16px; }
.pr-error { margin: -6px 6px 12px; }
.screen .chart + .chart { margin-top: 16px; }
.recbtn { margin-top: 16px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.recbtn b { font-size: 15px; overflow-wrap: anywhere; }
.chart-head .sub { display: block; }
.chart-head > div { min-width: 0; }
.chart-head b { white-space: nowrap; flex: none; }
.chart-head b small { font-size: 12px; font-weight: 500; color: var(--mute); }
/* чип с настоящим select поверх: выглядит как в макете, открывает родной список */
.pick { position: relative; display: inline-block; padding: 5px 12px; font-size: 11px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.ex { padding: 16px; }
.ex + .ex { margin-top: 16px; }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ex-head b { font-size: 16px; overflow-wrap: anywhere; }
.ex-head .sub { white-space: nowrap; }
.mini { display: flex; gap: 10px; margin: 10px 0 6px; }
.mini > div { flex: 1; padding: 10px; border-radius: 14px; min-width: 0; }
.mini b { font-size: 17px; display: block; font-variant-numeric: tabular-nums; }
.mini span { font-size: 10px; color: var(--mute); }
.rec-l { margin: 10px 0 2px; }
/* плашка «новый» — одно из трёх мест, где можно жёлтый */
.rec-new { background: var(--yellow); color: var(--on-yellow); font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.home-stats .hs-card { min-height: 60px; }
.home-stats .hs-card + .hs-card { margin-top: 16px; }
.home-stats .chips { margin-bottom: 6px; }
.home-stats .chips[hidden] { display: none; }

/* ---------- цвет дня программы: элемент рисует себя через var(--dc) / var(--dci) ---------- */
.c-red { --dc: var(--day-red); --dci: var(--day-red-ink); }
.c-blue { --dc: var(--day-blue); --dci: var(--day-blue-ink); }
.c-green { --dc: var(--day-green); --dci: var(--day-green-ink); }
.c-violet { --dc: var(--day-violet); --dci: var(--day-violet-ink); }
.c-orange { --dc: var(--day-orange); --dci: var(--day-orange-ink); }
.c-aqua { --dc: var(--day-aqua); --dci: var(--day-aqua-ink); }
.c-magenta { --dc: var(--day-magenta); --dci: var(--day-magenta-ink); }
.c-yellow { --dc: var(--day-yellow); --dci: var(--day-yellow-ink); }
.c-none { --dc: var(--day-none); --dci: var(--day-none-ink); }

/* «Последние тренировки»: полоска слева цветом дня */
.recent { overflow: hidden; }
.recent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--dc);
}
.recent .label { display: flex; align-items: center; gap: 6px; }
.recent .dmark { min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }

.settings-btn { display: block; width: 100%; margin-top: 26px; padding: 14px; border-radius: 16px; font-weight: 600; }
/* главная: карточки еды и недели во всю ширину — семь точек по 22 px не влезают в половину */
.home-cards { grid-template-columns: 1fr; }
.home-cards .week { justify-content: space-between; }

/* ---------- настройки ---------- */
.set-card + .set-card { margin-top: 16px; }
.set-goals .field { margin-top: 10px; }
.set-name { flex: none; width: 76px; color: var(--mute); font-size: 13px; }
.set-goals .field input { text-align: right; }
.set-goals .field > span:last-child { flex: none; width: 30px; color: var(--mute); font-size: 13px; }
.set-hint { font-size: 11px; color: var(--mute); margin-top: 8px; }
.set-foot { text-align: center; margin: 18px 0 8px; }
.set-plates { flex-wrap: wrap; overflow: visible; gap: 8px; margin: 8px 0 0; }
.set-plates .chip { min-width: 52px; }
.set-bar { flex: none; width: 96px; margin-top: 0; }
.set-bar input { text-align: right; }
.set-card .set-line + .set-line { margin-top: 10px; }
.set-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.set-line .pick { font-size: 13px; padding: 8px 12px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .round { width: 36px; height: 36px; font-size: 18px; }
.stepper .round:disabled { opacity: .4; }
.stepper b { min-width: 22px; text-align: center; font-size: 18px; }
.set-day { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.swatch { display: grid; place-items: center; padding: 10px 0; border-radius: 14px; }
.swatch .dmark { min-width: 30px; height: 30px; border-radius: 15px; font-size: 13px; }
/* выбранный — вдавленный: состояние видно не только цветом */
.swatch.on, .btn.ghost.on { box-shadow: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi); }


/* ---------- лист плана тренировки ---------- */
.plan-title { margin: 14px 0 8px; }
.plan-days { margin-bottom: 4px; }
.plan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; }
.plan-chip .dmark { min-width: 20px; height: 20px; font-size: 10px; }
.plan-chip.on { box-shadow: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi); font-weight: 700; }
.plan-ex { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-ex-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-ex-head b { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.plan-tools { display: flex; gap: 6px; flex: none; }
.plan-tool { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; display: grid; place-items: center; padding: 0; }
.plan-tool:disabled { opacity: .35; }
.plan-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.plan-fields .field { margin-top: 0; padding: 8px 10px; gap: 4px; }
.plan-fields .field input { text-align: right; font-variant-numeric: tabular-nums; }
.plan-fields .field span { font-size: 11px; white-space: nowrap; }
.rec-reps { font-size: 14px; font-weight: 600; margin-top: 4px; }
.plan-bump { font-style: normal; font-weight: 700; color: var(--good); margin-left: 3px; }
.plan-empty { margin: 12px 0 0; }
.plan-add { margin-top: 12px; }
.plan-note textarea { flex: 1; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 15px; resize: none; color: var(--ink); }
.plan-repeat { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; }
.plan-repeat[hidden] { display: none; }
.plan-repeat input { width: 20px; height: 20px; accent-color: var(--accent); }
.up-day { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); }
.up-day .dmark { min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
.wo-plan { color: var(--ink); }
.wo-plan.met { color: var(--good); font-weight: 600; }

/* настройки: уведомление о плане */
.set-notify + .set-notify { margin-top: 12px; }
.set-time { margin-top: 0; padding: 6px 12px; }
.set-time input { font-size: 15px; color: var(--ink); text-align: right; }
.set-time input:disabled { opacity: .5; }
/* переключатель: состояние видно положением кружка, не только цветом */
.switch { position: relative; width: 52px; height: 30px; border-radius: 15px; padding: 0; flex: none; }
.switch i { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--mute); transition: left .15s ease-out; }
.switch.on i { left: 26px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .switch i { transition: none; } }

/* время тренировки */
.wo-time { margin-top: 0; margin-bottom: 14px; font-size: 13px; }
.wo-time .g { color: var(--mute); }
.wo-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wo-times .field { margin-top: 14px; }
.wo-times .field input { text-align: right; font-size: 16px; color: var(--ink); }

/* ---------- поделиться планом ---------- */
.cal-share { display: block; width: 100%; margin-top: 12px; padding: 10px; border-radius: 14px; font-size: 13px; font-weight: 600; text-align: center; }
.cal-share[hidden] { display: none; }
.cal-link { overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
/* подпись «по плану …»: одна мелкая строка, без рамки (лист плана, доска тренировки) */
.plan-src { font-size: 11px; color: var(--mute); padding-top: 10px; overflow-wrap: anywhere; }
.ps-list { margin-top: 0; }
.ps-plan { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ps-plan:last-child { border-bottom: none; }
.ps-plan .li { border-bottom: none; padding-bottom: 6px; }
.ps-plan.past { opacity: .5; }
.ps-ex { font-size: 13px; padding: 3px 0; overflow-wrap: anywhere; }
.ps-ex span { color: var(--mute); white-space: nowrap; }
.ps-note { font-size: 12px; color: var(--mute); margin-top: 4px; overflow-wrap: anywhere; }
.ps-why { text-align: center; margin: 16px 6px 0; font-size: 13px; }
.ps-modes { display: grid; gap: 10px; margin-top: 16px; }
.ps-modes > button { padding: 13px; border-radius: 16px; font-size: 14px; font-weight: 600; text-align: center; }

/* ---------- фото прогресса ---------- */
.ph-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.ph-bar .btn { flex: 1; padding: 12px; border-radius: 16px; font-weight: 600; text-align: center; cursor: pointer; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn.ph-cell { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: pointer; }
.ph-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-cell.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph-n { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent);
  color: var(--on-accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ph-compare { margin-bottom: 14px; }
.ph-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ph-pair figure { margin: 0; }
.ph-pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; display: block; background: var(--lo); }
.ph-pair figcaption { text-align: center; font-size: 12px; color: var(--mute); margin-top: 6px; }
.ph-full { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 16px; margin-top: 12px; background: var(--lo); }
.ph-del { color: var(--bad); }

/* ---------- подсказка вечером ---------- */
.hint-box { margin-bottom: 14px; }
.hint-card { padding: 14px 16px; }
.hint-text { font-size: 14px; font-weight: 600; line-height: 1.4; }
.hint-add { display: block; width: 100%; margin-top: 10px; padding: 11px; border-radius: 14px; font-weight: 600; }

/* ---------- мои блюда ---------- */
.rc-link { display: block; margin: 0 0 10px auto; }
.rc-add { display: block; width: 100%; padding: 13px; border-radius: 16px; font-weight: 600; margin-bottom: 14px; }
.rc-list { display: flex; flex-direction: column; gap: 12px; }
.btn.rc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border-radius: 20px; text-align: left; }
.rc-card b { font-size: 16px; }
.rc-card .g { font-size: 12px; color: var(--mute); }
.rc-hint { margin-top: 14px; }
.rc-nums { display: flex; gap: 10px; margin-top: 12px; }
.rc-nums .field { flex: 1 1 0; min-width: 0; margin-top: 0; }
.rc-nums .field > span:first-child { color: var(--mute); font-size: 13px; }
.rc-nums input { text-align: right; min-width: 0; width: 100%; }

/* ---------- сканер штрихкода ---------- */
.food-input .scan-btn { font-size: 18px; }
.scan-view { position: relative; margin-top: 12px; border-radius: 18px; overflow: hidden; background: var(--lo); aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 35%; bottom: 35%; border: 3px solid var(--accent); border-radius: 12px; }
.scan-photo { display: block; margin-top: 12px; padding: 12px; border-radius: 16px; font-weight: 600; text-align: center; cursor: pointer; }
.scan-name { margin-top: 10px; }
