/* ============================================================
   Epulonis – Stylesheet
   Warm, cosy cookbook design, system fonts only. Light & dark theme.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f4ede3;
  --text: #2c2622;
  --muted: #7a6f64;
  --border: #e8ddce;
  --border-strong: #d8c9b4;

  --primary: #c8543b;
  --primary-dark: #a8412c;
  --primary-soft: #f8e7e1;

  --ok: #3f7d5a;
  --ok-bg: #e6f1ea;
  --low: #b9821c;
  --low-bg: #fbf0d8;
  --missing: #b23b3b;
  --missing-bg: #f8e4e1;
  --unknown: #6b7280;
  --unknown-bg: #ecedf0;

  --header-bg: rgba(250, 246, 240, .88);

  --shadow-sm: 0 1px 2px rgba(40, 30, 20, .05);
  --shadow: 0 1px 2px rgba(40, 30, 20, .04), 0 10px 28px rgba(60, 40, 20, .07);
  --shadow-lg: 0 12px 40px rgba(60, 40, 20, .14);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================
   Dark theme – applied via [data-theme="dark"] or, for the "System"
   setting, via prefers-color-scheme unless the user forced light.
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1714;
  --surface: #251f1a;
  --surface-2: #2f2823;
  --text: #ece4d8;
  --muted: #a99e8e;
  --border: #3a322a;
  --border-strong: #4b4137;
  --primary: #cf5d40;
  --primary-dark: #ec8a65;
  --primary-soft: #3a2620;
  --ok: #74c79b; --ok-bg: #1f3a2c;
  --low: #e0b15a; --low-bg: #3a3120;
  --missing: #ec8a82; --missing-bg: #3d2723;
  --unknown: #9aa3ae; --unknown-bg: #2a2e34;
  --header-bg: rgba(27, 23, 20, .85);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1714;
    --surface: #251f1a;
    --surface-2: #2f2823;
    --text: #ece4d8;
    --muted: #a99e8e;
    --border: #3a322a;
    --border-strong: #4b4137;
    --primary: #cf5d40;
    --primary-dark: #ec8a65;
    --primary-soft: #3a2620;
    --ok: #74c79b; --ok-bg: #1f3a2c;
    --low: #e0b15a; --low-bg: #3a3120;
    --missing: #ec8a82; --missing-bg: #3d2723;
    --unknown: #9aa3ae; --unknown-bg: #2a2e34;
    --header-bg: rgba(27, 23, 20, .85);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .3em; }
h2 { font-size: 1.45rem; margin: 0 0 .6em; }
h3 { font-size: 1.15rem; margin: 0; }

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1 0 auto; padding-top: 32px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; letter-spacing: .2px; }

.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.nav-link {
  color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: .96rem;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { color: var(--primary-dark); background: var(--primary-soft); }

/* ---------- Suche ---------- */
.search { position: relative; flex: 1 1 auto; max-width: 440px; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  display: flex; color: var(--muted); opacity: .85; pointer-events: none;
}
/* type-Attribut im Selektor, damit die generische input[type="search"]-Regel
   weiter unten das linke Padding (Platz fürs Icon) nicht überschreibt */
.search input[type="search"] {
  width: 100%; padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); font-size: .95rem; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.search input[type="search"]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 60; max-height: 70vh; overflow-y: auto;
}
.search-results:empty { display: none; }
.sr-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; border-bottom: 1px solid var(--border);
}
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.active { background: var(--surface-2); }
.sr-thumb {
  width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-2);
}
.sr-thumb-fallback {
  width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.2rem;
  color: #fff; background: linear-gradient(135deg, #d9826a, #c8543b);
}
.sr-text { min-width: 0; }
.sr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-empty { padding: 16px; color: var(--muted); text-align: center; font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: transform .05s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 13px; font-size: .88rem; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--missing); border-color: #e7c2bd; }
.btn-danger:hover { background: var(--missing-bg); }
.nav-new { padding-top: 9px; padding-bottom: 9px; }

.icon-btn {
  background: transparent; border: 1px solid transparent; cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; font-size: 1rem; color: var(--muted);
  display: inline-grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--missing-bg); color: var(--missing); }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 22px; }
.page-sub { color: var(--muted); margin: 0; }
.breadcrumb { margin: 0 0 14px; font-size: .9rem; }
.breadcrumb a { color: var(--muted); }

