/* HomeChef: mobile-first styles, Modern Blue theme. No external fonts or frameworks (offline-friendly). */

/* ------------------------------------------------------------------
   Modern Blue theme (v0.3.1). All colours live here as tokens.
   Approved palette: background #EEF5F9, primary #356D91, light accent #D8EAF3,
   text #263D4C, cards #FFFFFF, secondary text #667D8B.
   Semantic colours (success / warning / danger / fridge / freezer) are
   deliberately NOT blue so food-safety states stay distinct.
   Contrast is checked by tests/unit/theme.test.js (WCAG AA).
   ------------------------------------------------------------------ */
:root {
  color-scheme: light dark;
  --bg: #eef5f9;               /* approved: main background */
  --surface: #ffffff;          /* approved: cards */
  --surface-2: #e6f0f6;        /* subtle tinted surface (meta chips, tags) */
  --text: #263d4c;             /* approved: primary text */
  --muted: #5b6f7c;            /* secondary TEXT: approved #667D8B darkened for 4.5:1 contrast */
  --muted-decor: #667d8b;      /* approved secondary colour, for non-text decoration only */
  --muted-on-accent: #4c606d;  /* secondary text on the light-blue accent (#D8EAF3) */
  --border: #d3e3ec;
  --border-strong: #7990a0;    /* form-field outlines, 3:1 against background */
  --primary: #356d91;          /* approved: primary blue */
  --primary-strong: #285570;
  --on-primary: #ffffff;
  --primary-soft: #d8eaf3;     /* approved: light blue accent */
  --accent: #a63d32;           /* destructive text buttons ("Clear all") */
  --accent-soft: #fbe7e3;
  --success-text: #23693f;
  --success-bg: #e1f2e7;
  --success: #2b7a4b;
  --warn-text: #8a4b00;        /* caution: missing ingredients, "not for freezing" */
  --warn-bg: #fff1d6;
  --danger-text: #a3261b;      /* food-storage danger: can't be kept safely */
  --danger-bg: #fde9e6;
  --danger-border: #c0392b;
  --fridge-bg: #ddf1f2;
  --fridge-text: #1c6b72;
  --freezer-bg: #ece9fb;
  --freezer-text: #4b3fa3;
  --focus: #0e3f5f;            /* keyboard focus ring: 10:1 against the background */
  --shadow: 0 1px 2px rgb(38 61 76 / 0.06), 0 2px 8px rgb(38 61 76 / 0.06);
  --shadow-float: 0 8px 24px rgb(38 61 76 / 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --gutter: 16px;
  --nav-h: 64px;
  --maxw: 720px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dark mode: complementary deep blues. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1c25;
    --surface: #162733;
    --surface-2: #1e3242;
    --text: #e3eef4;
    --muted: #9db3c1;
    --muted-decor: #8aa2b1;
    --muted-on-accent: #b3c6d2;
    --border: #2a4252;
    --border-strong: #6f8a9b;
    --primary: #7fb6d9;
    --primary-strong: #a6cde6;
    --on-primary: #0b1a24;
    --primary-soft: #1f3b50;
    --accent: #f4a393;
    --accent-soft: #3d201b;
    --success-text: #86d6a5;
    --success-bg: #16342a;
    --success: #86d6a5;
    --warn-text: #ffcf8a;
    --warn-bg: #3a2a10;
    --danger-text: #ffa296;
    --danger-bg: #43201c;
    --danger-border: #ff8a7a;
    --fridge-bg: #123a3e;
    --fridge-text: #86d8de;
    --freezer-bg: #262247;
    --freezer-text: #bdb3f7;
    --focus: #ffd166;            /* warm yellow ring: stands out from every blue */
    --shadow: none;
    --shadow-float: 0 8px 24px rgb(0 0 0 / 0.45);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}
.top-nav { display: none; }

/* ---------- Bottom navigation (phones) ---------- */
.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--nav-h);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
}
.bottom-nav a[aria-current='page'] { color: var(--primary); }
.bottom-nav a[aria-current='page'] svg {
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 2px 14px;
  box-sizing: content-box;
}

