@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations");
  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;
}

:root {
  --bg: #F3F4EF;
  --surface: #FFFFFF;
  --ink: #1E2421;
  --muted: #5B635E;
  --muted-2: #4A524D;
  --line: #E2E5DE;
  --line-soft: #EEF0EA;
  --accent: #2F6B4F;
  --accent-ink: #234F3B;
  --accent-soft: #E3EEE6;
  --warm-bg: #F6E7DA; --warm-fg: #9A4A1F;
  --green-bg: #E3EEE6; --green-fg: #2F6B4F;
  --blue-bg: #E6ECF5; --blue-fg: #2D4870;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
svg { flex: none; }

/* ---------- кнопки-иконки ---------- */
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; color: var(--ink);
}

/* ---------- главная ---------- */
.home-head { padding: 28px 4px 4px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.home-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.home-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }

.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px; margin-top: 16px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font: inherit; font-size: 16px; color: var(--ink);
}
.search input::placeholder { color: #6B736E; }
.search input::-webkit-search-cancel-button { display: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.count { margin: 10px 4px; font-size: 13px; color: var(--muted); }

.cards { display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }
.card {
  display: flex; gap: 14px; align-items: center; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.card[hidden] { display: none; }
.tile {
  flex: none; width: 84px; height: 84px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tint-warm { background: var(--warm-bg); color: var(--warm-fg); }
.tint-green { background: var(--green-bg); color: var(--green-fg); }
.tint-blue { background: var(--blue-bg); color: var(--blue-fg); }
.card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.25; }
.card-meta { font-size: 13px; color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--bg); color: var(--muted-2); }
.badge-protein { font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- страница рецепта ---------- */
.recipe { display: flex; flex-direction: column; gap: 20px; padding-top: 16px; padding-bottom: 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.back {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 10px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 600;
}
.hero { height: 180px; border-radius: 24px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.title-block { display: flex; flex-direction: column; gap: 10px; }
.recipe h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted-2); text-decoration: none;
}

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 18px; font-weight: 800; white-space: nowrap; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-accent { background: var(--accent-soft); border-color: #CFE0D4; }
.stat-accent .stat-label, .stat-accent .stat-value, .stat-accent .stat-sub { color: var(--accent-ink); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel h2, .section-title { margin: 0; font-size: 20px; font-weight: 800; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 14px; padding: 3px; }
.stepper button {
  width: 38px; height: 38px; border: none; border-radius: 11px; background: var(--surface);
  font-size: 20px; font-weight: 700; cursor: pointer; line-height: 1;
}
.stepper output { min-width: 78px; text-align: center; font-size: 14px; font-weight: 700; }

.ingredients { list-style: none; margin: 0; padding: 0; }
.ing-group { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 14px 2px 6px; }
.ing {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 6px 2px;
  border: none; border-top: 1px solid var(--line-soft); background: transparent;
  text-align: left; cursor: pointer;
}
.box {
  flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #C9CEC6;
  display: flex; align-items: center; justify-content: center; background: var(--surface);
}
.box svg { visibility: hidden; }
.qty { flex: none; width: 76px; font-size: 15px; font-weight: 800; color: var(--accent); }
.ing-name { flex: 1; font-size: 15px; line-height: 1.35; }
.ing[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.ing[aria-pressed="true"] .box svg { visibility: visible; }
.ing[aria-pressed="true"] .qty,
.ing[aria-pressed="true"] .ing-name { color: #6B736E; }
.ing[aria-pressed="true"] .ing-name { text-decoration: line-through; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 58px; border-radius: 18px; border: none; width: 100%;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer;
}

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.step-n {
  flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.step-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.step-text { margin: 0; font-size: 15px; line-height: 1.5; }
.time-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--warm-fg); background: var(--warm-bg); border-radius: 8px; padding: 3px 8px;
}

.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.store { background: var(--blue-bg); color: var(--blue-fg); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.store span:first-child { font-size: 12px; font-weight: 600; }
.store span:last-child { font-size: 17px; font-weight: 800; }
.prose { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted-2); white-space: pre-line; }
.source { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

/* ---------- режим готовки ---------- */
.cook {
  position: fixed; inset: 0; z-index: 10; background: #17201B; color: #F2F5F1;
  display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.cook[hidden] { display: none; }
.cook-inner { max-width: 640px; width: 100%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.cook-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cook-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #A9B5AD; }
.cook-name { font-size: 16px; font-weight: 700; }
.cook .icon-btn { background: #24302A; border-color: #24302A; color: #F2F5F1; }
.cook :focus-visible { outline-color: #9FD3B4; }
.progress { display: flex; gap: 5px; }
.progress span { flex: 1; height: 5px; border-radius: 3px; background: #2E3A33; }
.progress span.on { background: #9FD3B4; }
.cook-main { flex: 1; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; min-height: 0; }
.cook-label { font-size: 15px; font-weight: 700; color: #9FD3B4; }
.cook-text { margin: 0; font-size: 27px; font-weight: 700; line-height: 1.32; letter-spacing: -.01em; }
.need { background: #212C26; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.need-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #A9B5AD; }
.need-row { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.need-row b { color: #9FD3B4; white-space: nowrap; }
.timer {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px;
  border-radius: 16px; border: 1.5px solid #E8A27C; background: transparent; color: #F4BC9C;
  font-size: 16px; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums;
}
.timer.running { background: #3A2A20; }
.timer.done { background: #E8A27C; color: #2A1A10; }
.awake { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #A9B5AD; }
.cook-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
.cook-nav button { height: 60px; border-radius: 18px; border: none; font-size: 17px; font-weight: 800; cursor: pointer; }
.cook-prev { background: #24302A; color: #F2F5F1; }
.cook-prev:disabled { opacity: .45; cursor: default; }
.cook-next { background: #9FD3B4; color: #12301F; }
body.cooking { overflow: hidden; }
