:root {
  --bg: #FAF6F4;
  --card: #ffffff;
  --ink: #211A1D;
  --muted: #8A7F83;
  --muted2: #B7AEB1;
  --berry: #E84E6B;      /* акцент / белки */
  --amber: #F0A742;      /* углеводы */
  --mint: #5BC7A9;       /* жиры */
  --leaf: #4FB98E;       /* листики клубники / знак */
  --track: #F3ECEE;
  --c: var(--amber);     /* углеводы */
  --p: var(--berry);     /* белки */
  --f: var(--mint);      /* жиры */
  --sh-card: 0 12px 30px -20px rgba(40,20,30,.45);
  --sh-soft: 0 6px 16px -12px rgba(40,20,30,.4);
  --sh-meal: 0 10px 26px -22px rgba(40,20,30,.5);
}

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

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 520px; margin: 0 auto; padding: 14px 18px 100px; }

.hidden { display: none !important; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; min-height: 78vh; gap: 12px; }
.muted { color: var(--muted); }

h1 { font-size: 26px; font-weight: 900; margin: 4px 0; letter-spacing: -0.02em; }
.emoji { font-size: 60px; line-height: 1; }

/* Кастомные иконки Ням (SVG-спрайт, см. #ic-sprite в index.html).
   Размер наследуется от font-size контекста через 1em. */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: 0 0 auto; }
.ic-l { margin-right: 6px; }        /* иконка перед текстом в кнопке/строке */
.streak .ic { color: var(--berry); }   /* огонёк-стрик — всегда акцент */

/* Знак «ням.» (AppMark из спеки иконок). Размер задаётся через --am. */
.appmark { --am: 64px; width: var(--am); height: var(--am); border-radius: calc(var(--am) * .31);
  background: var(--berry); display: inline-flex; align-items: flex-end; justify-content: center;
  gap: calc(var(--am) * .03); }
.appmark .am-n { font-weight: 900; color: #fff; line-height: .9; letter-spacing: -0.06em;
  font-size: calc(var(--am) * .47); }
.appmark .am-dot { width: calc(var(--am) * .092); height: calc(var(--am) * .092); border-radius: 50%;
  background: #fff; margin-bottom: calc(var(--am) * .064); }

/* Кнопки */
.btn {
  border: none; border-radius: 16px; padding: 16px 18px; font-size: 17px; font-weight: 900;
  cursor: pointer; width: 100%; transition: filter .15s, transform .05s; letter-spacing: -0.01em;
  font-family: inherit;
}
.btn:active { transform: scale(0.99); }
.btn-primary { background: var(--berry); color: #fff; box-shadow: 0 14px 30px -12px rgba(232,78,107,.6); }
.btn-primary:active { filter: brightness(0.96); }
.btn-primary:disabled { opacity: .5; box-shadow: none; }
.link { background: none; border: none; color: var(--berry); font-size: 15px; font-weight: 800;
  cursor: pointer; padding: 0; font-family: inherit; }

/* Верхняя строка дашборда (стрик + календарь) */
.dash-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 0; }
.dash-date { padding: 11px 15px; border-radius: 14px; background: var(--card); box-shadow: var(--sh-soft);
  font-size: 15px; font-weight: 900; color: var(--ink); line-height: 1; display: flex; align-items: center; }
.add-head { justify-content: space-between; }
.head-icon { width: 42px; height: 42px; border-radius: 13px; border: none; background: var(--card);
  box-shadow: var(--sh-soft); color: var(--berry); font-size: 22px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.head-icon:active { transform: scale(0.96); }
.streak { display: flex; align-items: center; gap: 7px; background: var(--card); border-radius: 999px;
  padding: 8px 14px; box-shadow: var(--sh-soft); font-size: 17px; font-weight: 900; cursor: pointer;
  border: none; color: var(--ink); font-family: inherit; }
.streak:active { transform: scale(0.97); }

/* Экран стрика */
.streak-hero { text-align: center; padding: 20px 0 6px; }
.streak-flame { font-size: 66px; line-height: 1; color: var(--berry); }
.streak-big { font-size: 66px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; margin-top: 4px; }
.streak-milestone { background: linear-gradient(135deg, var(--berry), var(--amber)); color: #fff;
  border-radius: 20px; padding: 16px 18px; font-weight: 800; text-align: center; margin: 16px 0; }
.streak-week { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; }
.sw-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sw-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--track);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; color: var(--muted2); }
.sw-dot.active { background: var(--berry); border-color: var(--berry); color: #fff; }
.sw-dot.today { box-shadow: 0 0 0 3px rgba(232, 78, 107, 0.25); }
.sw-lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.dash-cal { width: 44px; height: 44px; border-radius: 14px; background: var(--card);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-soft); font-size: 20px; }

