/* ============================================================
   Огнеман — Design System
   Палитра: янтарь + терракота + кремовый
   Версия: 6.0 (единый контейнер шапки/контента/подвала)
   ============================================================ */

/* ---------- 1. Переменные ---------- */
:root {
  --brand-50:  #fff7ed;
  --brand-100: #ffedd5;
  --brand-200: #fed7aa;
  --brand-300: #fdba74;
  --brand-400: #fb923c;
  --brand-500: #f97316;
  --brand-600: #ea580c;
  --brand-700: #c2410c;
  --brand-800: #9a3412;

  --cream:    #fefaf5;
  --cream-2:  #faf3e8;
  --cream-3:  #f3e9d8;
  --white:    #ffffff;
  --ink:      #1f1a17;
  --ink-2:    #4a3f37;
  --ink-3:    #8a7a6e;
  --ink-4:    #b8a99b;
  --line:     #f0e6d6;
  --line-2:   #e0d2bd;

  --green-500: #16a34a;
  --green-100: #dcfce7;
  --green-700: #15803d;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --amber-700: #b45309;
  --red-500:   #dc2626;
  --red-100:   #fee2e2;
  --red-700:   #b91c1c;
  --blue-500:  #2563eb;
  --blue-100:  #dbeafe;
  --blue-700:  #1d4ed8;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --shadow-1: 0 1px 2px rgba(58,42,32,.05), 0 1px 3px rgba(58,42,32,.06);
  --shadow-2: 0 4px 12px rgba(58,42,32,.08), 0 2px 6px rgba(58,42,32,.04);
  --shadow-3: 0 10px 30px rgba(58,42,32,.10), 0 4px 12px rgba(58,42,32,.06);
  --shadow-4: 0 20px 50px rgba(58,42,32,.15);
  --shadow-focus: 0 0 0 4px rgba(249,115,22,.18);

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1280px;
  --container-pad: 24px;
  --nav-h: 68px;
}

[data-theme="dark"] {
  --cream:    #161310;
  --cream-2:  #1e1a16;
  --cream-3:  #2a251f;
  --white:    #221d18;
  --ink:      #f4ede3;
  --ink-2:    #d6ccbd;
  --ink-3:    #9a8d7d;
  --ink-4:    #6c6358;
  --line:     #2f2820;
  --line-2:   #3e352b;

  --brand-50:  #2a1a10;
  --brand-100: #3d2213;
  --brand-200: #5a301a;
  --brand-300: #7a3c1c;
  --brand-400: #b45309;
  --brand-700: #fdba74;
  --brand-800: #fed7aa;

  --green-100: #143020;
  --green-700: #86efac;
  --amber-100: #3a2a0d;
  --amber-700: #fcd34d;
  --red-100:   #3a1515;
  --red-700:   #fca5a5;
  --blue-100:  #172038;
  --blue-700:  #93c5fd;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
  --shadow-2: 0 4px 12px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.25);
  --shadow-3: 0 10px 30px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
  --shadow-4: 0 20px 50px rgba(0,0,0,.6);
  --shadow-focus: 0 0 0 4px rgba(251,146,60,.28);
}

@media (max-width: 1023px) {
  :root { --container-pad: 16px; }
}

@media (max-width: 640px) {
  :root { --container-pad: 12px; }
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
}
img, svg, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--brand-700); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-600); text-decoration: underline; }
kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--cream-2);
  font-family: var(--font-mono);
  font-size: .85em;
  color: var(--ink-2);
}

/* ---------- 3. Типографика ---------- */
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}
h1 { font-size: clamp(26px, 4vw, 38px); }
h2 { font-size: clamp(20px, 2.6vw, 26px); }
h3 { font-size: clamp(17px, 2vw, 20px); }
h4 { font-size: 16px; font-weight: 700; }
p  { margin: 0 0 1em; }
small { font-size: 13px; color: var(--ink-3); }
.muted { color: var(--ink-3); font-size: 13px; }
.lead { font-size: clamp(15px, 2vw, 18px); color: var(--ink-2); line-height: 1.55; }

/* ---------- 4. Layout: main + admin-main ---------- */
main {
  flex: 1 0 auto;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s6) var(--container-pad);
  width: 100%;
}

.admin-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s6) var(--container-pad) 48px;
  width: 100%;
}

@media (min-width: 1024px) {
  main,
  .admin-main {
    padding-top: var(--s8);
    padding-bottom: var(--s8);
  }
  .admin-main { padding-bottom: 48px; }
}

/* ---------- 5. HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(254,250,245,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .2s, border-color .2s;
}
[data-theme="dark"] .site-header { background: rgba(22,19,16,.85); }

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 var(--container-pad);
  height: var(--nav-h);
}

/* Бренд */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
  text-decoration: none;
  flex-shrink: 0;
  padding: 6px 4px;
  border-radius: var(--r-sm);
}
.brand:hover { text-decoration: none; color: var(--ink); background: var(--brand-50); }
.brand svg { flex-shrink: 0; width: 26px; height: 26px; }
.brand__name {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1;
}
.brand__dot { color: var(--brand-500); font-weight: 900; }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-end;
  padding: 0 var(--s2);
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: var(--r-full);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.site-nav a:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  text-decoration: none;
}
.site-nav a.is-active {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* Действия в шапке */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
}

.theme-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 9px 11px;
  border-radius: var(--r-full);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1;
  transition: background .15s;
}
.theme-toggle:hover { background: var(--brand-50); color: var(--brand-700); }