/* ---------- Chips / Tags ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips-sm { margin-bottom: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: .82rem; font-weight: 500;
  background: var(--surface-2); color: var(--text); border: 1px solid transparent;
}
.chip:hover { text-decoration: none; border-color: var(--border-strong); }
.chip.active { background: var(--primary); color: #fff; }
.chip-count { font-size: .75rem; opacity: .7; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }

/* ---------- Recipe grid / cards ---------- */
.recipe-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.recipe-card {
  display: flex; flex-direction: column;
  transition: transform .14s ease, box-shadow .14s ease;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-media {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--surface-2);
}
.card-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
  transition: transform .3s ease;
}
.recipe-card:hover .card-media img { transform: scale(1.04); }
.card-fallback {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 3rem; color: rgba(255,255,255,.92);
  background: linear-gradient(135deg, #e0917a, #c8543b 70%);
}
.card-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255,255,255,.92); color: #2c2622;
  font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 1.18rem; margin: 0; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary-dark); text-decoration: none; }
.card-desc {
  color: var(--muted); font-size: .9rem; margin: 2px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; padding-top: 12px;
  color: var(--muted); font-size: .85rem;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 70px 20px; background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.empty-state.small { padding: 48px 20px; }
.empty-emoji { font-size: 3rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 6px auto 20px; }

/* ============================================================
   Rezept-Detailseite
   ============================================================ */
.recipe-hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 21 / 9; background: var(--surface-2); box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.recipe-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.recipe-hero .card-fallback { font-size: 5rem; }

.recipe-head { margin-bottom: 28px; }
.recipe-head .lead { font-size: 1.12rem; color: var(--muted); max-width: 70ch; margin: 6px 0 0; }
.recipe-head h1 { margin-top: 10px; }

.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 15px; box-shadow: var(--shadow-sm);
}
.badge-ico { font-size: 1.25rem; }
.badge-k { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.badge-v { display: block; font-weight: 600; }

.recipe-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.recipe-actions form { margin: 0; }

.recipe-layout {
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 32px;
  align-items: start;
}

/* Zutaten-Spalte */
.ingredients { padding: 20px; position: sticky; top: 84px; }
.ing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.ing-head h2 { margin: 0; }

.servings-stepper {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border-radius: 999px; padding: 3px;
}
.step-btn {
  width: 30px; height: 30px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--surface); color: var(--text); font-size: 1.2rem; line-height: 1;
  box-shadow: var(--shadow-sm); display: grid; place-items: center;
}
.step-btn:hover { background: #fff; color: var(--primary-dark); }
.servings-field { display: inline-flex; align-items: baseline; gap: 4px; padding: 0 4px; }
#servings-input {
  width: 2.6em; border: none; background: transparent; text-align: center;
  font-size: 1.05rem; font-weight: 700; color: var(--text); font-family: var(--sans);
  -moz-appearance: textfield;
}
#servings-input::-webkit-outer-spin-button,
#servings-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#servings-input:focus { outline: none; }
.servings-unit { font-size: .82rem; color: var(--muted); }

.pantry-hint { font-size: .85rem; color: var(--muted); margin: 0 0 14px; }

.ingredient-list { list-style: none; margin: 0; padding: 0; }
.ingredient {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.ingredient:last-child { border-bottom: 0; }
.ing-amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; min-width: 3.2em; }
.ing-amount .unit { font-weight: 500; color: var(--muted); font-size: .9em; }
.ing-name { line-height: 1.35; }
.ing-note { display: block; font-size: .82rem; color: var(--muted); }

