:root {
  color-scheme: light;
  --page: #fcfaf5;
  --surface: #fffefa;
  --ink: #232c21;
  --muted: #515a4d;
  --line: #e9e5d7;
  --green: #234234;
  --dark: #1c352a;
  --tint: #e9efe2;
  --sun: #f5cc68;
  --sun-hover: #f8d982;
  --warning: #74430e;
  --soft: #f5f0e4;
  --radius: 19px;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
h1, h2, .meal-title { font-family: var(--serif); font-weight: 500; letter-spacing: -.046em; line-height: 1.04; }
a { color: var(--green); text-underline-offset: .16em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, a, input, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #7c6830; outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; left: 1rem; top: .65rem; padding: .7rem 1rem; background: white; z-index: 10; }
.load-state { padding: 3rem 0; }

.topbar { border-bottom: 1px solid var(--line); background: var(--page); }
.top-inner { width: min(100% - 2rem, 72rem); min-height: 4.2rem; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: inline-flex; align-items: center; gap: .02em; padding: .35rem 0; min-height: 44px; border: 0; background: none; font-weight: 850; font-size: 2.05rem; line-height: 1; letter-spacing: -.095em; color: var(--green); }
.wordmark > span:last-child { color: #a46423; }
.brand-mark { width: 1.4rem; height: 1.4rem; margin-right: .38rem; display: grid; grid-template: repeat(2, 1fr) / repeat(2, 1fr); gap: 2px; transform: rotate(-11deg); }
.brand-mark i { background: var(--green); border-radius: .18rem; }
.brand-mark i:nth-child(2) { background: #d39739; border-radius: .36rem .18rem .18rem .18rem; }
.desktop-nav { display: none; }
.settings-button, .quiet-button { min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: .38rem .85rem; background: var(--surface); font-size: .875rem; font-weight: 650; white-space: nowrap; }
.settings-button:hover, .quiet-button:hover { background: var(--soft); }
.settings-icon { margin-right: .2rem; font-size: 1.12em; }
.mobile-nav { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); z-index: 3; background: var(--page); border-top: 1px solid var(--line); padding: .25rem .6rem max(.35rem, env(safe-area-inset-bottom)); }
.mobile-nav button { min-height: 52px; display: grid; justify-items: center; align-content: center; gap: .32rem; background: none; border: 0; border-radius: .7rem; font-size: .79rem; line-height: 1.1; color: var(--muted); }
.mobile-nav button[aria-current] { background: var(--tint); color: var(--green); font-weight: 700; }
.nav-icon { height: .96rem; width: 1.03rem; border: 1.6px solid currentColor; display: inline-block; position: relative; border-radius: .17rem; }
.calendar::before { position: absolute; content: ""; left: 0; right: 0; top: 3px; border-bottom: 1.5px solid; }
.basket { height: .69rem; margin-top: .27rem; border-radius: 0 0 .22rem .22rem; }
.basket::before { position: absolute; content: ""; width: .48rem; height: .35rem; border: 1.5px solid; border-bottom: 0; border-radius: .25rem .25rem 0 0; top: -.37rem; left: .17rem; }
.cupboard::before { position: absolute; content: ""; top: 0; bottom: 0; left: 45%; border-left: 1.5px solid; }

.shell { width: min(100% - 2rem, 72rem); margin-inline: auto; padding-block: 1.7rem calc(5.8rem + env(safe-area-inset-bottom)); }
.shell:focus { outline: none; }
.intro { margin-bottom: 1.2rem; }
.context { margin-bottom: .6rem; font-size: .875rem; font-weight: 700; color: var(--muted); }
.intro h1 { font-size: clamp(2.7rem, 9vw, 5rem); }
.intro > p:last-child { margin-top: .68rem; color: var(--muted); }
.workspace { display: grid; gap: 1.4rem; align-items: start; }
.column { min-width: 0; }
.overview { grid-row: 1; min-width: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: .65rem; margin-bottom: .85rem; }
.section-heading h2 { font-size: clamp(1.7rem, 4vw, 2.23rem); }
.section-heading p { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.section-note { margin-bottom: .9rem; color: var(--muted); }

.summary { color: white; background: var(--green); border-radius: var(--radius); padding: 1.05rem 1.15rem 1.1rem; }
.summary h2 { font: 650 .91rem/1.3 "Segoe UI", system-ui, sans-serif; letter-spacing: normal; color: #e4ede0; }
.checkout { margin: .23rem 0 .55rem; font: 400 clamp(2.1rem, 7vw, 3.45rem)/1 var(--serif); letter-spacing: -.06em; }
.summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: .58rem 0 .7rem; margin: 0 0 .75rem; border-block: 1px solid #5d7568; }
.summary-stats div { min-width: 0; }
.summary-stats dt { color: #e0e9de; font-size: .82rem; }
.summary-stats dd { margin: .02rem 0 0; font-size: 1.06rem; font-weight: 700; }
.summary-meta { display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.summary-meta p { font-size: .78rem; color: #e0e9de; max-width: 18ch; }
.summary-missing { margin-bottom: .8rem; font-size: .875rem; color: #f4e7c8; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; padding: .55rem .9rem; border-radius: .62rem; font-weight: 700; font-size: .875rem; text-decoration: none; background: var(--surface); }
.primary { background: var(--sun); color: #292315; }
.primary:hover { background: var(--sun-hover); }
.outline { border-color: var(--line); color: var(--green); }
.outline:hover { background: var(--tint); }
.dark-button { background: var(--green); color: white; }
.dark-button:hover { background: var(--dark); }
.soft-button { background: var(--tint); color: var(--green); }
.soft-button:hover { background: #dce6d4; }

.meal-list { display: grid; gap: .65rem; }
.meal-card { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); align-items: center; column-gap: .77rem; padding: .58rem .67rem .58rem .58rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.meal-card.main-meal { border-color: #d8c58a; }
.meal-photo, .recipe-photo, .step-photo { background-color: #dadfd1; background-position: center; background-repeat: no-repeat; overflow: hidden; }
.meal-card > .meal-photo { grid-row: 1 / span 2; }
.meal-photo { border-radius: .72rem; width: 100%; aspect-ratio: 1; align-self: center; }
.photo-chicken { background-image: url("./assets/chicken-bowl.jpg"); background-size: cover; }
.photo-skillet { background-image: url("./assets/skillet.jpg"); background-size: cover; }
.photo-shrimp, .photo-pork, .photo-shakshuka, .photo-curry, .photo-meatballs, .photo-frittata { background-image: url("./assets/dinners.jpg"); background-size: 200% 300%; }
.photo-shrimp { background-position: 0 0; }
.photo-pork { background-position: 100% 0; }
.photo-shakshuka { background-position: 0 50%; }
.photo-curry { background-position: 100% 50%; }
.photo-meatballs { background-position: 0 100%; }
.photo-frittata { background-position: 100% 100%; }
.meal-body { min-width: 0; grid-column: 2; align-self: end; }
.meal-order { color: var(--muted); font-size: .77rem; font-weight: 700; }
.meal-title { font-size: clamp(1.35rem, 5.1vw, 1.93rem); }
.meal-title button { padding: .17rem 0; color: var(--ink); border: 0; background: none; font: inherit; letter-spacing: inherit; text-align: left; }
.meal-title button:hover { text-decoration: underline; text-underline-offset: .11em; text-decoration-thickness: 1px; }
.meal-subtitle { display: none; font-size: .88rem; color: var(--muted); }
.meal-time { color: var(--muted); font-size: .82rem; }
.meal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; grid-column: 2; grid-row: 2; align-self: start; }
.swap { border: 0; background: transparent; color: var(--green); font-size: .82rem; font-weight: 700; padding: .4rem .15rem; min-height: 44px; }
.swap:hover { text-decoration: underline; text-underline-offset: .18em; }
.meal-price { font-size: .86rem; font-weight: 700; color: var(--green); }
.empty-meal { grid-template-columns: minmax(0,1fr) auto; padding: .85rem; }
.empty-meal .meal-title { margin-top: .18rem; font-size: 1.35rem; }
.empty-meal p:not(.meal-order) { color: var(--muted); font-size: .875rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.panel + .panel { margin-top: .8rem; }
.panel h2 { font-size: 1.66rem; }
.panel details { margin-top: .6rem; }
.panel summary { color: var(--green); cursor: pointer; padding-block: .35rem; font-weight: 700; }
.panel p { color: var(--muted); }
.group-caption { margin-bottom: .4rem; color: var(--muted); font-size: .86rem; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-row { border-bottom: 1px solid var(--line); padding-block: .75rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .7rem; }
.item-row:last-child { border-bottom: 0; padding-bottom: .2rem; }
.item-label { display: flex; align-items: start; gap: .6rem; min-width: 0; font-weight: 650; }
.item-label input { width: 1.2rem; height: 1.2rem; margin: .12rem 0 0; flex: none; accent-color: var(--green); }
.item-label:has(input) { cursor: pointer; }
.item-row.is-checked .item-label span { text-decoration: line-through; color: var(--muted); }
.item-price { text-align: right; font-weight: 730; }
.item-meta { grid-column: 1 / -1; margin: .1rem 0 0 1.8rem; color: var(--muted); font-size: .82rem; }
.item-meta.no-check { margin-left: 0; }
.item-meta a, .item-meta button { font-size: inherit; }
.item-meta a { margin-right: .8rem; }
.link-button { color: var(--green); border: 0; background: none; padding: .35rem 0; min-height: 40px; font-weight: 650; text-decoration: underline; text-underline-offset: .15em; }
.item-missing { color: var(--warning); font-size: .83rem; }
.plan-note { margin: .85rem 0 0; font-size: .83rem; color: var(--muted); }
.pantry-nav { margin: .4rem 0 1rem; }
.pantry-row { padding-block: .65rem; border-bottom: 1px solid var(--line); }
.pantry-row:last-child { border-bottom: 0; }
.pantry-row label { font-weight: 650; }
.pantry-control { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-top: .25rem; }
.pantry-control input { width: 5.3rem; min-height: 44px; border: 1px solid #c7c9b9; border-radius: .5rem; padding-inline: .45rem; background: white; }
.pantry-control > span { color: var(--muted); font-size: .87rem; }
.pantry-tools { display: flex; flex-wrap: wrap; gap: .45rem; margin: .65rem 0; }
.pantry-meta { margin-top: .25rem; }
.pantry-meta small { font-size: .82rem; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); width: min(100% - 1.1rem, 38rem); max-height: min(90dvh, 52rem); color: var(--ink); padding: 0; background: var(--surface); box-shadow: 0 1.4rem 5rem #16261e44; }
dialog::backdrop { background: #15291dc0; }
.dialog-inner { padding: 1.1rem; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; }
.dialog-heading h2 { font-size: clamp(1.9rem, 7vw, 2.6rem); }
.dialog-heading p { color: var(--muted); margin-top: .4rem; }
.close-dialog { flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--page); font-size: 1.4rem; }
.field { display: grid; gap: .32rem; margin-block: .85rem; font-weight: 650; }
.field select { appearance: none; width: 100%; min-height: 45px; border: 1px solid #cbd0be; border-radius: .55rem; padding: .4rem 2.5rem .4rem .65rem; font-weight: 500; background: linear-gradient(45deg, transparent 50%, var(--green) 50%) right 1.13rem center / .35rem .35rem no-repeat, linear-gradient(135deg, var(--green) 50%, transparent 50%) right .8rem center / .35rem .35rem no-repeat, white; }
.filterset { padding: .6rem .7rem .5rem; border: 1px solid var(--line); border-radius: .65rem; margin: 1rem 0; }
.filterset legend { padding-inline: .25rem; font-weight: 700; }
.filterset p { color: var(--muted); font-size: .83rem; }
.filters { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: .35rem 0; }
.filters label { display: flex; align-items: center; gap: .27rem; min-height: 39px; font-size: .9rem; }
.filters input { width: 1.06rem; height: 1.06rem; accent-color: var(--green); }
.swap-options { display: grid; gap: .5rem; }
.swap-option { display: flex; align-items: center; text-align: left; width: 100%; gap: .75rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--page); padding: .55rem; }
.swap-option:hover { border-color: #8c9b80; background: var(--tint); }
.swap-option .meal-photo { width: 3.75rem; flex: none; }
.swap-option small { display: block; color: var(--muted); font-size: .8rem; }
.recipe-photo { width: 100%; aspect-ratio: 1; border-radius: 1rem; margin-block: .7rem .9rem; }
.recipe-photo.photo-chicken { aspect-ratio: 1.5; }
.recipe-intro { color: var(--muted); margin-bottom: .68rem; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: .75rem 1rem; }
.recipe-card h3 { margin-bottom: .35rem; font-family: var(--serif); font-weight: 600; font-size: 1.42rem; }
.ingredients { padding-left: 1.1rem; margin: .35rem 0 .85rem; }
.ingredients li { padding-block: .11rem; }
.recipe-steps { margin: .3rem 0 .9rem; padding-left: 1.3rem; }
.recipe-steps li { margin-bottom: .6rem; }
.recipe-steps p { margin-top: .12rem; }
.step-amounts { margin: .36rem 0 .4rem; padding: .5rem .65rem; border-radius: .57rem; background: var(--tint); }
.recipe-credit { margin-top: .75rem; font-size: .86rem; color: var(--muted); }
.step-photo { aspect-ratio: 1.6; border-radius: .8rem; margin-block: .55rem .75rem; }
.cook-navigation { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.1rem; }
.cook-progress { margin-bottom: .25rem; font-weight: 700; color: var(--muted); font-size: .84rem; }

@media (min-width: 42rem) {
  .shell, .top-inner { width: min(100% - 3.2rem, 72rem); }
  .shell { padding-block: 2.5rem 4rem; }
  .mobile-nav { display: none; }
  .desktop-nav { display: flex; gap: .22rem; }
  .desktop-nav button { min-height: 44px; border: 0; background: none; padding: .3rem .75rem; border-radius: 999px; color: var(--muted); font-size: .9rem; }
  .desktop-nav button[aria-current], .desktop-nav button:hover { color: var(--green); background: var(--tint); }
  .intro { margin-bottom: 1.85rem; }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(15.6rem, .54fr); gap: clamp(1.1rem, 3vw, 2.6rem); }
  .overview { grid-column: 2; grid-row: 1; position: sticky; top: 1.3rem; }
  .column { grid-column: 1; grid-row: 1; }
  .meal-photo { align-self: stretch; }
  .meal-card { grid-template-columns: 5.55rem minmax(0, 1fr); }
  .meal-subtitle { display: block; }
  .summary { padding: 1.15rem; }
  .summary-meta { flex-wrap: wrap; }
  .summary-meta p { max-width: none; }
  .panel, .dialog-inner { padding: 1.35rem; }
  .pantry-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 1rem; }
  .pantry-control { margin: 0; }
}
@media (min-width: 64rem) {
  .top-inner { min-height: 4.8rem; }
  .shell { padding-top: 2.9rem; }
  .meal-card { grid-template-columns: 7.3rem minmax(0, 1fr) auto; gap: 1.1rem; padding: .58rem .9rem .58rem .58rem; }
  .meal-title { font-size: 2rem; }
  .meal-card > .meal-photo { grid-row: auto; }
  .meal-body { align-self: center; }
  .meal-actions { grid-column: 3; grid-row: auto; align-self: center; justify-items: end; display: grid; text-align: right; gap: 0; margin-top: 0; }
  .meal-price { font-size: .92rem; white-space: nowrap; }
  .meal-order { font-size: .8rem; }
  .empty-meal { grid-template-columns: minmax(0,1fr) auto; padding: .85rem; }
  .summary { padding: 1.5rem; }
  .summary-meta { flex-wrap: nowrap; }
  .summary-meta p { max-width: 18ch; }
}
@media print {
  .topbar, .mobile-nav, .skip, .shell, dialog .close-dialog, .recipe-actions, .recipe-photo { display: none !important; }
  :root, body { background: white; color: black; }
  dialog[open] { display: block; position: static; width: auto; max-width: none; max-height: none; border: 0; border-radius: 0; margin: 0; padding: 0; box-shadow: none; }
  dialog::backdrop { display: none; }
  .dialog-inner { margin: 0; padding: 0; }
  .recipe-steps li { break-inside: avoid; }
  .recipe-card h2 { font-size: 28pt; }
  .recipe-card { font-size: 10.5pt; }
}

/* The badge, date, and product stay together on narrow shopping lists. */
.flyer-pick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem .55rem;
  padding: .52rem .62rem;
  margin-block: .45rem .3rem;
  border-left: 3px solid #bf8f32;
  border-radius: .44rem;
  background: #fbf2d6;
  color: #3f3220;
}
.flyer-pick strong { font-size: .92rem; }
.flyer-badge {
  flex: none;
  padding: .08rem .4rem;
  border: 1px solid #e4bc63;
  border-radius: .34rem;
  background: #f8d982;
  color: #3c2f17;
  font-size: .77rem;
  font-weight: 750;
}
.flyer-date { font-size: .8rem; color: #685437; }
.flyer-button { margin-right: .67rem; margin-block: .25rem; border-color: #dfc778; background: #fcf5df; color: #3f3220; }
.flyer-button:hover { background: #f8e7b2; }
.flyer-product {
  padding: .62rem .75rem;
  border-radius: .63rem;
  background: #fbf2d6;
}
.flyer-product p, .flyer-status { color: var(--muted); font-size: .88rem; }
.flyer-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .8rem; }
.flyer-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: .55rem;
  background: var(--soft);
}
.flyer-frame img, .flyer-target { position: absolute; display: block; }
.flyer-target {
  pointer-events: none;
  outline: 3px solid #ffda60;
  box-shadow: inset 0 0 0 1px #2e2213, 0 0 0 100vmax rgb(20 26 17 / .46);
}


.pantry-scan-panel { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.25rem; flex-wrap: wrap; background: var(--tint); }
.pantry-scan-panel p { margin-top: .3rem; }
.pantry-scan-panel .button { flex: none; }
.scan-note, .scan-status { font-size: .88rem; color: var(--muted); margin-block: .55rem; }
.scan-status { min-height: 1.3em; }
.scan-photos { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: 0; margin: .65rem 0; }
.scan-photos img { width: 100%; aspect-ratio: 1.5; object-fit: cover; border-radius: .55rem; }
.scan-photos .link-button { font-size: .85rem; }
.scan-row { border: 1px solid var(--line); border-radius: .8rem; margin: 0 0 .7rem; padding: .5rem .75rem .7rem; min-inline-size: 0; }
.scan-row legend { font-weight: 750; padding-inline: .3rem; }
.scan-row .field { margin-block: .45rem; }
.scan-row input:not([type="checkbox"]) {
  width: 100%;
  min-height: 45px;
  border: 1px solid #cbd0be;
  border-radius: .55rem;
  padding: .4rem .65rem;
  background: white;
  font-weight: 500;
}
.scan-amount { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(5.7rem, .65fr); gap: .5rem; }
.scan-confirm { min-height: 44px; display: flex; align-items: center; gap: .45rem; font-weight: 680; }
.scan-confirm input { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
[data-extra-pantry] { display: flex; align-items: end; gap: .5rem; }
[data-extra-pantry] label { flex: 1; }

