/* Режим v14 «Форма» — оформление.

   Цвет кодирует тип дня, как в его PDF: верх — оранжевый, низ — синий,
   памп — фиолетовый, фулбади — бирюзовый, отдых — графит, еда — зелёный.
   Это не украшение: по цвету полосы «волны» видно, какой день сегодня и что
   пропущено. Condensed-гарнитура Oswald — та же, что в заголовках PDF, и она
   лежит локально: шрифт по сети в офлайн-PWA не доедет. */

@font-face {
  font-family: 'Oswald'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/oswald-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Oswald'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/oswald-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #eef0ec;
  --surface: #ffffff;
  --surface-2: #e4e7e1;
  --cell-w: #d9ddd5;
  --cell-r: #ffffff;
  --ink: #15171a;
  --muted: #5d636b;
  --line: #d6dad2;
  --upper: #ff6a1a;
  --lower: #2f6bff;
  --pump: #8b5cf6;
  --full: #0c9c9c;
  --rest: #8a9199;
  --food: #1b9e55;
  --warn: #d99a00;
  --bad: #e5484d;
  --good: #1b9e55;
  --on-accent: #ffffff;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 20px -12px rgba(0,0,0,.25);
  --radius: 14px;
  --display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113; --surface: #171a1d; --surface-2: #1f2327; --cell-w: #2a2f34; --cell-r: #111315;
    --ink: #eceeea; --muted: #9ba1a8; --line: #2a2f34;
    --upper: #ff7a2e; --lower: #4c80ff; --pump: #9d74ff; --full: #19b3b3; --rest: #6c737b;
    --food: #2bb866; --warn: #f2b01e; --bad: #ff5d62; --good: #2bb866;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px -18px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113; --surface: #171a1d; --surface-2: #1f2327; --cell-w: #2a2f34; --cell-r: #111315;
  --ink: #eceeea; --muted: #9ba1a8; --line: #2a2f34;
  --upper: #ff7a2e; --lower: #4c80ff; --pump: #9d74ff; --full: #19b3b3; --rest: #6c737b;
  --food: #2bb866; --warn: #f2b01e; --bad: #ff5d62; --good: #2bb866;
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px -18px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body);
  padding-bottom: calc(76px + var(--safe-b)); min-height: 100vh; overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--upper); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.loading { padding: 40px 0; color: var(--muted); text-align: center; }
[hidden] { display: none !important; }

/* ── типографика ── */
.eyebrow { font: 700 11px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.display { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: -.005em; line-height: .92; }
.h2 { font: 500 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0; }
.h3 { font: 600 16px/1.25 var(--body); margin: 0; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
p { margin: 0 0 8px; }

/* ── шапка ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 54px; gap: 12px; }
.top-id { display: flex; flex-direction: column; min-width: 0; }
.top-title { font: 600 19px/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── нижняя навигация ── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar-row { display: grid; grid-template-columns: repeat(5, 1fr); padding: 0 6px; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; color: var(--muted); min-height: 58px; }
.tabbar i { font-style: normal; font-size: 18px; line-height: 1; }
.tabbar b { font-weight: 600; font-size: 11px; letter-spacing: .01em; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on i { color: var(--upper); }

/* ── карточки и блоки ── */
.block { margin: 18px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.card.flat { box-shadow: none; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; border: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin: 4px 0; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; background: var(--surface-2); font-weight: 600; text-align: center; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--upper); color: var(--on-accent); }
.btn.food { background: var(--food); color: var(--on-accent); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 14px; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }
.link { color: var(--upper); font-weight: 600; text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2);
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font: 700 10px/1.4 var(--body); letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); }
.tag.upper { background: color-mix(in srgb, var(--upper) 16%, transparent); color: var(--upper); }
.tag.lower { background: color-mix(in srgb, var(--lower) 16%, transparent); color: var(--lower); }
.tag.pump { background: color-mix(in srgb, var(--pump) 16%, transparent); color: var(--pump); }
.tag.full { background: color-mix(in srgb, var(--full) 16%, transparent); color: var(--full); }
.tag.food { background: color-mix(in srgb, var(--food) 16%, transparent); color: var(--food); }
.tag.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.tag.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ── ВОЛНА: 28 дней одной полосой. Высота столбика = плановые подходы дня,
   поэтому волна Н1 → Н4 видна как волна, а не как надпись. ── */
