/* === Токены: тёплая палитра «кулинарной книги» === */
:root {
  --bg: #FAF5EE;
  --bg-soft: #F4ECE0;
  --card: #FFFFFF;
  --card-cream: #FBF6EE;
  --ink: #2A1F1A;
  --ink-soft: #6B5C50;
  --ink-mute: #9A8B7E;
  --line: #EDE4D5;
  --line-soft: #F2EADB;
  --accent: #C76E3A;
  --accent-deep: #A85727;
  --accent-soft: #E8A87C;
  --accent-bg: #FBEFE6;
  --green: #4A6B3E;
  --green-deep: #2F4A26;
  --green-soft: #7FA26C;
  --green-bg: #E8F0DE;
  --green-cream: #F2F6EA;
  --red: #B0533C;
  --red-bg: #F7E9E3;
  --gold: #C9A14B;
  --shadow-sm: 0 2px 8px rgba(120, 80, 40, 0.06);
  --shadow: 0 6px 20px rgba(120, 80, 40, 0.08);
  --shadow-lg: 0 14px 40px rgba(120, 80, 40, 0.12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --nav-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --serif: ui-rounded, "SF Pro Rounded", "Nunito", "Avenir Next Rounded", "Quicksand", Georgia, "PT Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Nunito", "Avenir Next Rounded", "Quicksand", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; overscroll-behavior-y: none; overscroll-behavior: none; }
body {
  font-family: var(--sans);
  background-color: var(--bg);
  background-image:
    url("/img/food-tomato.svg"),
    url("/img/food-lemon.svg"),
    url("/img/food-carrot.svg"),
    url("/img/food-broccoli.svg"),
    url("/img/food-mushroom.svg"),
    url("/img/food-leaf.svg");
  background-position:
    92% 8%,
    6% 22%,
    88% 64%,
    10% 78%,
    80% 92%,
    4% 46%;
  background-repeat: no-repeat;
  background-size: 70px, 60px, 70px, 80px, 65px, 70px;
  background-attachment: fixed;
  background-blend-mode: multiply;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh; overscroll-behavior: none;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
}
/* Лёгкая пастельная вуаль поверх, чтобы фон не отвлекал */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: rgba(250, 245, 238, 0.78);
  pointer-events: none;
  z-index: 0;
}
.section, .topbar, .bottom-nav, .toast { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: rgba(250, 245, 238, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar h1 {
  font-family: var(--serif); letter-spacing: 0.01em;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0;
  margin: 0;
  color: var(--green-deep);
}
.topbar .back { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.topbar .icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow-sm); font-size: 18px;
}

.section { display: none; padding: 16px 20px 24px; }
.section.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h2.title { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: 0; margin: 4px 0 6px; color: var(--green-deep); }
.subtitle { color: var(--ink-soft); margin: 0 0 18px; font-size: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 22px;
  border-radius: 999px; font-weight: 600; font-size: 16px;
  background: var(--ink); color: #FFF7EB;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  width: 100%; box-shadow: var(--shadow);
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--green); color: #FFF; }
.btn.primary:hover { background: var(--green-deep); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.soft { background: var(--accent-bg); color: var(--accent-deep); box-shadow: none; }
.btn.soft:hover { background: #F8E2D0; }
.btn.danger { background: var(--red-bg); color: var(--red); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 8px 16px; font-size: 14px; width: auto; }
.btn.icon-only { width: 44px; padding: 0; min-height: 44px; }

.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; }
.card.soft { background: var(--card-cream); box-shadow: var(--shadow-sm); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  background: var(--bg-soft); color: var(--ink-soft);
}
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.accent { background: var(--accent-bg); color: var(--accent-deep); }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 252, 246, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line-soft);
  padding: 8px 0 calc(8px + var(--safe-bottom));
}
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  color: var(--ink-mute); font-size: 11px; font-weight: 500;
}
.bottom-nav button .ic { font-size: 22px; line-height: 1; }
.bottom-nav button.active { color: var(--green); }
.bottom-nav button.active .ic { transform: scale(1.05); }