.btn-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-full);
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  text-decoration: none;
  transition: background .15s, transform .15s;
  min-height: 38px;
}
.btn-search:hover {
  background: var(--brand-600);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Гамбургер */
.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 8px 10px;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  transition: background .15s, border-color .15s;
}
.nav-toggle:hover { background: var(--brand-50); border-color: var(--brand-200); }
.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink-2);
  border-radius: 2px;
  transition: transform .2s, opacity .15s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.inline { display: inline-flex; align-items: center; gap: 2px; }
.inline .link {
  background: none; border: 0; padding: 8px 12px; border-radius: var(--r-full);
  color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.inline .link:hover { background: var(--red-100); color: var(--red-700); }

/* Мобильная шапка */
@media (max-width: 960px) {
  .site-header__inner { gap: var(--s2); }
  .nav-toggle { display: flex; order: 3; margin-left: auto; }
  .site-header__actions { order: 4; margin-left: 0; }
  .btn-search { display: none; }
  .site-nav {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--s2) var(--container-pad) var(--s4);
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s ease, padding .2s;
    z-index: 49;
  }
  .site-nav.is-open {
    max-height: min(70vh, 500px);
    overflow-y: auto;
  }
  .site-nav a {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: var(--r);
    justify-content: flex-start;
  }
  .site-nav a.is-active { background: var(--brand-50); }
}

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px 18px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-2);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px;
  text-align: center;
  min-height: 44px;
  transition: all .15s;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-primary {
  background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-600) 100%);
  border-color: var(--brand-600);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(234,88,12,.28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-700) 100%);
  border-color: var(--brand-700);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(234,88,12,.32);
  transform: translateY(-1px);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-700); }
.btn-ghost:hover { background: var(--brand-50); border-color: var(--brand-200); }
.btn-lg { padding: 14px 26px; font-size: 16px; min-height: 52px; border-radius: var(--r-lg); }
.btn-block { display: flex; width: 100%; }
.btn-danger { background: var(--red-100); border-color: var(--red-500); color: var(--red-700); }
.btn-danger:hover { background: var(--red-500); color: #fff; }

[data-favorite].btn-primary {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: var(--white);
}

.btn-copy { position: relative; }
.btn-copy.copied::after {
  content: 'Скопировано';
  position: absolute;
  top: -34px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- 7. Flash ---------- */
.flash {
  max-width: calc(var(--container) - 2 * var(--container-pad));
  margin: var(--s4) auto 0;
  padding: 14px 18px;
  border-radius: var(--r);
  font-size: 14px; font-weight: 500;
  border-left: 4px solid;
  animation: slideDown .25s ease;
  width: 100%;
}
.flash-error   { background: var(--red-100);   color: var(--red-700);   border-color: var(--red-500); }
.flash-success { background: var(--green-100); color: var(--green-700); border-color: var(--green-500); }
.flash-info    { background: var(--blue-100);  color: var(--blue-700);  border-color: var(--blue-500); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 8. Hero ---------- */
.hero {
  position: relative;
  padding: clamp(36px, 6vw, 72px) var(--s5);
  text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(251,146,60,.22) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 80% 100%, rgba(234,88,12,.10) 0%, transparent 70%);
  border-radius: var(--r-xl);
  margin-bottom: var(--s8);
  overflow: hidden;
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(251,146,60,.14) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 80% 100%, rgba(234,88,12,.06) 0%, transparent 70%);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f97316' fill-opacity='0.04'%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Ccircle cx='40' cy='30' r='2'/%3E%3Ccircle cx='25' cy='45' r='2'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: .8;
}
[data-theme="dark"] .hero::before { opacity: .3; }
.hero > * { position: relative; }
.hero h1 { margin: 0 auto var(--s3); max-width: 720px; }
.hero .lead { max-width: 560px; margin: 0 auto var(--s6); }
.hero-cta { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--white);
  border: 1px solid var(--line-2);
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: var(--s4);
  box-shadow: var(--shadow-1);
}
.hero-badge::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-500);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- 9. Features / Scenarios / How ---------- */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s4); margin-bottom: var(--s8);
}
.feature {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  display: flex; gap: var(--s3); align-items: flex-start;
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.feature-ico {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  display: grid; place-items: center;
  font-size: 22px;
}
.feature h3 { margin: 0 0 4px; font-size: 16px; }
.feature p { margin: 0; color: var(--ink-3); font-size: 14px; }

.scenarios { margin-bottom: var(--s8); }
.scenarios h2 { text-align: center; margin-bottom: var(--s5); }
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s3);
}
.scenario {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s2);
  padding: var(--s5) var(--s4);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  text-align: center;
  font-weight: 600; font-size: 14px;
  min-height: 120px;
  transition: all .2s;
  text-decoration: none;
}
.scenario:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.scenario-emoji { font-size: 32px; line-height: 1; }
.scenario small { color: var(--ink-3); font-weight: 500; font-size: 12px; }

.how {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--s8) var(--s6);
  margin-bottom: var(--s8);
  border: 1px solid var(--line);
}
.how h2 { text-align: center; margin-bottom: var(--s6); }
.steps-list {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s5);
  counter-reset: how;
  margin: 0;
}
.steps-list li {
  counter-increment: how;
  position: relative;
  padding-left: 56px;
  min-height: 56px;
  display: flex; flex-direction: column; justify-content: center;
}
.steps-list li::before {
  content: counter(how);
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: var(--white);
  font-weight: 800; font-size: 20px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-2);
}
.steps-list li strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.steps-list li span { color: var(--ink-3); font-size: 14px; }