.wave { padding: 16px 0 6px; }
.wave-bars { display: grid; grid-template-columns: repeat(28, 1fr); align-items: end; gap: 3px; height: 78px; position: relative; }
.wave-bar { position: relative; border-radius: 3px 3px 1px 1px; min-height: 5px; background: var(--c, var(--rest));
  opacity: .28; transition: opacity .2s, transform .2s; }
.wave-bar.done { opacity: 1; }
.wave-bar.missed { opacity: 1; background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.wave-bar.rest { --c: var(--rest); }
.wave-bar.rest.done { opacity: .7; }
.wave-bar.today { opacity: 1; outline: 2px solid var(--ink); outline-offset: 2px; }
.wave-bar.future.rest { opacity: .2; }
.wave-bar button { position: absolute; inset: -8px -2px -18px; }
.wave-weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 8px; }
.wave-week { border-top: 2px solid var(--line); padding-top: 5px; font: 600 11px/1.2 var(--body); color: var(--muted); letter-spacing: .04em; }
.wave-week.on { border-color: var(--ink); color: var(--ink); }
.wave-week b { font-family: var(--display); font-size: 13px; font-weight: 600; }
.wave-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wave-meta .display { font-size: 30px; }

/* ── герой дня ── */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 18px 16px 16px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #000) 0%, color-mix(in srgb, var(--c) 70%, #000) 100%); }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%;
  border: 26px solid rgba(255,255,255,.08); pointer-events: none; }
