/* Треня — стили. Цвета только из токенов (ТЗ, design/tokens.css), тёмная тема. */
:root {
  --bg: #0E0F10; --surface: #17191B; --surface-2: #23272A; --line: #2A2E31;
  --ink: #F4F6F6; --ink-muted: #9AA3A6; --card: #FFFFFF; --on-card: #0E0F10; --on-card-muted: #5F676A;
  --accent: #5CE1E6; --on-accent: #0A1214; --accent-text: #5CE1E6; --glow: #3FB8C4;
  --alarm: #FF5A47; --alarm-soft: #3A1511; --success: #7BE38A; --track: #E3E7E8; --warn: #F2C14E;
  --shadow-card: 0 12px 32px -8px #000000b3; --focus-ring: 0 0 0 2px #0E0F10, 0 0 0 4px #5CE1E6;
  --radius-sm: 12px; --radius-lg: 28px; --radius-full: 9999px;
  --font-display: "Dela Gothic One", "Arial Black", sans-serif;
  --font-sans: "Golos Text", system-ui, -apple-system, sans-serif;
  --tg-safe-top: 0px; --tg-safe-bottom: 0px; --tg-content-top: 0px; --tg-content-bottom: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
/* у Dela Gothic One одно начертание — без поддельного жирного */
html { font-synthesis: none; }
body { background: var(--bg); color: var(--ink); font: 500 15px/22px var(--font-sans); overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
a { color: var(--accent-text); text-decoration: none; }
img { display: block; }
.num, .metric, .big { font-variant-numeric: tabular-nums; }

#app { max-width: 520px; margin: 0 auto; min-height: 100%; position: relative; }
.glow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(340px 300px at var(--gx, 30%) var(--gy, 30%), rgba(63,184,196,.36), rgba(63,184,196,0) 72%); }
#view { position: relative; z-index: 1; padding: calc(var(--tg-safe-top) + var(--tg-content-top) + 18px) 20px calc(110px + var(--tg-safe-bottom)); }
#view.no-tabs { padding-bottom: calc(40px + var(--tg-safe-bottom)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.muted { color: var(--ink-muted); }

/* заголовки */
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.title { margin: 0; font: 400 clamp(32px, 10.5vw, 46px)/0.95 var(--font-display); text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap; }
.title.sm { font-size: 32px; white-space: normal; }
.cap { font: 700 11px/14px var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted); }
.h2 { font: 800 20px/26px var(--font-sans); margin: 0; }
.h3 { font: 800 16px/22px var(--font-sans); margin: 0; }
.lead { color: var(--ink-muted); margin: 0; }
.link { font: 800 13px/18px var(--font-sans); color: var(--accent-text); }

/* кнопки */
.rb { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--ink);
  display: inline-grid; place-items: center; flex: none; }
.rb svg { width: 18px; height: 18px; }
.rb.accent { background: var(--accent); color: var(--on-accent); }
.ava { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent);
  display: inline-grid; place-items: center; font: 400 16px var(--font-display); flex: none; }
.btn { height: 54px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent);
  font: 800 16px var(--font-sans); display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 0 20px; }
.btn.sec { background: var(--surface-2); color: var(--ink); }
.btn.alarm { background: var(--alarm); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink-muted); height: 44px; }
.btn.sm { height: 42px; font-size: 14px; width: auto; }
.btn:disabled { opacity: .45; }
.btn svg { width: 20px; height: 20px; }
.pill { height: 36px; padding: 0 14px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--ink);
  font: 800 13px var(--font-sans); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill svg { width: 16px; height: 16px; }
.pill.on { background: var(--accent); color: var(--on-accent); }

/* сегменты и чипы */
.seg { display: flex; background: var(--surface-2); border-radius: var(--radius-full); padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 40px; border-radius: var(--radius-full); font: 800 14px var(--font-sans); color: var(--ink-muted); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border-radius: var(--radius-full); box-shadow: inset 0 0 0 1px var(--line);
  font: 700 13px var(--font-sans); color: var(--ink); white-space: nowrap; flex: none; }
