:root {
    --bg: #fbfaf7;
    --fg: #1f2421;
    --muted: #5f6b64;
    --line: #e4e2dc;
    --card: #fff;
    --accent: #0f7a55;
    --accent-soft: #e3f3ec;
    --radius: 14px;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #141816; --fg: #e9ece9; --muted: #9aa6a0; --line: #2c3430; --card: #1c211e; --accent: #4cc493; --accent-soft: #1f3329; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-row { display: flex; gap: 16px; align-items: center; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--fg); }
.search { flex: 1 1 220px; }
.search input { width: 100%; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); min-height: 44px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 8px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--fg); background: var(--card); min-height: 40px; display: inline-flex; align-items: center; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters { margin: 4px 0 16px; color: var(--muted); }
.filters select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.hint, .empty { color: var(--muted); }
.empty { padding: 48px 0; text-align: center; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 24px; }
.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 .15s; }
.card:hover { transform: translateY(-2px); }
.card img, .card-noimg { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.card-noimg { display: grid; place-items: center; font-size: 2.5rem; background: var(--accent-soft); }
.card-body { padding: 12px 14px 14px; }
.card h2 { font-size: 1.05rem; margin: 0 0 6px; line-height: 1.3; }
.meta { margin: 0; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 12px; }

.recipe { max-width: 860px; margin: 0 auto; padding-bottom: 40px; }
.crumbs { color: var(--muted); font-size: .9rem; margin: 18px 0 4px; }
.recipe h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; margin: 4px 0 8px; }
.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); }
.facts strong { color: var(--fg); }
.hero { margin: 16px 0; }
.hero img { border-radius: var(--radius); width: 100%; max-height: 520px; object-fit: cover; }
.hero figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.nutrition { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.nutrition div { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; min-width: 96px; text-align: center; }
.nutrition strong { display: block; font-size: 1.15rem; }
.nutrition span { font-size: .8rem; color: var(--muted); }
.nutrition .small { width: 100%; margin: 0; font-size: .8rem; color: var(--muted); }

.cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1.6fr; } }
.ingredients ul { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.qty { font-weight: 600; }
.note { color: var(--muted); font-size: .9rem; }
.servings { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.servings button, .print button { font: inherit; min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.print button { padding: 0 18px; }
.steps ol { padding-left: 1.3em; }
.steps li { margin-bottom: 12px; }
.steps li::marker { font-weight: 700; color: var(--accent); }

.legal { max-width: 760px; margin: 0 auto; padding: 24px 0 48px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 18px 0 28px; margin-top: 32px; }
.site-footer p { margin: 4px 0; }
.pager { display: flex; gap: 12px; justify-content: center; margin: 12px 0 32px; }

@media print {
    .site-header, .site-footer, .chips, .filters, .servings, .print, .crumbs { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .cols { grid-template-columns: 1fr 1.6fr; }
    .hero img { max-height: 280px; }
}