.hero .eyebrow { color: rgba(255,255,255,.78); }
.hero-name { font: 600 54px/.9 var(--display); text-transform: uppercase; margin: 8px 0 6px; letter-spacing: -.01em; }
.hero-focus { font-weight: 600; opacity: .92; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.hero-meta .chip { background: rgba(255,255,255,.16); color: #fff; }
.hero .btn.primary { background: #fff; color: #111; }
.hero .btn.ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.hero.rest { --c: #3a4148; }
.hero-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.18); font-size: 13px; }
.hero-note .btn { margin-top: 8px; }
.mods { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mods button { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.14); color: #fff; }
.mods button.on { background: #fff; color: #111; }

/* ── чек-ин дня ── */
.checkin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checkin > .stepper:first-child { grid-column: 1 / -1; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stepper { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.stepper .eyebrow { font-size: 10px; }
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stepper-row button { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); font-size: 20px; font-weight: 500; line-height: 1; flex: none; }
.stepper-val { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; text-align: center; flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; padding: 0; height: 34px; border-radius: 8px; }
.stepper-val:focus { background: var(--surface); outline: 2px solid var(--upper); }
.stepper-val::placeholder { color: var(--muted); }
.stepper-val small { font: 600 11px var(--body); color: var(--muted); margin-left: 2px; }

.toggle { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; text-align: left; min-height: 52px; }
.toggle .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.toggle.on .box { background: var(--good); border-color: var(--good); color: #fff; }
.toggle b { font-size: 13px; line-height: 1.2; display: block; }
.toggle small { color: var(--muted); font-size: 11px; display: block; }
.mood { display: flex; gap: 6px; }
.mood button { flex: 1; height: 42px; border-radius: 12px; background: var(--surface-2); font-size: 20px; filter: grayscale(1); opacity: .6; }
.mood button.on { filter: none; opacity: 1; background: color-mix(in srgb, var(--upper) 18%, var(--surface-2)); }
.score { display: flex; align-items: center; gap: 10px; }
.ring { width: 46px; height: 46px; flex: none; }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--good); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .3s; }
textarea.note { width: 100%; min-height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; resize: vertical; }

/* ── еда ── */
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.macro { background: var(--surface-2); border-radius: 12px; padding: 9px 10px; }
.macro .num { font-size: 20px; line-height: 1; font-weight: 600; }
.macro .bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 7px; }
.macro .bar span { display: block; height: 100%; background: var(--food); border-radius: 3px; }
.macro .tiny { color: var(--muted); }
.timeline { position: relative; }
.meal { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.meal:first-child { border-top: 0; }
.meal-time { font: 600 16px/1.2 var(--display); font-variant-numeric: tabular-nums; color: var(--muted); padding-top: 2px; }
.meal.now .meal-time { color: var(--food); }
.meal.eaten { opacity: .62; }
.meal-name { font-weight: 600; }
.meal-slot { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meal.late .meal-slot { color: var(--muted); font-style: italic; }
.meal-kcal { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meal-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.eat { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.eat.on { background: var(--food); border-color: var(--food); color: #fff; }
.swap-btn { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 2px; }
.ingredients { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.ingredients li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.ingredients li b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt { display: block; width: 100%; text-align: left; padding: 12px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.opt.on { outline: 2px solid var(--food); }
.opt .tiny { color: var(--muted); }
.crave { display: flex; align-items: center; gap: 12px; }
.crave .display { font-size: 22px; }

/* ── правило весов ── */
.rule-rows { display: grid; gap: 6px; }
.rule-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.rule-row.on { outline: 2px solid var(--ink); background: var(--surface); }
.bigdelta { font: 600 38px/1 var(--display); font-variant-numeric: tabular-nums; }

/* ── программа ── */
.week-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.week-pill { border-radius: 12px; padding: 10px 8px 9px; background: var(--surface-2); text-align: left; position: relative; overflow: hidden; }
.week-pill .num { font-size: 22px; line-height: 1; font-weight: 600; }
.week-pill .tiny { display: block; color: var(--muted); margin-top: 2px; }
.week-pill .fill { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--upper); }
.week-pill.on { background: var(--ink); color: var(--bg); }
.week-pill.on .tiny { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.week-pill.now::after { content: 'сейчас'; position: absolute; top: 6px; right: 7px; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--upper); }
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-chip { border-radius: 10px; padding: 7px 4px; text-align: center; background: color-mix(in srgb, var(--c, var(--rest)) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--rest)) 35%, transparent); }
.day-chip .tiny { display: block; color: var(--muted); font-weight: 700; }
.day-chip b { display: block; font: 600 12px/1.15 var(--display); text-transform: uppercase; color: var(--c, var(--rest)); margin-top: 2px; }
.day-chip.today { outline: 2px solid var(--ink); }
.wk { border-left: 4px solid var(--c); }
.wk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; width: 100%; text-align: left; }
.wk-name { font: 600 26px/1 var(--display); text-transform: uppercase; color: var(--c); }
.ex-rows { margin-top: 10px; }
.ex-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.ex-row .lbl { font: 600 15px var(--display); color: var(--muted); }
.ex-row .nm { font-weight: 600; font-size: 14px; line-height: 1.25; }
.ex-row .sub { font-size: 12px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.dots i.on { background: var(--c, var(--ink)); }
.ss-bracket { border-left: 2px dashed var(--line); margin-left: 12px; padding-left: 8px; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 36px; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--upper)); }
.acc { border-top: 1px solid var(--line); }
.acc:first-child { border-top: 0; }
.acc > summary { list-style: none; cursor: pointer; padding: 13px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.acc[open] > summary::after { content: '−'; }
.acc-body { padding: 0 0 14px; }
.example { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.example span { font: 600 15px var(--display); padding: 5px 8px; border-radius: 8px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.example span.win { background: var(--upper); color: #fff; }
.example i { color: var(--muted); font-style: normal; }

/* ── ПЛЕЕР ТРЕНИРОВКИ ── */
.player { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.p-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.p-top { display: flex; align-items: center; gap: 8px; min-height: 54px; }
.p-title { flex: 1; min-width: 0; }
.p-title b { display: block; font: 600 20px/1 var(--display); text-transform: uppercase; color: var(--c); }
.p-title span { font-size: 12px; color: var(--muted); }
.p-clock { font: 600 18px var(--display); font-variant-numeric: tabular-nums; color: var(--muted); }
.p-progress { height: 4px; background: var(--surface-2); }
.p-progress span { display: block; height: 100%; background: var(--c); transition: width .3s; }
.p-steps { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 10px; scrollbar-width: none; max-width: 560px; margin: 0 auto; }
.p-steps::-webkit-scrollbar { display: none; }
.p-step { flex: none; min-width: 38px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); font: 600 14px var(--display); color: var(--muted); }
.p-step.on { background: var(--ink); color: var(--bg); }
.p-step.done { background: color-mix(in srgb, var(--c) 22%, var(--surface-2)); color: var(--ink); }
.p-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 150px; }
.p-foot { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.p-nav { display: flex; gap: 8px; padding: 10px 0; }
.p-nav .btn { flex: 1; }

.exc { margin: 14px 0; }
.exc-head { display: flex; gap: 12px; align-items: flex-start; }
.exc-lbl { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; font: 600 20px var(--display); }
.exc-name { font: 600 25px/1.02 var(--display); text-transform: uppercase; margin: 0; letter-spacing: -.005em; }
.exc-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.exc-target { margin: 12px 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.exc-target b { font-family: var(--display); font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 600; }
.exc-target.up { background: color-mix(in srgb, var(--upper) 14%, var(--surface-2)); }
.exc-target.hold { background: color-mix(in srgb, var(--warn) 16%, var(--surface-2)); }
.exc-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.cues { margin: 8px 0; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.cues ol { margin: 0; padding-left: 20px; }
.cues li { margin: 4px 0; }
.cues .err { margin-top: 8px; color: var(--bad); font-size: 13px; }
.cues .depth { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 14%, transparent); font-size: 13px; }

/* Строка подхода — дневник PDF: серая клетка вес, белая — повторы. */
.sets { display: grid; gap: 6px; margin: 10px 0; }
.set { display: grid; grid-template-columns: 26px minmax(76px, 0.9fr) 1.4fr 48px; gap: 6px; align-items: stretch; }
.set-n { display: grid; place-items: center; font: 600 15px var(--display); color: var(--muted); }
.cell { border-radius: 12px; min-height: 52px; display: flex; align-items: center; justify-content: center; font: 600 22px var(--display); font-variant-numeric: tabular-nums; }
.cell small { font: 600 11px var(--body); color: var(--muted); margin-left: 3px; }
.cell.w { background: var(--cell-w); flex-direction: column; line-height: 1; gap: 2px; }
.cell.w small { margin: 0; font-size: 10px; }
.cell.w.none { font-size: 12px; font-family: var(--body); color: var(--muted); }
.cell.r { background: var(--cell-r); border: 1px solid var(--line); justify-content: space-between; padding: 0 4px; }
.cell.r button { width: 38px; height: 44px; border-radius: 10px; font-size: 22px; color: var(--muted); }
.cell.r button:active { background: var(--surface-2); }
.cell.r .val { flex: 1; text-align: center; }
.cell.r .val.ghost { color: var(--muted); }
.check { border-radius: 12px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--muted); }
.set.done .check { background: var(--c); border-color: var(--c); color: #fff; }
.set.done .cell.r { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.set.next .check { border-color: var(--c); color: var(--c); }
.set-meta { grid-column: 2 / -1; font-size: 12px; color: var(--muted); margin-top: -2px; }
.ladder { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.ladder button { flex: none; min-width: 48px; height: 40px; border-radius: 10px; background: var(--surface-2); font: 600 16px var(--display); }
.ladder button.on { background: var(--ink); color: var(--bg); }
.round-label { font: 700 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 10px 0 2px; }
.ss-tag { display: inline-flex; gap: 6px; align-items: center; font: 700 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--c); margin: 14px 0 0; }
.tech { margin: 6px 0 2px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--c); font-size: 13px; }
.tech b { color: var(--c); }
.prompt { margin: 8px 0; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.prompt-q { font-weight: 600; margin-bottom: 8px; }
.pain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pain button { border-radius: 10px; padding: 9px 4px; background: var(--surface-2); font-size: 12px; font-weight: 700; line-height: 1.15; }
.pain button b { display: block; font: 600 17px var(--display); }
.pain button.on[data-v="0"], .pain button.on[data-v="1"] { background: var(--good); color: #fff; }
.pain button.on[data-v="2"] { background: var(--warn); color: #111; }
.pain button.on[data-v="3"] { background: var(--bad); color: #fff; }
.advice { margin-top: 8px; font-size: 13px; padding: 9px 11px; border-radius: 10px; }
.advice.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.advice.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.advice.ok { background: color-mix(in srgb, var(--good) 14%, transparent); }
.hint { font-size: 13px; padding: 9px 11px; border-radius: 10px; background: color-mix(in srgb, var(--lower) 12%, transparent); margin: 6px 0; }
.warm-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.warm-item:first-child { border-top: 0; }
.warm-item .dose { font: 600 15px var(--display); color: var(--muted); }
.big-timer { text-align: center; padding: 20px 0 8px; }
.big-timer .num { font-size: 84px; line-height: 1; font-weight: 600; }
.big-timer .eyebrow { display: block; margin-bottom: 4px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.stat .num { font-size: 26px; font-weight: 600; line-height: 1; display: block; }
.stat .tiny { color: var(--muted); }

/* ── таймеры (отдых, удержание, кухня, «10 минут») ── */
.timers { position: fixed; left: 0; right: 0; bottom: calc(66px + var(--safe-b)); z-index: 60; pointer-events: none; }
.player:not([hidden]) ~ .timers, body.playing .timers { bottom: calc(70px + var(--safe-b)); }
.timer { pointer-events: auto; max-width: 540px; margin: 6px auto 0; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 8px 8px 8px 14px; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); width: calc(100% - 20px); }
.timer .fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--k, var(--upper)) 40%, transparent); transition: width .25s linear; }
.timer > * { position: relative; }
.timer .lbl { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer .t { font: 600 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.timer button { background: rgba(127,127,127,.25); color: inherit; border-radius: 10px; min-width: 44px; height: 40px; padding: 0 10px; font-weight: 700; font-size: 13px; }
.timer.done { animation: pulse 1s ease-in-out infinite; }
.timer.rest { --k: var(--upper); }
.timer.hold { --k: var(--lower); }
.timer.cook { --k: var(--food); }
.timer.crave { --k: var(--pump); }
@keyframes pulse { 50% { transform: scale(1.02); } }

/* ── прогресс ── */
.tracker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.tracker-wd { font: 700 10px var(--body); text-align: center; color: var(--muted); letter-spacing: .06em; }
.tcell { aspect-ratio: 1; border-radius: 9px; position: relative; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tcell .d { font: 600 14px var(--display); }
.tcell .w { width: 16px; height: 4px; border-radius: 2px; background: var(--c, transparent); }
.tcell .sc { position: absolute; inset: 0; border-radius: 9px; background: var(--good); opacity: var(--s, 0); }
.tcell > * { position: relative; }
.tcell.today { outline: 2px solid var(--ink); }
.tcell.future { opacity: .45; }
.week-sum { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 4px 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.week-sum b { color: var(--ink); }
.chart { width: 100%; height: 170px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .corridor { fill: color-mix(in srgb, var(--good) 14%, transparent); }
.chart .pt { fill: var(--muted); }
.chart .avg { fill: none; stroke: var(--upper); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .avgpt { fill: var(--upper); }
.chart text { fill: var(--muted); font: 11px var(--body); }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th { text-align: left; font: 700 10px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 4px; }
.mtable td { padding: 7px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mtable td.num { font-size: 16px; }
.delta-up { color: var(--good); font-weight: 700; }
.delta-down { color: var(--bad); font-weight: 700; }
.mfield { display: grid; grid-template-columns: 1fr 140px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mfield:first-child { border-top: 0; }
.mfield input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: center; font: 600 20px var(--display); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { aspect-ratio: 3/4; border-radius: 12px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; padding: 6px; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.compare { position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--x, 50%)); }
.compare .line { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.compare input { position: absolute; inset: auto 0 10px; width: calc(100% - 20px); margin: 0 10px; }
.vratio { display: flex; align-items: baseline; gap: 10px; }
.vratio .num { font-size: 44px; font-weight: 600; line-height: 1; }

/* ── покупки ── */
.shop-cat { margin: 14px 0 6px; }
.shop-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.shop-item .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.shop-item.on .box { background: var(--food); border-color: var(--food); color: #fff; }
.shop-item.on .nm { text-decoration: line-through; color: var(--muted); }
.shop-item .qty { font: 600 15px var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.shop-item .qty small { display: block; font: 600 11px var(--body); color: var(--muted); }
.gear { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.gear:first-child { border-top: 0; }
.gear .prio { font: 600 22px var(--display); color: var(--muted); }
.gear-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.gear .effect { font-size: 12px; margin-top: 6px; color: var(--food); font-weight: 600; }
.prep-step { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
/* Заготовка: партия → вес готового → судки. */
.prep-comp { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.prep-comp .eat { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
.prep-comp.done > div > .card-row b:first-child { text-decoration: line-through; color: var(--muted); }
.yield { margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.yield label { display: block; font-weight: 600; margin-bottom: 4px; }
.yield input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: 600 20px var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.prep-box { padding: 10px 0; border-top: 1px solid var(--line); }
.prep-box .ingredients li span:last-child { text-align: right; }
.tag.cold { background: color-mix(in srgb, var(--lower) 16%, transparent); color: var(--lower); }
.prep-cta { display: block; border-color: var(--food); }
.nw { white-space: nowrap; }
/* Кухонный режим: читается с расстояния вытянутой руки. */
.kitchen { padding-top: 14px; }
.kitchen .k-title { font: 600 30px/1.05 var(--display); text-transform: uppercase; margin: 4px 0 10px; }
.kitchen .k-amount { font-size: 18px; margin: 0 0 10px; }
.kitchen .k-how { font-size: 17px; line-height: 1.5; margin: 0 0 14px; }
.kitchen .k-list { font-size: 15px; }
.kitchen .k-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.kitchen .yield input { height: 56px; font-size: 26px; }
/* Отчёт недели — текст, который уходит в чат как есть. */
.report { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Consolas, monospace; background: var(--surface-2); border-radius: 12px; padding: 10px; max-height: 320px; overflow: auto; margin: 8px 0 0; }
.prep-days { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.micro { padding: 8px 0; border-top: 1px solid var(--line); }
.micro .bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.micro .bar span { display: block; height: 100%; background: var(--food); border-radius: 3px; }
.micro.low .bar span { background: var(--warn); }
.micro.low b { color: var(--warn); }
.missed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ── шторка ── */
.backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 90vh; background: var(--bg); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; max-width: 600px; margin: 0 auto; box-shadow: 0 -10px 40px rgba(0,0,0,.3); padding-bottom: var(--safe-b); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 16px 6px; }
.sheet-head h2 { font: 600 22px/1.1 var(--display); text-transform: uppercase; margin: 0; }
.sheet-body { overflow-y: auto; padding: 4px 16px 24px; -webkit-overflow-scrolling: touch; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: 13px; font-weight: 600; }
.field input[type="date"], .field input[type="time"], .field input[type="number"], .field select {
  height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays button { height: 40px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 12px; }
.weekdays button.on { background: var(--ink); color: var(--bg); }
.video { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; margin: 8px 0; }
.video iframe, .video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video button { position: absolute; inset: 0; display: grid; place-items: center; }
.video button span { width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 26px; }
.video-title { font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }

@media (min-width: 700px) {
  .hero-name { font-size: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
