:root {
  --bg: #f4f1e9;
  --bg-2: #ebe7dc;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --surface-muted: #f0ede4;
  --ink: #1e2a23;
  --ink-2: #4f5b54;
  --ink-3: #7c857f;
  --line: rgba(38, 58, 47, .11);
  --line-strong: rgba(38, 58, 47, .19);
  --brand: #315c45;
  --brand-2: #477a5c;
  --brand-soft: #dce8dd;
  --lime: #d6e887;
  --lime-soft: #edf4c9;
  --peach: #f0a56a;
  --peach-soft: #fbe5d3;
  --red: #b94d47;
  --red-soft: #f7dfdc;
  --yellow: #b98324;
  --yellow-soft: #f7ebc9;
  --blue: #4f7285;
  --blue-soft: #e0edf1;
  --shadow-sm: 0 1px 2px rgba(24, 35, 29, .05), 0 8px 24px rgba(24, 35, 29, .045);
  --shadow-md: 0 18px 50px rgba(24, 35, 29, .12), 0 3px 10px rgba(24, 35, 29, .06);
  --shadow-lg: 0 28px 80px rgba(24, 35, 29, .18), 0 8px 24px rgba(24, 35, 29, .08);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --sidebar: 244px;
  --max-content: 1440px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100%; margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--lime); color: var(--ink); }

button, [role="button"], input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(71, 122, 92, .28);
  outline-offset: 2px;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--ink-2);
}
.boot-screen p { margin: 0; font-weight: 650; letter-spacing: -.01em; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--brand);
  display: grid;
  padding: 8px;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 20px rgba(49,92,69,.18);
}
.brand-mark span { border-radius: 5px; background: var(--surface); }
.brand-mark span:nth-child(1) { grid-row: 1 / 3; background: var(--lime); }
.brand-mark span:nth-child(2) { background: var(--surface); }
.brand-mark span:nth-child(3) { background: var(--peach); }
.brand-mark--small { width: 34px; height: 34px; border-radius: 11px; padding: 7px; gap: 3px; }
.brand-mark--large { width: 66px; height: 66px; border-radius: 22px; padding: 13px; gap: 6px; animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(49,92,69,.25); } }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 26px 18px 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(248, 246, 239, .88);
  backdrop-filter: blur(18px);
  z-index: 30;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-copy strong { display: block; font-size: 21px; line-height: 1; letter-spacing: -.045em; }
.brand-copy span { display: block; margin-top: 5px; font-size: 10px; font-weight: 800; color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; }

