/* Тарелкин — дизайн-система «Воздух» (v3, 22.07.2026).
   Лёгкий минимализм: тёплый off-white фон, мягкие тени вместо жёстких рамок,
   крупная типографика, кольцо БЖУ из трёх сегментов, карточки приёмов пищи,
   деликатные анимации появления. Mobile-first 360–430px, всё по-русски.

   Токены:
   цвета   — bg #F6F5F0 · card #FFF · border #ECEAE2 · text #1B1A17 ·
             secondary #6E6A62 · accent #1E8A58 (+pressed #177148, soft #E5F4EC) ·
             БЖУ: белки #3FBD8C · жиры #F0B03F · углеводы #6EAAF2 · клетчатка #9A8CDB ·
             danger #C4554D (только текст/иконки, не заливка больших кнопок)
   шрифт   — системный стек; шкала 13/15/17/20/24/30/38 (+44 лендинг)
   сетка   — отступы кратны 4; радиусы 14/18/22; тач-таргет ≥44px
   тени    — карточки: 0 1px 2px rgba(27,26,23,.03), 0 10px 30px rgba(27,26,23,.06)
   анимации— rise/pop ≤ .6s, cubic-bezier(.2,.8,.2,1); prefers-reduced-motion уважается */

:root {
  --bg: #F6F5F0;
  --card: #FFFFFF;
  --border: #ECEAE2;
  --text: #1B1A17;
  --text-secondary: #6E6A62;
  --accent: #1E8A58;
  --accent-pressed: #177148;
  --accent-soft: #E5F4EC;
  --protein: #3FBD8C;
  --fat: #F0B03F;
  --carbs: #6EAAF2;
  --fiber: #9A8CDB;
  --danger: #C4554D;
  --radius: 14px;
  --radius-card: 18px;
  --shadow-card: 0 1px 2px rgba(27, 26, 23, 0.03), 0 10px 30px rgba(27, 26, 23, 0.06);
  --shadow-pop: 0 2px 6px rgba(27, 26, 23, 0.05), 0 18px 44px rgba(27, 26, 23, 0.10);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* без резинового оверскролла: в webview он «отрывал» фиксированный таббар */
  overscroll-behavior-y: none;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 20px 16px calc(150px + env(safe-area-inset-bottom));
  position: relative;
}

.screen[hidden] { display: none; }

/* появление контента экрана */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Иконки (SVG-спрайт, Lucide) ---------- */

/* атрибут hidden не действует на корневой svg — прячем спрайт явно */
svg[hidden] { display: none; }

.icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-inline { width: 16px; height: 16px; vertical-align: -3px; }
.icon-lg { width: 26px; height: 26px; }
.icon-danger { color: var(--danger); }

/* ---------- Кнопки ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #25A46C, var(--accent));
  color: #fff;
  box-shadow: 0 8px 22px rgba(30, 138, 88, 0.28);
}
.btn-primary:active { background: var(--accent-pressed); }

.btn-secondary {
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(27, 26, 23, 0.03);
}
.btn-secondary:active { background: var(--accent-soft); }

.btn-m { min-height: 44px; font-size: 16px; padding: 10px 16px; }

/* единственная «залитая» danger-кнопка — внутри шторки подтверждения,
   активируется только вводом слова */
.btn-danger-solid { background: var(--danger); color: #fff; border: none; box-shadow: none; }
.btn-danger-solid:disabled { opacity: 0.45; cursor: default; }
.btn-danger-solid:not(:disabled):active { background: #A8443D; }

.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 4px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.link-danger { color: var(--danger); font-size: 14px; font-weight: 500; }

.bottom-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 480px;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(246, 245, 240, 0), var(--bg) 30%);
}

/* ---------- Лендинг ---------- */

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 6vh 12px 30px;
  margin: -20px -16px 0;
  background:
    radial-gradient(90% 60% at 18% 0%, #E9F6EE 0%, rgba(233, 246, 238, 0) 70%),
    radial-gradient(80% 55% at 85% 8%, #FDF1E0 0%, rgba(253, 241, 224, 0) 70%),
    radial-gradient(90% 70% at 50% 30%, #EDF3FC 0%, var(--bg) 80%);
  border-radius: 0 0 32px 32px;
}

h1 { font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }

.landing-logo { width: 96px; height: 96px; animation: pop 0.6s var(--ease) both; }

.landing-hero h1 {
  font-size: 46px;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #184032, #1E8A58 75%, #27A86C);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise 0.6s var(--ease) 0.05s both;
}

.landing-slogan {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  animation: rise 0.6s var(--ease) 0.15s both;
}

.landing-cta {
  max-width: 340px;
  margin: 10px auto 0;
  animation: rise 0.6s var(--ease) 0.25s both;
}
.landing-note {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  animation: rise 0.6s var(--ease) 0.3s both;
}

/* живой мокап приложения в hero: кольцо БЖУ рисуется, карточки въезжают,
   блик пробегает, телефон мягко «дышит» */
.hero-app {
  position: relative;
  width: min(272px, 76%);
  margin: 18px auto 4px;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--border);
  background: var(--card);
  animation:
    rise 0.7s var(--ease) 0.35s both,
    hero-float 7s ease-in-out 1.2s infinite alternate;
}
@keyframes hero-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-7px); }
}

