:root {
  --bg: #FBF6F0;
  --surface: #FFFFFF;
  --text: #1F2A24;
  --muted: #5C6F62;
  --accent: #C45C26;
  --accent-hover: #a84d1e;
  --primary: #2F5D4A;
  --primary-hover: #24493a;
  --ok: #1E7A3A;
  --danger: #A52828;
  --line: #E6DDD2;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.has-sticky { padding-bottom: 56px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img, svg { max-width: 100%; display: block; }
button, input, select { font: inherit; }
main { flex: 1; }
h1, h2, h3 { line-height: 1.25; color: var(--primary); font-weight: 700; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); margin-bottom: 12px; }
h2 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); margin-bottom: 14px; }
h3 { font-size: 1rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { margin: 32px 0; }
.muted { color: var(--muted); font-size: .9rem; }
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 16px; max-width: 46rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; margin-top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); overflow: hidden; }
.skip { position: absolute; top: -100px; left: 8px; background: var(--surface); padding: 8px 12px; z-index: 200; }
.skip:focus { top: 8px; }

/* Шапка */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas:
    "logo toggle cart"
    "search search search";
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  padding: 8px 0;
}
.logo { grid-area: logo; display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo:hover { color: #fff; }
.logo-mark { flex-shrink: 0; }
.logo-text { font-size: 1rem; font-weight: 700; color: #fff; display: block; line-height: 1.2; }
.logo-sub { font-size: .72rem; color: rgba(255, 255, 255, .7); }
.nav-toggle {
  grid-area: toggle;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .2); }
.site-nav {
  display: none;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.site-nav.is-open {
  display: flex;
  grid-column: 1 / -1;
  grid-area: auto;
  flex-direction: column;
  padding: 8px 0 12px;
  border-top: 1px solid rgba(255, 255, 255, .15);
}
.site-nav a { color: rgba(255, 255, 255, .9); font-size: .9rem; padding: 6px 0; }
.site-nav a:hover { color: #fff; }
.header-search { grid-area: search; min-width: 0; }
.header-search input {
  width: 100%;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: .875rem;
  background: #fff;
  color: var(--text);
}
.cart-link {
  grid-area: cart;
  color: rgba(255, 255, 255, .9);
  font-size: .8rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-link:hover { color: #fff; }
.cart-badge {
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  border-radius: 99px;
  min-width: 1.25rem;
  padding: 1px 6px;
  text-align: center;
}
.cart-badge[hidden] { display: none; }

@media (min-width: 960px) {
  .header-inner {
    grid-template-columns: auto 1fr minmax(180px, 260px) auto;
    grid-template-areas: "logo nav search cart";
  }
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open {
    display: flex;
    grid-area: nav;
    flex-direction: row;
    flex-wrap: wrap;
    border: 0;
    padding: 0;
    justify-content: flex-end;
  }
  .site-nav a { padding: 4px 0; font-size: .82rem; }
}

/* Хлебные крошки */
.breadcrumbs { padding: 10px 0; font-size: .82rem; color: var(--muted); }
.breadcrumbs.container { padding-top: 10px; padding-bottom: 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* Карточки */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.pagination { display: flex; gap: 16px; align-items: center; margin-top: 28px; color: var(--muted); }
.pagination a { font-weight: 600; }
.card-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  min-height: 88px;
}
.card-link:hover { box-shadow: 0 4px 12px rgba(31, 42, 36, .08); color: var(--text); border-color: #d5c9b8; }
.card-link strong { font-size: .95rem; color: var(--primary); }
.card-link span { font-size: .82rem; color: var(--muted); line-height: 1.4; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); }

/* Герой */
.hero { background: var(--primary); color: #fff; padding: 36px 0 40px; }
.hero h1 { color: #fff; margin-bottom: 12px; }
.hero .lead { color: rgba(255, 255, 255, .85); margin-bottom: 20px; }
.hero-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 640px; }
.hero-search input { flex: 1; border: none; border-radius: var(--radius-sm); padding: 12px 16px; font-size: .95rem; min-width: 0; }
.chips, .chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .chips a {
  background: rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .95);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: .82rem;
}
.hero .chips a:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.chip-list a {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: .82rem;
}
.chip-list a:hover { border-color: var(--accent); color: var(--accent); }

/* Калькулятор */
.calc-page { padding: 8px 0 32px; }
.calc-widget { display: grid; gap: 16px; margin: 20px 0; }
@media (min-width: 768px) {
  .calc-widget { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .calc-result { position: sticky; top: calc(var(--header-h) + 12px); }
}
.calc-form { display: flex; flex-direction: column; gap: 14px; }
.field { min-width: 0; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--primary); }
.field select,
.field input[type=text],
.field input[type=search],
.field input[type=number] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
}
.field select:focus,
.field input:focus { outline: none; border-color: var(--primary); }
.stepper { display: flex; align-items: stretch; width: 100%; }
.stepper input {
  flex: 1;
  width: 0;
  text-align: center;
  border-radius: 0;
  border-left: none;
  border-right: none;
  font-variant-numeric: tabular-nums;
}
.step {
  background: var(--surface);
  border: 1.5px solid var(--line);
  padding: 0 14px;
  font-size: 1.2rem;
  cursor: pointer;
  min-width: 44px;
  color: var(--primary);
}
.step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.step:hover { background: var(--bg); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.preset { background: var(--bg); border: 1.5px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: .82rem; cursor: pointer; }
.preset:hover, .preset.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 4px; }
.calc-result { text-align: left; }
.result-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.result-total { font-size: 1.35rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: 12px; line-height: 1.3; }
#result-items, #sc-items { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 12px; font-size: .9rem; display: flex; flex-direction: column; gap: 8px; }
.result-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.result-row.highlight { font-weight: 700; }
.sticky-result {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  text-align: center;
  font-size: .95rem;
  font-weight: 600;
  z-index: 90;
}
@media (min-width: 768px) { .sticky-result { display: none !important; } }

.faq-block { margin: 24px 0; }
.faq-item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 14px 16px; background: var(--surface); }
.faq-item summary { font-weight: 600; cursor: pointer; color: var(--primary); }
.faq-item p { margin-top: 8px; font-size: .9rem; color: var(--muted); }

.portions-bar { margin: 20px 0 28px; }
.portions-label { margin-bottom: 12px; color: var(--muted); }
.portions-label strong { color: var(--primary); font-size: 1.15rem; }
.portions-control { display: flex; align-items: center; gap: 12px; margin: 0; flex-wrap: wrap; }
.portions-stepper { max-width: 168px; }
.portions-stepper .portions-value {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  border-top: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  background: var(--bg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.portions-bar .presets { margin: 0; }
.recipe-block { margin: 28px 0; }
.ing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ing-list li {
  display: grid;
  grid-template-columns: 8.2rem minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.ing-list li:last-child { border-bottom: none; }
.ing-qty {
  display: grid;
  grid-template-columns: 4.2rem 2.8rem;
  gap: 6px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.ing-amount { min-width: 0; text-align: right; color: var(--accent); font-weight: 700; }
.ing-unit { color: var(--muted); font-size: .88rem; }
.ing-name { color: var(--text); }
.ok-msg { color: var(--ok); font-size: .85rem; margin-left: 10px; font-weight: 600; }
.recipe-steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.recipe-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.recipe-steps li::before {
  content: counter(step);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / span 2;
}
.recipe-steps li strong { color: var(--primary); }
.recipe-steps li span { grid-column: 2; color: var(--muted); }
.shopping-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shopping-item .muted { font-variant-numeric: tabular-nums; white-space: nowrap; }
.shopping-page { padding: 8px 0 32px; }
.empty-state { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.add-manual { margin-top: 32px; }
#add-item-form { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { #add-item-form { grid-template-columns: 2fr 1fr 1fr 1.4fr auto; align-items: end; } }
#add-item-form input, #add-item-form select {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--bg);
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.shopping-group { margin-bottom: 24px; }
.shopping-group h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.shopping-item.done { opacity: .45; text-decoration: line-through; }
.shopping-item input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }

.prose { max-width: 46rem; }
.prose p { margin-bottom: 12px; }
.prose h2 { margin: 24px 0 10px; }
.prose ul, .prose ol { margin: 0 0 12px 1.2rem; }
.calc-cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 24px 0; text-align: center; }

table, .data-table, .prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
caption { text-align: left; font-weight: 700; color: var(--primary); margin-bottom: 8px; caption-side: top; }
th { background: var(--primary); color: #fff; padding: 10px 12px; text-align: left; font-weight: 600; }
td { border-bottom: 1px solid var(--line); padding: 10px 12px; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: rgba(251, 246, 240, .7); }
td:last-child, th:last-child { font-variant-numeric: tabular-nums; text-align: right; }

.converter-widget {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 24px 0;
  align-items: end;
}
@media (min-width: 720px) {
  .converter-widget { grid-template-columns: 1fr 1fr 1fr; }
}
.converter-result {
  grid-column: 1 / -1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0;
}
.weight-widget { display: flex; flex-direction: column; gap: 12px; max-width: 360px; margin: 24px 0; }

.scenario-form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; margin-bottom: 24px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
fieldset legend { padding: 0 6px; font-size: .85rem; font-weight: 600; color: var(--primary); }

.ing-rows { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: grid; grid-template-columns: 1fr 90px 90px auto; gap: 8px; align-items: center; }
.ing-row input, .ing-row select {
  width: 100%;
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  background: var(--bg);
}
@media (max-width: 639px) {
  .hero-search { flex-direction: column; }
  .ing-row { grid-template-columns: 1fr 1fr; }
  .logo-sub { display: none; }
}

.search-result { padding: 12px 0; border-bottom: 1px solid var(--line); }
.search-form { display: flex; gap: 8px; margin-bottom: 20px; max-width: 560px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); }

.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, .85);
  padding: 32px 0 16px;
  margin-top: 48px;
}
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: #fff; }
.site-footer .muted { color: rgba(255, 255, 255, .7); }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-weight: 700; color: #fff; margin-bottom: 8px; }
.copy { margin-top: 24px; font-size: .8rem; opacity: .75; }
.ad-slot { display: none; }

#fe-toast {
  position: fixed;
  bottom: 72px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 999;
  font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
