:root {
  color-scheme: light dark;
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2620;
  --muted: #7a7166;
  --accent: #b4552d;
  --accent-soft: #f3e2d5;
  --line: #e8e0d4;
  --good: #4a7c59;
  --on-accent: #ffffff;
  --noimg: #e9d9c2;
  --shadow: rgba(0,0,0,0.08);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171411;
    --card: #211d19;
    --ink: #f3ede4;
    --muted: #b8ab9d;
    --accent: #e08a61;
    --accent-soft: #3b2921;
    --line: #453c34;
    --good: #88b594;
    --on-accent: #171411;
    --noimg: #2d2721;
    --shadow: rgba(0,0,0,0.32);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--accent); }
header.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.top .inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.brand span { color: var(--accent); }
nav.main { display: flex; gap: 4px; margin-left: auto; }
nav.main a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
}
nav.main a.active, nav.main a:hover { background: var(--accent-soft); color: var(--accent); }
.badge {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
}
main { max-width: 1100px; margin: 0 auto; padding: 22px 18px 80px; }
h1 { font-size: 1.7rem; margin: 0.4em 0; }
h2 { font-size: 1.25rem; margin-top: 2em; }
.browse-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.browse-heading .btn { white-space: nowrap; }
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 16px 0;
}
.toolbar input[type="search"] {
  flex: 1 1 220px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
  background: var(--card);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
.chip.on { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
select.filter {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 0.9rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow); }
.card img { width: 100%; height: 160px; object-fit: cover; background: var(--accent-soft); }
.card .noimg {
  height: 160px; background: linear-gradient(135deg, var(--accent-soft), var(--noimg));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
}
.card .body { padding: 12px 14px 14px; }
.card .title { font-weight: 700; margin: 0 0 4px; font-size: 1.02rem; }
.card .meta { color: var(--muted); font-size: 0.82rem; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 2px 9px; margin: 2px 4px 2px 0;
}
.recipe-head { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 760px) { .recipe-head { grid-template-columns: 380px 1fr; } }
.recipe-head img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.meta-row { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); margin: 10px 0; }
.meta-row b { color: var(--ink); }
.ing-list { list-style: none; padding: 0; }
.ing-list li {
  padding: 9px 4px; border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; align-items: baseline;
}
.ing-list li:last-child { border-bottom: 0; }
.ing-list .qty { font-weight: 700; white-space: nowrap; min-width: 90px; color: var(--accent); }
.ing-group {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.8rem; color: var(--muted); margin-top: 14px; list-style: none;
}
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; padding: 10px 0 10px 46px; position: relative; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem;
}
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
  padding: 11px 20px; border-radius: 10px; font-size: 0.95rem;
  text-decoration: none;
}
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn.small { padding: 7px 13px; font-size: 0.85rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; align-items: center; }
.scaler { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.scaler button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  font-size: 1.2rem; cursor: pointer; font-weight: 800;
}
.aisle { margin-top: 26px; }
.aisle h3 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); border-bottom: 2px solid var(--line); padding-bottom: 6px;
}
.shop-item { display: flex; gap: 12px; align-items: baseline; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.shop-item input { transform: scale(1.25); }
.shop-item.done .nm { text-decoration: line-through; color: var(--muted); }
.shop-item .nm { flex: 1; }
.shop-item .q { font-weight: 700; color: var(--accent); white-space: nowrap; }
.plan-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .plan-grid { grid-template-columns: repeat(7, 1fr); } }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.day h4 { margin: 0 0 8px; font-size: 0.9rem; }
.slot { margin-bottom: 10px; }
.slot label { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.slot select { width: 100%; margin-top: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.82rem; background: var(--card); }
.slot .rm { font-size: 0.75rem; color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 30px; }
.count { color: var(--muted); font-size: 0.9rem; margin: 8px 0; }
.collection-line { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.export-link { font-size:.86rem; font-weight:700; text-underline-offset:3px; }
.choice-field { margin:16px 0 4px; }
.choice-field label { display:block; color:var(--muted); font-size:.8rem; font-weight:700; margin-bottom:5px; }