.chip.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.chip:disabled { opacity: .4; }

/* панели и карточки */
.panel { background: var(--surface); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); color: var(--on-card); border-radius: 26px; padding: 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--card); color: var(--on-card); border-radius: 26px; padding: 14px; display: flex; flex-direction: column;
  min-height: 124px; text-align: left; }
.tile .lbl { font: 700 13px/18px var(--font-sans); display: flex; justify-content: space-between; }
.tile .lbl svg, .hero svg { width: 18px; height: 18px; flex: none; }
.hero .ctrl .play svg { width: 20px; height: 20px; }
.tile .bar { height: 4px; border-radius: 2px; background: var(--track); width: 70%; margin-top: 6px; overflow: hidden; }
.tile .bar i { display: block; height: 100%; background: var(--on-card); }
.tile .val { margin-top: auto; font: 400 31px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.tile .val small { font-size: 16px; }
.tile .sub { font: 700 10px/13px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--on-card-muted); margin-top: 4px; }
.tile.dark { background: var(--surface); color: var(--ink); }
.tile.dark .sub { color: var(--ink-muted); }
.progress { height: 6px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }

/* упражнения */
.exrow { display: flex; gap: 12px; align-items: center; background: var(--card); color: var(--on-card); border-radius: 22px;
  padding: 10px 12px 10px 10px; text-align: left; width: 100%; }
.exrow .pic { width: 58px; height: 58px; border-radius: 16px; background: var(--track); flex: none; overflow: hidden;
  display: grid; place-items: center; color: var(--on-card-muted); }
.exrow .pic img { width: 100%; height: 100%; object-fit: cover; }
.exrow .pic svg { width: 28px; height: 28px; }
.exrow .nm { font: 700 15px/20px var(--font-sans); }
.exrow .mt { font: 700 10px/14px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--on-card-muted); margin-top: 2px; }
.exrow .nt { font: 500 12px/16px var(--font-sans); color: var(--on-card-muted); margin-top: 3px; }
.exrow .st { width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--track); flex: none; display: grid; place-items: center; color: #fff; }
.exrow .st.done { background: var(--on-card); }
.exrow .st svg { width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.excard { background: var(--card); color: var(--on-card); border-radius: 22px; padding: 8px 8px 12px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.excard .pic { height: 108px; border-radius: 16px; background: var(--track); overflow: hidden; position: relative; display: grid; place-items: center; color: var(--on-card-muted); }
.excard .pic img { width: 100%; height: 100%; object-fit: cover; }
.excard .tag { position: absolute; left: 6px; top: 6px; background: var(--on-card); color: var(--card); font: 800 9px/1 var(--font-sans);
  letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; }
.excard .nm { font: 700 14px/18px var(--font-sans); padding: 0 4px; }
.excard .mt { font: 700 9.5px/13px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--on-card-muted); padding: 0 4px; }
/* два кадра: начало и конец движения — чередуем */
.frames { position: relative; width: 100%; height: 100%; }
.frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.frames img + img { animation: flip 1.8s steps(1) infinite; }
@keyframes flip { 0% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .frames img + img { animation: none; opacity: 0; } }

/* неделя */
.week { display: flex; gap: 6px; }
.week span { flex: 1; text-align: center; padding: 7px 0; border-radius: 12px; font: 800 11px var(--font-sans); color: var(--ink-muted); }
.week .done { background: var(--surface-2); color: var(--ink); }
.week .planned { box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.week .missed { background: var(--alarm-soft); color: var(--alarm); }
.week .today { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* тренер */
.coachb { display: flex; gap: 10px; align-items: flex-start; background: var(--alarm-soft); border-radius: 20px; padding: 12px; }
.coachb .av { width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--alarm); color: var(--bg);
  display: grid; place-items: center; font: 400 14px var(--font-display); flex: none; }
.coachb b { display: block; font: 800 10.5px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--alarm); }
.coachb p { margin: 3px 0 0; font: 500 14px/20px var(--font-sans); color: var(--ink); white-space: pre-wrap; }
.coachb.neutral { background: var(--surface); }
.coachb.neutral b { color: var(--accent-text); }
.msg-user { align-self: flex-end; max-width: 82%; background: var(--surface-2); border-radius: 20px 20px 6px 20px; padding: 10px 14px; white-space: pre-wrap; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.bars { display: inline-flex; gap: 3px; }
.bars i { width: 6px; height: 16px; border-radius: 3px; background: var(--line); }
.bars i.on { background: var(--alarm); }

/* таб-бар */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--tg-safe-bottom)); z-index: 5;
  width: calc(100% - 28px); max-width: 492px; display: flex; justify-content: space-around; align-items: center;
  background: var(--surface); border-radius: var(--radius-full); padding: 6px; box-shadow: 0 10px 30px -10px #000; }