/* === Онбординг === */
.onboard-hero { text-align: center; padding: 24px 20px 8px; }
.onboard-hero .logo {
  font-family: var(--serif); letter-spacing: 0.01em;
  font-size: 46px; line-height: 1.05;
  letter-spacing: -0.02em; margin: 8px 0 12px;
}
.onboard-hero .logo em { font-style: italic; color: var(--accent); }
.onboard-hero p { color: var(--ink-soft); font-size: 17px; max-width: 320px; margin: 0 auto 24px; }
.onboard-hero .hero-img {
  width: 100%; max-width: 420px; margin: 12px auto 28px;
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.onboard-hero .hero-img img { width: 100%; height: auto; }

.onboard-step { padding: 8px 0; }
.onboard-step h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 4px 0 6px; color: var(--green-deep); }
.onboard-step .step-num {
  display: inline-block;
  font-size: 13px; color: var(--accent);
  background: var(--accent-bg); padding: 4px 10px;
  border-radius: 999px; margin-bottom: 12px;
}
.onboard-step p.lead { color: var(--ink-soft); margin: 0 0 18px; }

.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.choice {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center; font-weight: 500; font-size: 15px;
  transition: all .15s ease;
}
.choice .em { font-size: 26px; display: block; margin-bottom: 6px; }
.choice.selected { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-deep); }
.choice:active { transform: scale(0.98); }

.checkbox-grid { display: grid; gap: 10px; }
.checkbox-grid .choice { text-align: left; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checkbox-grid .check { color: var(--accent); font-weight: 700; }

.text-input {
  width: 100%;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; font-size: 16px; outline: none;
}
.text-input:focus { border-color: var(--accent); }

.onboard-actions { display: flex; gap: 10px; margin-top: 24px; }
.onboard-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.onboard-progress span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.onboard-progress span.on { background: var(--accent); width: 22px; border-radius: 999px; }

/* === Главный экран === */
.greet { padding: 24px 20px 8px; }
.greet h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: 0; margin: 0 0 4px; color: var(--green-deep); }
.greet p { color: var(--ink-soft); margin: 0; }

.cta-block {
  margin: 18px 20px 12px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(232,240,222,0.92) 0%, rgba(213,228,196,0.92) 100%),
    url("/img/food-leaf.svg") right -20px bottom -20px/120px no-repeat;
  border-radius: var(--radius-xl);
  position: relative; overflow: hidden;
  border: 1px solid rgba(127, 162, 108, 0.25);
}
.cta-block::before { content: ''; position: absolute; top: -40px; right: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.25); }
.cta-block::after { content: ''; position: absolute; bottom: -60px; right: 30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.cta-block h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 14px; position: relative; color: var(--green-deep); }
.cta-block .cta-buttons { display: grid; gap: 8px; position: relative; }
.cta-block .photo-btn {
  background: var(--green-deep); color: #FFFAF0;
  min-height: 56px; border-radius: 999px;
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow);
}
.cta-block .secondary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cta-block .secondary-actions .btn { flex: 1; min-width: 0; font-size: 14px; min-height: 46px; padding: 10px 12px; }

.modes { padding: 8px 20px 4px; }
.modes h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 14px 0 10px; color: var(--green-deep); }
.modes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px 10px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft);
  transition: transform .1s ease;
}
.mode-card:active { transform: scale(0.97); }
.mode-card .em { font-size: 28px; display: block; margin-bottom: 6px; }
.mode-card .lb { font-size: 13px; font-weight: 500; }

.fridge-teaser { padding: 18px 20px 4px; }
.fridge-teaser h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 0 0 10px; color: var(--green-deep); }
.fridge-counts { display: flex; gap: 10px; }
.fridge-counts .mini {
  flex: 1; background: var(--card); padding: 12px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm); text-align: center;
}
.fridge-counts .mini .n { font-size: 22px; font-weight: 700; color: var(--accent); }
.fridge-counts .mini .l { font-size: 12px; color: var(--ink-soft); }

/* === Распознавание === */
.recognize-state { padding: 60px 20px; text-align: center; }
.recognize-state .spinner {
  width: 64px; height: 64px; margin: 0 auto 24px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent) 0%, transparent 60%);
  animation: spin 1.2s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 18px, #000 19px);
          mask: radial-gradient(circle, transparent 18px, #000 19px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.recognize-state h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 8px; }
.recognize-state p { color: var(--ink-soft); }
.recognize-state.warn { background: var(--red-bg); border-radius: var(--radius); padding: 32px 20px; }
.recognize-state.warn h2 { color: var(--red); }

/* === Подтверждение продуктов === */
.products-list { display: grid; gap: 10px; margin: 12px 0 20px; }
.product-row {
  display: grid; grid-template-columns: 1fr auto;
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  gap: 10px; align-items: center;
}
.product-row .meta { min-width: 0; }
.product-row .name-input {
  width: 100%; background: transparent;
  border: 1px solid transparent; border-bottom: 1px dashed var(--line);
  padding: 4px 0; font-size: 15px; font-weight: 600; outline: none;
}
.product-row .name-input:focus { border-bottom-color: var(--accent); }
.product-row .qty-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.product-row .qty-line input {
  width: 80px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 8px; text-align: right; font-size: 14px; outline: none;
}
.product-row .qty-line select {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 8px; font-size: 14px; outline: none;
}
.product-row .row-actions { display: flex; gap: 4px; }
.product-row .row-actions button {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-soft);
  display: grid; place-items: center; font-size: 16px;
}
.product-row .row-actions button.del { color: var(--red); }