.hero-app-screen {
  padding: 22px 18px 18px;
  text-align: left;
}
.hero-app-greet {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  animation: rise 0.6s var(--ease) 0.5s both;
}

.hero-ring {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 14px;
  animation: pop 0.7s var(--ease) 0.6s both;
}
.hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.hero-track { fill: none; stroke: #F0EEE7; stroke-width: 11; }
.hero-seg {
  fill: none;
  stroke-width: 11;
  stroke-linecap: butt;
  animation: hero-seg-draw 1.1s var(--ease) backwards;
}
/* from-кадр без «to»: сегмент дорисовывается до значения dasharray из класса.
   Дуга = 1450 из 2000 ккал (72.5% от 326.7), доли Б/Ж/У 26% / 33% / 41% */
@keyframes hero-seg-draw {
  from { stroke-dasharray: 0 326.7; }
}
.hs-p {
  stroke: var(--protein);
  stroke-dasharray: 61.6 265.1;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 2px 6px rgba(63, 189, 140, 0.4));
  animation-delay: 0.8s;
}
.hs-f {
  stroke: var(--fat);
  stroke-dasharray: 78.2 248.5;
  stroke-dashoffset: -61.6;
  filter: drop-shadow(0 2px 6px rgba(240, 176, 63, 0.4));
  animation-delay: 1.0s;
}
.hs-c {
  stroke: var(--carbs);
  stroke-dasharray: 97.1 229.6;
  stroke-dashoffset: -139.8;
  filter: drop-shadow(0 2px 6px rgba(110, 170, 242, 0.4));
  animation-delay: 1.2s;
}

.hero-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-ring-center b { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.hero-ring-center span { font-size: 12px; color: var(--text-secondary); }

.hero-rows { display: flex; flex-direction: column; gap: 8px; }
.hero-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  animation: rise 0.55s var(--ease) backwards;
}
.hero-row:nth-child(1) { animation-delay: 1.5s; }
.hero-row:nth-child(2) { animation-delay: 1.65s; }
.hero-row:nth-child(3) { animation-delay: 1.8s; }
.hero-row-emoji { font-size: 17px; flex: none; }
.hero-row-name { flex: 1; min-width: 0; }
.hero-row b { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }

/* пробегающий блик */
.hero-shine {
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -80%;
  width: 46%;
  background: linear-gradient(105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: hero-shine 6.5s ease-in-out 2.4s infinite;
}
@keyframes hero-shine {
  0%   { left: -80%; }
  18%  { left: 150%; }
  100% { left: 150%; }
}

.landing-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: linear-gradient(115deg, #FFF3D6, #FFE7C2);
  border: 1px solid #F2DDAE;
  color: #6B4E12;
  font-size: 14.5px;
  line-height: 1.4;
}
.landing-banner b { font-size: 15.5px; }
.banner-emoji { font-size: 30px; flex: none; }

/* мокап мини-дневника */
.mockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}
.mockup-ring { position: relative; width: 106px; height: 106px; flex: none; }
.mockup-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mockup-track { fill: none; stroke: #F0EEE7; stroke-width: 11; }
.mockup-fill {
  fill: none;
  stroke: var(--protein);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 235;   /* 687 из 2448 — сумма строк мокапа */
}
.mockup-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mockup-center b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.mockup-center span { font-size: 10px; color: var(--text-secondary); }
.mockup-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mockup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  background: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
  white-space: nowrap;
}
/* имя блюда сжимается с многоточием, граммовка подстрокой, калории видны всегда */
.mockup-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.mockup-row span i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--text-secondary);
}
.mockup-row b { font-size: 12.5px; flex: none; }

.landing-h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 34px 0 14px; }

