/* Mini App «Замая Выручай × Меню от Замаи» — эталон владельца 2026-11-04 (content/brand/design): молочный фон, глубокий зелёный, золото листа только в логотипе, Manrope. */
:root {
  color-scheme: light;
  --ground: #fff8ee; --card: #fffbf4; --line: #e8e4d9; --ink: #203b32; --muted: #707a70; --soft: #586b5f;
  --sage: #226800; --sage-dark: #062b08; --sage-soft: #edf1e5; --sage-mid: #569b05; --sage-ink: #D8E6CF; --leaf: #A9CF8E;
  --sand: #E9D3B5; --peach: #F6D9C9; --gold: #ffd322;
  --warm: #2F5D3A; --warm-soft: #FBF1EA; --warm-line: #F0D2BF; --warm-ink: #8A4B22; --placeholder: #EFE7D8;
  --accent-text: #174f46; --on-accent: #FFFFFF; --field: #FFFFFF; --nav: #FFFDF8; --label: #34403A; --strike: #8A8F86; --knob: #FFFFFF;
  --photo-shade: rgba(20, 40, 28, 0.78); --hero-glow: rgba(169, 207, 142, 0.35); --bar-track: rgba(255, 255, 255, 0.22); --overlay: rgba(30, 43, 34, 0.35);
  --shadow: 0 8px 28px #173d2910; --shadow-btn: 0 5px 15px #174f4626; --shadow-hero: 0 10px 26px rgba(36, 74, 46, 0.25);
  --shadow-nav: 0 -4px 18px rgba(47, 61, 42, 0.06); --shadow-plus: 0 6px 16px rgba(47, 93, 58, 0.35);
  --welcome-shade: #0e3028d9;
  --welcome-tag: #fffdf8e8;
  --welcome-ink: #174f46;
  --desktop-glow: #e9eddf;
  --desktop-shadow: #174f4610;
}
/* Тёмная тема: глубокий изумруд вместо молока; зелёный текст светлеет, чтобы читаться на тёмном. */
:root[data-theme="dark"] {
  --welcome-shade: #06120cdd; --welcome-tag: #162e24ee; --welcome-ink: #d6e8be; --desktop-glow: #183428; --desktop-shadow: #00000030;
  color-scheme: dark;
  --ground: #0e201a; --card: #182e24; --line: #30463a; --ink: #f6f4e9; --muted: #aabaae; --soft: #c7d1c6;
  --sage: #306c55; --sage-dark: #2F6140; --sage-soft: #243e2f; --sage-mid: #4F8C5F; --sage-ink: #CFE3C6; --leaf: #A9CF8E;
  --sand: #3A3122; --peach: #3B2A24; --gold: #D9B25A;
  --warm: #3F7A4F; --warm-soft: #33261C; --warm-line: #5A4030; --warm-ink: #F0B88E; --placeholder: #1C3327;
  --accent-text: #d6e8be; --on-accent: #FFFFFF; --field: #10241A; --nav: #12261C; --label: #D5DDD3; --strike: #8F9A90; --knob: #EEF0E6;
  --photo-shade: rgba(6, 18, 12, 0.85); --hero-glow: rgba(169, 207, 142, 0.18); --bar-track: rgba(255, 255, 255, 0.18); --overlay: rgba(0, 0, 0, 0.55);
  --shadow: 0 8px 28px #0002; --shadow-btn: 0 6px 16px rgba(0, 0, 0, 0.35); --shadow-hero: 0 10px 26px rgba(0, 0, 0, 0.4);
  --shadow-nav: 0 -4px 18px rgba(0, 0, 0, 0.35); --shadow-plus: 0 6px 16px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: Manrope, system-ui, sans-serif; }
body { min-height: 100vh; }
.screen { display: none; flex-direction: column; gap: 16px; padding: 20px 16px 110px; max-width: 480px; margin: 0 auto; }
.screen.on { display: flex; }
h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -0.3px; }
p { margin: 0; line-height: 1.45; }
.muted { color: var(--muted); font-size: 13px; }
.lead { color: var(--soft); font-size: 15px; }

/* шапка: логотип платформы + продукт */
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand b { display: block; font-size: 17px; font-weight: 800; color: var(--accent-text); line-height: 1.1; }
.brand span { display: block; font-size: 11px; color: var(--muted); }
.brand-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 4px; }
.brand-hero svg { width: 56px; height: 56px; }
.brand-hero b { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.05; }
.brand-hero .tagline { color: var(--accent-text); font-weight: 600; font-size: 13px; letter-spacing: 0.4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.soft { background: var(--sage-soft); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.warn { background: var(--warm-soft); border: 1px solid var(--warm-line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.big { font-size: 52px; font-weight: 800; color: var(--accent-text); letter-spacing: -1px; }
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--sage-mid), var(--sage-dark)); color: var(--on-accent);
  border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-hero); }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--hero-glow), transparent 70%); }