/* ---------- 10. Card / Card-panel ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6);
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }

.card-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6);
  margin-bottom: var(--s4);
}
.card-panel ul, .card-panel ol { margin: 0; padding-left: var(--s5); }
.card-panel ul li, .card-panel ol li { padding: 4px 0; }
.card-panel h3:first-child { margin-top: 0; }

/* ---------- 11. Recipe cards (grid) ---------- */
.recipe-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s5);
  justify-content: center;
}
.recipe-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all .2s;
  box-shadow: var(--shadow-1);
}
.recipe-card:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-3);
  transform: translateY(-3px);
}
.recipe-card .thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  display: grid; place-items: center;
  font-size: 56px;
  color: var(--brand-700);
  text-transform: uppercase;
  font-weight: 800;
}
.recipe-card .thumb-image { padding: 0; height: auto; display: block; }
.recipe-card .thumb-image picture { display: block; }
.recipe-card .thumb-image img {
  width: 100%; height: 180px; object-fit: cover; display: block;
}
.recipe-card .body {
  padding: var(--s5) var(--s5) var(--s6);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.recipe-card h2 { font-size: 17px; margin: 0; line-height: 1.35; }
.recipe-card h2 a { color: var(--ink); }
.recipe-card h2 a:hover { color: var(--brand-700); text-decoration: none; }
.recipe-card .desc { color: var(--ink-3); font-size: 14px; margin: 0; line-height: 1.5; }

.recipe-card .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--s2);
  margin: 0;
  padding: var(--s3) 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.recipe-card .meta > div { display: flex; flex-direction: column; gap: 2px; }
.recipe-card .meta dt {
  color: var(--ink-3); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em;
}
.recipe-card .meta dd { margin: 0; font-weight: 700; color: var(--ink); font-size: 14px; }

/* ---------- 12. Badges ---------- */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  background: var(--cream-2);
  color: var(--ink-2);
  text-decoration: none;
}
a.badge { text-decoration: none; }
a.badge:hover { text-decoration: none; filter: brightness(.95); }
.badge-ok   { background: var(--green-100); color: var(--green-700); }
.badge-warn { background: var(--amber-100); color: var(--amber-700); }
.badge-info { background: var(--blue-100);  color: var(--blue-700); }
.badge-ok::before   { content: '✓'; font-weight: 900; }
.badge-warn::before { content: '!'; font-weight: 900; }

/* ---------- 13. Reasons ---------- */
.reasons {
  list-style: none; padding: 0; margin: 0 0 var(--s3);
  font-size: 14px;
  color: var(--ink-2);
}
.reasons li {
  padding: 6px 0 6px 22px;
  position: relative;
  line-height: 1.5;
}
.reasons li::before {
  content: '→';
  position: absolute; left: 0; top: 6px;
  color: var(--brand-500);
  font-weight: 900;
  font-size: 14px;
}
.reasons li a { color: var(--ink); font-weight: 600; }
.reasons li a:hover { color: var(--brand-700); }

/* ---------- 14. Empty ---------- */
.empty {
  background: var(--white);
  border: 2px dashed var(--line-2);
  border-radius: var(--r-xl);
  padding: var(--s10) var(--s6);
  text-align: center;
}
.empty::before {
  content: '🍽️';
  display: block;
  font-size: 56px;
  margin-bottom: var(--s3);
  opacity: .7;
}
.empty h2 { margin-bottom: var(--s3); }
.empty p { color: var(--ink-3); max-width: 420px; margin: 0 auto var(--s4); }
.empty ul { display: inline-block; text-align: left; margin: 0 0 var(--s5); padding-left: 20px; color: var(--ink-2); }
.empty-actions { margin-top: var(--s4); }

/* ---------- 15. Forms ---------- */
.form { display: grid; gap: var(--s4); }
label { display: block; font-weight: 600; font-size: 14px; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 6px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  min-height: 46px;
  transition: border-color .15s, box-shadow .15s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: var(--cream-2); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: var(--shadow-focus);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7a6e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
select[multiple] { background-image: none; padding: 6px; min-height: auto; }
select[multiple] option { padding: 6px 8px; border-radius: 4px; }
textarea { min-height: 96px; resize: vertical; }
textarea[rows="14"] { font-family: var(--font-mono); font-size: 13px; line-height: 1.45; }

fieldset {
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  background: var(--white);
  margin: 0;
}
legend {
  font-weight: 800; font-size: 15px;
  color: var(--ink);
  padding: 0 var(--s2);
  letter-spacing: -.01em;
}

.inline-checks {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  border: 0; padding: 0;
}
.inline-checks .check {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--white);
  cursor: pointer;
  font-weight: 500; font-size: 14px;
  transition: all .15s;
  min-height: 40px;
  user-select: none;
}
.inline-checks .check:hover { border-color: var(--brand-300); background: var(--brand-50); }
.inline-checks .check input {
  margin: 0; padding: 0; width: auto; min-height: auto;
  accent-color: var(--brand-500);
  transform: scale(1.15);
}
.inline-checks .check:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

label.check {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--white);
  cursor: pointer;
  font-weight: 500; font-size: 14px;
  min-height: 40px;
  margin: 4px 4px 4px 0;
  transition: all .15s;
}
label.check:hover { border-color: var(--brand-300); background: var(--brand-50); }
label.check input {
  margin: 0; padding: 0; width: auto; min-height: auto;
  accent-color: var(--brand-500);
  flex-shrink: 0;
}
label.check:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