/* демо разбора нутриентов на лендинге */
.nutri-demo { margin-top: 14px; }
.nutri-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.nutri-title .icon-inline { color: var(--accent); width: 18px; height: 18px; }
.nutri-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.nutri-name { flex: none; width: 96px; font-size: 14px; font-weight: 600; }
.nutri-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #F0EEE7;
  overflow: hidden;
}
.nutri-fill { display: block; height: 100%; border-radius: 4px; }
.nf-c  { width: 92%; background: var(--fat); }
.nf-ca { width: 71%; background: var(--carbs); }
.nf-fe { width: 64%; background: #E07856; }
.nf-mg { width: 58%; background: var(--protein); }
.nutri-pct {
  flex: none;
  width: 42px;
  text-align: right;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.nutri-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
}

.card-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.landing-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.landing-step { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.landing-step-n {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-step-n.n1 { background: #E2F5EC; color: #177148; }
.landing-step-n.n2 { background: #FCEEDA; color: #A66B12; }
.landing-step-n.n3 { background: #E7F0FC; color: #3A6BB5; }

.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.landing-feature { padding: 14px; border-color: transparent; }
.landing-feature b { font-size: 15px; color: var(--text); }
.feature-emoji { display: block; font-size: 28px; margin-bottom: 6px; }
.f-mint { background: #E7F6EE; }
.f-lavender { background: #EFEBFB; }
.f-peach { background: #FCEFE2; }
.f-lemon { background: #FBF5DC; }

.landing-honest {
  margin-top: 12px;
  background: var(--accent-soft);
  border-color: transparent;
  font-size: 14.5px;
}

/* тарифы */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.plan { padding: 16px 14px; }
.plan-pro {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, #F0FAF4, #FFFFFF);
}
.plan-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-pressed);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 3px 8px;
  margin-bottom: 6px;
}
.plan-name { font-size: 16px; font-weight: 700; }
.plan-price { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 8px; }
.plan-per { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.plan-list { list-style: none; font-size: 13px; color: var(--text-secondary); }
.plan-list li { margin-bottom: 6px; padding-left: 18px; position: relative; }
.plan-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan-list b { color: var(--text); }

.plan-trial {
  margin-top: 10px;
  background: linear-gradient(115deg, #FFF3D6, #FFE7C2);
  border-color: #F2DDAE;
  color: #6B4E12;
  font-size: 14px;
  box-shadow: none;
}
.plan-trial b { font-size: 15px; }
.plans-cta { margin-top: 12px; }

.landing-install p { font-size: 14.5px; margin-bottom: 8px; }
.landing-install p:last-child { margin-bottom: 0; }
.landing-install .landing-note { text-align: left; }

.landing-faq { margin-bottom: 8px; font-size: 14.5px; }
.landing-faq summary { font-weight: 600; cursor: pointer; padding: 2px 0; }
.landing-faq p { margin-top: 8px; color: var(--text-secondary); }

#landing-cta2 { margin-top: 26px; }
.landing-footer { text-align: center; color: var(--text-secondary); font-size: 13px; padding: 18px 0 6px; }

/* описательный SEO-блок — читаемый, но ненавязчивый */
.landing-seo { margin-top: 8px; }
.landing-seo p { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 12px; }

/* ---------- Экран входа: карточка поверх размытого интерфейса ---------- */

.auth-screen { position: static; }

.auth-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  padding: 60px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  filter: blur(9px) saturate(0.9);
  transform: scale(1.06);   /* прячем размытые края */
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.auth-center {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(246, 245, 240, 0.35);
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px 22px 14px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  animation: pop 0.45s var(--ease) both;
}
.auth-card .text-input { text-align: center; }
.auth-card .code-input { text-align: center; }

.auth-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
}
.auth-title { font-size: 24px; margin-bottom: 6px; outline: none; }
.auth-hint { font-size: 13.5px; }
.auth-landing-link { margin-top: 6px; font-size: 14px; }

/* ---------- Онбординг целей ---------- */

.ob-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ob-dots { display: flex; gap: 6px; }
.ob-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #DEDCD3;
  transition: background 0.25s, transform 0.25s var(--ease);
}
.ob-dot.active { background: var(--accent); transform: scale(1.2); }

.ob-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; outline: none; }
.ob-step { animation: rise 0.45s var(--ease) both; }
.ob-step .profile-hint { margin-bottom: 14px; }

.ob-sex { display: flex; gap: 8px; margin: 4px 0 14px; }
.ob-sex-chip { flex: 1; text-align: center; }

.ob-options { display: flex; flex-direction: column; gap: 10px; }
.ob-option {
  text-align: left;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease), border-color 0.15s, background 0.15s;
}
.ob-option:active { transform: scale(0.98); }
.ob-option b { font-size: 16px; color: var(--text); }
.ob-option.active { border-color: var(--accent); background: var(--accent-soft); }

.ob-result { text-align: center; padding: 24px 16px; }
.ob-kcal { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.ob-macros { margin-top: 8px; color: var(--text-secondary); font-size: 15px; }

/* ---------- Экран обработки ---------- */

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 30vh;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--protein);
  border-right-color: var(--fat);
  border-bottom-color: var(--carbs);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--text-secondary); font-size: 17px; text-align: center; outline: none; }

.btn-cancel-loading { max-width: 220px; }

h1, .totals-card, .error-text { outline: none; }

/* ---------- Экран результата ---------- */

.totals-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  animation: rise 0.5s var(--ease) both;
}

.totals-kcal { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.totals-kcal-unit { font-size: 20px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0; }

.totals-macros {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.macro { display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.macro-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.macro-label::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
  background: var(--fiber);
}
.macro:nth-child(1) .macro-label::before { background: var(--protein); }
.macro:nth-child(2) .macro-label::before { background: var(--fat); }
.macro:nth-child(3) .macro-label::before { background: var(--carbs); }
.macro-value { font-size: 19px; font-weight: 700; }
.macro-value::after { content: " г"; font-size: 13px; font-weight: 400; color: var(--text-secondary); }

.warning {
  background: #FFF7E8;
  border: 1px solid #F0DFBB;
  border-radius: var(--radius);
  color: #7A5C1E;
  font-size: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.items-list { display: flex; flex-direction: column; gap: 10px; }

.item-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  animation: rise 0.5s var(--ease) both;
}
.items-list .item-card:nth-child(2) { animation-delay: 0.06s; }
.items-list .item-card:nth-child(3) { animation-delay: 0.12s; }
.items-list .item-card:nth-child(4) { animation-delay: 0.18s; }

.item-card.not-found { opacity: 0.65; }

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.item-name { font-size: 17px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }

.item-kcal { font-size: 17px; font-weight: 700; white-space: nowrap; }
.item-kcal small { font-weight: 400; color: var(--text-secondary); }

.item-source {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-note { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }

/* Степпер граммовки */
.grams-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.stepper-btn {
  width: 48px;
  height: 44px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--accent);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.stepper-btn:active { background: var(--accent-soft); }
.stepper-btn:disabled { opacity: 0.4; }

.grams-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  color: var(--text);
}
.grams-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.grams-unit { flex: none; color: var(--text-secondary); font-size: 15px; width: 16px; }

/* ---------- Экран ошибки ---------- */

.error-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 24vh;
  text-align: center;
  animation: rise 0.5s var(--ease) both;
}

.error-icon { font-size: 56px; }
.error-text { font-size: 18px; color: var(--text); max-width: 320px; }
.error-box .btn { max-width: 320px; }

/* ---------- Редактирование продукта ---------- */

.item-name-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  border: none;
  background: none;
  padding: 8px 4px 8px 0;
  margin: -8px 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.item-name-btn .edit-icon { color: var(--accent); width: 15px; height: 15px; flex: none; }
.item-name-btn:active .item-name { color: var(--accent-pressed); }

/* ---------- Шторки ---------- */

.picker { position: fixed; inset: 0; z-index: 40; }
.picker[hidden] { display: none; }

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 26, 23, 0.45);
}

.picker-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  max-width: 480px;
  height: 86vh;      /* фолбэк для браузеров без dvh */
  height: 86dvh;
  max-height: 100%;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 0;
  animation: sheet-in 0.3s var(--ease);
}
@keyframes sheet-in {
  from { transform: translateY(6%); opacity: 0.6; }
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.picker-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; min-width: 0; overflow-wrap: anywhere; flex: 1; }
.picker-close {
  width: 44px; height: 44px; flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.picker-close .icon { width: 18px; height: 18px; }
.picker-close:active { background: var(--accent-soft); }

.picker-search {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}
.picker-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.picker-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  flex: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.picker-cats::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: none;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.picker-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.picker-section {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 2px 6px;
}

.food-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.food-row:active { background: var(--accent-soft); }
.food-row-name { min-width: 0; overflow-wrap: anywhere; font-size: 15.5px; }
.food-row-sub { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; }
.food-row-kcal { flex: none; font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

.picker-note { color: var(--text-secondary); font-size: 14.5px; text-align: center; padding: 18px 8px; }

/* детальный разбор продукта */
.nutrient-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.nutrient-row:last-child { border-bottom: none; }
.nutrient-name { min-width: 0; }
.nutrient-tag {
  font-size: 11px;
  color: var(--accent-pressed);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 6px;
  white-space: nowrap;
}
.nutrient-value { flex: none; font-weight: 600; white-space: nowrap; }
.nutrient-pct { color: var(--text-secondary); font-weight: 400; font-size: 13px; }
.nutrient-over { color: var(--danger); font-weight: 600; }
.norms-source-link { color: var(--accent); }
.nutrients-note { font-size: 12.5px; color: var(--text-secondary); padding: 10px 4px 4px; }

.item-details-btn {
  display: inline-block;
  border: none;
  background: none;
  padding: 6px 0;
  margin-top: 2px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cat-chip, .food-row, .show-more { touch-action: manipulation; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body.picker-open { position: fixed; width: 100%; }

.show-more {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin: 4px 0 10px;
}

/* ---------- Обрезка фото ---------- */

.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #141412;
  display: flex;
  flex-direction: column;
}
.crop-modal[hidden] { display: none; }

.crop-hint {
  color: #E8E8E3;
  font-size: 14.5px;
  text-align: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
}

.crop-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none; /* жесты обрабатываем сами */
}

#crop-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.crop-rect {
  position: absolute;
  border: 2px solid #2AB77E;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #2AB77E;
  border: 3px solid #fff;
  border-radius: 50%;
  /* увеличенная зона нажатия */
  padding: 12px;
  background-clip: content-box;
  box-sizing: content-box;
}
.crop-handle[data-corner="nw"] { top: -24px; left: -24px; }
.crop-handle[data-corner="ne"] { top: -24px; right: -24px; }
.crop-handle[data-corner="sw"] { bottom: -24px; left: -24px; }
.crop-handle[data-corner="se"] { bottom: -24px; right: -24px; }

.crop-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: #141412;
}
.crop-btn { min-height: 50px; font-size: 16px; }
#crop-cancel { flex: 1; }
#crop-full { flex: 1.2; }
#crop-apply { flex: 1.4; }

/* ---------- Живая камера ---------- */

.camera-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.camera-modal[hidden] { display: none; }

#camera-video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }

.camera-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px calc(26px + env(safe-area-inset-bottom));
  background: #000;
}

