/* «Умное меню» — белый фон, зелёные акценты, шрифт Onest. Цвета сняты с макетов. */

@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {  /* только ради знака ₽ */
  font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+20A0-20C0;
}

:root {
  --green: #2f9a56;
  --green-deep: #238a4a;
  --green-bright: #3ab661;
  --green-soft: #e9f8ee;
  --green-line: #9ad7ab;
  --ink: #0f1728;
  --text: #3a4557;
  --muted: #6f7b8f;
  --line: #eceef2;
  --surface: #f4f6f8;
  --navy: #213241;
  --red: #f0394a;
  --gutter: 16px;
  --tabbar: 74px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.35 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, textarea, output { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
svg { width: 24px; height: 24px; flex: none; fill: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(47, 154, 86, .45); outline-offset: 2px; }
.dish-emoji { display: grid; place-items: center; background: linear-gradient(135deg, #fff5e3, #ffe6c9); font-size: 46px; line-height: 1; }

/* ---------- каркас экрана ---------- */

.screen {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px var(--gutter) calc(16px + var(--safe-bottom));
  animation: screen-in .22s ease both;
}
.screen--tabbed { padding-bottom: calc(var(--tabbar) + 20px + var(--safe-bottom)); }
.screen--center { align-items: center; text-align: center; }
.screen--flush { padding-top: 0; padding-left: 0; padding-right: 0; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

/* нижний блок кнопок прилипает к низу, контент прокручивается под ним */
.bottom {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: calc(100% + 2 * var(--gutter));
  margin: auto calc(-1 * var(--gutter)) calc(-16px - var(--safe-bottom));
  padding: 24px var(--gutter) calc(16px + var(--safe-bottom));
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 22px);
}
.bottom--pair { grid-template-columns: 1fr 1fr; }
.bottom--wide-right { grid-template-columns: 1fr 1.45fr; }
.bottom--wide-right .btn { padding: 0 10px; font-size: 17px; white-space: nowrap; }
.bottom__note { grid-column: 1 / -1; margin-top: 2px; }

.title { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.title--xl { font-size: 34px; }
.lead { margin-top: 10px; font-size: 18px; line-height: 1.35; font-weight: 500; color: var(--muted); }
.label { display: block; margin: 28px 0 12px; font-size: 18px; font-weight: 700; }
.hint { margin-top: 12px; font-size: 15px; color: var(--muted); }
.hint--center { text-align: center; }
.hint--warn { color: #d2453b; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 16px;
  border-radius: 16px;
  font-size: 18px; font-weight: 700;
  transition: transform .12s ease, background-color .2s, box-shadow .2s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn svg { width: 22px; height: 22px; }
.btn--primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px -10px rgba(35, 138, 74, .8); }
.btn--primary:disabled { background: #b7d8c3; box-shadow: none; }
.btn--ghost { background: #f4f6f7; border: 1px solid #e6e9ed; }
.btn--outline { background: #fff; border: 1px solid #e1e5ea; }
.btn--liked { background: var(--green-soft); color: var(--green-deep); box-shadow: none; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; }

/* ---------- 1. приветствие ---------- */

.welcome__art { width: auto; height: min(36vh, 330px); margin: 4px auto 6px; }
.welcome__title { max-width: 340px; }
.checks { display: grid; gap: 14px; margin: 26px auto 0; text-align: left; }
.checks li { display: flex; align-items: center; gap: 16px; font-size: 18px; font-weight: 500; color: var(--text); }
.checks__mark {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: #8dc971; color: #fff;
}
.checks__mark svg { width: 18px; height: 18px; }
.fineprint { font-size: 14px; line-height: 1.4; color: var(--muted); text-align: center; }
.linkish { font-size: inherit; text-decoration: underline; text-decoration-color: rgba(111, 123, 143, .4); text-underline-offset: 2px; }

/* ---------- шаги онбординга ---------- */

.progress { display: flex; align-items: center; gap: 16px; margin: 6px 0 26px; }
.progress__bar { flex: 1; height: 8px; border-radius: 99px; background: #ebedf0; overflow: hidden; }
.progress__bar i { display: block; height: 100%; border-radius: inherit; background: var(--green-deep); }
.progress__label { font-size: 17px; font-weight: 500; color: var(--muted); }
.icon-back { display: grid; place-items: center; align-self: flex-start; width: 40px; height: 40px; margin: -6px 0 2px -8px; color: #4b5870; }
.icon-back svg { width: 28px; height: 28px; }

.stepper { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 18px; }
.stepper__btn {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: #f8f9fc; border: 1px solid #e6e9ef;
  transition: opacity .15s, transform .12s;
}
.stepper__btn:active:not(:disabled) { transform: scale(.94); }
.stepper__btn:disabled { opacity: .35; }
.stepper__value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }

.people { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.choice {
  height: 56px; border-radius: 14px;
  background: #f8f9fa; border: 1px solid #edf0f3;
  font-size: 20px; font-weight: 600;
  transition: background-color .15s, color .15s;
}
.choice--on { background: var(--navy); border: 2px solid #8e9aa6; color: #fff; }

.stores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.store {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 108px; padding: 12px 4px;
  border: 1.5px solid var(--line); border-radius: 16px; background: #fff;
  font-size: 15px; font-weight: 500;
  transition: background-color .15s, border-color .15s;
}
.store img { width: 46px; height: 46px; }
.store--on { background: var(--green-soft); border-color: var(--green-line); }
.store { position: relative; }
.store--soon { background: #f7f8f9; color: #8a95a8; cursor: default; }
.store--soon img { filter: grayscale(1); opacity: .45; }
/* бейдж «скоро» на плитках того, что ещё не подключено */
.soon-badge {
  position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 999px;
  background: #fff3d6; color: #a46a00; font-size: 11px; font-weight: 700; line-height: 1.4; text-transform: lowercase;
}

.goals { display: grid; gap: 12px; margin-top: 22px; }
.option {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 10px 14px 10px 12px;
  border: 1.5px solid var(--line); border-radius: 18px; background: #fff;
  text-align: left;
  transition: background-color .15s, border-color .15s;
}
.option img { width: 58px; height: 58px; flex: none; }
.option__body { flex: 1; min-width: 0; }
.option__title { display: block; font-size: 18px; font-weight: 700; }
.option__desc { display: block; margin-top: 3px; font-size: 15px; color: var(--muted); }
.option__check {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #d9dde3; color: #fff;
}
.option__check svg { width: 15px; height: 15px; opacity: 0; }
.option--on { border-color: var(--green); background: #f3fbf6; }
.option--on .option__check { background: var(--green); border-color: var(--green); }
.option--on .option__check svg { opacity: 1; }

.restrictions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.restr {
  display: flex; align-items: center; gap: 10px;
  min-height: 74px; padding: 10px;
  border: 1.5px solid var(--line); border-radius: 16px; background: #fff;
  font-size: 15px; font-weight: 500; line-height: 1.2; text-align: left;
  transition: background-color .15s, border-color .15s;
}
.restr img { width: 48px; height: 48px; flex: none; }
.restr--on { border-color: var(--green); background: #f3fbf6; }
.note {
  display: block; width: 100%; min-height: 100px; padding: 14px 16px;
  border: 1px solid #e3e7ec; border-radius: 16px; background: #fafbfc;
  font-size: 16px; line-height: 1.4; resize: none;
}
.note::placeholder { color: #98a1b1; }
.note:focus { outline: none; border-color: var(--green-line); background: #fff; }

/* ---------- 5. генерация ---------- */

.gen__art { width: auto; height: min(30vh, 270px); margin: 0 auto 8px; }
.gen__title { font-size: 28px; }
.checks--steps { gap: 12px; margin-top: 22px; }
.checks--steps li { color: #9aa3b2; transition: color .3s; }
.checks--steps .checks__mark { background: #eceff3; color: transparent; transition: background-color .3s, color .3s; }
.checks--steps li.is-active, .checks--steps li.is-done { color: var(--text); }
.checks--steps li.is-active .checks__mark { background: none; border: 3px solid #d7eee0; border-top-color: var(--green); animation: spin .8s linear infinite; }
.checks--steps li.is-done .checks__mark { background: var(--green); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.meter { width: 100%; height: 12px; margin-top: 26px; border-radius: 99px; background: #e7f5ec; overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green-bright); transition: width .7s ease; }
.tip { display: flex; gap: 14px; width: 100%; margin-top: 22px; padding: 18px; border-radius: 20px; background: #fff6e2; text-align: left; }
.tip__icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: #fbbd23; color: #fff; }
.tip__icon svg { width: 20px; height: 20px; }
.tip__title { font-size: 17px; font-weight: 800; }
.tip__text { margin-top: 4px; font-size: 15px; line-height: 1.4; color: var(--text); }

/* ---------- 6. готово ---------- */

.done__badge { position: relative; display: grid; place-items: center; width: 150px; height: 112px; margin: 6px auto 4px; }
.done__circle { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: #a3df95; color: #0b6b35; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.done__circle svg { width: 44px; height: 44px; }
.ray { position: absolute; width: 18px; height: 7px; border-radius: 4px; background: #a7e39c; }
.ray--1 { left: 26px; top: 12px; transform: rotate(48deg); }
.ray--2 { left: 4px; top: 56px; transform: rotate(12deg); }
.ray--3 { right: 26px; top: 20px; transform: rotate(-42deg); }
.ray--4 { right: 4px; top: 70px; transform: rotate(16deg); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done__title, .done__lead { text-align: center; }
.done__lead { margin-top: 8px; }

.total { margin-top: 24px; padding: 22px; background: linear-gradient(#fdfefd, #f8faf9); }
.total__value { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.total__label { margin-top: 6px; font-size: 17px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 16px; border-radius: 14px; background: #e6f7e9; color: #1b7a40; font-size: 17px; font-weight: 600; }
.pill--warn { background: #fff0e6; color: #c2530f; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fact { padding: 16px 16px 18px; }
.fact__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 50%; background: #f2f4f6; color: #1f2d3d; }
.fact__title { font-size: 20px; font-weight: 800; }
.fact__sub { margin-top: 2px; font-size: 16px; color: var(--muted); }
.fact--row { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.fact--row .fact__icon { width: 56px; height: 56px; margin: 0; }
.fact--row .fact__icon svg { width: 28px; height: 28px; }

/* ---------- 7. меню недели ---------- */

.menu__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.menu__range { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 18px; font-weight: 500; color: var(--muted); }
.menu__range svg { width: 20px; height: 20px; }
.square-btn { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #f3f5f7; color: #1f2d3d; }
.square-btn svg { width: 26px; height: 26px; }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 20px; }
.day {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 10px; border-radius: 14px; background: #f5f6f7;
  font-size: 16px; font-weight: 500;
  transition: background-color .15s, color .15s;
}
.day b { font-size: 17px; font-weight: 600; }
.day--today:not(.day--on)::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.day--on { background: var(--green); color: #fff; }

.meals { display: grid; gap: 12px; margin-top: 16px; }
.meal { display: flex; gap: 12px; width: 100%; padding: 8px 8px 8px 16px; text-align: left; transition: transform .12s; }
.meal:active { transform: scale(.985); }
.meal__text { flex: 1; min-width: 0; padding: 12px 0; }
.meal__kind { display: block; font-size: 19px; font-weight: 800; }
.meal__name { display: block; margin-top: 6px; font-size: 16px; line-height: 1.3; font-weight: 500; color: #46536a; }
.meal__photo { flex: none; width: 132px; height: 104px; border-radius: 14px; object-fit: cover; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.chip {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 6px; border-radius: 14px; background: #f4f6f7;
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.chip svg { width: 22px; height: 22px; color: #3b475c; }
.chips--outline .chip { height: 44px; background: #fff; border: 1px solid var(--line); font-weight: 500; }
.chip--flame svg { color: #f59e0b; }

/* ---------- нижняя панель ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 480px; margin: 0 auto;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #eef0f3;
  backdrop-filter: blur(12px);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; font-size: 13px; font-weight: 500; color: #6b778c; }
.tab svg { width: 28px; height: 28px; }
.tab--active { color: var(--green); }
.tab--active svg { fill: currentColor; }  /* у «Меню» заливается домик, у остальных иконок заливки нет */

/* ---------- 8. рецепт ---------- */

.recipe__hero { position: relative; height: 250px; background: #f3f1ec; overflow: hidden; }
.recipe__photo, .recipe__img { width: 100%; height: 100%; }
.recipe__img { object-fit: cover; }
.recipe__img.dish-emoji { font-size: 110px; }
.round-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 4px 14px rgba(15, 23, 40, .12); }
.round-btn--gray { align-self: flex-start; background: #f3f5f6; box-shadow: none; }
.recipe__back { position: absolute; top: 14px; left: 16px; }
.recipe__fav { position: absolute; top: 14px; right: 16px; color: var(--red); }
.recipe__fav[aria-pressed="true"] svg { fill: currentColor; }
.recipe__sheet { position: relative; margin-top: -22px; padding: 22px var(--gutter) 0; border-radius: 24px 24px 0 0; background: #fff; }
.recipe__subtitle { margin-top: 4px; font-size: 21px; font-weight: 700; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: #f3f5f7; }
.segmented__btn { height: 44px; border-radius: 12px; font-size: 16px; font-weight: 600; color: #5d6a80; transition: background-color .15s, color .15s; }
.segmented--light .segmented__btn--on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(15, 23, 40, .08); }
.segmented--green { margin-top: 16px; padding: 0; border: 1px solid #e8ebef; }
.segmented--green .segmented__btn { height: 48px; border-radius: 15px; }
.segmented--green .segmented__btn--on { background: var(--green); color: #fff; }

.ingredients { margin-top: 6px; }
.ingredients li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f3; font-size: 17px; color: var(--text); }
.ingredients li span:last-child { color: var(--muted); text-align: right; white-space: nowrap; }
.steps { margin-top: 10px; counter-reset: step; }
.steps li { display: flex; gap: 12px; padding: 10px 0; font-size: 16px; line-height: 1.45; color: var(--text); }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-soft); color: var(--green); font-size: 15px; font-weight: 700;
}
#recipe-like { margin-top: 18px; }
.recipe__source { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 10px; padding: 8px; font-size: 14px; color: var(--muted); }
.recipe__source svg { width: 16px; height: 16px; }

/* ---------- 9. оценка дня ---------- */

.rate__title { margin-top: 18px; }
.rate__date { margin-top: 8px; font-size: 20px; font-weight: 700; color: #8a95a8; }
.rate { display: grid; gap: 12px; margin-top: 22px; }
.rate__item { display: flex; align-items: center; gap: 16px; padding: 14px; }
.rate__photo { flex: none; width: 102px; height: 104px; border-radius: 16px; object-fit: cover; }
.rate__body { flex: 1; min-width: 0; }
.rate__name { font-size: 17px; line-height: 1.3; font-weight: 500; }
.rate__btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.vote { display: grid; place-items: center; height: 50px; border-radius: 14px; transition: opacity .15s, transform .12s, box-shadow .15s; }
.vote:active { transform: scale(.94); }
.vote svg { width: 26px; height: 26px; }
.vote--like { background: #e7fbe9; color: #1f9a45; }
.vote--meh { background: #f5f6f8; color: #a6afbb; }
.vote--dislike { background: #ffedef; color: var(--red); }
.vote--dislike svg { transform: rotate(180deg); }
.vote--on { box-shadow: inset 0 0 0 2px currentColor; }
.rate__item--voted .vote:not(.vote--on) { opacity: .4; }

/* ---------- 10. список покупок ---------- */

.shop { display: grid; gap: 14px; margin-top: 16px; }
.shop__note { margin: 0; font-size: 13px; line-height: 1.4; }
.shop__card { padding: 2px 16px 4px; }
.shop__head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 0; border-bottom: 1px solid #edf0f3; text-align: left; }
.shop__logo { flex: none; width: 40px; height: 40px; }
.shop__name { flex: 1; min-width: 0; font-size: 19px; font-weight: 800; }
.shop__total { font-size: 19px; font-weight: 800; white-space: nowrap; }
.shop__head > svg, .shop__more > svg { width: 20px; height: 20px; color: #8a95a8; transition: transform .2s; }
.shop__head[aria-expanded="true"] > svg { transform: rotate(90deg); }
.shop__more[aria-expanded="true"] > svg { transform: rotate(-90deg); }
.shop__items { padding-top: 6px; }
.shop__items li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 16px; color: var(--text); }
.shop__dot { flex: none; width: 9px; height: 9px; margin: 0 4px; border-radius: 50%; background: #cfd5dc; }
.shop__mini { flex: none; width: 18px; height: 18px; }
.shop__item { flex: 1; min-width: 0; overflow-wrap: break-word; }
.shop__item small { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.shop__price { font-weight: 500; white-space: nowrap; }
.shop__more { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; font-size: 16px; color: var(--muted); text-align: left; }
.shop__more > svg { margin-left: auto; }
.shop__plus { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.shop__plus svg { width: 16px; height: 16px; }
.cat-tile { display: grid; place-items: center; border-radius: 12px; background: #f3f5f7; font-size: 22px; }
.sticky-cta {
  position: sticky; bottom: calc(var(--tabbar) + 8px + var(--safe-bottom)); z-index: 2;
  margin-top: 16px; padding-top: 12px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 14px);
}

/* ---------- «Новое меню»: кнопка и шторка ---------- */

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 40px; margin-top: 4px; padding: 0 14px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-deep); font-size: 15px; font-weight: 700;
}
.pill-btn svg { width: 18px; height: 18px; }

.sheet { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 40, .45); animation: fade-in .2s ease both; }
.sheet__panel {
  position: relative; display: grid; gap: 12px;
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 10px var(--gutter) calc(16px + var(--safe-bottom));
  border-radius: 24px 24px 0 0; background: #fff;
  animation: sheet-up .25s cubic-bezier(.2, .9, .3, 1) both;
}
.sheet__grip { justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: #dfe3e8; }
.sheet__title { font-size: 20px; font-weight: 800; }
.sheet__option {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px;
  border: 1px solid var(--line); border-radius: 18px; background: #fff; text-align: left;
  transition: background-color .15s;
}
.sheet__option:active { background: #f6f8f7; }
.sheet__option b { display: block; font-size: 17px; font-weight: 700; }
.sheet__option small { display: block; margin-top: 3px; font-size: 14px; color: var(--muted); }
.sheet__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }

/* ---------- 11. поиск товаров ---------- */

.lead--tight { margin-top: 6px; }
.searchbar { display: flex; gap: 10px; margin-top: 18px; }
.searchbox {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: #f6f7f9;
}
.searchbox svg { width: 24px; height: 24px; color: #4b5870; }
.searchbox input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.searchbox input::placeholder { color: #8d97a8; }
.searchbox:focus-within { border-color: var(--green-line); background: #fff; }
.filter-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: none;
  width: 72px; height: 56px; border-radius: 16px; background: #f3f5f7; font-size: 13px; font-weight: 500; color: #2c3748;
}
.filter-btn { position: relative; }
.filter-btn svg { width: 22px; height: 22px; }
.filter-btn .soon-badge { top: -7px; right: -4px; }

.chips-scroll {
  display: flex; gap: 8px; margin: 14px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 2px;
  overflow-x: auto; scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chip-filter {
  flex: none; height: 40px; padding: 0 16px; border-radius: 12px; background: #f3f5f7;
  font-size: 16px; font-weight: 500; color: #2c3748; transition: background-color .15s, color .15s;
}
.chip-filter--on { background: var(--green); color: #fff; font-weight: 600; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.section-head__title { font-size: 20px; font-weight: 800; }
.link-more { display: inline-flex; align-items: center; gap: 2px; font-size: 16px; font-weight: 500; color: var(--green); }
.link-more svg { width: 18px; height: 18px; }

.plist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pcard { display: flex; gap: 12px; padding: 10px; border-radius: 18px; }
.pcard--out { opacity: .6; }
.pcard__img { flex: none; width: 84px; height: 84px; border-radius: 14px; background: #f6f7f8; object-fit: contain; }
.photo-empty { display: grid; place-items: center; color: #b7bfca; }
.photo-empty svg { width: 34px; height: 34px; }
.pcard__body { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 1; min-width: 0; }
.pcard__title { min-width: 0; overflow-wrap: break-word; font-size: 17px; font-weight: 700; line-height: 1.25; }
.pcard__title--clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; }
.pcard__sub { font-size: 14px; color: var(--muted); }
.pcard__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin-top: 6px; }
.price-pill {
  display: inline-flex; align-items: baseline; gap: 5px; flex: none;
  padding: 6px 8px; border-radius: 12px; background: #eaf7ee; color: #1b6e3b; font-size: 13px; white-space: nowrap;
}
.price-pill b { font-size: 16px; font-weight: 800; }
.price-pill s { color: #8a95a8; font-size: 12px; }
.store-tag { display: inline-flex; align-items: center; gap: 5px; min-width: 0; margin-top: 2px; font-size: 13px; color: #4b5870; }
.store-tag img { width: 20px; height: 20px; }
.out-tag { font-size: 13px; color: #c2530f; }
.btn-soft { flex: none; height: 36px; padding: 0 11px; border-radius: 12px; background: #e3f5e9; color: #1b6e3b; font-size: 14px; font-weight: 600; }
.btn-soft:active { background: #d3eedc; }
.nowrap { white-space: nowrap; }
.search-note { padding: 18px; font-size: 16px; line-height: 1.45; color: var(--text); text-align: center; }

/* ---------- 12. сравнение цен ---------- */

.compare__top { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 10px; }
.link-back { display: inline-flex; align-items: center; gap: 4px; margin-left: -6px; font-size: 17px; font-weight: 500; color: var(--green); }
.link-back svg { width: 24px; height: 24px; }
.fav-btn { display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink); }
.fav-btn svg { width: 28px; height: 28px; }
.fav-btn[aria-pressed="true"] { color: var(--red); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

.chead { display: flex; gap: 14px; margin-top: 16px; padding: 12px; }
.chead__img { flex: none; width: 104px; height: 96px; border-radius: 14px; background: #f6f7f8; object-fit: contain; }
.chead__body { min-width: 0; }
.chead__title { font-size: 21px; font-weight: 800; line-height: 1.2; }
.chead__sub { margin-top: 4px; font-size: 15px; line-height: 1.3; color: var(--muted); }
.chead__amount { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 12px; background: #f3f5f7; font-size: 16px; font-weight: 600; }

.spread { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: #eaf7ee; }
.spread svg { width: 26px; height: 26px; color: var(--green); }
.spread p { font-size: 15px; line-height: 1.35; color: #2a3547; }
.spread b { font-size: 17px; font-weight: 800; color: var(--green-deep); white-space: nowrap; }

.offers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; list-style: none; }
.offer { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px; border-radius: 18px; text-align: left; }
.offer--best { border: 1.5px solid var(--green-line); background: #f4fbf6; }
.offer--current { box-shadow: 0 0 0 2px #cfe9d8; }
.offer__rank { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 10px; background: #f2f4f6; font-size: 15px; font-weight: 700; }
.offer--best .offer__rank { background: #dff3e6; }
.offer__logo { flex: none; width: 36px; height: 36px; }
.offer__body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; min-width: 0; }
.offer__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  width: 100%; min-width: 0; overflow-wrap: break-word;  /* «быстроразваривающаяся» не должна распирать строку */
  font-size: 15px; font-weight: 700; line-height: 1.25;
}
.badge-best { padding: 3px 10px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }
.offer__meta { font-size: 13px; color: var(--muted); }
.offer__stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #4b5870; }
.offer__stock svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: #e3f5e9; color: var(--green); }
.offer__stock--out svg { background: #ffe9e6; color: #d2453b; }
.offer__price { flex: none; font-size: 18px; font-weight: 800; white-space: nowrap; }
.offer > svg { width: 18px; height: 18px; margin-top: 3px; color: #8a95a8; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.tile { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: #f4f6f7; text-align: left; }
.tile--soon { color: #8a95a8; }
.tile--soon .soon-badge { top: -8px; right: 8px; }
.tile > svg:first-child { width: 26px; height: 26px; color: #4b5870; }
.tile > svg:last-child { width: 16px; height: 16px; margin-left: auto; color: #8a95a8; }
.tile span { min-width: 0; }
.tile b { display: block; font-size: 14px; font-weight: 700; }
.tile small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* ---------- список покупок: товары из поиска ---------- */

.shop__head--static { cursor: default; }
.shop__head--static .cat-tile svg { width: 22px; height: 22px; color: var(--green); }
.shop__remove { display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-right: -4px; border-radius: 50%; color: #8a95a8; }
.shop__remove svg { width: 16px; height: 16px; }
.shop__remove:active { background: #f1f3f5; }

/* ---------- 13. профиль ---------- */

.profile { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 16px; }
.profile__avatar {
  display: grid; place-items: center; flex: none; width: 72px; height: 72px; overflow: hidden;
  border-radius: 50%; background: linear-gradient(135deg, #5cc27e, var(--green-deep)); color: #fff; font-size: 30px; font-weight: 800;
}
.profile__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile__body { min-width: 0; }
.profile__name { font-size: 21px; font-weight: 800; line-height: 1.2; }
.profile__sub { margin-top: 2px; font-size: 15px; color: var(--muted); }
.profile__since { margin-top: 6px; font-size: 13px; color: var(--muted); }
.tg-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px;
  background: #e8f3fd; color: #1c7ed6; font-size: 13px; font-weight: 600;
}
.tg-badge svg { width: 14px; height: 14px; }
.admin-note { display: grid; gap: 4px; margin-top: 12px; padding: 14px 16px; background: #fff8e8; border-color: #f6e3b4; font-size: 15px; }
.plan-card { padding: 4px 16px; }
.plan-list div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.plan-list div:last-child { border-bottom: 0; }
.plan-list dt { color: var(--muted); font-size: 15px; }
.plan-list dd { font-size: 15px; font-weight: 600; text-align: right; }
.profile__edit { margin-top: 14px; }
.btn--danger { margin-top: 10px; background: #fff; border: 1px solid #f3d0cc; color: #d2453b; }

/* ---------- обслуживание: прогоны парсера (виден только администратору) ---------- */

.jobs .label { margin-bottom: 10px; }
.jobs__panel { display: grid; gap: 12px; padding: 16px; }
.jobs__actions { display: grid; gap: 8px; }
.jobs__btn { min-height: 48px; font-size: 16px; }
.jobs__btn:disabled { opacity: .55; }  /* пока идёт прогон, второй запустить нельзя */
.jobs__progress { display: grid; gap: 8px; }
.jobs__bar { height: 8px; border-radius: 99px; background: #ebedf0; overflow: hidden; }
.jobs__bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green-bright); transition: width .4s ease; }
.jobs__step { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.jobs__result { padding: 10px 12px; border-radius: 14px; background: var(--green-soft); color: var(--green-deep); font-size: 14px; font-weight: 600; }
.jobs__result--warn { background: #fdecec; color: #d2453b; }
.jobs__subtitle { margin: 20px 0 10px; font-size: 16px; font-weight: 700; }
.jobs__runs { display: grid; gap: 10px; list-style: none; }
.run { display: grid; gap: 6px; padding: 14px 16px; }
.run__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.run__label { font-size: 15px; font-weight: 700; }
.run__date { flex: none; font-size: 13px; color: var(--muted); }
.run__stats { font-size: 14px; color: var(--text); }
.run__failed { font-size: 14px; color: #c2530f; overflow-wrap: anywhere; }
.run__retry { min-height: 44px; margin-top: 4px; font-size: 15px; }

/* ---------- отчёт по целям на «Готово!» ---------- */

.goals-report { margin-top: 12px; padding: 16px; }
.goals-report__title { font-size: 17px; font-weight: 800; }
.goals-report__list { display: grid; gap: 10px; margin-top: 10px; }
.goal-row { display: flex; align-items: center; gap: 10px; }
.goal-row__mark { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.goal-row__mark svg { width: 15px; height: 15px; }
.goal-row--part .goal-row__mark { background: #fff0e6; color: #c2530f; }
.goal-row__text { flex: 1; min-width: 0; font-size: 15px; }
.goal-row__text small { display: block; font-size: 13px; color: var(--muted); }
.goal-row__count { font-size: 15px; font-weight: 700; white-space: nowrap; }
.goal-row--part .goal-row__count { color: #c2530f; }
.goals-report__day { margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0f3; font-size: 14px; color: var(--muted); }

/* ---------- 14. история меню ---------- */

.profile__history { margin-top: 10px; }
.history { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 18px; }
.hist { padding: 14px 16px; }
.hist__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hist__date { font-size: 14px; color: var(--muted); }
.hist__current { padding: 3px 10px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }
.hist__total { margin-top: 6px; font-size: 22px; font-weight: 800; }
.hist__total span { margin-left: 6px; font-size: 13px; font-weight: 600; }
.hist__ok { color: var(--green-deep); }
.hist__warn { color: #c2530f; }
.hist__plan { margin-top: 2px; font-size: 14px; color: var(--text); }
.hist__goals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hist__goal { padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-size: 13px; font-weight: 600; }
.hist__goal--part { background: #fff0e6; color: #c2530f; }
.hist__preview { margin-top: 10px; padding-left: 18px; list-style: disc; font-size: 14px; color: var(--muted); }
.hist__pick { margin-top: 12px; min-height: 44px; font-size: 16px; }

/* ---------- всплывашка ---------- */

.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 20;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 18px;
  border-radius: 14px; background: rgba(15, 23, 40, .9); color: #fff;
  font-size: 15px; font-weight: 500; text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast--show { animation: toast 1.8s ease both; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