/* ---------- 16. Picker ---------- */
.picker { display: grid; gap: var(--s5); max-width: 900px; margin: 0 auto; }
.picker > h1 { text-align: center; margin-bottom: 0; }

.picker-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s6);
  box-shadow: var(--shadow-1);
}
.picker-section-header { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.picker-section-number {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: var(--white);
  font-weight: 800; font-size: 16px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-2);
}
.picker-section-header h2 { margin: 0; font-size: 18px; }
.picker-section-header small {
  display: block; color: var(--ink-3);
  font-weight: 500; font-size: 13px; margin-top: 2px;
}
.picker-intro { text-align: center; margin-bottom: var(--s5); }
.picker-intro h1 { margin: 0 0 var(--s3); }
.picker-intro .lead { max-width: 560px; margin: 0 auto; }
.picker-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s3);
}
.picker-group { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.picker-group:last-of-type { margin-bottom: 0; }
.picker-group h4 {
  margin: 0; font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); font-weight: 800;
}
.picker-hint { margin-top: var(--s2); }
.picker-submit { margin-top: var(--s5); }

/* ---------- 17. Suggest ---------- */
.search-wrap { position: relative; }
.suggest {
  list-style: none; margin: 6px 0 0; padding: 6px;
  background: var(--white);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 320px; overflow-y: auto;
  z-index: 20;
  box-shadow: var(--shadow-3);
  min-width: 280px;
}
.suggest:empty { display: none; }
.suggest li {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: background .1s;
}
.suggest li:hover, .suggest li.active { background: var(--brand-50); color: var(--brand-700); }
.suggest li.suggest-loading,
.suggest li.suggest-empty { color: var(--ink-3); font-size: 13px; cursor: default; }
.suggest li.suggest-loading:hover,
.suggest li.suggest-empty:hover { background: none; color: var(--ink-3); }

/* ---------- 18. Recipe / Article ---------- */
.recipe {
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
}

.recipe > section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s6) var(--s5);
  margin-bottom: var(--s5);
  box-shadow: var(--shadow-1);
}
.recipe > section h2 {
  position: relative;
  padding-left: 16px;
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: var(--s4);
  font-size: 20px;
}
.recipe > section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  border-radius: 2px;
}
.recipe > section h3 {
  margin-top: var(--s5);
  margin-bottom: var(--s3);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
}
.recipe > section p:last-child,
.recipe > section ul:last-child,
.recipe > section ol:last-child { margin-bottom: 0; }

.recipe > header { margin-bottom: var(--s5); }
.recipe > header h1 { margin-bottom: var(--s3); }
.recipe .lead { font-size: 17px; color: var(--ink-2); margin-bottom: 0; }

.breadcrumbs {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: var(--s4);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.breadcrumbs a { color: var(--ink-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-700); text-decoration: underline; }
.breadcrumbs span { color: var(--ink-4); }

.recipe > dl.meta,
.recipe .meta {
  background: var(--cream-2);
  border-radius: var(--r);
  padding: var(--s4);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s3) var(--s4);
  margin: var(--s4) 0 var(--s5);
  font-size: 13px;
}
.recipe > dl.meta div { display: flex; flex-direction: column; gap: 2px; }
.recipe > dl.meta dt {
  color: var(--ink-3); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em;
}
.recipe > dl.meta dd { margin: 0; font-weight: 700; color: var(--ink); font-size: 14px; }

.recipe-actions {
  display: flex; gap: var(--s3); flex-wrap: wrap;
  margin: var(--s4) 0 var(--s5);
}

.recipe-hero {
  margin: 0 0 var(--s5);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--cream-2);
  box-shadow: var(--shadow-2);
}
.recipe-hero img {
  width: 100%; height: auto;
  max-height: 460px;
  object-fit: cover;
  display: block;
}

.servings-form {
  display: flex; gap: var(--s3); align-items: end;
  padding: var(--s4);
  background: var(--cream-2);
  border-radius: var(--r);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}
.servings-form label { flex: 1; min-width: 100px; }
.servings-form input { max-width: 120px; }

.ingredients {
  list-style: none; padding: 0; margin: 0;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ingredients li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--s3);
  padding: 14px var(--s5);
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 15px;
}
.ingredients li:last-child { border-bottom: 0; }
.ingredients li.have { background: linear-gradient(90deg, var(--green-100) 0%, transparent 100%); }
.ingredients .name { font-weight: 500; color: var(--ink); }
.ingredients .name em { font-style: normal; color: var(--ink-3); font-size: 13px; margin-left: 4px; }
.ingredients .name a { color: var(--ink); }
.ingredients .name a:hover { color: var(--brand-700); }
.ingredients .qty { color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.ingredients .mark {
  color: var(--green-700);
  font-size: 12px;
  font-weight: 700;
  background: var(--green-100);
  padding: 3px 10px;
  border-radius: var(--r-full);
  text-decoration: none;
  white-space: nowrap;
}
.ingredients .mark:hover { background: var(--green-500); color: var(--white); text-decoration: none; }

.steps {
  counter-reset: step;
  padding: 0; margin: 0;
  list-style: none;
  display: grid; gap: var(--s3);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: var(--s4) var(--s5) var(--s4) 68px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r);
  line-height: 1.6;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: var(--s4); top: var(--s4);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: var(--white);
  font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-2);
}
.steps li strong { display: block; margin-bottom: 2px; }
.steps li small { color: var(--ink-3); font-size: 13px; }

.equip { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin: 0; }
.equip li {
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: 13px; font-weight: 600;
}
.timer-hint {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--amber-100);
  color: var(--amber-700);
  font-size: 12px; font-weight: 600;
}
.timer-hint::before { content: '⏱️'; }