.add-product-card {
  background: var(--card-cream);
  border: 1.5px dashed var(--accent-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--accent-deep); font-weight: 500;
}

/* === Карточки рецептов === */
.recipes-section { margin-top: 18px; }
.recipes-section h3 {
  font-family: var(--serif); font-size: 19px; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.recipes-section h3 .count {
  font-family: var(--sans); font-size: 12px;
  color: var(--ink-mute); font-weight: 500;
}
.recipes-section .empty {
  background: var(--card-cream); padding: 20px; border-radius: var(--radius);
  color: var(--ink-soft); font-size: 14px; text-align: center;
}

.recipe-card {
  background: var(--card); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px;
  transition: transform .1s ease;
}
.recipe-card:active { transform: scale(0.99); }
.recipe-card .photo {
  height: 160px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #FBEFE6 100%);
}
.recipe-card .photo .em { font-size: 70px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08)); }
.recipe-card .photo .badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,0.95);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.recipe-card .photo .badge.can { color: var(--green); }
.recipe-card .photo .badge.need { color: var(--accent); }
.recipe-card .photo .fav {
  position: absolute; top: 10px; right: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: grid; place-items: center;
  font-size: 18px; color: var(--ink-mute);
}
.recipe-card .photo .fav.on { color: var(--red); }
.recipe-card .body { padding: 14px 16px 16px; }
.recipe-card .name { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 0 0 4px; color: var(--green-deep); }
.recipe-card .desc { color: var(--ink-soft); font-size: 14px; margin: 0 0 10px; }
.recipe-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.recipe-card .meta .chip { font-size: 12px; padding: 4px 10px; }
.recipe-card .match {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.recipe-card .match .bar {
  flex: 1; height: 6px; background: var(--bg-soft);
  border-radius: 999px; overflow: hidden;
}
.recipe-card .match .bar > div { height: 100%; background: var(--accent); border-radius: 999px; }
.recipe-card .match .pct { font-size: 13px; color: var(--accent-deep); font-weight: 600; min-width: 40px; text-align: right; }
.recipe-card .need-list { font-size: 13px; color: var(--accent-deep); margin-top: 6px; }

/* Большая «Удиви меня» */
.hero-recipe {
  background: var(--card); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 16px;
}
.hero-recipe .photo {
  height: 200px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #F5C29B 0%, #E8986A 100%);
}
.hero-recipe .photo .em { font-size: 96px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.1)); }
.hero-recipe .photo .label {
  position: absolute; top: 14px; left: 14px;
  background: rgba(255,255,255,0.95); color: var(--accent-deep);
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.hero-recipe .body { padding: 18px 20px 20px; }
.hero-recipe h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 6px; }
.hero-recipe .desc { color: var(--ink-soft); margin: 0 0 12px; }
.hero-recipe .actions { display: flex; gap: 8px; margin-top: 14px; }

/* === Карточка фильтров === */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0 8px; margin: 0 -4px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.filter-chip.on { background: var(--green); color: #FFF; border-color: var(--green); }

/* === Страница рецепта === */
.recipe-hero {
  height: 220px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #E8A87C 0%, #FBEFE6 100%);
}
.recipe-hero .em { font-size: 110px; filter: drop-shadow(0 6px 20px rgba(0,0,0,0.1)); }
.recipe-hero .fav {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: grid; place-items: center; font-size: 20px;
  box-shadow: var(--shadow);
}
.recipe-hero .back-overlay {
  position: absolute; top: 16px; left: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: grid; place-items: center; font-size: 20px;
  box-shadow: var(--shadow);
}
.recipe-body { padding: 22px 20px 24px; }
.recipe-body h1 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 8px; color: var(--green-deep); }
.recipe-body .desc { color: var(--ink-soft); margin: 0 0 14px; }
.recipe-body .stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-radius: var(--radius);
  padding: 14px 8px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.recipe-body .stats > div { text-align: center; }