.pantry-pill {
  display: inline-flex; align-items: center; gap: 5px; align-self: center;
  font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pantry-pill .pill-ico { font-size: .8em; }
.pantry-pill.ok { background: var(--ok-bg); color: var(--ok); }
.pantry-pill.low { background: var(--low-bg); color: var(--low); }
.pantry-pill.missing { background: var(--missing-bg); color: var(--missing); }
.pantry-pill.unknown { background: var(--unknown-bg); color: var(--unknown); }

.pantry-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; margin-right: 4px; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.dot.low { background: var(--low); }
.dot.missing { background: var(--missing); }

/* Zubereitung */
.notes-box {
  display: flex; gap: 12px; background: var(--low-bg);
  border: 1px solid var(--border); border-left: 4px solid var(--low);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 24px;
}
.notes-box .notes-ico { font-size: 1.2rem; }
.notes-box strong { display: block; margin-bottom: 2px; color: var(--text); }
.notes-box p { margin: 0; color: var(--text); opacity: .85; }

.step-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.step-list li {
  position: relative; counter-increment: step;
  padding: 0 0 22px 52px; min-height: 36px;
}
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-family: var(--serif); font-weight: 700; font-size: 1.05rem;
  display: grid; place-items: center;
}
.step-list li::after {
  content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px;
  background: var(--border);
}
.step-list li:last-child { padding-bottom: 0; }
.step-list li:last-child::after { display: none; }
.step-text { display: block; padding-top: 4px; }

/* ============================================================
   Formulare
   ============================================================ */
.recipe-form { max-width: 820px; }
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 22px 24px; margin-bottom: 20px;
}
.form-section-title { margin: 0 0 14px; font-size: 1.25rem; }
.form-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.form-section-head .form-section-title { margin: 0; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.req { color: var(--primary); }
.hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }

input:not([type]), input[type="text"], input[type="url"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: var(--sans); font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
::placeholder { color: var(--muted); opacity: .75; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.image-preview { margin-top: 12px; border-radius: var(--radius-sm); overflow: hidden; max-width: 260px; border: 1px solid var(--border); }
.image-preview img { width: 100%; height: 150px; object-fit: cover; }

/* dynamische Zeilen */
.rows { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: start; }
.ingredient-row .cell-amount { flex: 0 0 78px; }
.ingredient-row .cell-unit { flex: 0 0 96px; }
.ingredient-row .cell-name { flex: 2 1 130px; }
.ingredient-row .cell-note { flex: 2 1 130px; }
.step-row { align-items: stretch; }
.step-row .step-num {
  flex: 0 0 30px; height: 38px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark); border-radius: var(--radius-sm);
  font-weight: 700; font-family: var(--serif);
}
.step-row textarea { flex: 1; }
.row-remove {
  flex: 0 0 38px; height: 38px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; font-size: .9rem;
  transition: background .15s, color .15s, border-color .15s;
}
.row-remove:hover { background: var(--missing-bg); color: var(--missing); border-color: #e7c2bd; }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.form-actions-inline { margin-top: 4px; }

/* ============================================================
   Vorratskammer
   ============================================================ */
.pantry-layout { display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start; }
.pantry-form-card { position: sticky; top: 84px; }
.pantry-count { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.pantry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pantry-item {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.pantry-item-name { font-weight: 600; }
.pantry-item-qty {
  font-variant-numeric: tabular-nums; color: var(--text);
  background: var(--surface-2); padding: 4px 11px; border-radius: 999px; font-size: .88rem; white-space: nowrap;
}
.pantry-item-actions { display: flex; align-items: center; gap: 2px; }
.pantry-item-actions form { margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0; border-top: 1px solid var(--border); background: var(--surface-2);
  margin-top: auto; color: var(--muted); font-size: .9rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between;
  padding-top: 22px; padding-bottom: 22px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }
.footer-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.switch-btn {
  border: none; background: transparent; color: var(--muted);
  font-family: var(--sans); font-size: .82rem; font-weight: 500;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.switch-btn:hover { color: var(--text); }
.switch-btn.active { background: var(--primary); color: #fff; }

.error-detail {
  text-align: left; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; max-width: 760px; margin: 0 auto 20px; font-size: .82rem; color: var(--muted);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .recipe-layout { grid-template-columns: 1fr; }
  .ingredients { position: static; }
  .pantry-layout { grid-template-columns: 1fr; }
  .pantry-form-card { position: static; }
}

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; }
  .brand { order: 1; }
  .nav { order: 2; margin-left: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav-link { padding: 7px 9px; }
  .recipe-hero { aspect-ratio: 16 / 10; }
  .grid-3 { grid-template-columns: 1fr; }
  .badges { gap: 8px; }
  .ingredient-row { flex-wrap: wrap; }
  .ingredient-row .cell-amount { flex: 1 1 70px; }
  .ingredient-row .cell-unit { flex: 1 1 80px; }
  .ingredient-row .cell-name, .ingredient-row .cell-note { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .nav-new { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