.rate {
  background: var(--cream-2);
  padding: var(--s5);
  border-radius: var(--r-lg);
  text-align: center;
}
.rate h2 { border: 0; margin-bottom: var(--s3); }
.rating { display: inline-flex; gap: 4px; font-size: 0; }
.rating button {
  background: none; border: 0; padding: 6px;
  font-size: 34px;
  color: var(--ink-4);
  cursor: pointer;
  transition: color .15s, transform .15s;
  line-height: 1;
}
.rating button:hover { transform: scale(1.15); }
.rating button.on, .rating button:hover { color: var(--amber-500); }

.comments { margin-top: var(--s5); }
.comment-list { list-style: none; padding: 0; display: grid; gap: var(--s3); }
.comment {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
}
.comment p { margin: 0 0 var(--s2); }
.comment time { font-size: 12px; color: var(--ink-3); }

/* ---------- 19. Test / Checklist / Path ---------- */
.test-options { display: grid; gap: var(--s2); margin: var(--s4) 0; }
.test-options label.check {
  display: flex;
  width: 100%;
  margin: 0;
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 15px;
  min-height: 48px;
  align-items: flex-start;
  line-height: 1.45;
}
.test-options label.check input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--brand-500);
  transform: scale(1.2);
}
.test-options label.check:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 600;
}

#checklist-progress { color: var(--brand-700); font-weight: 700; }
.checklist-item { transform: scale(1.15); margin-right: 8px; flex-shrink: 0; }
.path-step { transform: scale(1.15); margin-right: 8px; flex-shrink: 0; }
[data-path] .steps li { padding: 14px 16px 14px 54px; }
#path-progress { font-size: 14px; color: var(--ink-3); margin-bottom: var(--s3); }

/* ---------- 20. Cook modal ---------- */
.cook-modal {
  position: fixed; inset: 0;
  background: rgba(31,26,23,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
  z-index: 100;
}
.cook-body {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--s6);
  max-width: 520px; width: 100%;
  position: relative;
  box-shadow: var(--shadow-4);
}
.cook-step { font-size: 18px; line-height: 1.5; margin-bottom: var(--s4); min-height: 100px; color: var(--ink); }
.cook-timer {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-600);
  text-align: center;
  padding: var(--s3);
  background: var(--brand-50);
  border-radius: var(--r);
  margin-bottom: var(--s4);
  min-height: 56px;
  font-variant-numeric: tabular-nums;
}
.cook-timer:empty { display: none; }
.cook-nav { display: flex; gap: var(--s2); }
.cook-nav button {
  flex: 1;
  padding: 12px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-2);
  background: var(--white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 46px;
  transition: all .15s;
}
.cook-nav button:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.cook-nav button[data-act="done"] { background: var(--green-100); border-color: var(--green-500); color: var(--green-700); }
.cook-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: 0;
  font-size: 24px; cursor: pointer;
  color: var(--ink-3);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  padding: 0;
}
.cook-close:hover { background: var(--cream-2); color: var(--ink); }

/* ---------- 21. Details / Summary ---------- */
details { margin: 8px 0; }
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-700);
  padding: 6px 0;
  list-style: none;
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform .15s;
  color: var(--brand-500);
}
details[open] summary::before { content: '▾ '; }
details[open] summary { margin-bottom: 8px; }

/* ---------- 22. Auth ---------- */
.auth {
  max-width: 440px;
  margin: var(--s8) auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s8) var(--s6);
  box-shadow: var(--shadow-2);
}
.auth h1 { text-align: center; margin-bottom: var(--s6); }
.auth .form { gap: var(--s4); }