.btn-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-shutter:active { background: #fff; }

.btn-camera-cancel {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Нижняя навигация с FAB-камерой ---------- */

/* прибит к нижней кромке: плавающая «пилюля» в webview отрывалась и скакала
   при скролле и клавиатуре */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  max-width: 480px;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(27, 26, 23, 0.08);
  padding: 0 6px env(safe-area-inset-bottom);
  z-index: 30;
  transform: translateZ(0);
}
.tabbar[hidden] { display: none; }

.tab {
  flex: 1;
  min-height: 58px;
  border: none;
  background: none;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tab.active { color: var(--accent); font-weight: 700; }
.tab-icon { width: 22px; height: 22px; }

.tab-fab {
  flex: none;
  align-self: flex-start;
  width: 62px;
  height: 62px;
  margin: -20px 8px 0;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: linear-gradient(135deg, #27B478, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(30, 138, 88, 0.45);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease);
}
.tab-fab:active { transform: scale(0.94); background: var(--accent-pressed); }

body.has-tabbar .container { padding-bottom: calc(210px + env(safe-area-inset-bottom)); }

/* ---------- Тосты ---------- */

.toast-box {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(74px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  padding: 0 16px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  background: #262521;
  color: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.3s var(--ease);
}
.toast-action {
  border: none;
  background: none;
  color: #63DBA8;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 4px;
  cursor: pointer;
  white-space: nowrap;
}
@keyframes toast-in {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
}

/* ---------- Дневник: приветствие, шапка и лента недели ---------- */

.diary-greet {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 2px 2px 10px;
  animation: rise 0.5s var(--ease) both;
}

.diary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.diary-date {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.diary-date .icon-inline { width: 18px; height: 18px; color: var(--accent); }

.today-chip {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  min-height: 34px;
  padding: 4px 14px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.today-chip:active { background: var(--accent-soft); }

.week-strip-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 12px;
}
.week-nav {
  width: 26px;
  height: 48px;
  flex: none;
  border: none;
  background: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.week-nav:disabled { opacity: 0.3; }
.week-nav .icon { width: 18px; height: 18px; }

.week-strip {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  touch-action: pan-y;
}
.day-cell {
  position: relative;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0 10px;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
  min-height: 58px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.day-cell:disabled { opacity: 0.35; cursor: default; }
.day-dow { font-size: 11px; color: var(--text-secondary); }
.day-num {
  width: 34px; height: 34px;
  line-height: 34px;
  border-radius: 50%;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.day-cell.selected .day-num {
  background: var(--text);
  color: #fff;
  font-weight: 700;
  transform: scale(1.06);
}
.day-cell.today:not(.selected) .day-num { color: var(--accent); font-weight: 800; }
.day-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--protein);
}
.day-cell.selected .day-dot { background: var(--text); }

/* ---------- Дневник: кольцо БЖУ и мини-бары ---------- */

.diary-card {
  text-align: left;
  padding: 18px 16px 4px;
  animation: rise 0.5s var(--ease) 0.05s both;
}
.diary-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.diary-nut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 10px 0;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.diary-nut-btn:active { color: var(--accent-pressed); }

.ring-wrap { position: relative; width: 158px; height: 158px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: #F0EEE7; stroke-width: 11; }

/* три сегмента БЖУ: белки → жиры → углеводы, встык без скруглений */
.ring-seg {
  fill: none;
  stroke-width: 11;
  stroke-linecap: butt;
  stroke-dasharray: 0 326.7;
  transition: stroke-dasharray 0.9s var(--ease), stroke-dashoffset 0.9s var(--ease);
}
.ring-seg-p { stroke: var(--protein); filter: drop-shadow(0 2px 6px rgba(63, 189, 140, 0.45)); }
.ring-seg-f { stroke: var(--fat);     filter: drop-shadow(0 2px 6px rgba(240, 176, 63, 0.45)); }
.ring-seg-c { stroke: var(--carbs);   filter: drop-shadow(0 2px 6px rgba(110, 170, 242, 0.45)); }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 18px;
}
.ring-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.ring-label { font-size: 12px; color: var(--text-secondary); line-height: 1.3; margin-top: 2px; }

/* строка недобора/перебора — под кольцом, на всю ширину карточки */
.ring-status {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 0 2px;
}
.ring-status[hidden] { display: none; }
.ring-status.over { color: var(--danger); }
.ring-status.hit { color: var(--accent); }

.minibars {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  row-gap: 3px;
  min-width: 0;
}
.mb-label { font-size: 12px; color: var(--text-secondary); }
.mb-val { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-bar {
  flex-basis: 100%;
  height: 6px;
  background: #F0EEE7;
  border-radius: 3px;
  overflow: hidden;
}
.mb-bar[hidden] { display: none; }
.mb-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.8s var(--ease);
}
#mb-fill-protein { background: var(--protein); }
#mb-fill-fat { background: var(--fat); }
#mb-fill-carbs { background: var(--carbs); }
#mb-fill-fiber { background: var(--fiber); }
.mb-fill.over { background: var(--danger); }

/* ---------- Дневник: карточки приёмов пищи ---------- */

.diary-meals { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.meal-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow-card);
  animation: rise 0.5s var(--ease) both;
}
.diary-meals .meal-section:nth-child(2) { animation-delay: 0.06s; }
.diary-meals .meal-section:nth-child(3) { animation-delay: 0.12s; }
.diary-meals .meal-section:nth-child(4) { animation-delay: 0.18s; }
.diary-meals .meal-section:nth-child(5) { animation-delay: 0.24s; }

.meal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.meal-emoji {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  background: linear-gradient(135deg, #F3F8F1, #FBF4E9);
}
.meal-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; flex: 1; min-width: 0; }
.meal-kcal { font-weight: 700; font-size: 14px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* доли Б/Ж/У приёма пищи — три тонкие полоски */
.meal-bars { display: flex; gap: 5px; margin-bottom: 10px; }
.meal-bars span {
  display: block;
  height: 5px;
  border-radius: 3px;
  min-width: 5px;
  transition: flex-grow 0.6s var(--ease);
}
.meal-bars .bp { background: var(--protein); }
.meal-bars .bf { background: var(--fat); }
.meal-bars .bc { background: var(--carbs); }

.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.entry-row:active { background: var(--accent-soft); }
.entry-name { min-width: 0; overflow-wrap: anywhere; font-size: 15.5px; font-weight: 500; }
.entry-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-secondary); }
.entry-kcal-cell { flex: none; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.meal-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border: 1.5px dashed #DDDACF;
  border-radius: 12px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.meal-add-row:active { background: var(--accent-soft); }
.meal-add-row .icon { width: 17px; height: 17px; }

.diary-add-btn {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.diary-empty { color: var(--text-secondary); text-align: center; padding: 14px 10px 4px; font-size: 15px; }

/* ---------- Месячный календарь ---------- */

.cal-title { text-align: center; flex: 1; font-size: 17px; }
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 6px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.cal-day {
  position: relative;
  min-height: 46px;
  border: none;
  background: none;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cal-day:not(:disabled):active { background: var(--accent-soft); }
.cal-day.selected { background: var(--text); color: #fff; font-weight: 700; }
.cal-day.today:not(.selected) { color: var(--accent); font-weight: 700; }
.cal-day:disabled { opacity: 0.3; cursor: default; }
.cal-day .day-dot { bottom: 5px; }
.cal-day.selected .day-dot { background: #fff; }

/* ---------- Добавки и пилюли ---------- */

/* информационный блок «где получать напоминания» — компактный, не карточка */
.notify-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
}
.notify-note[hidden] { display: none; }
.notify-ico { font-size: 16px; flex: none; line-height: 1.3; }
.notify-note b { font-weight: 700; }
.notify-setup { flex-direction: column; gap: 10px; }
.notify-setup-text { display: flex; align-items: flex-start; gap: 10px; }
.notify-btns { display: flex; gap: 8px; padding-left: 26px; }
.notify-btns .btn { flex: 1; max-width: 160px; }

.supps-sub { display: flex; align-items: baseline; justify-content: space-between; }
.supps-progress { font-size: 13.5px; font-weight: 400; color: var(--text-secondary); }
.supp-add-link { font-weight: 600; padding: 0 4px; min-height: 32px; }

.take-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(27, 26, 23, 0.03);
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.take-row:active { background: var(--accent-soft); }
.take-check {
  width: 28px; height: 28px; flex: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.2s, border-color 0.2s;
}
.take-row.taken .take-check { background: var(--protein); border-color: var(--protein); color: #fff; }
.take-check .icon { width: 15px; height: 15px; stroke-width: 3; }
.take-main { flex: 1; min-width: 0; }
.take-name { font-size: 15.5px; overflow-wrap: anywhere; }
.take-row.taken .take-name { color: var(--text-secondary); }
.take-sub { font-size: 12.5px; color: var(--text-secondary); }
.take-time-cell { flex: none; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.take-row.taken .take-time-cell { color: var(--accent-pressed); }

.supp-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(27, 26, 23, 0.03);
  padding: 12px 14px;
  margin-bottom: 8px;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.supp-card:active { background: var(--accent-soft); }
.supp-card-name { font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.supp-card-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.supp-card-warn { color: #B4611E; }

.supp-form .text-input { margin-bottom: 10px; }
.supp-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 4px 2px 8px;
}
.sp-times { padding: 0 0 10px; }
.sp-chip { color: var(--text); }
.sp-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp-chip.active b { color: rgba(255, 255, 255, 0.85); font-weight: 600; margin-left: 6px; }
.sp-chip-add { border-style: dashed; color: var(--accent); }
.sp-time-inline { max-width: 180px; }

.auth-step-btn { margin-top: 8px; }
#auth-step-code .btn { margin-top: 8px; }
.auth-max-status { margin-top: 10px; }
.max-note { margin-top: 8px; }
.auth-max-manual { text-align: left; margin-top: 10px; }
.auth-max-manual summary { text-align: center; }

.arch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.arch-info { flex: 1; min-width: 0; }
.arch-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.arch-sub { font-size: 12.5px; color: var(--text-secondary); }

/* ---------- Тарелочки и MAX ---------- */

.coins-row { font-size: 24px; margin-bottom: 8px; }
.coins-row b { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.coins-refs { font-size: 14px; color: var(--text-secondary); margin-left: 8px; }
.plans-mini { display: flex; gap: 8px; margin-top: 8px; }
.plans-mini .btn { flex: 1; min-width: 0; font-size: 13.5px; padding: 10px 6px; }
.plans-mini .btn:disabled { opacity: 0.45; }

/* ---------- Профиль ---------- */

.profile-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; outline: none; }
.profile-sub { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 22px 0 10px; }
.profile-hint { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 10px; }
.profile-email { font-size: 17px; font-weight: 700; margin-bottom: 12px; overflow-wrap: anywhere; }

.danger-zone {
  margin-top: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.name-row { display: flex; gap: 8px; margin-bottom: 10px; }
.name-input { flex: 1; min-width: 0; margin-bottom: 0; }
.name-save { width: auto; flex: none; }

/* нормы нутриентов в профиле */
.norm-group {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 14px 2px 6px;
}
.norm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  margin-bottom: 6px;
}
.norm-name { min-width: 0; }
.norm-unit { color: var(--text-secondary); font-size: 12.5px; }
.norm-input { width: 96px; flex: none; text-align: center; margin-bottom: 0; min-height: 42px; }
#norms-save { margin-top: 12px; }

/* ---------- Скелетоны загрузки ---------- */

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #EDEBE4 25%, #F6F4EE 40%, #EDEBE4 55%);
  background-size: 400% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -100% 0; } }
.skeleton-row { height: 52px; margin-bottom: 6px; }
.skeleton-stack { padding: 2px 0; }

.about-box p { font-size: 14.5px; margin-bottom: 10px; }
.about-box p:last-child { margin-bottom: 0; }

.text-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 10px;
}
.text-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.code-input { text-align: center; font-size: 24px; letter-spacing: 8px; font-weight: 700; }

.card-box .text-input { background: var(--bg); }

.auth-error { color: var(--danger); font-size: 14.5px; margin-top: 8px; }

.goals-box .btn { margin-top: 6px; }
.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15.5px;
  margin-bottom: 8px;
}
.goal-input { width: 110px; flex: none; text-align: center; margin-bottom: 0; }

.mifflin-box { margin: 6px 0 12px; }
.mifflin-box summary {
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
.mifflin-row { display: flex; gap: 8px; }
.mif-input { min-width: 0; }

/* история анализов */
.history-card {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(27, 26, 23, 0.03);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.history-photo {
  width: 56px; height: 56px; flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-soft);
}
.history-info { flex: 1; min-width: 0; }
.history-dishes { font-size: 14.5px; overflow-wrap: anywhere; }
.history-meta { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.history-repeat {
  flex: none;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.history-repeat:active { background: var(--accent-soft); }

/* ---------- Шторки приёма пищи и записи ---------- */

.sheet-compact { height: auto; max-height: 80dvh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.meal-options { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.meal-options .meal-option { text-align: left; }
.meal-options-row { flex-direction: row; flex-wrap: wrap; }
.meal-options-row .cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.entry-kcal { text-align: center; font-size: 15px; color: var(--text-secondary); padding: 6px 0 10px; }

/* быстрый ввод штуками: «2 яйца», «3 ломтика» */
.unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}
.unit-chips[hidden] { display: none; }
.unit-chip {
  flex: none;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.unit-chip:active { background: var(--accent-soft); }

/* свои продукты */
.picker-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  width: 100%;
  min-height: 46px;
  margin: 6px 0 calc(10px + env(safe-area-inset-bottom));
  border: 1.5px dashed #DDDACF;
  border-radius: 12px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.picker-create:active { background: var(--accent-soft); }

.myfood-row { display: flex; gap: 6px; margin-bottom: 6px; }
.myfood-row .food-row { flex: 1; min-width: 0; margin-bottom: 0; }
.myfood-del {
  flex: none;
  width: 44px;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.myfood-del .icon { width: 17px; height: 17px; }
#entry-sheet .btn { margin-top: 6px; }
#confirm-sheet .btn { margin-top: 8px; }
#confirm-sheet .profile-hint { margin-bottom: 12px; }

/* ---------- Десктоп: шире колонка, крупнее hero ---------- */

@media (min-width: 700px) {
  .container {
    max-width: 680px;
    padding-top: 40px;
    padding-bottom: 40px;
  }
  body.has-tabbar .container { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .bottom-actions { position: static; max-width: 680px; padding: 24px 0; background: none; }
  .picker-sheet { max-width: 640px; border-radius: 24px 24px 0 0; }
  .tabbar { max-width: 480px; }

  .landing-hero { padding-top: 4vh; border-radius: 0 0 40px 40px; }
  .landing-hero h1 { font-size: 58px; }
  .landing-slogan { font-size: 24px; }
  .hero-app { width: 300px; }
  .landing-h2 { font-size: 28px; }
  .landing-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .landing-step { flex-direction: column; }
  .landing-grid { gap: 12px; }

  .diary-greet { font-size: 36px; }
  .diary-card-main { gap: 28px; justify-content: flex-start; }
  .ring-wrap { width: 176px; height: 176px; }
  .minibars { max-width: 360px; }
}

/* ---------- Доступность: без анимаций по запросу системы ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
    transition-duration: 0.01s !important;
  }
}