/* Заголовок */
.topbar { display: flex; align-items: center; gap: 12px; margin: 14px 2px 16px; }
.topbar-title { font-size: 42px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.topbar-title.sm { font-size: 24px; }
.topbar-sub { font-size: 16px; font-weight: 700; margin-top: 4px; }

/* Карточка */
.card { background: var(--card); border-radius: 26px; padding: 20px; box-shadow: var(--sh-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-title { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }

/* Кольцо калорий (полное) */
.gauge-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 4px 0; }
.gauge { position: relative; width: 172px; height: 172px; flex: 0 0 auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--track); stroke-width: 13; }
.ring-fg { fill: none; stroke: var(--berry); stroke-width: 13; stroke-linecap: round;
  stroke-dasharray: 395.84; stroke-dashoffset: 395.84; transition: stroke-dashoffset .7s ease; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.gauge-num { font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.gauge-label { font-size: 13px; font-weight: 800; margin-top: 4px; }
.side-stat { text-align: center; min-width: 66px; }
.side-num { font-size: 23px; font-weight: 900; letter-spacing: -0.02em; }
.side-label { font-size: 13px; font-weight: 700; margin-top: 2px; }

/* Бары БЖУ */
.macros { display: flex; gap: 16px; margin-top: 18px; }
.macro { flex: 1; }
.macro-name { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.bar { height: 7px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; transition: width .7s ease; }
.bar-fill.p { background: var(--p); }
.bar-fill.f { background: var(--f); }
.bar-fill.c { background: var(--c); }
.macro-val { font-size: 12.5px; font-weight: 700; margin-top: 6px; }

/* Секции */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 12px; }
.section-title { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }

/* Приёмы */
.meals-list { display: flex; flex-direction: column; gap: 12px; }
.meal { background: var(--card); border-radius: 22px; padding: 14px 16px; box-shadow: var(--sh-meal);
  display: flex; align-items: center; gap: 14px; }
.meal-ic { width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto;
  background: #FCE9ED; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.meal-body { flex: 1; min-width: 0; }
.meal-desc { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-sub { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.meal-kcal { font-weight: 900; white-space: nowrap; font-size: 16px; }
.empty { color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; padding: 22px; }

/* Добавление */
.phrase { width: 100%; border: none; border-radius: 18px; padding: 16px; font-size: 16px;
  font-family: inherit; font-weight: 700; resize: none; margin-bottom: 12px; background: var(--card); color: var(--ink);
  box-shadow: var(--sh-card); }
.phrase:focus { outline: 2px solid var(--berry); }
.draft { margin-top: 18px; }

/* Итоговая карточка (ккал + плитки БЖУ) */
.draft-total-card { margin-bottom: 6px; }
.dt-kcal { display: flex; align-items: baseline; gap: 8px; }
.dt-kcal span:first-child { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; }
.dt-unit { font-size: 16px; font-weight: 800; color: var(--muted); }
.dt-tiles { display: flex; gap: 10px; margin-top: 14px; }
.dt-tile { flex: 1; text-align: center; border-radius: 14px; padding: 10px 4px; }
.dt-tile.c { background: #FDF3E7; }
.dt-tile.p { background: #FCE9ED; }
.dt-tile.f { background: #E7F6F1; }
.dt-val { font-size: 18px; font-weight: 900; }
.dt-tile.c .dt-val { color: #D68A22; }
.dt-tile.p .dt-val { color: var(--berry); }
.dt-tile.f .dt-val { color: #33A385; }
.dt-lbl { font-size: 12px; font-weight: 800; margin-top: 2px; }
.dt-tile.c .dt-lbl { color: #B08A4E; }
.dt-tile.p .dt-lbl { color: #C77188; }
.dt-tile.f .dt-lbl { color: #6AAE9A; }

.draft-sub { font-size: 15px; font-weight: 900; color: var(--ink); margin: 20px 2px 12px; }

/* Редактируемые строки продуктов */
.draft-items { display: flex; flex-direction: column; gap: 10px; }
.draft-item { background: var(--card); border-radius: 18px; padding: 13px 15px; box-shadow: var(--sh-meal);
  display: flex; align-items: center; gap: 12px; }
.di-emoji { font-size: 24px; flex: 0 0 auto; width: 26px; text-align: center; }
.di-info { flex: 1; min-width: 0; }
.di-name { font-size: 16px; font-weight: 800; display: flex; align-items: baseline; min-width: 0; }
.di-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.di-kcal { font-size: 13px; font-weight: 800; color: var(--ink); margin-top: 2px; white-space: nowrap; }
.di-macros { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.di-grams-static { font-size: 14px; font-weight: 800; color: var(--muted); }
.tag { font-size: 10px; padding: 2px 6px; border-radius: 6px; margin-left: 6px; font-weight: 900;
  flex: 0 0 auto; letter-spacing: .03em; }
.tag.ai { background: #7B61FF; color: #fff; }

/* Степпер порции в строке продукта */
.stepper-sm { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.step-sm { width: 30px; height: 30px; border-radius: 9px; border: none; font-size: 18px; font-weight: 900;
  cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; line-height: 1; }
.step-sm.minus { background: var(--track); color: var(--muted); }
.step-sm.plus { background: var(--berry); color: #fff; }
.step-sm:active { transform: scale(0.92); }
.di-grams { font-size: 14px; font-weight: 800; min-width: 48px; text-align: center; }

/* Нижняя навигация */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: center;
  max-width: 520px; margin: 0 auto; padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid #F0EAEB; }
.tab { background: none; border: none; cursor: pointer; flex: 1; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800; color: var(--muted2); padding: 2px 0; }
.tab.active { color: var(--berry); }
.tab-ic { font-size: 24px; display: inline-flex; }   /* цвет наследуется от .tab (muted2 / berry в active) */

/* График калорий */
.chart { display: flex; flex-direction: column; gap: 8px; }
.chart-plot { position: relative; height: 140px; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 8px; }
.chart-bar { flex: 1; border-radius: 7px 7px 3px 3px; background: var(--berry);
  min-height: 3px; transition: height .5s ease; }
.chart-bar.over { background: var(--amber); }
.chart-labels { display: flex; justify-content: space-between; gap: 8px; }
.chart-labels > div { flex: 1; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.chart-normline { position: absolute; left: 0; right: 0; border-top: 1.5px dashed #D8CFD1; pointer-events: none; }
.chart-normcap { position: absolute; right: 0; transform: translateY(-100%);
  font-size: 10px; font-weight: 700; color: var(--muted); background: var(--card); padding: 0 4px; }

/* Средние */
.avg-big { font-size: 36px; font-weight: 900; letter-spacing: -0.03em; margin: 4px 0 10px; }
.avg-macros { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; gap: 8px; flex-wrap: wrap; }
.avg-macros b { font-weight: 900; }

/* Профиль */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 4px 4px 16px; }
.prof-avatar { width: 66px; height: 66px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--berry), var(--amber)); display: flex; align-items: center;
  justify-content: center; font-size: 26px; font-weight: 900; color: #fff; }
.prof-name { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }
.prow { display: flex; justify-content: space-between; align-items: center; padding: 13px 0;
  border-bottom: 1px solid var(--track); font-size: 15px; font-weight: 700; }
.prow:first-child { padding-top: 2px; }
.prow:last-child { border-bottom: none; padding-bottom: 2px; }
.prow .k { color: var(--muted); }
.prow .v { font-weight: 900; }
.prow-edit { cursor: pointer; }
.prow-edit .v::after { content: ' ›'; color: var(--muted2); font-weight: 900; }
.prow-edit:active { opacity: .6; }

/* Тёмная карточка нормы */
.norm-card { background: var(--ink); color: #fff; border-radius: 24px; padding: 20px 22px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; }
.norm-lbl { font-size: 14px; font-weight: 800; color: rgba(255,255,255,.6); }
.norm-big { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; margin-top: 2px; }
.norm-unit { font-size: 16px; font-weight: 800; color: rgba(255,255,255,.6); }
.norm-macros { text-align: right; font-size: 13px; font-weight: 700; line-height: 1.9; color: rgba(255,255,255,.75); }
.norm-macros b { color: #fff; }

/* Запись веса */
.weight-form { display: flex; gap: 10px; }
.weight-input { flex: 1; border: none; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 700;
  font-family: inherit; background: var(--bg); color: var(--ink); }
.weight-input:focus { outline: 2px solid var(--berry); }

/* Цель по весу (Фаза 4) */
.goal-block { margin-bottom: 18px; }
.wg-top { display: flex; align-items: baseline; justify-content: space-between; }
.wg-current { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; }
.wg-unit { font-size: 16px; font-weight: 800; color: var(--muted); }
.wg-delta { font-size: 14px; font-weight: 800; color: var(--muted); }
.wg-delta.good { color: #33A385; }
.wg-ends { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700;
  color: var(--muted); margin: 14px 0 6px; }
.wg-bar { height: 9px; border-radius: 99px; background: var(--track); overflow: hidden; }
.wg-fill { height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--berry), var(--amber)); transition: width .7s ease; }
.wg-pct { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); margin-top: 12px; }
.goal-btn { width: 100%; margin-top: 14px; border: none; border-radius: 14px; padding: 14px;
  background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 900; font-family: inherit;
  cursor: pointer; transition: filter .15s; }
.goal-btn:active { filter: brightness(0.97); }

/* Онбординг */
.onb-head { display: flex; align-items: center; gap: 14px; padding: 10px 2px 20px; }
.onb-progress { flex: 1; height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
#onb-bar { height: 100%; width: 0; background: var(--berry); border-radius: 99px; transition: width .3s ease; }
.onb-title { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; margin: 8px 2px 24px; line-height: 1.15; }
.onb-body { display: flex; flex-direction: column; gap: 12px; }
.onb-choice { background: var(--card); border: none; border-radius: 18px; padding: 20px 18px; font-size: 17px;
  font-weight: 800; text-align: left; cursor: pointer; box-shadow: var(--sh-meal); color: var(--ink);
  font-family: inherit; transition: transform .05s; }
.onb-choice:active { transform: scale(0.99); }
.onb-input { width: 100%; border: none; border-radius: 18px; padding: 22px; font-size: 30px; font-weight: 900;
  text-align: center; background: var(--card); color: var(--ink); box-shadow: var(--sh-card); font-family: inherit; }
.onb-input:focus { outline: 2px solid var(--berry); }
#onb-controls { margin-top: 16px; }

/* «Составляем твой план» */
.plan-ring { position: relative; width: 220px; height: 220px; }
.plan-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.plan-track { fill: none; stroke: var(--track); stroke-width: 18; }
.plan-fg { fill: none; stroke: var(--berry); stroke-width: 18; stroke-linecap: round;
  stroke-dasharray: 640.9; stroke-dashoffset: 640.9; }
.plan-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 56px; font-weight: 900; letter-spacing: -0.03em; }
.plan-title { font-size: 32px; font-weight: 900; text-align: center; line-height: 1.15; margin-top: 12px; }
.plan-list { display: flex; flex-direction: column; gap: 20px; margin-top: 36px; width: 100%; max-width: 320px; }
.plan-item { display: flex; align-items: center; gap: 16px; font-size: 19px; font-weight: 800; color: var(--muted2);
  transition: color .3s; }
.plan-item.done { color: var(--ink); }
.plan-check { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--track); flex: none;
  display: flex; align-items: center; justify-content: center; transition: background .3s, border-color .3s; }
.plan-item.done .plan-check { background: var(--berry); border-color: var(--berry); }
.plan-item.done .plan-check::after { content: '✓'; color: #fff; font-size: 15px; font-weight: 900; }

/* Переключатель метода добавления (Фразой / Поиск) */
.segment { display: flex; gap: 6px; background: var(--track); border-radius: 16px; padding: 5px; margin-bottom: 18px; }
.seg-btn { flex: 1; border: none; background: transparent; border-radius: 12px; padding: 11px 8px;
  font-size: 15px; font-weight: 900; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s, box-shadow .15s; letter-spacing: -0.01em; }
.seg-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--sh-soft); }

/* Строка поиска */
.search-bar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px;
  padding: 4px 14px; box-shadow: var(--sh-meal); }
.search-ic { color: var(--muted2); flex: 0 0 auto; }
.search-input { flex: 1; border: none; background: transparent; padding: 13px 0; font-size: 17px;
  font-weight: 700; font-family: inherit; color: var(--ink); min-width: 0; }
.search-input:focus { outline: none; }
.search-input::placeholder { color: var(--muted2); font-weight: 700; }
.food-clear { border: none; background: var(--track); color: var(--muted); width: 26px; height: 26px;
  border-radius: 50%; font-size: 14px; font-weight: 900; cursor: pointer; flex: 0 0 auto; font-family: inherit;
  display: flex; align-items: center; justify-content: center; }

/* Бейдж «скоро» (в фото-карточке) */
.soon { font-size: 9px; font-weight: 900; background: var(--muted2); color: #fff; border-radius: 5px;
  padding: 2px 5px; letter-spacing: .02em; text-transform: uppercase; }

/* Карточка «Сфотографировать блюдо» (скоро) */
.scan-cta { display: flex; align-items: center; gap: 12px; background: #FCE9ED; border-radius: 18px;
  padding: 13px 15px; margin-top: 16px; }
.scan-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--berry); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; color: #fff; }
.scan-txt { flex: 1; min-width: 0; }
.scan-title { font-size: 15px; font-weight: 900; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.scan-sub { font-size: 13px; font-weight: 700; color: #C77188; margin-top: 1px; }

/* Список результатов поиска */
.results-head { font-size: 13px; font-weight: 800; color: var(--muted); margin: 20px 4px 10px; letter-spacing: .02em; }
.food-list { display: flex; flex-direction: column; gap: 1px; background: var(--card); border-radius: 20px;
  overflow: hidden; box-shadow: var(--sh-meal); }
.food-list:empty { display: none; }
.food-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--track); transition: background .1s; background: var(--card); text-align: left;
  border-left: none; border-right: none; border-top: none; width: 100%; font-family: inherit; }
.food-row:last-child { border-bottom: none; }
.food-row:active { background: var(--track); }
.food-emoji { font-size: 24px; flex: 0 0 auto; width: 26px; text-align: center; }
.food-info { flex: 1; min-width: 0; }
.food-name { font-size: 16px; font-weight: 800; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-brand { font-size: 13px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-kcal { text-align: right; flex: 0 0 auto; }
.food-kcal-n { font-size: 16px; font-weight: 900; color: var(--ink); }
.food-kcal-u { font-size: 12px; font-weight: 700; color: var(--muted); }
.food-plus { width: 32px; height: 32px; border-radius: 50%; background: var(--track); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; color: var(--ink); }

/* Лист выбора порции (bottom sheet) */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20,12,16,.42); }
.sheet-card { position: relative; width: 100%; max-width: 520px; background: var(--card);
  border-radius: 28px 28px 0 0; padding: 12px 22px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px -20px rgba(40,20,30,.5); animation: sheet-up .25s ease; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--track); margin: 2px auto 16px; }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.sheet-emoji { width: 52px; height: 52px; border-radius: 50%; background: #FCE9ED; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 26px; }
.sheet-head-txt { flex: 1; min-width: 0; }
.sheet-name { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.sheet-sub { font-size: 13px; font-weight: 700; margin-top: 2px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 18px; }
.step-btn { width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--track);
  font-size: 28px; font-weight: 900; color: var(--ink); cursor: pointer; flex: 0 0 auto; font-family: inherit;
  display: flex; align-items: center; justify-content: center; line-height: 1; }
.step-btn:active { transform: scale(0.94); }
.step-field { display: flex; align-items: baseline; gap: 6px; min-width: 120px; justify-content: center; }
.step-input { width: 92px; border: none; background: transparent; text-align: right; font-size: 40px;
  font-weight: 900; color: var(--ink); font-family: inherit; letter-spacing: -0.03em; padding: 0; }
.step-input:focus { outline: none; }
.step-unit { font-size: 20px; font-weight: 800; color: var(--muted); }
.portion-kcal { text-align: center; font-size: 30px; font-weight: 900; letter-spacing: -0.03em; }
.portion-kcal span { color: var(--berry); }
.portion-macros { text-align: center; font-size: 14px; font-weight: 700; margin: 4px 0 20px; }

/* Редактирование приёма пищи */
.meal { cursor: pointer; transition: transform .05s; }
.meal:active { transform: scale(0.99); }
.ms-title { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; text-align: center; margin-bottom: 16px; }
.ms-input { width: 100%; border: none; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 700;
  font-family: inherit; background: var(--bg); color: var(--ink); margin-bottom: 12px; }
.ms-input:focus { outline: 2px solid var(--berry); }
.ms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.ms-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.ms-field input { border: none; border-radius: 12px; padding: 13px; font-size: 17px; font-weight: 900;
  font-family: inherit; background: var(--bg); color: var(--ink); width: 100%; }
.ms-field input:focus { outline: 2px solid var(--berry); }
.btn-delete { width: 100%; margin-top: 10px; border: none; border-radius: 14px; padding: 14px;
  background: #FCE9ED; color: var(--berry); font-size: 15px; font-weight: 900; font-family: inherit; cursor: pointer; }
.btn-delete:active { filter: brightness(0.97); }

/* Тренд веса */
.wt-empty { color: var(--muted); font-size: 14px; font-weight: 700; padding: 8px 2px; }
.wt-svg { width: 100%; height: 90px; display: block; }
.wt-line { fill: none; stroke: var(--berry); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.wt-dot { fill: var(--berry); }
.wt-cur { font-size: 16px; font-weight: 900; margin-bottom: 6px; }