/* ---------- Screens ---------- */
.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--gutter) 24px;
  outline: none;
}
.screen { display: grid; gap: 14px; }
.screen-head { padding: 4px 2px 2px; }
.screen-head h1 { font-size: 1.625rem; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin-top: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.card--flush { padding: 0 0 8px; gap: 0; overflow: hidden; }
.card--next { background: var(--surface-2); box-shadow: none; }
.card--summary { border-color: var(--primary); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-head h2, .card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title--padded { padding: 16px 16px 8px; }

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.875rem;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.875rem;
}

.hint { color: var(--muted); font-size: 0.875rem; }
.empty { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover:not(:disabled) { background: var(--accent-soft); }
.btn--small { padding: 6px 12px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- Chips ---------- */
.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-list:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--primary); }
.chip--selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.chip-x { font-size: 1.125rem; line-height: 1; opacity: 0.85; }
.chip--toggle[aria-pressed='true'],
.chip--filter[aria-pressed='true'] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
  font-weight: 600;
}
.chip--toggle[aria-pressed='true']::before {
  content: '✓';
  font-weight: 700;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 16px;
}

/* ---------- Category accordions ---------- */
.category { border-top: 1px solid var(--border); }
.category summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}
.category summary::-webkit-details-marker { display: none; }
.category summary::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted-decor);
  border-bottom: 2px solid var(--muted-decor);
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform 0.15s;
}
.category[open] summary::after { transform: rotate(-135deg); }
.group-count { color: var(--primary); font-size: 0.8125rem; font-weight: 600; }

/* ---------- Search combobox ---------- */
.combobox { position: relative; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 1rem; /* >=16px prevents iOS zoom on focus */
}
.input:focus { border-color: var(--primary); outline: 3px solid var(--focus); outline-offset: 1px; }
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  max-height: 320px;
  overflow-y: auto;
}
.search-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.search-option[aria-selected='true'] { background: var(--primary-soft); }
.tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

/* ---------- Lazy Mode ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar::after { content: ''; flex: 0 0 4px; } /* keeps right padding when scrolled */
.filter-bar .chip { flex: none; min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }

.recipe-list { display: grid; gap: 8px; padding: 0 12px 8px; max-height: 420px; overflow-y: auto; }
.recipe-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.recipe-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.recipe-option:has(input:checked) .recipe-option__local,
.recipe-option:has(input:checked) .recipe-option__meta { color: var(--muted-on-accent); }
.recipe-option input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.recipe-option__body { display: grid; gap: 2px; min-width: 0; }
.recipe-option__name { font-weight: 700; }
.recipe-option__local { color: var(--muted); font-size: 0.875rem; font-style: italic; }
.recipe-option__summary { font-size: 0.875rem; }
.recipe-option__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 2px;
}
.recipe-option__meta .ok { color: var(--success-text); }
.recipe-option__meta .warn { color: var(--warn-text); }

.segmented {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.segmented__item { position: relative; }
.segmented__item input,
.size-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented__item span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.segmented__item input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.segmented__item input:focus-visible + span,
.size-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper__btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 1.25rem;
  cursor: pointer;
}
.stepper__btn:disabled { opacity: 0.35; cursor: default; }
.stepper__value { min-width: 2ch; text-align: center; font-size: 1.125rem; font-weight: 700; }