.hero .muted { color: var(--sage-ink); }
.hero .num { font-size: 42px; font-weight: 800; letter-spacing: -1px; }
.bar { height: 8px; border-radius: 4px; background: var(--bar-track); overflow: hidden; }
.bar > div { height: 8px; background: var(--leaf); border-radius: 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.btn { display: block; width: 100%; text-align: center; background: var(--sage); color: var(--on-accent); border: 0; font: inherit; font-weight: 700;
  font-size: 16px; padding: 16px; border-radius: 18px; min-height: 54px; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-btn); }
.btn:active { background: var(--sage-dark); }
.btn.pay { background: var(--sage); font-weight: 800; font-size: 17px; }
.btn.ghost { background: var(--card); color: var(--accent-text); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: none; color: var(--warm-ink); box-shadow: none; font-weight: 600; }
.meal { cursor: pointer; font: inherit; color: inherit; text-align: left; width: 100%; }
.btn.small { width: auto; font-size: 14px; padding: 0 16px; min-height: 44px; border-radius: 12px; box-shadow: none; }
.chip { font: inherit; font-size: 13px; color: var(--accent-text); background: var(--sage-soft); border: 0; border-radius: 12px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
label { font-size: 14px; color: var(--label); }
input, select { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; min-height: 46px; width: 100%; background: var(--field); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--leaf); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.inline { display: flex; gap: 8px; }
.inline input { flex-grow: 1; }
.error { color: var(--warm-ink); font-size: 14px; }

/* приём пищи: иконка в плашке + название + ккал */
.meal { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.meal .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--peach); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.meal .ico svg { width: 22px; height: 22px; stroke: var(--sage); }
.meal .txt { flex-grow: 1; min-width: 0; }
.meal > b { white-space: nowrap; }
.meal .txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msgs { display: flex; flex-direction: column; gap: 10px; }
.me, .her { max-width: 86%; border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.45; }
.me { align-self: flex-end; background: var(--sage); color: var(--on-accent); border-bottom-right-radius: 6px; }
.her { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.her.safe { background: var(--warm-soft); border-color: var(--warm-line); }
.price { display: flex; align-items: baseline; gap: 10px; }
.price b { font-size: 36px; font-weight: 800; letter-spacing: -1px; color: var(--accent-text); }
.price s { color: var(--strike); }
.check { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.check i { width: 28px; height: 28px; border-radius: 50%; background: var(--sage); color: var(--on-accent); font-style: normal; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.photo-box { height: 220px; border-radius: 24px; background: linear-gradient(135deg, var(--sand), var(--peach)); display: flex; align-items: center; justify-content: center;
  color: var(--soft); font-size: 14px; overflow: hidden; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }

/* нижняя панель: 4 вкладки и круглая «+» (фото тарелки) по центру */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
  background: var(--nav); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-nav); }
nav.tabs button, nav.tabs label { font: inherit; font-size: 11px; color: var(--muted); background: none; border: 0; min-height: 48px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
nav.tabs svg { width: 22px; height: 22px; stroke: currentColor; }
nav.tabs button[aria-current="page"] { color: var(--accent-text); font-weight: 700; }
nav.tabs .plus span { width: 52px; height: 52px; margin-top: -22px; border-radius: 50%; background: var(--sage); color: var(--on-accent); display: flex;
  align-items: center; justify-content: center; box-shadow: var(--shadow-plus); border: 4px solid var(--ground); }
nav.tabs .plus svg { stroke: var(--on-accent); width: 24px; height: 24px; }
/* приветствие Замаи, кольцо нормы, помощник, профиль, переключатели */
.hero-photo { position: relative; min-height: 340px; border-radius: 28px; overflow: hidden; background: linear-gradient(160deg, var(--sage-mid), var(--sage-dark));
  display: flex; align-items: flex-end; box-shadow: var(--shadow-hero); }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--photo-shade) 100%); }
.hero-photo-text { position: relative; z-index: 1; padding: 22px; display: flex; flex-direction: column; gap: 6px; color: var(--on-accent); }
.hero-photo-text b { font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -0.5px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--sage-soft); }
.avatar.logo { display: flex; align-items: center; justify-content: center; }
.avatar.logo svg { width: 30px; height: 30px; }
.avatar.letter { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; color: var(--accent-text); }
.vera-says { flex-direction: row; gap: 12px; align-items: flex-start; }
.vera-says p { font-size: 14px; color: var(--soft); margin: 4px 0; }
.day { flex-direction: row; align-items: center; gap: 16px; }
.ring-box { position: relative; width: 124px; height: 124px; flex-shrink: 0; }
.ring-box svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track, .ring-fill { fill: none; stroke-width: 11; }
.ring-track { stroke: var(--sage-soft); }
.ring-fill { stroke: var(--sage); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-text b { font-size: 28px; font-weight: 800; color: var(--accent-text); line-height: 1; }
.ring-text span { font-size: 11px; color: var(--muted); }
.day-macros { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.day-macros div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.btn-ico { width: 20px; height: 20px; stroke: var(--on-accent); vertical-align: -4px; margin-right: 8px; }
.helper { flex-direction: row; align-items: center; gap: 12px; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.helper > span { display: flex; flex-direction: column; gap: 2px; }
.profile-head { flex-direction: row; align-items: center; gap: 14px; }
.profile-head > div { display: flex; flex-direction: column; gap: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--sage-soft); border-radius: 14px; padding: 4px; }
.seg button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--soft); border-radius: 10px; min-height: 40px; cursor: pointer; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--card); color: var(--accent-text); font-weight: 700; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .ring-fill { transition: none; } }