/* ---------- 23. Timeline / Notif ---------- */
.timeline { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.timeline li {
  display: flex; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 14px;
}
.timeline time { color: var(--ink-3); min-width: 140px; font-size: 12px; font-variant-numeric: tabular-nums; }

.notif-list { list-style: none; padding: 0; display: grid; gap: var(--s3); }
.notif {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
}
.notif.unread { border-left-color: var(--brand-500); background: var(--brand-50); }
.notif h3 { margin: 0 0 var(--s2); font-size: 16px; }
.notif p { margin: 0 0 var(--s2); font-size: 14px; }
.notif time { font-size: 12px; color: var(--ink-3); }

/* ---------- 24. Menu planner ---------- */
.menu-days { list-style: none; padding: 0; counter-reset: day; display: grid; gap: var(--s3); }
.menu-days li {
  counter-increment: day;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.menu-days li:last-child { border-bottom: 0; }
.menu-days li::before {
  content: 'День ' counter(day);
  display: inline-block;
  background: var(--brand-100);
  color: var(--brand-700);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 700;
  margin-right: var(--s2);
}
.day-card {
  display: flex; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.day-card::before {
  counter-increment: day;
  content: counter(day);
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: var(--white);
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
}
.day-card-body { flex: 1; min-width: 0; }
.day-card h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.3; }
.day-card-meta { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.leftovers { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.leftovers li { padding: 4px 12px; background: var(--cream-2); border-radius: var(--r-full); font-size: 13px; }

/* ---------- 25. Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--cream-2) 25%, var(--line) 37%, var(--cream-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r);
  padding: var(--s6);
  color: var(--ink-3);
  text-align: center;
  font-weight: 500;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 26. Page header / Grid / Utilities ---------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s4);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}
.page-header > div:first-child { flex: 1; min-width: 0; }
.page-header h1 { margin: 0 0 4px; }
.page-header-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.row-grid {
  display: grid;
  grid-template-columns: 2fr 3fr 1fr 1fr auto auto;
  gap: var(--s2);
  align-items: center;
  margin-bottom: var(--s2);
}
.row-grid textarea, .row-grid input, .row-grid select {
  min-height: 40px; padding: 8px 10px; font-size: 13px;
}

.image-block {
  background: var(--cream-2);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: var(--s4);
  margin: var(--s4) 0;
}
.image-preview { display: flex; gap: var(--s4); align-items: flex-start; margin-bottom: var(--s3); flex-wrap: wrap; }
.image-preview picture img { border-radius: var(--r); border: 1px solid var(--line); max-width: 220px; }

.code {
  background: var(--cream-2);
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  color: var(--ink);
}

.quick-actions { list-style: none; padding: 0; display: flex; gap: var(--s2); flex-wrap: wrap; }
.quick-actions a { text-decoration: none; }

/* ---------- 27. To-top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-3);
  z-index: 30;
  transition: background .15s, transform .15s;
}
.to-top.visible { display: flex; }
.to-top:hover { background: var(--brand-600); transform: translateY(-2px); }

/* ---------- 28. Admin table ---------- */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table th {
  background: var(--cream-2);
  font-weight: 700;
  color: var(--ink-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--cream); }
.admin-table td strong { color: var(--ink); }

/* ---------- 29. Statuses ---------- */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  background: var(--cream-3);
  color: var(--ink-2);
}
.status-published     { background: var(--green-100); color: var(--green-700); }
.status-draft         { background: var(--amber-100); color: var(--amber-700); }
.status-generated     { background: var(--blue-100);  color: var(--blue-700); }
.status-needs_review  { background: var(--amber-100); color: var(--amber-700); }
.status-approved      { background: var(--green-100); color: var(--green-700); }
.status-rejected      { background: var(--red-100);   color: var(--red-700); }
.status-archived      { background: var(--cream-3);   color: var(--ink-3); }
.status-create, .status-update, .status-login, .status-logout, .status-backup { background: var(--blue-100); color: var(--blue-700); }
.status-delete, .status-bulk_delete { background: var(--red-100); color: var(--red-700); }
.status-bulk_publish  { background: var(--green-100); color: var(--green-700); }
.status-bulk_unpublish{ background: var(--amber-100); color: var(--amber-700); }

/* ---------- 30. Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s3);
  margin: 0 0 var(--s6);
}
.stats > div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  text-align: center;
}
.stats dt {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.stats dd { margin: 6px 0 0; font-size: 28px; font-weight: 800; color: var(--brand-700); }

/* ---------- 31. Tabs / Filters / Bulk ---------- */
.tabs { display: flex; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.tab {
  padding: 8px 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  text-decoration: none;
}
.tab:hover { text-decoration: none; background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.tab.active { background: var(--brand-500); border-color: var(--brand-500); color: var(--white); }

.filters {
  display: flex;
  gap: var(--s2);
  margin-bottom: var(--s4);
  flex-wrap: wrap;
  align-items: center;
}
.filters input,
.filters select { max-width: 280px; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.filters input[type="search"] { flex: 1; min-width: 200px; max-width: none; }

.bulk-bar {
  display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap;
  padding: var(--s3) var(--s4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: var(--s4);
  box-shadow: var(--shadow-1);
}
.bulk-bar span { font-weight: 700; color: var(--ink-2); }
.bulk-bar .btn { padding: 8px 14px; min-height: 38px; font-size: 13px; }

/* ---------- 32. Funnel / Bar ---------- */
.funnel, .bar-list { list-style: none; padding: 0; }
.funnel li, .bar-list li {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 3fr 60px;
  gap: var(--s3);
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}
.bar { background: var(--cream-2); height: 20px; border-radius: var(--r-full); overflow: hidden; }
.bar > div {
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  height: 100%;
  border-radius: var(--r-full);
  transition: width .4s ease;
}
.bar-list span, .funnel span { color: var(--ink-2); font-weight: 500; }
.bar-list b, .funnel b { text-align: right; font-weight: 700; color: var(--ink); }

/* ---------- 33. Admin form ---------- */
.admin-form {
  display: grid;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s6);
  max-width: 900px;
}
.form-row { display: grid; gap: 6px; }
.form-row label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.form-row-wide { grid-column: 1 / -1; }
.form-row small { font-size: 12px; color: var(--ink-3); }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- 34. Pantry (legacy) ---------- */
.my-pantry .pantry-actions { display: flex; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.pantry-page { display: grid; gap: var(--s3); }
.pantry-group {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
}
.pantry-group-priority {
  border-color: var(--amber-500);
  background: linear-gradient(135deg, var(--amber-100) 0%, var(--white) 100%);
  box-shadow: 0 2px 8px rgba(245,158,11,.1);
}
.pantry-group-header {
  display: flex; align-items: center; gap: var(--s2);
  margin-bottom: var(--s3);
  font-weight: 700; color: var(--ink-2); font-size: 14px;
}
.pantry-group-header .count {
  background: var(--cream-2); color: var(--ink-3);
  padding: 2px 10px; border-radius: var(--r-full); font-size: 12px;
}
.pantry-items { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pantry-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.pantry {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  min-height: 52px;
  padding: var(--s3);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--cream-2);
  margin-top: var(--s3);
}
.pantry:empty::before { content: 'Пока пусто'; color: var(--ink-4); font-size: 13px; padding: 8px; }
.pantry-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 14px;
  border-radius: var(--r-full);
  background: var(--white);
  border: 1.5px solid var(--brand-200);
  font-size: 14px; font-weight: 600;
  color: var(--brand-800);
}
.pantry-item.priority { background: linear-gradient(135deg, var(--amber-100), #fde68a); border-color: var(--amber-500); }
.pantry-item button {
  background: none; border: 0; cursor: pointer;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--brand-700);
  font-size: 15px;
  padding: 0;
}
.pantry-item button:hover { background: var(--brand-100); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--white);
  color: var(--ink-2);
  font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer;
  min-height: 38px;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-700); }
.chip:active { transform: scale(.97); }
.quick { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }

/* ---------- 35. FOOTER ---------- */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--line);
  margin-top: var(--s10);
  color: var(--ink-3);
  font-size: 14px;
  flex-shrink: 0;
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s8) var(--container-pad) var(--s6);
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--s8) var(--s6);
}
.footer-brand .brand {
  margin-bottom: var(--s3);
  padding-left: 0;
}
.footer-brand p {
  margin: 0;
  max-width: 340px;
  line-height: 1.6;
  font-size: 13px;
  color: var(--ink-3);
}
.footer-brand .footer-tagline {
  color: var(--brand-700);
  font-weight: 700;
  font-size: 13px;
  margin-top: var(--s3);
}

.footer-col h4 {
  margin: 0 0 var(--s3);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer-col ul a {
  display: inline-block;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s;
  padding: 2px 0;
}
.footer-col ul a:hover {
  color: var(--brand-700);
  text-decoration: none;
}

.site-footer__bottom {
  border-top: 1px solid var(--line);
  padding: var(--s4) var(--container-pad);
  background: var(--cream);
}
[data-theme="dark"] .site-footer__bottom { background: var(--cream-2); }
.site-footer__bottom-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  font-size: 12px;
  color: var(--ink-3);
}
.site-footer__bottom-inner p { margin: 0; }
.site-footer__bottom-inner a { color: var(--ink-2); }
.site-footer__bottom-inner a:hover { color: var(--brand-700); }
.site-footer__legal {
  max-width: 520px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--s6) var(--s5);
    padding: var(--s6) var(--container-pad) var(--s4);
  }
  .footer-brand { grid-column: 1 / -1; text-align: center; }
  .footer-brand p { margin-inline: auto; }
  .footer-brand .brand { justify-content: center; }
}

