/* Pennyplate. A leafy green strip that always shows the running total, white
   cards on a pale mint page, one sunny yellow for tags and one tomato red for "over". */
:root {
  --page: #f1f8f2; --surface: #ffffff; --ink: #1d2b24; --muted: #5c6f64; --line: #dce8df;
  --go: #17804b; --go-ink: #ffffff; --tag: #ffcb3d; --tag-ink: #1d2b24; --over: #d93a2b;
  --till: #155e3b; --till-ink: #ffffff; --till-muted: #cfe6d8;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --page: #101a14; --surface: #19261e; --ink: #ecf4ee; --muted: #9db0a4; --line: #2a3b31;
    --go: #4fd08f; --go-ink: #062a17; --over: #ff7a6b; --till: #0b2417; --till-muted: #9cc3ad; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.5 var(--text);
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
h1, h2, h3, .brand, button, .till-total { font-family: var(--round); }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
[hidden] { display: none !important; }
.note { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.error { color: var(--over); font-size: .9rem; flex-basis: 100%; }
.error:empty { display: none; }

/* ---- the till: name, running total, budget meter ---- */
.till { position: sticky; top: 0; z-index: 5; background: var(--till); color: var(--till-ink);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.till-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; max-width: 1120px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.brand svg { width: 26px; height: 26px; }
.brand .cut { fill: var(--till); }
.till-total { font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.meter { max-width: 1120px; margin: 8px auto 0; height: 10px; border-radius: 5px; background: rgb(255 255 255 / .16); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--tag); border-radius: 5px; transition: width .25s ease; }
.meter.over span { background: var(--over); }
.till-sub { max-width: 1120px; margin: 6px auto 0; font-size: .85rem; color: var(--till-muted); min-height: 1.3em; }
@media (prefers-reduced-motion: reduce) { .meter span { transition: none; } }

/* ---- layout: one view at a time on a phone, side by side on a wide screen ---- */
main { max-width: 1120px; margin: 0 auto; padding: 18px 16px 8px; }
.view { display: none; }
.view.current { display: block; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: none; color: var(--muted); border: 0; border-radius: 0; min-height: 56px; font-size: 1rem; font-weight: 600; }
.tabs button[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--tag); }
#tab-count:not(:empty) { background: var(--tag); color: var(--tag-ink); border-radius: 10px; padding: 1px 8px; font-size: .8rem; margin-left: 4px; }
@media (min-width: 980px) {
  body { padding-bottom: 24px; }
  main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .view { display: block; }
  .tabs { display: none; }
}

/* ---- controls ---- */
button { font-size: 1rem; font-weight: 600; background: var(--go); color: var(--go-ink); border: 0; border-radius: 10px;
  padding: 10px 16px; min-height: 44px; cursor: pointer; white-space: nowrap; }
button.quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
button.quiet.on { background: var(--tag); color: var(--tag-ink); border-color: var(--tag); }
button:disabled { opacity: .4; cursor: default; }
input[type=text], select { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 9px 10px; min-height: 44px; width: 100%; }
:is(button, input, select, summary):focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; }
input[aria-invalid=true] { border-color: var(--over); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--go); flex: none; }
.money { display: inline-flex; align-items: center; gap: 2px; }
.money input { width: 5.2em; text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.stepper button { background: none; color: var(--ink); min-width: 40px; padding: 0; font-size: 1.25rem; border-radius: 8px; }
.stepper output { min-width: 1.6em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- "Feeding 4 people on $150 a week." ---- */
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 18px; }

/* ---- meals ---- */
.group { margin-bottom: 18px; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.group-head h2 { margin: 0; }
/* Meal tiles: the picture is the control. Two across on a phone. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { position: relative; background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.tile.kept { box-shadow: 0 0 0 3px var(--tag); }
.tile-open, button.tile.choice { background: none; color: var(--ink); border: 0; border-radius: 0; padding: 0 0 8px; min-height: 0;
  text-align: left; white-space: normal; font-weight: 400; display: flex; flex-direction: column; flex: 1; width: 100%; }
button.tile.choice { background: var(--surface); border-radius: 16px; overflow: hidden; }
.tile-photo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--page); }
/* No picture yet: a short tinted band, so the tile reads as finished and not as a failed image. */
.tile-photo.blank { display: grid; place-items: center; aspect-ratio: 5 / 2; color: var(--tag);
  background: color-mix(in srgb, var(--tag) 22%, var(--surface)); }
.tile-photo.blank svg { height: 44px; width: 44px; }
.badge.tested { background: var(--go); color: var(--go-ink); }
.tile-name { font-family: var(--round); font-weight: 700; line-height: 1.25; padding: 8px 10px 0; display: block; }
.tile-sub { color: var(--muted); font-size: .85rem; padding: 2px 10px 0; display: block; }
.badge { font-family: var(--text); font-size: .7rem; font-weight: 700; background: var(--tag); color: var(--tag-ink); border-radius: 6px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; vertical-align: 2px; }
.pin { position: absolute; top: 8px; right: 8px; min-height: 32px; padding: 4px 12px; font-size: .8rem; border-radius: 16px;
  background: rgb(21 60 40 / .74); color: #fff; backdrop-filter: blur(6px); }
.pin.on { background: var(--tag); color: var(--tag-ink); }
.change { margin: 0 8px 8px; min-height: 38px; padding: 6px 10px; font-size: .9rem; }

/* The sheet: slides up from the bottom on a phone, sits in the middle on a wide screen. */
dialog { border: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--ink); background: var(--page);
  width: 100%; max-width: 640px; max-height: 88dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; overflow-y: auto; }
dialog::backdrop { background: rgb(10 26 17 / .55); }
@media (min-width: 700px) { dialog { margin: auto; border-radius: 22px; } }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise .22s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } }
}
.sheet-close { float: right; background: none; color: var(--muted); border: 1.5px solid var(--line); min-height: 36px; padding: 4px 12px; font-size: .85rem; margin: 0 0 8px 12px; }
.sheet-top { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; clear: both; margin-bottom: 8px; }
.sheet-top h2 { font-size: 1.3rem; line-height: 1.2; margin: 0; }
.sheet-photo { width: 112px; height: 112px; border-radius: 16px; object-fit: cover; display: block; background: var(--surface); }
.sheet-photo.blank { display: grid; place-items: center; color: var(--line); }
.sheet-photo.blank svg { width: 44px; }
dialog h3 { font-size: 1rem; margin: 16px 0 4px; }
dialog ul, dialog ol { padding-left: 22px; margin: 6px 0; }
dialog li { margin: 5px 0; }
.warn { background: var(--surface); border-left: 5px solid var(--tag); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 10px 0; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.caption, .source { color: var(--muted); font-size: .8rem; margin: 4px 0; }
.plan-actions { display: flex; gap: 10px; margin: 4px 0 18px; }
.options { background: var(--surface); border-radius: 14px; padding: 4px 14px; }
.options summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.options fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.options legend { color: var(--muted); font-size: .9rem; padding: 0; }
.count { color: var(--muted); }

/* ---- shopping list ---- */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-head h1 { margin: 0; }
.store { background: var(--surface); border-radius: 14px; padding: 12px 14px; margin: 10px 0; display: grid; gap: 8px; }
.store p { margin: 0; }
#store-name { font-weight: 600; }
.store-row, .store-actions { display: flex; gap: 8px; }
.store-row input { flex: 1; }
.aisle { font-size: .95rem; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.item { background: var(--surface); border-radius: 12px; margin-bottom: 6px; display: grid; grid-template-columns: 52px 1fr; }
.tick { display: grid; place-items: center; cursor: pointer; }
.tick input { width: 26px; height: 26px; accent-color: var(--go); }
.item details { min-width: 0; }
.item summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px 10px 0; min-height: 56px; }
.item summary::-webkit-details-marker { display: none; }
.item .name { font-weight: 600; display: block; line-height: 1.3; }
.item .name::first-letter { text-transform: uppercase; }
.item .buy { color: var(--muted); font-size: .9rem; display: block; }
.item .cost { font-family: var(--round); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .cost.none { font-family: var(--text); font-weight: 600; font-size: .8rem; color: var(--tag-ink); background: var(--tag); border-radius: 6px; padding: 2px 8px; }
.item.done .name { text-decoration: line-through; }
.item.done summary, .item.have summary { opacity: .55; }
.fields { padding: 0 12px 12px 0; display: grid; gap: 8px; }
.fields .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; align-items: end; }
.fields label { font-size: .85rem; color: var(--muted); display: grid; gap: 3px; }
.fields .check { font-size: .95rem; color: var(--ink); display: flex; }
.fields p { margin: 0; font-size: .85rem; color: var(--muted); }
.savings:empty { display: none; }
.savings { background: var(--surface); border-left: 5px solid var(--tag); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.saving { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.saving b { display: block; line-height: 1.3; }
.saving span { font-size: .85rem; color: var(--muted); }
.extras { margin-top: 22px; }
.extra-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.extra-row { grid-template-columns: 52px 1fr auto auto; align-items: center; padding: 6px 8px 6px 0; gap: 8px; }
.extra-what { display: flex; align-items: center; gap: 10px; min-width: 0; }
.extra-row .stepper button { min-width: 32px; min-height: 38px; }
.extra-row .money input { width: 4.2em; }
.extra-row .name { padding: 12px 0; }
.extra-row button { min-height: 36px; padding: 4px 10px; font-size: .85rem; }

@media print {
  .no-print, .till, #view-plan, .tick, .fields { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  main { display: block; }
  .view { display: block; }
  .item { grid-template-columns: 1fr; border-bottom: 1px solid #ccc; border-radius: 0; margin: 0; }
  .item.have { display: none; }
  .item summary { padding: 4px 0; min-height: 0; }
}

.fine-print { font-size: .8rem; margin-top: 14px; }
#send-cart { justify-self: start; }
dialog .sheet-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: 10px; background: var(--go); color: var(--go-ink); font-family: var(--round); font-weight: 600; text-decoration: none; }

/* ---- setting up the week ---- */
body.setting-up .till-row, body.setting-up .meter, body.setting-up .till-sub { display: none; }
body.setting-up main { display: block; max-width: 560px; }
body.setting-up .view { display: none; }
body.setting-up #view-setup { display: block; }
body:not(.setting-up) #view-setup { display: none; }
.step { background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.step h2 { margin-bottom: 10px; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; }
.field-row + .field-row { border-top: 1px solid var(--line); }
.store-list { display: grid; gap: 8px; margin-top: 10px; }
.store-list button { text-align: left; white-space: normal; font-weight: 400; line-height: 1.3; padding: 10px 12px; }
.store-list button b { display: block; font-family: var(--round); }
#build { width: 100%; min-height: 54px; font-size: 1.1rem; margin-top: 4px; }
.summary-line { color: var(--muted); margin: -6px 0 12px; }
button.link { background: none; border: 0; color: var(--go); padding: 0 4px; min-height: 32px; text-decoration: underline; font-size: inherit; }
.tile-cost { font-size: .85rem; font-weight: 600; padding: 2px 10px 0; display: block; color: var(--go); }
.tile-cost.more { color: var(--muted); }
.tile-cost.over { color: var(--over); }
/* ---- product pictures from the store ---- */
.item summary { grid-template-columns: auto 1fr auto; }
.item .shot { width: 44px; height: 44px; object-fit: contain; background: #fff; display: block; }
.item .shot.none { background: var(--page); }
dialog li.with-shot { list-style: none; margin-left: -22px; display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center; }
dialog li.with-shot img, dialog li.with-shot span.none { width: 32px; height: 32px; object-fit: contain; background: #fff; display: block; }
dialog li.with-shot span.none { background: var(--surface); }

#shop-actions h2 { margin: 0; }
#shop-actions #send-cart { width: 100%; min-height: 52px; font-size: 1.05rem; }
.store-actions { flex-wrap: wrap; }

.staples { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
button.chip { min-height: 40px; padding: 6px 14px; border-radius: 20px; font-size: .95rem; font-weight: 600; background: var(--surface); }
@media (max-width: 480px) { .extra-row { grid-template-columns: 52px 1fr auto; } .extra-row .money { grid-column: 2; justify-self: start; } .extra-row .stepper { grid-row: 1 / span 2; grid-column: 3; } }

.about { margin: 32px 0 8px; padding-top: 14px; border-top: 1px solid var(--line, rgba(0,0,0,.12)); color: var(--muted); font-size: .8rem; max-width: 70ch; }
.about p { margin: 6px 0; }
.about a, .note a, .legal a { color: var(--go); }
button.danger { background: var(--tomato, #d93a2b); color: #fff; border-color: transparent; }
.legal { max-width: 68ch; margin: 0 auto; padding: 24px 16px 60px; line-height: 1.55; }
.legal h1 { font-size: 1.6rem; margin: 0 0 4px; }
.legal h2 { font-size: 1.1rem; margin: 26px 0 6px; }
.legal li { margin: 4px 0; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 16px; min-width: 0; }
.hero h1 { font-size: clamp(1.7rem, 5.2vw, 2.5rem); line-height: 1.1; margin: 4px 0 10px; letter-spacing: -.02em; text-wrap: balance; }
.lead { font-size: 1.02rem; line-height: 1.5; color: var(--muted); margin: 0; max-width: 46ch; }
.hero-photos { display: flex; gap: 8px; }
.hero-photos img { flex: 1 1 0; min-width: 0; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; }
.hero-photos img:nth-child(even) { margin-top: 14px; }
@media (max-width: 559px) { .hero-photos img:nth-child(n+5) { display: none; } }
@media (min-width: 900px) {
  body.setting-up main { max-width: 1040px; }
  body.setting-up #view-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); column-gap: 56px; align-items: start; padding-top: 20px; }
  .hero { grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 28px; gap: 28px; margin: 0; }
  #view-setup > .step, #view-setup > form { grid-column: 2; }
  body.setting-up .about { max-width: none; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 600; }
.chip.on { background: var(--over); border-color: var(--over); color: #fff; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.check.quick { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check.quick input { width: 22px; height: 22px; accent-color: var(--go); }
.item .where { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 6px; background: var(--tag); color: var(--tag-ink); font-size: .78rem; font-weight: 700; }
.how { display: none; }
@media (min-width: 900px) {
  .how { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: how; color: var(--muted); line-height: 1.45; max-width: 44ch; }
  .how li { counter-increment: how; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
  .how li::before { content: counter(how); grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--tag); color: var(--tag-ink); display: grid; place-items: center; font-family: var(--round); font-weight: 700; }
  .how b { color: var(--ink); display: block; }
}

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--page); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented.wide { display: grid; margin-bottom: 14px; }
.segmented button { background: none; border: 0; border-radius: 9px; min-height: 40px; padding: 6px 10px; font-weight: 600; color: var(--muted); white-space: nowrap; font-size: .92rem; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 94, 59, .18); }
.step h3 { font-size: .95rem; margin: 6px 0 0; }
.chip:disabled { opacity: 1; cursor: default; }
label.stack { display: grid; gap: 6px; font-weight: 600; margin: 4px 0 10px; }
label.stack input, .field-row select { font: inherit; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
label.stack input { font-weight: 400; width: 100%; }

.tile-sub .each { color: var(--go); font-weight: 700; margin-left: 8px; white-space: nowrap; }
.item .cost-wrap { display: grid; justify-items: end; gap: 1px; }
.item .kind { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.item .kind.estimate { color: #8a5a00; }
.waste { margin: 18px 0 4px; }
.waste h2 { font-size: 1.1rem; margin: 0 0 4px; }
.cook-step { font-size: 1.35rem; line-height: 1.45; margin: 14px 0 6px; }
.cook-dots { display: flex; gap: 6px; }
.cook-dots span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.cook-dots span.on { background: var(--go); }
.pantry h3 { font-size: .85rem; color: var(--muted); margin: 14px 0 2px; }
.pantry .check { border-bottom: 1px solid var(--line); }
ul.prep { padding-left: 18px; margin: 6px 0; }
ul.prep li { margin: 6px 0; line-height: 1.4; }
.day { background: var(--page); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.day-head { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; color: var(--muted); }
.day-head b { color: var(--ink); font-family: var(--round); }
.day ul { list-style: none; padding: 0; margin: 6px 0 0; }
.day li { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; align-items: center; min-height: 36px; }
.day-meal { font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.day-time { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.day li button.link { text-align: left; padding: 4px 0; color: var(--ink); font-weight: 600; text-decoration: none; white-space: normal; min-width: 0; min-height: 0; line-height: 1.3; }
.segmented.wide { margin-top: 6px; }
@media (prefers-color-scheme: dark) { .item .kind.estimate { color: #ffcb3d; } }
.waste:empty { display: none; }
.waste { background: var(--surface); border-left: 5px solid var(--go); border-radius: 12px; padding: 12px 14px; }
.tile-sub { display: flex; flex-wrap: wrap; column-gap: 8px; }
.tile-sub .each { margin-left: 0; }

.options { display: grid; gap: 8px; margin-top: 8px; }
.option { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; text-align: left; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 76px; font-family: var(--text); font-weight: 400; }
.option.on { border-color: var(--go); box-shadow: inset 0 0 0 1px var(--go); }
.option .shot { width: 56px; height: 56px; object-fit: contain; background: #fff; display: block; }
.option .shot.none { background: var(--page); border-radius: 8px; }
.option-what, .option-price { display: grid; gap: 2px; min-width: 0; }
.option-what b { font-weight: 600; line-height: 1.25; }
.option-what span { color: var(--muted); font-size: .85rem; }
.option-what .option-plan { color: var(--go); font-weight: 600; }
.option-price { justify-items: end; white-space: nowrap; }
.option-price b { font-family: var(--round); font-size: 1.05rem; }
.option-price span { font-size: .75rem; color: var(--muted); }
.extra-row .link { display: block; padding: 2px 0; min-height: 28px; font-size: .85rem; text-align: left; }
.tile-sub .facts { white-space: nowrap; }

.tile.cooked .tile-photo { opacity: .55; }
.tile-cooked { position: absolute; top: 10px; left: 10px; background: var(--go); color: var(--go-ink); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; }
.kitchen-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kitchen-form select, .kitchen-form input, label.stack select { font: inherit; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; font-weight: 400; }
.kitchen-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.kitchen-row span { color: var(--muted); font-size: .85rem; text-align: right; }
.kitchen-row .link { text-align: left; color: var(--ink); font-weight: 600; text-decoration: none; padding: 0; }
.kitchen-row.soon span { color: #8a5a00; font-weight: 600; }
.kitchen-row.past span { color: var(--over); font-weight: 600; }
dialog h3 { margin: 18px 0 4px; font-size: 1rem; }
#kitchen-count:not(:empty) { background: var(--over); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .75rem; margin-left: 4px; }
@media (prefers-color-scheme: dark) { .kitchen-row.soon span { color: #ffcb3d; } }

.tabs button { font-size: .92rem; padding: 0 2px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; display: grid; gap: 2px; }
.stat span { color: var(--muted); font-size: .82rem; }
.stat b { font-family: var(--round); font-size: 1.45rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat small { color: var(--muted); font-size: .75rem; min-height: 1em; }
.meter.spend { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter.spend span { display: block; height: 100%; background: var(--go); border-radius: 6px; }
.meter.spend.over span { background: var(--over); }
.chart { width: 100%; height: auto; display: block; background: var(--surface); border-radius: 14px; padding: 6px 4px 0; }
.chart .bar { fill: #9cc9ae; }
.chart .bar.now { fill: var(--go); }
.chart .bar.over { fill: var(--over); }
.chart text { font-family: var(--text); fill: var(--muted); font-size: 8.5px; text-anchor: middle; }
.chart .bar-value { fill: var(--ink); font-weight: 600; }
.chart .budget-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 3; opacity: .55; }
.chart .budget-label { text-anchor: end; }
.shares { display: grid; gap: 8px; }
.share { display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr auto; gap: 8px; align-items: center; font-size: .88rem; }
.share-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-bar { background: var(--line); border-radius: 5px; height: 10px; overflow: hidden; }
.share-fill { display: block; height: 100%; background: var(--go); border-radius: 5px; }
.share-value { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: .8rem; }
.save-box { background: var(--surface); border-radius: 14px; padding: 12px 14px; margin: 8px 0; border-left: 5px solid var(--go); }
.save-box.estimate { border-left: 5px dashed var(--tag); }
.save-box b { font-family: var(--round); }
.save-box p { margin: 6px 0; }
.save-box small { color: var(--muted); font-size: .78rem; }
.receipt-rows { display: grid; gap: 10px; margin: 8px 0; }
.receipt-row { display: grid; grid-template-columns: 1fr 3.2rem 5rem; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.receipt-row select { grid-column: 1 / 3; }
.receipt-row .link { justify-self: end; font-size: .85rem; }
.paste { margin: 10px 0; }
.paste summary { font-weight: 600; min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--go); }
.paste textarea { width: 100%; font: inherit; font-size: .9rem; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); margin-bottom: 8px; }

.plans { display: grid; gap: 10px; margin: 10px 0; }
@media (min-width: 560px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; }
.plan-card.best { border-color: var(--go); }
.plan-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.plan-card ul { margin: 0; padding-left: 18px; line-height: 1.5; font-size: .92rem; }
.kitchen-form input[type=email], .kitchen-form input[type=password], .store-row input[type=password] { font: inherit; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; }
.about .link { font-size: inherit; }
.brand, .till-total { white-space: nowrap; }
@media (max-width: 430px) { .brand { font-size: .98rem; gap: 6px; } .brand svg { width: 22px; height: 22px; } .till-total { font-size: 1.12rem; } }
.plan-actions { flex-wrap: wrap; }

/* ---- header and bottom buttons, second pass ---- */
.till { padding-top: calc(10px + env(safe-area-inset-top)); border-radius: 0 0 20px 20px; box-shadow: 0 6px 18px rgb(12 48 30 / .18); }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1120px; margin: 0 auto; }
.brand { gap: 10px; }
.brand svg { width: 38px; height: 38px; flex: none; }
.wordmark { font-family: var(--round); font-weight: 800; font-size: 1.42rem; letter-spacing: -.025em; line-height: 1; }
.head-account { background: rgb(255 255 255 / .14); color: var(--till-ink); border: 0; border-radius: 999px; min-height: 36px; padding: 6px 14px; font-size: .88rem; font-weight: 600; }
.till-row { align-items: baseline; margin-top: 10px; }
.till-label { color: var(--till-muted); font-size: .85rem; font-weight: 600; }
.till-total { font-family: var(--round); font-size: 1.45rem; letter-spacing: -.01em; }
body.setting-up .till { padding-bottom: 12px; }
@media (max-width: 430px) { .brand { font-size: inherit; gap: 8px; } .brand svg { width: 34px; height: 34px; } .wordmark { font-size: 1.28rem; } .till-total { font-size: 1.3rem; } }

.tabs { box-shadow: 0 -4px 16px rgb(12 48 30 / .08); }
.tabs button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 60px; font-size: .74rem; padding: 6px 2px 4px; }
.tabs button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--go); box-shadow: inset 0 3px 0 var(--go); }
.tabs button b { font-weight: 700; }
.tabs button b:not(:empty) { background: var(--tag); color: var(--tag-ink); border-radius: 999px; padding: 0 6px; margin-left: 2px; font-size: .7rem; }
.tabs #kitchen-count:not(:empty) { background: var(--over); color: #fff; }
body.setting-up main { padding-bottom: 84px; }
dialog { padding-bottom: 0; }
.tabs.in-sheet { position: sticky; bottom: 0; left: auto; right: auto; margin: 22px -16px 0; z-index: 2; }
@media (min-width: 980px) { .tabs.in-sheet { display: none; } dialog { padding-bottom: 18px; } }

.chips.kinds { margin: 4px 0 14px; }
.chip.pick { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.chip.pick.on { background: var(--go); border-color: var(--go); color: var(--go-ink); text-decoration: none; }
.filters-on { background: var(--tag); color: var(--tag-ink); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: .9rem; line-height: 1.4; }
.filters-on .link { color: inherit; font-weight: 700; padding: 0; min-height: 0; }

/* A meal with no photo yet: a drawn plate on a warm tile, the same shape as a photo. */
.tile-photo.blank { aspect-ratio: 1; align-content: center; gap: 8px; background: #fdf0c4; color: #155e3b; border: 0; }
.tile-photo.blank svg { width: 64px; height: 64px; }
.tile-photo.blank small, .sheet-photo.blank small { font-size: .75rem; font-weight: 600; opacity: .75; }
.sheet-photo.blank { background: #fdf0c4; color: #155e3b; align-content: center; gap: 4px; }
.sheet-photo.blank small { display: none; }
@media (prefers-color-scheme: dark) { .tile-photo.blank, .sheet-photo.blank { background: #2c3a26; color: #ffcb3d; } }

/* Blog: plain reading pages that share the app's colors. */
.blog { background: var(--page); color: var(--ink); font-family: var(--text); margin: 0; padding: 0; }
.blog-top { background: var(--till); color: var(--till-ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(16px, calc((100% - 760px) / 2)); }
.blog-top nav { display: flex; align-items: center; gap: 14px; }
.blog-top a { color: inherit; text-decoration: none; font-weight: 600; }
.blog-brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--round); font-weight: 800; font-size: 1.15rem; }
.blog-cta { display: inline-block; background: var(--tag); color: var(--tag-ink) !important; border-radius: 999px; padding: 8px 16px; font-weight: 700; text-decoration: none; white-space: nowrap; }
body.blog { padding-bottom: 0; }
body.blog main { display: block; }
body.blog main.post, body.blog main.post-list { max-width: 66ch; margin: 0 auto; padding: 28px 16px 40px; line-height: 1.6; font-size: 1.04rem; }
.post h1, .post-list h1 { font-family: var(--round); font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 12px; text-wrap: balance; }
.post h2 { font-family: var(--round); font-size: 1.25rem; line-height: 1.25; margin: 30px 0 6px; }
.post p, .post ul { margin: 0 0 14px; }
.post li { margin: 6px 0; }
.post a, .post-list a, .blog-foot a { color: var(--go); }
.post-date { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.post-lead { color: var(--muted); font-size: 1.14rem; line-height: 1.45; margin-bottom: 22px; }
.post-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 34px 0 -14px; }
.post-pair img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; display: block; }
.post-try { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-top: 36px; }
.post-try h2 { margin-top: 0; }
.post-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post-list li a { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; text-decoration: none; color: var(--ink); }
.post-list li img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.post-list li a > span { display: grid; gap: 4px; min-width: 0; }
.post-list li b { font-family: var(--round); font-size: 1.1rem; line-height: 1.25; }
.post-list li span span { color: var(--muted); font-size: .95rem; line-height: 1.4; }
.post-list li time { color: var(--muted); font-size: .85rem; }
.blog-foot { max-width: 66ch; margin: 0 auto; padding: 20px 16px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; line-height: 1.5; }
.blog-foot a { margin-right: 12px; }
.blog a:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; border-radius: 6px; }
.blog-top nav { gap: 12px; flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 480px) { .blog-top { padding-left: 12px; padding-right: 12px; } .blog-brand { font-size: 0; gap: 0; } .blog-top nav { gap: 12px; font-size: .95rem; } .blog-top .blog-cta { padding: 7px 13px; } }
.recipe-photo { width: 100%; max-width: 420px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; display: block; margin: 0 0 8px; }
.recipe ol { padding-left: 1.3em; margin: 0 0 14px; }
.recipe ol li { margin: 10px 0; }
body.blog main.recipes { max-width: 980px; }
.recipes h2 { font-family: var(--round); font-size: 1.35rem; margin: 30px 0 12px; scroll-margin-top: 12px; }
.recipe-jump { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.recipe-jump a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; font-weight: 600; }
.recipe-grid, .post-list ul.recipe-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.recipe-grid li { margin: 0; }
.recipe-grid a, .post-list li .recipe-grid a, .post-list .recipe-grid li a { display: flex; flex-direction: column; gap: 4px; padding: 0 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); height: 100%; }
.recipe-grid img, .post-list .recipe-grid li img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 0; display: block; }
.recipe-grid b { font-family: var(--round); font-size: .98rem; line-height: 1.25; padding: 6px 10px 0; }
.recipe-grid span { color: var(--muted); font-size: .85rem; padding: 0 10px; }
.visits { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0 12px; }
.visits td, .visits th { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.visits td:last-child, .visits th:last-child { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
.post-list .recipe-grid li a > span, .recipe-grid a > span { display: block; }
.social a { margin-right: 10px; white-space: nowrap; }
.notify { margin: 0 0 16px; }
.notify label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.notify div { display: flex; gap: 8px; flex-wrap: wrap; }
.notify input[type=email] { flex: 1 1 200px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: var(--surface); color: var(--ink); }
.notify button { background: var(--go); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.notify p { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.notify-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