.recipe-body .stats .v { font-weight: 700; font-size: 16px; }
.recipe-body .stats .l { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.portion-control {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); padding: 14px 18px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.portion-control .label { font-size: 14px; color: var(--ink-soft); }
.portion-control .ctrls { display: flex; align-items: center; gap: 12px; }
.portion-control .ctrls button {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-deep);
  font-size: 18px; font-weight: 600;
  display: grid; place-items: center;
}
.portion-control .ctrls button:disabled { opacity: 0.4; }
.portion-control .ctrls .n { font-size: 18px; font-weight: 700; min-width: 30px; text-align: center; }

.ingredients-block h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 0 0 10px; color: var(--green-deep); }
.ing-cat { font-size: 12px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 6px; font-weight: 600; }
.ing-cat.have { color: var(--green); }
.ing-cat.need { color: var(--accent-deep); }
.ing-list { display: grid; gap: 8px; margin-bottom: 16px; }
.ing-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); padding: 12px 14px;
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
.ing-item .check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.ing-item.need .check { background: var(--accent-bg); color: var(--accent-deep); }
.ing-item .nm { flex: 1; }
.ing-item .qt { font-weight: 600; }

.steps { display: grid; gap: 12px; margin-top: 8px; }
.step {
  display: grid; grid-template-columns: 32px 1fr;
  gap: 12px; background: var(--card);
  padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.step .num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #FFF;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.step .txt { font-size: 15px; line-height: 1.5; }
.tip { background: var(--accent-bg); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; color: var(--accent-deep); margin-top: 10px; }

@media (max-width: 380px) {
  .cta-block h2 { font-size: 19px; }
  .modes-grid { grid-template-columns: repeat(2, 1fr); }
  .recipe-body .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .recipe-body .stats > div { padding: 4px; }
}

/* === Холодильник === */
.fridge-list { display: grid; gap: 10px; margin-top: 12px; }
.fridge-row {
  display: grid; grid-template-columns: 1fr auto;
  background: var(--card); padding: 14px 16px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  align-items: center; gap: 10px;
}
.fridge-row .name { font-weight: 600; }
.fridge-row .qty-line { font-size: 13px; color: var(--ink-soft); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fridge-row .qty-line input { width: 64px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 13px; text-align: right; outline: none; }
.fridge-row .qty-line select { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 13px; outline: none; }
.fridge-row .added { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.fridge-row .row-actions { display: flex; gap: 4px; }
.fridge-row .row-actions button {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-soft);
  display: grid; place-items: center; font-size: 15px;
}
.fridge-row .row-actions button.del { color: var(--red); }
.fridge-row.expired { border: 1.5px solid var(--red); }
.fridge-row.soon { border: 1.5px solid var(--accent-soft); }
.expiry-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.expiry-chip.bad { background: var(--red-bg); color: var(--red); }
.expiry-chip.soon { background: var(--accent-bg); color: var(--accent-deep); }
.expiry-chip.ok { background: var(--green-bg); color: var(--green); }

/* === Настройки === */
.settings-group {
  background: var(--card); border-radius: var(--radius);
  padding: 6px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .lbl { font-size: 15px; }
.settings-row .desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.settings-row select, .settings-row input[type="text"] {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; outline: none;
}
.toggle {
  width: 46px; height: 26px; border-radius: 999px;
  background: var(--line); position: relative;
  transition: background .15s ease;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #FFF; transition: transform .15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(20px); }

.help-banner {
  background: var(--accent-bg); border-radius: var(--radius);
  padding: 14px 16px; font-size: 13px; color: var(--accent-deep);
  margin-bottom: 14px;
  display: flex; gap: 10px; align-items: flex-start;
}

/* === Избранное / история === */
.list-card {
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: 12px; background: var(--card); padding: 12px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  align-items: center; margin-bottom: 10px;
}
.list-card .em-big {
  height: 60px; width: 60px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent-bg); font-size: 30px;
}
.list-card .meta { min-width: 0; }
.list-card .name { font-weight: 500; font-family: var(--serif); font-size: 16px; color: var(--green-deep); }
.list-card .sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.list-card .row-act { display: flex; gap: 6px; }
.list-card .row-act button {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-soft); display: grid; place-items: center; font-size: 14px;
}

/* === Тоаст (sound) === */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px);
  transform: translateX(-50%);
  background: var(--ink); color: #FFF7EB;
  padding: 12px 18px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow-lg);
  z-index: 100; opacity: 0; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }

/* === Утилиты === */
.hidden { display: none !important; }
[hidden] { display: none !important; }
#auth-form label { text-align: left; }
#auth-form input { min-width: 0; min-height: 44px; width: 100%; }
#auth-form button { min-height: 44px; }
#auth-form button:disabled { opacity: .6; cursor: wait; }
#auth-error { color: #973d22; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .section.active { animation: none; } }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--ink-mute); }
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