.nav-list { display: grid; gap: 7px; }
.nav-button {
  min-height: 50px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 720;
  letter-spacing: -.012em;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-button:hover { background: rgba(49, 92, 69, .07); color: var(--ink); transform: translateX(2px); }
.nav-button.is-active { background: var(--brand); color: white; box-shadow: 0 9px 20px rgba(49, 92, 69, .18); }
.nav-button .nav-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.nav-button .nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; background: var(--peach-soft); color: #824116; font-size: 11px; font-weight: 850; }
.nav-button.is-active .nav-badge { background: var(--lime); color: var(--ink); }

.sidebar-spacer { flex: 1; }
.kitchen-card {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(145deg, #e5eddc, #f4f1df);
  border: 1px solid rgba(49,92,69,.08);
  margin-bottom: 14px;
}
.kitchen-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kitchen-card__eyebrow { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 850; color: var(--brand-2); }
.kitchen-card__value { margin: 9px 0 4px; font-size: 27px; line-height: 1; letter-spacing: -.05em; font-weight: 780; }
.kitchen-card__sub { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.sidebar-action {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  display: flex; align-items: center; gap: 10px; padding: 0 13px; cursor: pointer; font-weight: 700; color: var(--ink-2);
}
.sidebar-action:hover { border-color: var(--line-strong); color: var(--ink); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #8db39b; box-shadow: 0 0 0 4px rgba(141,179,155,.15); }
.sync-dot.is-error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.main-column { grid-column: 2; min-width: 0; }
.topbar {
  height: 78px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(22px, 4vw, 58px);
  background: linear-gradient(to bottom, rgba(244,241,233,.96) 70%, rgba(244,241,233,.72));
  backdrop-filter: blur(16px);
}
.topbar__title { min-width: 0; }
.topbar__title p { margin: 0 0 4px; font-size: 11px; font-weight: 820; letter-spacing: .11em; text-transform: uppercase; color: var(--brand-2); }
.topbar__title h1 { margin: 0; font-size: clamp(24px, 2.5vw, 34px); line-height: 1; letter-spacing: -.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.mobile-brand { display: none; }

.content { width: min(100%, var(--max-content)); margin: 0 auto; padding: 20px clamp(22px, 4vw, 58px) 110px; }
.content-stack { display: grid; gap: 26px; }
.section { min-width: 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.05; letter-spacing: -.045em; }
.section-heading p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.section-heading__actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { margin: 0 0 8px; font-size: 10px; font-weight: 850; color: var(--brand-2); letter-spacing: .12em; text-transform: uppercase; }

.button {
  border: 0;
  border-radius: 14px;
  min-height: 43px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-sm); }
.button:active { transform: translateY(0); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button--primary { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(49,92,69,.18); }
.button--primary:hover { background: #274e3a; box-shadow: 0 11px 26px rgba(49,92,69,.24); }
.button--accent { background: var(--lime); box-shadow: none; }
.button--accent:hover { background: #cadd74; }
.button--ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.button--ghost:hover { background: rgba(49,92,69,.07); box-shadow: none; color: var(--ink); }
.button--danger { color: var(--red); background: var(--red-soft); box-shadow: none; }
.button--small { min-height: 35px; border-radius: 11px; padding: 0 12px; font-size: 11px; }
.button--icon { width: 43px; padding: 0; }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }

.icon-button {
  width: 43px; height: 43px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,.86);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); background: white; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 18px; }
.hero-card {
  min-height: 230px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 18%, rgba(214,232,135,.7), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(240,165,106,.28), transparent 35%),
    linear-gradient(145deg, #315c45, #3f7054);
  color: white;
  padding: clamp(24px, 4vw, 38px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(49,92,69,.16);
}
.hero-card::after {
  content: ""; position: absolute; width: 240px; height: 240px; right: -60px; bottom: -95px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.025), 0 0 0 48px rgba(255,255,255,.018);
}
.hero-card__eyebrow { font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .13em; color: var(--lime); }
.hero-card h2 { max-width: 670px; margin: 13px 0 10px; font-size: clamp(30px, 4vw, 52px); line-height: .98; letter-spacing: -.065em; }
.hero-card p { max-width: 600px; margin: 0; color: rgba(255,255,255,.75); font-size: 14px; line-height: 1.55; }
.hero-card__actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; position: relative; z-index: 2; }
.hero-card .button--light { background: white; color: var(--brand); box-shadow: none; }
.hero-card .button--outline-light { color: white; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }

.summary-card { border-radius: var(--radius-xl); padding: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: grid; gap: 15px; }
.summary-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.summary-card__top h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.summary-card__top p { margin: 5px 0 0; color: var(--ink-3); font-size: 12px; }
.summary-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) var(--progress, 72%), var(--surface-muted) 0); position: relative; flex: none; }
.summary-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.summary-ring strong { position: relative; z-index: 1; font-size: 12px; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-stat { border-radius: 15px; background: var(--surface-muted); padding: 13px 11px; }
.summary-stat strong { display: block; font-size: 23px; line-height: 1; letter-spacing: -.05em; }
.summary-stat span { display: block; margin-top: 7px; font-size: 10px; color: var(--ink-3); font-weight: 700; line-height: 1.25; }
.summary-note { padding: 12px 13px; border-radius: 14px; background: var(--lime-soft); color: #3e5023; font-size: 12px; line-height: 1.45; display: flex; gap: 9px; align-items: flex-start; }
.summary-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 18px; }
.search-box { min-width: min(100%, 280px); flex: 1; max-width: 480px; position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--ink-3); stroke-width: 2; }
.search-box input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.9); padding: 0 15px 0 42px; color: var(--ink); box-shadow: var(--shadow-sm); }
.search-box input::placeholder { color: #959d97; }
.filter-scroll { min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.filter-scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); padding: 0 13px; flex: none;
  display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 11px; font-weight: 760; cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { background: var(--brand); color: white; border-color: var(--brand); }
.chip--soft.is-active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .65; }

.food-sections { display: grid; gap: 18px; }
.food-section { border-radius: var(--radius-lg); background: rgba(255,253,248,.58); border: 1px solid var(--line); padding: 18px; }
.food-section__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.food-section__title { display: flex; align-items: center; gap: 10px; }
.storage-icon { width: 38px; height: 38px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 18px; }
.food-section h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.food-section__count { color: var(--ink-3); font-size: 11px; font-weight: 750; }
.food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.food-card {
  min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); padding: 14px; cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.food-card:hover { transform: translateY(-2px); border-color: rgba(49,92,69,.25); box-shadow: var(--shadow-sm); }