.size-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size-option {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.size-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.size-option__label { font-weight: 700; }
.size-option__grams { font-size: 0.875rem; color: var(--muted); }

.summary { display: grid; gap: 8px; }
.summary__recipe { font-weight: 700; font-size: 1.0625rem; }
.note {
  font-size: 0.875rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
}
.note--warn { background: var(--danger-bg); color: var(--danger-text); border-left: 4px solid var(--danger-border); }

/* ---------- Meal ideas (Leftover Ideas) ---------- */
.idea-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.idea {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}
.idea:hover { border-color: var(--primary); }
.idea--ready { border-color: var(--success); background: var(--success-bg); }
.idea__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.idea__name { font-weight: 700; }
.idea__local { color: var(--muted); font-size: 0.875rem; font-style: italic; }
.idea__line { font-size: 0.875rem; }
.idea__line--missing { color: var(--warn-text); }
.idea__meta { font-size: 0.8125rem; color: var(--muted); }
.badge {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--ready { background: var(--success); color: var(--on-primary); }
.badge--almost { background: var(--warn-bg); color: var(--warn-text); }
.badge--shop { background: var(--surface-2); color: var(--muted); }
.show-all { margin-top: 4px; color: var(--primary); }
.card-foot { padding: 4px 16px 8px; }
.card-foot:has(> [hidden]) { display: none; }
.count-badge[hidden] { display: none; }
.count-badge--warn { background: var(--warn-bg); color: var(--warn-text); }

.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn--block { width: 100%; }

/* ---------- Recipe detail ---------- */
.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.local-name { color: var(--muted); font-style: italic; margin-top: 2px; }
.meta-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meta-list li {
  font-size: 0.8125rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.action-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  z-index: 4;
}
.action-bar .btn { min-height: 52px; font-size: 1.0625rem; box-shadow: var(--shadow-float); }
.detail-ingredients { display: grid; gap: 14px; }
.status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}
.status--ready { background: var(--success-bg); color: var(--success-text); border-left: 4px solid var(--success); }
.status--missing { background: var(--warn-bg); color: var(--warn-text); border-left: 4px solid var(--warn-text); }
.ing-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ing-line {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.ing-line:first-child { border-top: 0; padding-top: 0; }
.ing-line__main { display: grid; flex: 1 1 140px; min-width: 0; }
.ing-line__name { font-weight: 600; }
.ing-line__note { font-size: 0.8125rem; color: var(--muted); }
.ing-line__qty { font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn--have { color: var(--primary); border-color: var(--primary); }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; }
.steps li::marker { font-weight: 700; color: var(--primary); }
.storage-list { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; font-size: 0.9375rem; }
.note--success { background: var(--success-bg); color: var(--success-text); border-left: 4px solid var(--success); }
.hint--block { display: block; font-weight: 400; }

/* ---------- Lazy Mode: recipe list details link ---------- */
.recipe-option-wrap { position: relative; }
.recipe-option-wrap .recipe-option { padding-bottom: 40px; }
.recipe-option__details {
  position: absolute;
  right: 12px;
  bottom: 8px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.recipe-option__details:hover { background: var(--primary-soft); }

/* ---------- Lazy Mode: session summary ---------- */
.btn--outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn--outline:hover:not(:disabled) { background: var(--primary-soft); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.jump-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.jump-row .btn { flex: 1 1 auto; }
.jump-row .btn--ghost { color: var(--primary); }
.fix-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.note--warn .btn--outline { border-color: currentColor; color: inherit; }
.meta-list li.meta-list__scaled { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }

/* ---------- Lazy Mode: shopping list ---------- */
.shop-progress { font-weight: 600; font-size: 0.9375rem; }
.shop-progress--done { color: var(--success-text); }
.shop-group { display: grid; gap: 4px; }
.shop-group__title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 6px;
}
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  min-height: 48px;
}
.shop-item:first-child { border-top: 0; }
.shop-item__check {
  flex: 1;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 0;
  cursor: pointer;
  min-width: 0;
}
.shop-item__check input { width: 22px; height: 22px; accent-color: var(--primary); margin: 0; }
.shop-item__name { font-weight: 600; min-width: 0; }
.shop-item__amount { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.shop-item__approx { color: var(--muted); font-size: 0.8125rem; }
.shop-item.is-ticked .shop-item__name,
.shop-item.is-ticked .shop-item__amount { text-decoration: line-through; color: var(--muted); }
.shop-item--plain { justify-content: space-between; padding: 8px 0; min-height: 40px; }
.shop-group--home .shop-item__name { font-weight: 500; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.copy-fallback { font-family: ui-monospace, monospace; font-size: 0.8125rem; min-height: 160px; }

/* ---------- Lazy Mode: meal-prep schedule ---------- */
.plan-totals { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-chip { font-size: 0.8125rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.plan-badge { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.plan-chip--fresh, .plan-badge--fresh { background: var(--success-bg); color: var(--success-text); }
.plan-chip--fridge, .plan-badge--fridge { background: var(--fridge-bg); color: var(--fridge-text); }
.plan-chip--freezer, .plan-badge--freezer { background: var(--freezer-bg); color: var(--freezer-text); }
.plan-chip--unplanned, .plan-badge--unplanned { background: var(--danger-bg); color: var(--danger-text); }
.plan-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-day {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.plan-day--fresh { border-left-color: var(--success); }
.plan-day--fridge { border-left-color: var(--fridge-text); }
.plan-day--freezer { border-left-color: var(--freezer-text); }
.plan-day--unplanned { border-left-color: var(--danger-border); background: var(--danger-bg); }
.plan-day--unplanned .plan-day__actions { color: var(--danger-text); }
.plan-day--none { opacity: 0.75; }
.plan-day__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.plan-day__actions { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: 0.9375rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  transform: translate(-50%, 20px);
  max-width: calc(100% - 2 * var(--gutter));
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9375rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.notice { padding: 16px; }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .top-nav { display: flex; gap: 4px; }
  .top-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
  }
  .top-nav a:hover { color: var(--text); }
  .top-nav a[aria-current='page'] { background: var(--primary-soft); color: var(--primary-strong); }
  .app-main { padding-top: 24px; }
  .toast { bottom: 24px; }
  .action-bar { bottom: 16px; }
  .recipe-list { max-height: 520px; }
  .filter-bar { flex-wrap: wrap; overflow: visible; }
  .filter-bar::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