@media (max-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-col h4 { margin-top: var(--s3); }
  .site-footer__bottom-inner { flex-direction: column; text-align: center; }
}

/* ---------- 36. Mobile bar ---------- */
.mobile-bar { display: none; }

/* ---------- 37. Global helpers ---------- */
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
code {
  font-family: var(--font-mono);
  font-size: .9em;
  padding: 2px 6px;
  background: var(--cream-2);
  border-radius: 4px;
  color: var(--ink-2);
}
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  :root { --container: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .row-grid { grid-template-columns: 1fr; }
  .recipe { max-width: 100%; }
}

@media (max-width: 640px) {
  :root { --nav-h: 60px; }
  body { font-size: 15px; }
  main { padding-top: var(--s4); padding-bottom: var(--s4); }

  .hero { padding: var(--s6) var(--s4); border-radius: var(--r-lg); margin-bottom: var(--s5); }
  .hero h1 { font-size: 25px; }
  .hero .lead { font-size: 15px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }

  .features { grid-template-columns: 1fr; gap: var(--s3); }
  .feature { padding: var(--s4); }

  .scenario-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
  .scenario { min-height: 100px; padding: var(--s3); font-size: 13px; }
  .scenario-emoji { font-size: 28px; }

  .how { padding: var(--s5) var(--s4); }
  .steps-list { grid-template-columns: 1fr; gap: var(--s4); }

  .recipe-grid { grid-template-columns: 1fr; gap: var(--s3); }
  .recipe-card .thumb-image img { height: 160px; }

  .recipe > section { padding: var(--s4) var(--s4) var(--s3); border-radius: var(--r); }
  .recipe > section h2 { font-size: 17px; }
  .recipe > dl.meta { grid-template-columns: repeat(2, 1fr); padding: var(--s3); }

  .btn { min-height: 48px; padding: 12px 18px; }
  .btn-lg { min-height: 54px; padding: 14px 22px; font-size: 16px; }

  .picker { gap: var(--s4); }
  .picker-section { padding: var(--s4); border-radius: var(--r-lg); }
  .picker-fields { grid-template-columns: 1fr; }
  .chip { padding: 10px 14px; min-height: 42px; font-size: 13px; }

  .ingredients li {
    grid-template-columns: 1fr auto;
    gap: var(--s2);
    padding: 12px var(--s4);
    font-size: 14px;
  }
  .ingredients .mark { grid-column: 1 / -1; justify-self: start; font-size: 11px; }

  .steps li { padding: var(--s3) var(--s4) var(--s3) 54px; font-size: 14px; }
  .steps li::before { width: 30px; height: 30px; font-size: 13px; left: var(--s3); top: var(--s3); }

  .servings-form { flex-direction: column; align-items: stretch; }
  .servings-form input { max-width: 100%; }

  .recipe-actions { flex-direction: column; }
  .recipe-actions .btn { width: 100%; }

  .rating button { font-size: 30px; padding: 8px; }
  .cook-body { padding: var(--s5) var(--s4); }
  .cook-step { font-size: 16px; min-height: 80px; }
  .cook-timer { font-size: 26px; }

  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select { max-width: 100%; }
  .tab { padding: 8px 14px; font-size: 13px; }

  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin-bottom: var(--s3);
    padding: var(--s3);
  }
  .admin-table td {
    padding: 6px 0;
    border: 0;
    display: flex;
    justify-content: space-between;
    gap: var(--s2);
    font-size: 13px;
    align-items: flex-start;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .03em;
    flex-shrink: 0;
    min-width: 90px;
  }
  .admin-table td:first-child { justify-content: flex-start; }
  .admin-table td:first-child::before { display: none; }

  .funnel li, .bar-list li { grid-template-columns: 1fr auto; gap: var(--s2); font-size: 13px; }
  .funnel li .bar, .bar-list li .bar { grid-column: 1 / -1; order: 3; }

  .comment { padding: var(--s3); }
  .timeline li { flex-wrap: wrap; padding: var(--s2) var(--s3); font-size: 13px; }
  .timeline time { min-width: auto; width: 100%; font-size: 11px; }

  .auth { margin: var(--s5) auto; padding: var(--s6) var(--s4); border-radius: var(--r-lg); }

  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; }

  .pantry-item-name { max-width: 130px; }
  .day-card { flex-wrap: wrap; padding: var(--s3); }
  .day-card-body { width: calc(100% - 52px); }
  .day-card h3 { font-size: 14px; }

  .suggest { min-width: 0; max-width: calc(100vw - 40px); }

  .has-bottom-bar main { padding-bottom: 84px; }
  .has-bottom-bar .mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 10px var(--container-pad);
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    background: rgba(254,250,245,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    gap: var(--s2);
    z-index: 40;
    box-shadow: 0 -4px 20px rgba(58,42,32,.08);
  }
  [data-theme="dark"] .has-bottom-bar .mobile-bar { background: rgba(22,19,16,.96); }
  .mobile-bar .btn { flex: 1; min-height: 48px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 22px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats dd { font-size: 22px; }
  .brand__name { font-size: 16px; }
  .brand svg { width: 22px; height: 22px; }
}