.tabbar button { width: 52px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: var(--ink-muted); position: relative; }
.tabbar button.on { background: var(--surface-2); color: var(--accent-text); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar .dot { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; border-radius: 99px; background: var(--alarm); }

/* шторка */
/* шторки — поверх полноэкранных режимов (.full, .ivl — 30), иначе «Остановить таймер?» не видно */
.scrim { position: fixed; inset: 0; background: #000a; z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); z-index: 41; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + var(--tg-safe-bottom)); transition: transform .25s ease; overscroll-behavior: contain; }
.sheet.on { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet .sh-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }

/* поля */
.field { display: flex; flex-direction: column; gap: 6px; }
.input { height: 50px; border-radius: 16px; background: var(--surface-2); border: 0; padding: 0 16px; width: 100%; font: 600 16px var(--font-sans); }
textarea.input { height: auto; min-height: 80px; padding: 12px 16px; resize: vertical; line-height: 22px; }
.input::placeholder { color: var(--ink-muted); }
.nfield { background: var(--card); color: var(--on-card); border-radius: 22px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.nfield label { font: 700 12px/16px var(--font-sans); color: var(--on-card-muted); }
.nfield input { border: 0; background: none; font: 400 28px/1.15 var(--font-display); width: 100%; padding: 0; color: var(--on-card); }
.nfield .u { font: 700 10px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--on-card-muted); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--surface-2); font: 800 22px var(--font-sans); flex: none; }
.stepper .v { flex: 1; text-align: center; font: 400 27px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.stepper .v small { font: 700 11px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); display: block; margin-top: 4px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.sw { width: 50px; height: 30px; border-radius: 99px; background: var(--surface-2); position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 99px; background: var(--ink-muted); transition: .2s; }
.sw.on { background: var(--accent); }
.sw.on::after { left: 23px; background: var(--on-accent); }
input[type=time].input { color-scheme: dark; }

/* варианты (цель, тренер) */
.opt { background: var(--surface); border-radius: 22px; padding: 14px 16px; text-align: left; display: flex; flex-direction: column; gap: 4px;
  box-shadow: inset 0 0 0 1.5px transparent; width: 100%; }
.opt.on { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--surface-2); }
.opt.coach.on { box-shadow: inset 0 0 0 1.5px var(--alarm); background: var(--alarm-soft); }
.opt .t { font: 800 17px/22px var(--font-sans); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.opt .d { color: var(--ink-muted); font-size: 13.5px; line-height: 19px; }
.opt .q { font-size: 13.5px; line-height: 19px; font-style: italic; }
.opt:disabled { opacity: .45; }

/* онбординг */
.ob { min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.ob-top { display: flex; align-items: center; gap: 12px; }
.ob-top .progress { flex: 1; }
.ob-foot { position: sticky; bottom: 0; padding: 12px 0 calc(12px + var(--tg-safe-bottom)); background: linear-gradient(transparent, var(--bg) 30%); margin-top: auto; }
.hero { position: relative; height: 330px; margin: 10px 0 0; }
.hero .card { position: absolute; width: 190px; box-shadow: var(--shadow-card); }
.hero .c1 { left: 0; top: 30px; transform: rotate(-7deg); }
.hero .c2 { right: 0; top: 0; transform: rotate(6deg); }
.hero .c3 { left: 60px; top: 170px; transform: rotate(-2deg); width: 210px; }
.mega { font: 400 72px/0.9 var(--font-display); text-transform: uppercase; margin: 0; letter-spacing: -.01em; }
.wordmark { margin: 0; width: min(100%, 330px); }
.wordmark img { width: 100%; height: auto; display: block; }
.loadsteps { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.loadsteps div { display: flex; gap: 12px; align-items: center; color: var(--ink-muted); font-weight: 700; }
.loadsteps div.on { color: var(--ink); }
.loadsteps div.ok { color: var(--accent-text); }
.loadsteps i { width: 22px; height: 22px; border-radius: 99px; box-shadow: inset 0 0 0 2px var(--line); flex: none; display: grid; place-items: center; }
.loadsteps .on i { box-shadow: inset 0 0 0 2px var(--accent); animation: pulse 1s infinite; }
.loadsteps .ok i { background: var(--accent); box-shadow: none; color: var(--on-accent); }
.loadsteps i svg { width: 14px; height: 14px; }
@keyframes pulse { 50% { opacity: .35; } }
.phases { display: flex; flex-direction: column; gap: 8px; }
.phase { display: flex; gap: 12px; align-items: flex-start; }
.phase .n { width: 30px; height: 30px; border-radius: 99px; background: var(--surface-2); display: grid; place-items: center; font: 400 13px var(--font-display); flex: none; }
.phase.cur .n { background: var(--accent); color: var(--on-accent); }

/* полноэкранные режимы: тренировка и интервалы */
.full { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto;
  padding: calc(var(--tg-safe-top) + var(--tg-content-top) + 14px) 20px calc(20px + var(--tg-safe-bottom)); }
.full .in { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.runcard { background: var(--card); color: var(--on-card); border-radius: 28px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.runcard .media { height: 210px; border-radius: 20px; background: #fff; overflow: hidden; display: grid; place-items: center; color: var(--on-card-muted); }
.runcard .media svg { width: 44px; height: 44px; }
.runcard .nm { font: 400 21px/1.1 var(--font-display); text-transform: uppercase; }
.runcard .reps { font: 400 21px/1 var(--font-display); white-space: nowrap; flex: none; }
.bigtime { font: 400 58px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.midtime { font: 400 24px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ctrl { display: flex; align-items: center; justify-content: space-between; }
.ctrl .side { width: 90px; font: 800 15px var(--font-sans); color: var(--ink-muted); text-align: left; }
.ctrl .side:last-child { text-align: right; color: var(--ink); }
.ctrl .play { width: 80px; height: 80px; border-radius: 99px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.ctrl .play svg { width: 26px; height: 26px; }
.logbox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logbox .stepper .v { font-size: 23px; }
.logbox .stepper button { width: 42px; height: 42px; }

/* интервалы */
.ivl { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; transition: background .25s;
  padding: calc(var(--tg-safe-top) + var(--tg-content-top) + 14px) 20px calc(22px + var(--tg-safe-bottom)); }
.ivl.prep { background: var(--surface-2); color: var(--ink); }
.ivl.work { background: var(--accent); color: var(--on-accent); }
.ivl.rest, .ivl.setrest { background: var(--alarm); color: var(--bg); }
.ivl.done { background: var(--bg); color: var(--ink); }
.ivl .in { max-width: 520px; width: 100%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.ivl .phase-l { font: 400 30px/1 var(--font-display); text-transform: uppercase; }
.ivl .clock { font: 400 min(23vw, 120px)/0.95 var(--font-display); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: center; margin: auto 0 0; }
.ivl .meta { font: 800 13px/18px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.ivl .exn { font: 400 19px/1.15 var(--font-display); text-transform: uppercase; }
.ivl .expic { width: 120px; height: 120px; border-radius: 20px; overflow: hidden; background: #fff; flex: none; }
.ivl .bar { height: 8px; border-radius: 99px; background: #0000002a; overflow: hidden; }
.ivl .bar i { display: block; height: 100%; background: currentColor; }
.ivl .rb { background: #00000022; color: inherit; }
.ivl .ctrl .side { color: inherit; opacity: .85; }
.ivl .ctrl .play { background: currentColor; }
.ivl .ctrl .play svg { color: var(--bg); }
.ivl.work .ctrl .play svg { color: var(--accent); }
.ivl.rest .ctrl .play svg, .ivl.setrest .ctrl .play svg { color: var(--alarm); }
.ivl.prep .ctrl .play svg { color: var(--surface-2); }
.amrap-btn { height: 96px; border-radius: 28px; background: #00000024; font: 400 24px var(--font-display); text-transform: uppercase; color: inherit; }
.laps { display: flex; flex-direction: column; gap: 6px; max-height: 30vh; overflow-y: auto; }
.laps div { display: flex; justify-content: space-between; font: 400 15px var(--font-display); font-variant-numeric: tabular-nums; }

/* календарь */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dn { text-align: center; font: 800 10px var(--font-sans); color: var(--ink-muted); letter-spacing: .06em; }
.cal button { aspect-ratio: 1; border-radius: 14px; font: 400 13px var(--font-display); color: var(--ink-muted); display: grid; place-items: center; }
.cal .done { background: var(--card); color: var(--on-card); }
.cal .planned { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--ink); }
.cal .missed { background: var(--alarm-soft); box-shadow: inset 0 0 0 1.5px var(--alarm); color: var(--alarm); }
.cal .today { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.cal .rest { color: var(--ink-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font: 700 12px var(--font-sans); color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }

/* графики */
.chart svg { width: 100%; height: auto; display: block; }
.hist { display: flex; flex-direction: column; }
.hist > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist > div:last-child { border-bottom: 0; }

/* меню */
.meal { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meal:last-child { border-bottom: 0; }
.meal .mh { display: flex; justify-content: space-between; font: 800 14px var(--font-sans); }
.meal .dish { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-muted); font-size: 14px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.slot .tm { font: 400 16px var(--font-display); width: 58px; font-variant-numeric: tabular-nums; }
ul.list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
ol.list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* мелочи */
.toast { position: fixed; left: 50%; top: calc(var(--tg-safe-top) + var(--tg-content-top) + 12px); transform: translate(-50%, -140%);
  background: var(--surface-2); color: var(--ink); padding: 12px 18px; border-radius: 16px; z-index: 50; font-weight: 700;
  transition: transform .25s; max-width: calc(100% - 32px); box-shadow: var(--shadow-card); }
.toast.on { transform: translate(-50%, 0); }
.skel { background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%;
  animation: sk 1.2s infinite; border-radius: 22px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--ink-muted); padding: 30px 10px; }
.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--alarm-soft);
  color: var(--alarm); font: 800 11px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.badge.acc { background: var(--surface-2); color: var(--accent-text); }
.kv { display: flex; justify-content: space-between; gap: 10px; }
.sep { height: 1px; background: var(--line); }
.spin { width: 22px; height: 22px; border-radius: 99px; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.photo-prev { width: 100%; max-height: 260px; object-fit: cover; border-radius: 20px; }

/* дневник питания */
.fsum { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.fsum .big { font: 400 44px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.fsum .left { font: 400 24px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.fsum .sub { font: 700 10px/13px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--on-card-muted); margin-top: 4px; }
.macs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mac { display: flex; flex-direction: column; gap: 5px; font: 700 12px/16px var(--font-sans); }
.mac .row { flex-direction: column; align-items: flex-start; gap: 0; }
.mac .muted { color: var(--on-card-muted); font-weight: 600; }
.mac .progress { background: var(--track); height: 5px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fact { background: var(--surface); border-radius: 20px; padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: 800 13px var(--font-sans); color: var(--ink); }
.fact svg { width: 24px; height: 24px; color: var(--accent-text); }
.fact:first-child { background: var(--accent); color: var(--on-accent); }
.fact:first-child svg { color: var(--on-accent); }
.frows { display: flex; flex-direction: column; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; color: inherit; }
.frow:last-child { border-bottom: 0; }
.frow .nm { display: block; font: 700 15px/20px var(--font-sans); }
.frow .mt { display: block; font: 600 12px/16px var(--font-sans); color: var(--ink-muted); margin-top: 1px; }
.frow b { font: 400 17px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.frows.on-card .frow { border-color: var(--track); }
.frows.on-card .mt { color: var(--on-card-muted); }
.chk { display: inline-block; font: 800 9.5px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; background: var(--warn); color: #0E0F10;
  padding: 3px 6px; border-radius: 99px; vertical-align: 2px; margin-left: 4px; }
.week7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 120px; }
.week7 button { display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--ink-muted); font: 800 10px var(--font-sans); height: 100%; }
.week7 .col { position: relative; flex: 1; width: 100%; background: var(--surface-2); border-radius: 10px; overflow: hidden; display: flex; align-items: flex-end; }
.week7 .col i { display: block; width: 100%; border-radius: 10px 10px 0 0; }
.week7 .col em { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--ink-muted); opacity: .7; }
.week7 .cur { color: var(--accent-text); }
.week7 .cur .col { box-shadow: inset 0 0 0 1.5px var(--accent); }
.micbtn { width: 108px; height: 108px; border-radius: 99px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: 6px 0; }
.micbtn svg { width: 40px; height: 40px; }
.micbtn.rec { background: var(--alarm); color: var(--bg); animation: pulse 1.2s infinite; }
.micbtn .spin { border-color: #0003; border-top-color: var(--on-accent); width: 34px; height: 34px; }

/* строка «Что съел?»: поиск по мере ввода + значки фото и микрофона прямо в строке */
.fbar { display: flex; align-items: center; gap: 4px; min-height: 58px; border-radius: 29px; background: var(--surface-2); padding: 6px 6px 6px 16px; }
.fbar .ic { color: var(--ink-muted); display: grid; place-items: center; flex: none; }
.fbar .ic svg { width: 20px; height: 20px; }
.fbar input { flex: 1; min-width: 0; height: 46px; border: 0; background: none; outline: 0; font: 600 16px var(--font-sans); color: var(--ink); padding: 0 6px; }
.fbar input::placeholder { color: var(--ink-muted); font-weight: 500; }
.fbar input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.ib { width: 46px; height: 46px; border-radius: 99px; display: grid; place-items: center; color: var(--accent-text); flex: none; }
.ib svg { width: 22px; height: 22px; }
.ib.on { background: var(--accent); color: var(--on-accent); }
.tchip { height: 34px; padding: 0 8px 0 12px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font: 800 13px var(--font-sans);
  display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: -8px; }
.tchip svg { width: 14px; height: 14px; }
.fbar.busy { gap: 12px; padding-left: 20px; }
.fbar.rec { background: var(--alarm-soft); gap: 10px; padding-left: 20px; }
.fbar.rec .ib { color: var(--ink); }
.fbar.rec .ib.on { background: var(--alarm); color: var(--bg); }
.recdot { width: 12px; height: 12px; border-radius: 99px; background: var(--alarm); animation: pulse 1s infinite; flex: none; }
.fdrop { background: var(--surface); border-radius: 22px; padding: 2px 16px; margin-top: 8px; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
.frow.ai .nm { color: var(--accent-text); }
.frow.ai svg { width: 20px; height: 20px; color: var(--accent-text); flex: none; }
.snack { position: fixed; left: 50%; bottom: calc(86px + var(--tg-safe-bottom)); transform: translate(-50%, 160%); z-index: 45; width: calc(100% - 28px); max-width: 492px;
  background: var(--card); color: var(--on-card); border-radius: 18px; padding: 12px 8px 12px 16px; display: flex; align-items: center; gap: 10px;
  font: 700 14px/19px var(--font-sans); box-shadow: var(--shadow-card); transition: transform .25s; }
.snack.on { transform: translate(-50%, 0); }
.snack button { flex: none; height: 38px; padding: 0 14px; border-radius: 99px; background: var(--track); color: var(--on-card); font: 800 13px var(--font-sans); }