/* меню, рецепт, «Готовим вместе» */
.row-link { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.row-link > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.chip.back { align-self: flex-start; }
h2 { margin: 6px 0 0; font-size: 19px; font-weight: 800; }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days .chip { flex-shrink: 0; min-width: 58px; text-transform: capitalize; }
.days .chip.today { box-shadow: inset 0 0 0 1.5px var(--accent-text); }
.slot { flex-direction: row; align-items: center; gap: 10px; padding: 10px; }
.dish { display: flex; align-items: center; gap: 12px; flex-grow: 1; min-width: 0; font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.dish img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--placeholder); }
.dish-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recipe-card { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 8px 8px 12px; box-shadow: var(--shadow); }
.recipe-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--placeholder); }
.recipe-card b { font-size: 14px; line-height: 1.25; }
.recipe-cover img, .cook-media img, img.wide { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; display: block; background: var(--placeholder); }
video.reel { width: 100%; aspect-ratio: 9 / 16; max-height: 70vh; object-fit: cover; border-radius: 24px; background: var(--placeholder); }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.grid4 .soft { padding: 10px 8px; align-items: center; text-align: center; }
.cook-step { display: flex; flex-direction: column; gap: 14px; }
#cook-h { font-size: 22px; line-height: 1.3; }
.timer { flex-direction: row; align-items: center; justify-content: space-between; }
.timer b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.btn[disabled].ghost { opacity: 0.4; }

/* анкета: шаги, карточки-варианты, −/+, переключатели, чипы, «Считаем…» */
.wz, .wz-welcome { display: flex; flex-direction: column; gap: 16px; }
.dots { display: flex; gap: 6px; }
.dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--sage); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts.two { display: grid; grid-template-columns: 1fr 1fr; }
.opt { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 48px 16px 16px; min-height: 64px;
  box-shadow: var(--shadow); transition: border-color 0.2s, background 0.2s, transform 0.2s; }
.opt b { font-size: 16px; }
.opt[aria-pressed="true"] { border-color: var(--accent-text); background: var(--sage-soft); }
.opt[aria-pressed="true"]::after { content: "✓"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px;
  border-radius: 50%; background: var(--sage); color: var(--on-accent); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.opt:active { transform: scale(0.98); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--sage-soft); color: var(--accent-text); font: inherit; font-size: 26px; font-weight: 700; cursor: pointer; }
.num-box { display: flex; align-items: baseline; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 8px 16px; box-shadow: var(--shadow); }
.num-box input { width: 110px; border: 0; padding: 0; min-height: 0; text-align: center; font-size: 40px; font-weight: 800; background: transparent; }
.num-box span { color: var(--muted); font-size: 16px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; min-height: 0; padding: 0; border-radius: 14px; border: 0;
  background: var(--line); position: relative; flex-shrink: 0; cursor: pointer; transition: background 0.2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); transition: left 0.2s; }
.switch input:checked { background: var(--sage); }
.switch input:checked::after { left: 23px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--sage); color: var(--on-accent); }
.wz-body { display: flex; flex-direction: column; gap: 12px; }
.wz-body.enter { animation: wz-in 0.25s ease-out; }
@keyframes wz-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.wz-calc { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 40px; text-align: center; }
.ring { width: 120px; height: 120px; border-radius: 50%; border: 8px solid var(--sage-soft); border-top-color: var(--sage); display: flex;
  align-items: center; justify-content: center; animation: spin 1.1s linear infinite; }
.ring svg { width: 48px; height: 48px; animation: spin 1.1s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.calc-list { display: flex; flex-direction: column; gap: 10px; }
.calc-list .check { opacity: 0; animation: fade 0.3s forwards; }
.calc-list .check:nth-child(2) { animation-delay: 0.4s; }
.calc-list .check:nth-child(3) { animation-delay: 0.8s; }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wz-body.enter, .ring, .ring svg { animation: none; } .calc-list .check { animation: none; opacity: 1; } .opt { transition: none; } }

/* состояния: скелет загрузки, «печатает», плашка «нет связи», занятая кнопка */
.skel { height: 68px; box-shadow: none; background: linear-gradient(90deg, var(--card) 0%, var(--placeholder) 50%, var(--card) 100%);
  background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.typing { color: var(--muted); font-style: italic; }
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--warm-soft); border-bottom: 1px solid var(--warm-line); color: var(--warm-ink); font-size: 14px; }
.btn[disabled], .chip[disabled] { opacity: 0.6; cursor: progress; }
.hidden { display: none !important; }