@media (min-width: 1200px) {
  .recipe-grid { gap: var(--s6); }
  .hero { padding: var(--s12) var(--s8); }
}

/* ============================================================
   Тёмная тема — overrides
   ============================================================ */
[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost) {
  background: var(--cream-2);
  border-color: var(--line-2);
  color: var(--ink);
}
[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost):hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
}
[data-theme="dark"] .btn-danger { background: var(--red-100); color: var(--red-700); }
[data-theme="dark"] .btn-danger:hover { background: var(--red-500); color: #fff; }
[data-theme="dark"] .recipe-card .thumb { color: var(--brand-700); }
[data-theme="dark"] .feature-ico { color: var(--ink); }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--ink-4); }
[data-theme="dark"] .empty { background: var(--white); border-color: var(--line-2); }
[data-theme="dark"] .code { background: var(--cream-3); }
[data-theme="dark"] code  { background: var(--cream-3); }
[data-theme="dark"] kbd   { background: var(--cream-3); border-color: var(--line-2); }
[data-theme="dark"] .suggest { background: var(--white); border-color: var(--line-2); }
[data-theme="dark"] .suggest li:hover { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .admin-table th { background: var(--cream-3); color: var(--ink-2); }
[data-theme="dark"] .admin-table tr:hover td { background: var(--cream-2); }
[data-theme="dark"] .cook-nav button { background: var(--cream-2); border-color: var(--line-2); color: var(--ink); }
[data-theme="dark"] .cook-nav button:hover { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .pantry-item { background: var(--white); border-color: var(--brand-200); color: var(--brand-800); }
[data-theme="dark"] .pantry-item.priority { background: var(--amber-100); border-color: var(--amber-500); }
[data-theme="dark"] .day-card { background: var(--cream-2); border-color: var(--line); }
[data-theme="dark"] .leftovers li { background: var(--cream-2); }
[data-theme="dark"] .recipe > dl.meta { background: var(--cream-2); }
[data-theme="dark"] .steps li { background: var(--cream-2); }
[data-theme="dark"] .ingredients { background: var(--cream-2); }
[data-theme="dark"] .comment { background: var(--cream-2); }
[data-theme="dark"] .pantry-group-priority { background: linear-gradient(135deg, var(--amber-100), var(--white)); }
[data-theme="dark"] .site-footer__bottom-inner { color: var(--ink-3); }

/* ============================================================
   Print
   ============================================================ */
@media print {
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .site-header, .site-footer, .mobile-bar, .flash, .no-print,
  .page-header-actions, .filters, .bulk-bar, .recipe-actions, .tabs,
  .to-top, .theme-toggle, .btn, .breadcrumbs { display: none !important; }
  main { padding: 0 !important; max-width: 100% !important; }
  .recipe { max-width: 100% !important; }
  .recipe > section { border: 1px solid #ccc !important; box-shadow: none !important; background: #fff !important; page-break-inside: avoid; }
  .card-panel, .recipe-card, .feature, .scenario {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
    page-break-inside: avoid;
  }
  a { color: #000 !important; text-decoration: none !important; }
  h1, h2, h3, h4 { color: #000 !important; page-break-after: avoid; }
  .badge { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  .hero::before { display: none; }
  .hero { background: none !important; padding: 0 !important; margin-bottom: 12px !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast */
@media (prefers-contrast: more) {
  :root { --ink: #000; --ink-3: #333; --line: #999; --line-2: #666; }
  [data-theme="dark"] { --ink: #fff; --ink-3: #ccc; --line: #555; --line-2: #888; }
}