.food-card__top { display: flex; align-items: flex-start; gap: 11px; }
.food-icon { width: 42px; height: 42px; border-radius: 14px; background: var(--surface-muted); display: grid; place-items: center; font-size: 22px; flex: none; }
.food-card__copy { min-width: 0; flex: 1; }
.food-card h4 { margin: 1px 0 5px; font-size: 13px; line-height: 1.2; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-card__meta { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-card__status { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status-pill { min-height: 24px; padding: 0 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 840; letter-spacing: .01em; }
.status-pill--fresh { background: var(--brand-soft); color: var(--brand); }
.status-pill--soon { background: var(--yellow-soft); color: #785714; }
.status-pill--low { background: var(--peach-soft); color: #824116; }
.status-pill--out, .status-pill--expired { background: var(--red-soft); color: var(--red); }
.status-pill--ready { background: var(--lime-soft); color: #455c1f; }
.status-pill--missing { background: var(--peach-soft); color: #874415; }
.food-card__qty { font-size: 10px; color: var(--ink-2); font-weight: 720; }
.progress-track { height: 5px; border-radius: 99px; background: var(--surface-muted); overflow: hidden; margin-top: 10px; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand-2); width: var(--progress); transition: width .25s ease; }
.progress-track.is-low span { background: var(--peach); }
.progress-track.is-soon span { background: #d3a84b; }
.progress-track.is-out span { background: var(--red); }

.empty-state { border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255,253,248,.52); padding: 42px 24px; text-align: center; }
.empty-state__icon { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); font-size: 27px; }
.empty-state h3 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.empty-state p { max-width: 480px; margin: 8px auto 18px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.recipe-plan-strip { border-radius: var(--radius-lg); background: linear-gradient(145deg, #f8edd9, #f4f1e9); border: 1px solid rgba(185,131,36,.13); padding: 18px; display: flex; align-items: center; gap: 16px; overflow-x: auto; }
.recipe-plan-strip__intro { min-width: 190px; }
.recipe-plan-strip__intro h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.025em; }
.recipe-plan-strip__intro p { margin: 0; font-size: 11px; color: var(--ink-2); line-height: 1.4; }
.plan-pill { min-width: 185px; max-width: 240px; border-radius: 16px; background: rgba(255,255,255,.72); border: 1px solid rgba(185,131,36,.12); padding: 12px; display: flex; align-items: center; gap: 10px; }
.plan-pill__emoji { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); font-size: 20px; flex: none; }
.plan-pill__copy { min-width: 0; }
.plan-pill__copy strong { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-pill__copy span { display: block; margin-top: 4px; font-size: 9px; color: var(--ink-3); }

.recipe-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(265px, 310px); gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }
.recipe-card { min-width: 0; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); scroll-snap-align: start; transition: transform .18s ease, box-shadow .18s ease; }
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.recipe-card__visual {
  height: 116px; position: relative; padding: 16px; display: flex; align-items: flex-end; overflow: hidden;
  background: var(--recipe-gradient, linear-gradient(145deg, #dfe9da, #f4e5cf));
}
.recipe-card__visual::before { content: ""; position: absolute; width: 100px; height: 100px; right: -20px; top: -30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); box-shadow: 0 0 0 18px rgba(255,255,255,.12), 0 0 0 36px rgba(255,255,255,.08); }
.recipe-card__emoji { font-size: 41px; filter: drop-shadow(0 5px 10px rgba(32,40,34,.13)); position: relative; z-index: 1; }
.recipe-card__readiness { position: absolute; top: 13px; left: 13px; z-index: 2; }
.recipe-card__favorite { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 11px; background: rgba(255,255,255,.74); display: grid; place-items: center; cursor: pointer; }
.recipe-card__favorite svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 2; }
.recipe-card__body { padding: 15px; }
.recipe-card__body h3 { margin: 0; font-size: 15px; line-height: 1.25; letter-spacing: -.025em; min-height: 38px; }
.recipe-card__tags { display: flex; gap: 6px; overflow: hidden; margin: 8px 0 13px; }
.mini-tag { min-height: 23px; border-radius: 99px; background: var(--surface-muted); color: var(--ink-2); padding: 0 8px; display: inline-flex; align-items: center; font-size: 8.5px; font-weight: 760; white-space: nowrap; }
.recipe-card__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recipe-meta-item { min-width: 0; }
.recipe-meta-item strong { display: block; font-size: 11px; }
.recipe-meta-item span { display: block; margin-top: 2px; font-size: 8px; color: var(--ink-3); }
.recipe-card__actions { display: flex; gap: 7px; margin-top: 12px; }
.recipe-card__actions .button:first-child { flex: 1; }

.shopping-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); align-items: start; gap: 18px; }
.shopping-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.shopping-card__header { padding: 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shopping-card__header h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.shopping-card__header p { margin: 5px 0 0; color: var(--ink-3); font-size: 11px; }
.quick-add { padding: 13px 17px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.quick-add input { flex: 1; min-width: 0; height: 41px; border: 1px solid var(--line); border-radius: 13px; padding: 0 13px; background: var(--surface-muted); }
.shopping-group { border-bottom: 1px solid var(--line); }
.shopping-group:last-child { border-bottom: 0; }
.shopping-group__title { padding: 14px 18px 8px; display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.shopping-row { min-height: 67px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 32px; gap: 9px; align-items: center; padding: 10px 15px; border-top: 1px solid rgba(38,58,47,.06); }
.shopping-row.is-complete { opacity: .5; }
.shopping-row.is-complete .shopping-row__copy strong { text-decoration: line-through; }
.check-button { width: 26px; height: 26px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.check-button.is-checked { background: var(--brand); border-color: var(--brand); color: white; }
.check-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.shopping-row__copy { min-width: 0; }
.shopping-row__copy strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopping-row__copy span { display: block; margin-top: 4px; font-size: 9px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopping-row__qty { text-align: right; font-size: 10px; font-weight: 760; color: var(--ink-2); white-space: nowrap; }
.row-menu { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.row-menu:hover { background: var(--surface-muted); color: var(--red); }
.row-menu svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.price-panel { position: sticky; top: 96px; display: grid; gap: 12px; }
.price-panel__head { padding: 20px; border-radius: var(--radius-lg); background: var(--brand); color: white; }
.price-panel__head h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.price-panel__head p { margin: 7px 0 15px; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.45; }
.price-panel__head .button { width: 100%; background: var(--lime); color: var(--ink); box-shadow: none; }
.store-estimate { border-radius: 18px; border: 1px solid var(--line); background: var(--surface); padding: 16px; position: relative; }
.store-estimate.is-cheapest { border-color: rgba(49,92,69,.32); box-shadow: 0 10px 24px rgba(49,92,69,.08); }
.cheapest-flag { position: absolute; top: 12px; right: 12px; border-radius: 99px; background: var(--lime-soft); color: #4d611f; padding: 5px 8px; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.store-estimate__name { font-size: 11px; font-weight: 780; color: var(--ink-2); }
.store-estimate__price { margin: 8px 0 5px; font-size: 29px; letter-spacing: -.055em; font-weight: 800; }
.store-estimate__meta { font-size: 9px; color: var(--ink-3); }
.coverage-track { height: 4px; border-radius: 99px; background: var(--surface-muted); margin-top: 11px; overflow: hidden; }
.coverage-track span { display: block; height: 100%; background: var(--brand-2); width: var(--coverage); }
.price-disclaimer { padding: 0 4px; font-size: 9px; color: var(--ink-3); line-height: 1.5; }

.mobile-nav { display: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(21,31,25,.46); backdrop-filter: blur(9px); display: grid; place-items: center; padding: 18px; animation: fade-in .18s ease; }
.modal-backdrop--drawer { place-items: stretch end; padding: 0; }
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(100%, 680px); max-height: min(92vh, 860px); overflow: auto; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.7); animation: modal-in .22s ease;
}
.modal--wide { width: min(100%, 940px); }
.modal--small { width: min(100%, 500px); }
.modal--drawer { width: min(100%, 560px); height: 100vh; max-height: none; border-radius: 28px 0 0 28px; animation: drawer-in .22s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(24px); } }
.modal__header { position: sticky; top: 0; z-index: 3; min-height: 75px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.94); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.modal__header h2 { margin: 0; font-size: 21px; line-height: 1.15; letter-spacing: -.04em; }
.modal__header p { margin: 5px 0 0; font-size: 10px; color: var(--ink-3); }
.modal__body { padding: 22px; }
.modal__footer { position: sticky; bottom: 0; z-index: 3; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.94); backdrop-filter: blur(14px); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.detail-hero { min-height: 180px; border-radius: 23px; padding: 24px; background: var(--recipe-gradient, linear-gradient(145deg, #dfe9da, #f4e5cf)); display: flex; align-items: flex-end; position: relative; overflow: hidden; }
.detail-hero::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; right: -45px; top: -60px; border: 1px solid rgba(255,255,255,.6); box-shadow: 0 0 0 25px rgba(255,255,255,.13), 0 0 0 50px rgba(255,255,255,.08); }
.detail-hero__emoji { font-size: 68px; filter: drop-shadow(0 10px 18px rgba(32,40,34,.13)); position: relative; z-index: 1; }
.detail-title { padding: 20px 2px 7px; }
.detail-title h2 { margin: 0; font-size: clamp(27px, 4vw, 40px); line-height: 1.03; letter-spacing: -.06em; }
.detail-title p { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.macro-card { border-radius: 15px; padding: 12px; background: var(--surface-muted); }
.macro-card strong { display: block; font-size: 16px; letter-spacing: -.035em; }
.macro-card span { display: block; margin-top: 4px; color: var(--ink-3); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; font-weight: 780; }

.batch-planner { margin: 18px 0; border-radius: 20px; background: linear-gradient(145deg, var(--brand-soft), #edf1e6); border: 1px solid rgba(49,92,69,.1); padding: 16px; display: grid; gap: 14px; }
.batch-planner__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.batch-planner h3 { margin: 0; font-size: 15px; letter-spacing: -.025em; }
.batch-planner p { margin: 5px 0 0; color: var(--ink-2); font-size: 10px; line-height: 1.4; }
.stepper-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.stepper-row label { font-size: 11px; font-weight: 750; }
.stepper-row label span { display: block; margin-top: 4px; color: var(--ink-3); font-size: 9px; font-weight: 500; }
.stepper { display: inline-grid; grid-template-columns: 34px minmax(40px, auto) 34px; align-items: center; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--brand); }
.stepper strong { min-width: 40px; text-align: center; font-size: 12px; }
.quick-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-count { width: 32px; height: 29px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; font-size: 10px; font-weight: 750; }
.quick-count.is-active { background: var(--brand); color: white; border-color: var(--brand); }

.detail-section { margin-top: 22px; }
.detail-section__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.detail-section h3 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.detail-section__head span { color: var(--ink-3); font-size: 10px; }
.ingredient-list { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.ingredient-row { min-height: 57px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.ingredient-row:last-child { border-bottom: 0; }
.availability-icon { width: 23px; height: 23px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 850; }
.availability-icon--yes { background: var(--brand-soft); color: var(--brand); }
.availability-icon--partial { background: var(--yellow-soft); color: #7a5811; }
.availability-icon--no { background: var(--red-soft); color: var(--red); }
.ingredient-row__copy strong { display: block; font-size: 11px; }
.ingredient-row__copy span { display: block; margin-top: 3px; font-size: 8px; color: var(--ink-3); }
.ingredient-row__qty { font-size: 9px; font-weight: 740; color: var(--ink-2); text-align: right; }
.steps-list { display: grid; gap: 10px; counter-reset: steps; }
.step-card { counter-increment: steps; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 11px; align-items: start; padding: 12px; border-radius: 15px; background: var(--surface-muted); color: var(--ink-2); font-size: 11px; line-height: 1.55; }
.step-card::before { content: counter(steps); width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: white; font-weight: 800; }

.food-detail-head { display: flex; align-items: center; gap: 14px; }
.food-detail-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); font-size: 32px; }
.food-detail-head h2 { margin: 0; font-size: 26px; letter-spacing: -.05em; }
.food-detail-head p { margin: 6px 0 0; font-size: 10px; color: var(--ink-3); }
.food-snapshot { margin-top: 17px; border-radius: 20px; padding: 16px; background: var(--surface-muted); }
.food-snapshot__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.food-snapshot__top strong { font-size: 26px; letter-spacing: -.055em; }
.food-snapshot__top span { font-size: 10px; color: var(--ink-3); }
.nutrition-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 14px; }
.nutrition-cell { border-radius: 14px; padding: 11px; background: var(--surface); }
.nutrition-cell strong { display: block; font-size: 14px; }
.nutrition-cell span { display: block; margin-top: 3px; font-size: 8px; color: var(--ink-3); }
.feedback-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.feedback-button { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); min-height: 74px; padding: 10px; cursor: pointer; text-align: left; }
.feedback-button:hover { border-color: rgba(49,92,69,.28); background: var(--brand-soft); }
.feedback-button strong { display: block; font-size: 10px; }
.feedback-button span { display: block; margin-top: 5px; font-size: 8px; line-height: 1.35; color: var(--ink-3); }
.lot-list { display: grid; gap: 8px; }
.lot-card { border: 1px solid var(--line); border-radius: 14px; padding: 11px; display: flex; justify-content: space-between; gap: 12px; }
.lot-card strong { display: block; font-size: 10px; }
.lot-card span { display: block; margin-top: 4px; font-size: 8px; color: var(--ink-3); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: 9px; font-weight: 820; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.form-field small { color: var(--ink-3); font-size: 8px; line-height: 1.4; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-strong); color: var(--ink); }
.input, .select { height: 43px; padding: 0 12px; }
.textarea { min-height: 100px; padding: 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(49,92,69,.38); }
.toggle-row { min-height: 54px; border: 1px solid var(--line); border-radius: 15px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.toggle-row__copy strong { display: block; font-size: 10px; }
.toggle-row__copy span { display: block; margin-top: 4px; font-size: 8px; color: var(--ink-3); line-height: 1.35; }
.toggle { width: 45px; height: 26px; padding: 3px; border: 0; border-radius: 99px; background: #d7dcd8; cursor: pointer; transition: background .18s ease; flex: none; }
.toggle::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform .18s ease; }
.toggle.is-on { background: var(--brand); }
.toggle.is-on::after { transform: translateX(19px); }

.builder-ingredient { display: grid; grid-template-columns: minmax(0, 1fr) 88px 100px 32px; gap: 7px; align-items: center; margin-bottom: 7px; }
.builder-ingredient .input, .builder-ingredient .select { height: 39px; font-size: 11px; }
.builder-preview { border-radius: 18px; padding: 15px; background: var(--brand-soft); display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.builder-preview__cell strong { display: block; font-size: 15px; }
.builder-preview__cell span { display: block; margin-top: 3px; font-size: 8px; color: var(--ink-2); }

.receipt-source-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0; }
.receipt-source { border: 1px solid var(--line); border-radius: 15px; padding: 12px; background: var(--surface); cursor: pointer; text-align: left; }
.receipt-source.is-active { border-color: var(--brand); background: var(--brand-soft); }
.receipt-source strong { display: block; font-size: 10px; }
.receipt-source span { display: block; margin-top: 4px; font-size: 8px; color: var(--ink-3); line-height: 1.35; }
.receipt-review { border: 1px solid var(--line); border-radius: 17px; overflow: hidden; margin-top: 14px; }
.receipt-review-row { display: grid; grid-template-columns: 26px minmax(0,1fr) 170px 64px; gap: 8px; align-items: center; padding: 9px; border-bottom: 1px solid var(--line); }
.receipt-review-row:last-child { border-bottom: 0; }
.receipt-review-row__name strong { display: block; font-size: 10px; }
.receipt-review-row__name span { display: block; margin-top: 3px; font-size: 8px; color: var(--ink-3); }
.receipt-review-row .select { height: 36px; font-size: 9px; }
.receipt-review-row__price { text-align: right; font-size: 10px; font-weight: 760; }

.onboarding-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 75% 20%, rgba(214,232,135,.38), transparent 32%), linear-gradient(145deg, #e9eee4, #f4eee4); }
.onboarding { width: min(100%, 920px); max-height: min(94vh, 880px); border-radius: 32px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 300px minmax(0,1fr); }
.onboarding-side { padding: 30px; background: var(--brand); color: white; display: flex; flex-direction: column; min-height: 650px; position: relative; overflow: hidden; }
.onboarding-side::after { content: ""; position: absolute; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; right: -160px; bottom: -70px; box-shadow: 0 0 0 35px rgba(255,255,255,.025), 0 0 0 70px rgba(255,255,255,.02); }
.onboarding-brand { display: flex; align-items: center; gap: 12px; }
.onboarding-brand strong { font-size: 22px; letter-spacing: -.045em; }
.onboarding-side h2 { margin: 70px 0 12px; font-size: 38px; line-height: .98; letter-spacing: -.065em; }
.onboarding-side p { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.55; }
.onboarding-progress { margin-top: auto; display: grid; gap: 11px; position: relative; z-index: 1; }
.progress-step { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.45); font-size: 10px; font-weight: 720; }
.progress-step i { width: 20px; height: 20px; border-radius: 7px; border: 1px solid rgba(255,255,255,.24); display: grid; place-items: center; font-style: normal; font-size: 8px; }
.progress-step.is-active { color: white; }
.progress-step.is-active i { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.progress-step.is-done { color: rgba(255,255,255,.75); }
.progress-step.is-done i { background: rgba(255,255,255,.16); }
/* `min-height: 0` is load-bearing: a grid/flex item defaults to a minimum size of its
   own content, so without it this column refuses to shrink, grows past the card's
   fixed height, and the footer holding the only Continue button is clipped by the
   card's `overflow: hidden`. The body below scrolls instead once this is set. */
.onboarding-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; max-height: min(94vh, 880px); }
.onboarding-body { flex: 1; overflow: auto; padding: 40px 42px 26px; }
.onboarding-body h1 { margin: 0; font-size: 31px; line-height: 1.05; letter-spacing: -.055em; }
.onboarding-body > p { margin: 10px 0 24px; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.onboarding-footer { padding: 15px 28px calc(15px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter-card { min-height: 75px; border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.counter-card strong { display: block; font-size: 12px; }
.counter-card span { display: block; margin-top: 4px; color: var(--ink-3); font-size: 9px; }
.counter-control { display: grid; grid-template-columns: 34px 34px 34px; align-items: center; }
.counter-control button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 17px; }
.counter-control b { text-align: center; font-size: 13px; }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.choice-card { min-height: 70px; border: 1px solid var(--line); border-radius: 17px; padding: 13px; background: var(--surface); cursor: pointer; text-align: left; }
.choice-card.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(49,92,69,.1); }
.choice-card strong { display: block; font-size: 11px; }
.choice-card span { display: block; margin-top: 5px; font-size: 8px; color: var(--ink-3); line-height: 1.45; }
.tag-entry { min-height: 44px; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 7px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tag-entry input { min-width: 120px; flex: 1; height: 28px; border: 0; outline: 0; background: transparent; padding: 0 5px; font-size: 11px; }
.tag-entry__tag { border-radius: 99px; background: var(--brand-soft); color: var(--brand); padding: 6px 9px; font-size: 9px; font-weight: 740; }
.store-choice { border: 1px solid var(--line); border-radius: 17px; padding: 13px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.store-logo { width: 42px; height: 42px; border-radius: 13px; background: var(--surface-muted); display: grid; place-items: center; font-size: 18px; font-weight: 900; }
.store-choice strong { display: block; font-size: 11px; }
.store-choice span { display: block; margin-top: 4px; color: var(--ink-3); font-size: 8px; }

.settings-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.settings-section:first-child { padding-top: 0; }
.settings-section:last-child { border-bottom: 0; }
.settings-section h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.025em; }
.settings-section > p { margin: -5px 0 13px; color: var(--ink-3); font-size: 9px; line-height: 1.45; }
.account-card { border-radius: 18px; padding: 15px; background: var(--brand-soft); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-card strong { display: block; font-size: 11px; }
.account-card span { display: block; margin-top: 4px; color: var(--ink-2); font-size: 9px; }
/* The alias is meant to be read and copied, so keep it monospaced and breakable. */
.account-card--alias strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.setup-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 10px; }
.setup-steps li { line-height: 1.45; }

.toast-stack { position: fixed; z-index: 300; right: 18px; bottom: 18px; display: grid; gap: 9px; pointer-events: none; }
.toast { width: min(360px, calc(100vw - 36px)); border-radius: 16px; padding: 13px 14px; background: #233a2e; color: white; box-shadow: var(--shadow-md); display: flex; gap: 10px; align-items: flex-start; animation: toast-in .25s ease; pointer-events: auto; }
.toast--error { background: #713430; }
.toast--warning { background: #6d531f; }
.toast__icon { width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; font-size: 12px; }
.toast strong { display: block; font-size: 10px; }
.toast span { display: block; margin-top: 4px; font-size: 9px; line-height: 1.4; color: rgba(255,255,255,.72); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.skeleton { border-radius: 13px; background: linear-gradient(90deg, var(--surface-muted), #f8f5ee, var(--surface-muted)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.text-danger { color: var(--red); }
.text-brand { color: var(--brand); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

@media (max-width: 1080px) {
  :root { --sidebar: 84px; }
  .sidebar { padding-inline: 14px; }
  .brand-lockup { justify-content: center; padding-inline: 0; }
  .brand-copy, .nav-button > span:not(.nav-icon):not(.nav-badge), .kitchen-card, .sidebar-action > span:not(.sync-dot) { display: none; }
  .nav-button { justify-content: center; padding: 0; }
  .nav-badge { position: absolute; margin: -28px 0 0 30px; min-width: 19px; height: 19px; padding: 0 5px; font-size: 8px; }
  .sidebar-action { justify-content: center; padding: 0; }
  .shopping-layout { grid-template-columns: minmax(0,1fr) 310px; }
}

@media (max-width: 840px) {
  :root { --sidebar: 0px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-column { grid-column: 1; }
  .topbar { height: 68px; padding: 0 17px; }
  .topbar__title p { display: none; }
  .topbar__title h1 { font-size: 24px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; }
  .mobile-brand strong { font-size: 17px; letter-spacing: -.04em; }
  .topbar__title { display: none; }
  .content { padding: 14px 15px 102px; }
  .hero-grid { grid-template-columns: 1fr; }
  .summary-card { display: none; }
  .hero-card { min-height: 222px; border-radius: 25px; padding: 24px; }
  .hero-card h2 { font-size: 34px; }
  .section-heading { align-items: flex-start; }
  .section-heading__actions .button:not(.keep-mobile) { display: none; }
  .food-section { padding: 13px; border-radius: 21px; }
  .food-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .food-card { padding: 12px; }
  .food-icon { width: 38px; height: 38px; font-size: 19px; }
  .food-card__top { gap: 8px; }
  .food-card__qty { display: none; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recipe-rail { grid-auto-columns: minmax(250px, 78vw); }
  .shopping-layout { grid-template-columns: 1fr; }
  .price-panel { position: static; grid-template-columns: repeat(3,1fr); }
  .price-panel__head { grid-column: 1 / -1; }
  .store-estimate__price { font-size: 24px; }
  .mobile-nav {
    position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(9px + env(safe-area-inset-bottom)); height: 66px; padding: 6px;
    display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; border: 1px solid rgba(38,58,47,.12); border-radius: 22px; background: rgba(255,253,248,.92); backdrop-filter: blur(20px); box-shadow: 0 14px 40px rgba(25,36,29,.18);
  }
  .mobile-nav button { border: 0; border-radius: 17px; background: transparent; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--ink-3); cursor: pointer; font-size: 8px; font-weight: 780; }
  .mobile-nav button.is-active { background: var(--brand); color: white; }
  .mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
  .modal--drawer { width: 100%; border-radius: 24px 24px 0 0; height: min(92vh, 900px); align-self: end; }
  .modal-backdrop--drawer { place-items: end stretch; }
  /* Stacked layout: the header row sizes to content and the main column takes the
     rest. `minmax(0,1fr)` rather than `1fr` so the track may shrink below content. */
  .onboarding { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); max-height: 95vh; border-radius: 26px; }
  .onboarding-side { min-height: auto; padding: 20px; flex-direction: row; align-items: center; justify-content: space-between; }
  .onboarding-side h2, .onboarding-side > p { display: none; }
  .onboarding-progress { margin: 0; display: flex; gap: 5px; }
  .progress-step span { display: none; }
  .onboarding-body { padding: 28px 22px 20px; }
  .onboarding-body h1 { font-size: 27px; }
}

@media (max-width: 570px) {
  .topbar__actions .button { display: none; }
  .content-stack { gap: 22px; }
  .hero-card { min-height: 240px; }
  .hero-card__actions .button { flex: 1; min-width: 130px; }
  .section-heading h2 { font-size: 22px; }
  .toolbar { align-items: stretch; }
  .search-box { flex-basis: 100%; max-width: none; }
  .food-grid { grid-template-columns: 1fr; }
  .food-card__qty { display: block; }
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-card__visual { height: 128px; }
  .shopping-card__header { align-items: flex-start; }
  .quick-add { padding: 10px; }
  .shopping-row { grid-template-columns: 32px minmax(0,1fr) auto 28px; padding-inline: 10px; }
  .price-panel { grid-template-columns: 1fr; }
  .price-panel__head { grid-column: auto; }
  .store-estimate { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .store-estimate__price { margin: 0; }
  .store-estimate__meta, .coverage-track { grid-column: 1 / -1; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
  .modal__body { padding: 17px; }
  .modal__footer { justify-content: stretch; }
  .modal__footer .button { flex: 1; }
  .macro-grid, .nutrition-grid { grid-template-columns: repeat(2,1fr); }
  .feedback-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field--full { grid-column: auto; }
  .builder-ingredient { grid-template-columns: minmax(0,1fr) 70px 83px 30px; }
  .receipt-source-grid { grid-template-columns: 1fr; }
  .receipt-review-row { grid-template-columns: 24px minmax(0,1fr) 56px; }
  .receipt-review-row .select { grid-column: 2 / -1; }
  .choice-grid { grid-template-columns: 1fr; }
  .onboarding-backdrop { padding: 0; place-items: end stretch; }
  .onboarding { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
  /* A phone's browser chrome counts toward vh but not dvh, so vh alone leaves the
     footer sitting underneath the URL bar even when the layout is otherwise right. */
  @supports (height: 100dvh) {
    .onboarding { max-height: 100dvh; height: 100dvh; }
  }
  .onboarding-main { max-height: none; min-height: 0; }
  .onboarding-side { padding-top: calc(16px + env(safe-area-inset-top)); }
  .onboarding-body { padding-top: 24px; }
  /* Skip link plus Back plus Continue overflow one row under about 390px, which
     pushed the primary action past the right edge and clipped it. Wrapping drops
     the skip link to its own line and keeps the action intact and full width. */
  .onboarding-footer { flex-wrap: wrap; padding-inline: 18px; }
  .onboarding-footer > div { flex: 1 1 auto; justify-content: flex-end; }
  .counter-card { min-height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Recent grocery log */
.purchase-log { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.purchase-log-card { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); padding: 12px; box-shadow: 0 6px 20px rgba(35,55,43,.035); }
.purchase-log-card__mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 900; }
.purchase-log-card__copy { min-width: 0; }
.purchase-log-card__copy > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.purchase-log-card__copy strong { font-size: 11px; }
.purchase-log-card__copy span, .purchase-log-card__copy small { color: var(--ink-3); font-size: 8px; }
.purchase-log-card__copy p { margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 9px; }
.purchase-log-card__copy small { display: block; }
.purchase-log-card__total { font-size: 11px; white-space: nowrap; }
@media (max-width: 700px) { .purchase-log { grid-template-columns: 1fr; } }

.recipe-cost-panel {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.recipe-cost-panel h3 { margin: 2px 0 4px; font-size: 17px; }
.recipe-cost-panel p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.recipe-cost-grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.recipe-cost-chip {
  min-width: 104px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  display: grid;
  gap: 2px;
}
.recipe-cost-chip span { color: var(--muted); font-size: 9px; font-weight: 750; }
.recipe-cost-chip strong { font-size: 15px; }
.recipe-cost-chip.is-cheapest { border-color: #aac794; background: #f0f6d9; }
@media (max-width: 640px) {
  .recipe-cost-panel { grid-template-columns: 1fr; }
  .recipe-cost-grid { justify-content: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recipe-cost-chip { min-width: 0; padding: 9px; }
}

/* Low-waste weekly planner */
.smart-week {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(0, 1.45fr);
  gap: 0;
  border: 1px solid rgba(53, 81, 62, .14);
  border-radius: 28px;
  background: linear-gradient(145deg, #243d30 0%, #345543 100%);
  box-shadow: 0 18px 42px rgba(33, 54, 41, .14);
  color: white;
}
.smart-week__intro { padding: 30px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.smart-week__intro .eyebrow { color: #d7e9c6; }
.smart-week__intro h2 { margin: 5px 0 9px; max-width: 420px; color: white; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.045em; }
.smart-week__intro > p:not(.eyebrow) { margin: 0; max-width: 510px; color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.65; }
.smart-week__intro .button { margin-top: 18px; }
.smart-week__stats { width: 100%; margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.smart-week__stats span { min-width: 0; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.065); color: rgba(255,255,255,.68); font-size: 8px; line-height: 1.25; }
.smart-week__stats strong { display: block; margin-bottom: 2px; color: white; font-size: 16px; }
.smart-week__recipes { padding: 15px; display: grid; gap: 8px; align-content: center; background: rgba(255,255,255,.06); }
.smart-week-card { width: 100%; min-width: 0; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.97); padding: 13px 14px; display: grid; grid-template-columns: 24px 42px minmax(0,1fr) 24px; gap: 10px; align-items: center; color: var(--ink); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.smart-week-card:hover { transform: translateY(-1px); border-color: rgba(69,105,78,.34); box-shadow: 0 10px 28px rgba(22,38,28,.12); }
.smart-week-card__number { color: var(--ink-3); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.smart-week-card__emoji { width: 42px; height: 42px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; font-size: 22px; }
.smart-week-card__copy { min-width: 0; display: grid; gap: 2px; }
.smart-week-card__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.smart-week-card__copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); font-size: 8px; font-weight: 760; }
.smart-week-card__copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 8px; }
.smart-week-card__arrow { color: var(--ink-3); }
.smart-week-card__arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Inventory confidence and price learning */
.food-card__confidence { display: block; margin-top: 4px; color: var(--ink-3); font-size: 7px; font-weight: 760; }
.food-card__confidence--low { color: #a35a42; }
.food-snapshot__signals { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.confidence-pill { border-radius: 999px; padding: 4px 7px; font-size: 7px; font-weight: 820; letter-spacing: .01em; }
.confidence-pill--high { background: #eaf4e3; color: #416644; }
.confidence-pill--medium { background: #f6efd9; color: #796329; }
.confidence-pill--low { background: #f8e5df; color: #995a46; }
.price-intelligence-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.price-intelligence-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); display: grid; gap: 3px; }
.price-intelligence-card > span { color: var(--ink-3); font-size: 8px; font-weight: 820; letter-spacing: .055em; text-transform: uppercase; }
.price-intelligence-card strong { overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.price-intelligence-card small { color: var(--ink-3); font-size: 8px; line-height: 1.45; }
.price-intelligence-card--best { border-color: #b8cda8; background: #f0f6e4; }
.empty-inline { border: 1px dashed var(--line-strong); border-radius: 15px; background: var(--surface-2); padding: 15px; display: grid; gap: 4px; }
.empty-inline strong { font-size: 11px; }
.empty-inline span { color: var(--ink-3); font-size: 9px; line-height: 1.55; }
.replenishment-grid { margin-top: 13px; }

@media (max-width: 840px) {
  .smart-week { grid-template-columns: 1fr; }
  .smart-week__intro { padding: 24px; }
  .smart-week__recipes { padding: 12px; }
}
@media (max-width: 570px) {
  .smart-week { border-radius: 23px; }
  .smart-week__intro { padding: 21px; }
  .smart-week__intro h2 { font-size: 25px; }
  .smart-week__stats { gap: 5px; }
  .smart-week__stats span { padding: 8px 7px; }
  .smart-week-card { grid-template-columns: 19px 38px minmax(0,1fr); padding: 11px; }
  .smart-week-card__emoji { width: 38px; height: 38px; }
  .smart-week-card__arrow { display: none; }
  .price-intelligence-grid { grid-template-columns: 1fr; }
  .food-snapshot__signals { align-items: flex-end; }
}
