/* Fonts are served from this site (OFL, public/fonts): no third-party request, and with
   font-display: optional the text never reflows when they arrive. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin.woff2?v=bs-02ku3Lj') format('woff2'); font-weight: 100 900; font-style: normal; font-display: optional; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin.woff2?v=bs-02ku3Lj') format('woff2'); font-weight: 100 900; font-style: normal; font-display: optional; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --surface-2: #f1ebdd;
  --ink: #1d2320;
  --ink-2: #4c5650;
  --ink-3: #7c857f;
  --line: #e3dccb;
  --green: #1f5135;
  --green-2: #2e7350;
  --green-soft: #e3efe6;
  --gold: #f6c453;
  --red: #b53b2a;
  --red-soft: #fbe6e1;
  --amber: #8a5a00;
  --amber-soft: #fbefd5;
  --blue: #23508a;
  --blue-soft: #e7f0fb;
  --blue-line: #cddcf0;
  --map-bg: #efe9da;
  --map-road: #fffdf8;
  --map-road-major: #e9b949;
  --map-road-edge: #d9d0bb;
  --map-water: #b7d3e1;
  --map-river: #9cc2d6;
  --map-park: #dae5c5;
  --map-rail: #a49d8d;
  --map-label: #59625c;
  --map-shield: #fffdf8;
  --map-shield-line: #a89f8b;
  --map-shield-ink: #3a423d;
  --map-shield-i: #2f5fa5;
  --st-tracked: #2e7350;
  --st-possible: #c98a12;
  --st-offline: #8e9690;
  --shadow: 0 1px 2px rgb(30 35 30 / 6%), 0 8px 24px -12px rgb(30 35 30 / 18%);
  --radius: 14px;
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121614; --surface: #1a201d; --surface-2: #222a26; --ink: #ecefe9; --ink-2: #b9c2bc; --ink-3: #87918b;
    --line: #2d3732; --green: #7fd1a1; --green-2: #9fe0b9; --green-soft: #1f3529; --gold: #f6c453;
    --red: #ff8f7d; --red-soft: #3a211d; --amber: #f6c453; --amber-soft: #3a2f16; --blue: #9cc3f0; --blue-soft: #1c2a3a; --blue-line: #2b3d52;
    --map-bg: #18201c; --map-road: #2f3a34; --map-road-major: #8a6d2a;
    --map-road-edge: #101512; --map-water: #1a3341; --map-river: #22465a; --map-park: #1b2a20; --map-rail: #4b5550;
    --map-label: #a7b1aa; --map-shield: #222a26; --map-shield-line: #4f5a54; --map-shield-ink: #dfe5e1; --map-shield-i: #2d5290;
    --st-tracked: #7fd1a1; --st-possible: #f0b445; --st-offline: #7c857f;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #121614; --surface: #1a201d; --surface-2: #222a26; --ink: #ecefe9; --ink-2: #b9c2bc; --ink-3: #87918b;
  --line: #2d3732; --green: #7fd1a1; --green-2: #9fe0b9; --green-soft: #1f3529; --gold: #f6c453;
  --red: #ff8f7d; --red-soft: #3a211d; --amber: #f6c453; --amber-soft: #3a2f16; --blue: #9cc3f0; --blue-soft: #1c2a3a; --blue-line: #2b3d52;
    --map-bg: #18201c; --map-road: #2f3a34; --map-road-major: #8a6d2a;
    --map-road-edge: #101512; --map-water: #1a3341; --map-river: #22465a; --map-park: #1b2a20; --map-rail: #4b5550;
    --map-label: #a7b1aa; --map-shield: #222a26; --map-shield-line: #4f5a54; --map-shield-ink: #dfe5e1; --map-shield-i: #2d5290;
    --st-tracked: #7fd1a1; --st-possible: #f0b445; --st-offline: #7c857f;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.link { background: none; border: 0; color: var(--green-2); cursor: pointer; padding: 0; font-weight: 600; }

/* ---------- Masthead ---------- */
.masthead { background: #1f5135; color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgb(0 0 0 / 15%); }
.masthead-inner { margin: 0 auto; padding: 14px clamp(20px, 3vw, 48px); display: flex; gap: 24px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-text { font: 600 22px/1 var(--display); letter-spacing: -0.01em; }
.brand-text em { font-style: italic; color: var(--gold); font-weight: 800; }
.search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 4px 4px 4px 14px; max-width: 760px; }
.search-icon { width: 20px; height: 20px; fill: #6b756f; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; width: 0; border: 0; outline: 0; background: transparent; padding: 10px 10px; color: #1d2320; font-size: 16px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-btn { border: 0; background: var(--gold); color: #1f2a1f; font-weight: 700; padding: 10px 20px; border-radius: 999px; cursor: pointer; }
.search-btn:hover { filter: brightness(1.05); }
.scan-btn { border: 0; background: transparent; padding: 8px; margin-right: 4px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.scan-btn[hidden] { display: none; }
.scan-btn svg { width: 22px; height: 22px; fill: #1f5135; }
/* In the app, keep content clear of the status bar and gesture area. */
.in-app .masthead { padding-top: env(safe-area-inset-top); }
.in-app body { padding-bottom: env(safe-area-inset-bottom); }
.search:focus-within { box-shadow: 0 0 0 3px rgb(246 196 83 / 70%); }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.topnav a { color: #e3efe6; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.topnav a:hover { background: rgb(255 255 255 / 10%); }
.topnav a[aria-current='page'] { background: rgb(255 255 255 / 14%); color: #fff; }
.topnav a:focus-visible, .brand:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.updated { display: block; font-size: 11px; font-weight: 500; color: #b9d4c2; line-height: 1.1; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; }
.suggest li { padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected='true'], .suggest li:hover { background: var(--surface-2); }

/* ---------- Layout ---------- */
.layout { margin: 0 auto; padding: 24px clamp(20px, 3vw, 48px) 40px; display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.filters { position: sticky; top: calc(var(--masthead-h, 76px) + 16px); align-self: start; max-height: calc(100vh - var(--masthead-h, 76px) - 32px); overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; padding-right: 14px; }
.filters-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.filters-head > span { display: flex; align-items: baseline; white-space: nowrap; }
.filters h2 { font: 600 20px/1.2 var(--display); margin: 0 0 8px; }
.fgroup { border-top: 1px solid var(--line); padding: 14px 0; }
.fgroup h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.hint-inline { color: var(--ink-3); font-size: 11px; font-weight: 500; }
.hint { color: var(--ink-3); font-size: 12px; margin: -2px 0 8px; }
.toggle, .check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.toggle input, .check input { accent-color: var(--green-2); width: 16px; height: 16px; }
.check .count { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.checklist { display: grid; gap: 2px; }

.results { min-width: 0; }
.results-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.summary { margin: 0; color: var(--ink-2); flex: 1; }
.summary strong { color: var(--ink); }
.sort { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.sort select { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 10px; }
.filters-close { display: none; }
.scrim { display: none; }
.filters-btn { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px; font-weight: 600; cursor: pointer; }
.didyoumean { margin: -4px 0 14px; color: var(--ink-2); }

/* ---------- Product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; text-align: left; padding: 0; }
.card:hover { transform: translateY(-2px); }
.card:focus-within { border-color: var(--green-2); }
.card-top { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 14px 14px 10px; }
.thumb { width: 76px; height: 76px; border-radius: 10px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.thumb.ph { display: grid; place-items: center; color: var(--ink-3); font: 600 26px var(--display); background: var(--surface-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.title { font-size: inherit; font-weight: 600; line-height: 1.3; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--ink-3); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.cy { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.badge.sale { background: var(--red-soft); color: var(--red); border-color: transparent; }

.offers { list-style: none; margin: 0; padding: 0 14px; border-top: 1px dashed var(--line); }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.offer:last-child { border-bottom: 0; }
.offer .store { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer .price { font: 700 17px/1 var(--sans); font-variant-numeric: tabular-nums; text-align: right; }
.was, .offer .was { color: var(--ink-3); text-decoration: line-through; font-size: 12px; font-weight: 500; margin-right: 6px; }
.dtable .now { font-size: 16px; font-weight: 700; }
.dtable .now.sale { color: var(--red); }
.pct-off { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.offer .sub { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.offer .promo { color: var(--red); font-weight: 600; }
.offer.best { background: linear-gradient(90deg, var(--green-soft), transparent 85%); margin: 0 -14px; padding: 8px 14px; }
.offer.best .store { color: var(--green); font-weight: 700; }
.offer.best .store::before { content: '★ '; color: var(--gold); }
.offer.oos { opacity: .45; }
.offer.oos .store::after { content: ' · out of stock'; }
.deal-why { margin: 0 14px 10px; font-size: 12px; font-weight: 700; color: var(--red); }
.depts { margin: -4px 0 14px; }
.depts .chip.on { background: var(--green-soft); border-color: var(--green-2); color: var(--green); }
.more { padding: 0 14px 8px; color: var(--ink-3); font-size: 13px; }
.title-btn { all: unset; cursor: pointer; }
.title-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.offer a.store { color: var(--ink-2); text-decoration: none; }
.offer a.store:hover, .offer a.store:focus-visible { color: var(--green-2); text-decoration: underline; }
.offer.best a.store { color: var(--green); }
.store .ext { font-size: 11px; margin-left: 3px; opacity: .55; }
.dtable a.store { text-decoration: none; }
.dtable a.store:hover { text-decoration: underline; }
.check-h { font-size: 11px; font-weight: 600; color: var(--amber, #b45309); white-space: nowrap; cursor: help; }
.check-h.soft { color: var(--ink-3); }
.aisle:empty { display: none; }
.aisle { color: var(--green-2); font-weight: 600; }
.nutrition { margin-top: 18px; max-width: 420px; }
.nutrition h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.serving { margin: 0 0 6px; font-size: 14px; }
.ntable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; border-top: 6px solid var(--ink); }
.ntable thead th { font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 4px 0; border-bottom: 3px solid var(--ink); }
.ntable th[scope=row] { text-align: left; font-weight: 700; padding: 4px 0; }
.ntable td { padding: 4px 0 4px 8px; }
.ntable .num { text-align: right; }
.ntable tr { border-bottom: 1px solid var(--line); }
.ntable tr.sub th { font-weight: 400; padding-left: 16px; }
.ntable tr.cal th, .ntable tr.cal td { font-size: 18px; font-weight: 800; }
.nutrition-img { max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.allergens { margin: 10px 0 0; font-size: 14px; }
.ingredients { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.ingredients summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.map-btn { font-size: 13px; font-weight: 600; color: var(--green-2); padding: 2px 0; }
.fp-wrap { margin-top: 16px; }
.fp-wrap h3 { font-size: 15px; margin: 0; }
.fp-where { margin: 2px 0 8px; font-weight: 600; color: var(--green-2); }
.floorplan { width: 100%; height: auto; max-height: 60vh; display: block; }
.fp-floor { fill: var(--surface-2); stroke: var(--line); stroke-width: .4; }
.fp-area rect { fill: var(--surface); stroke: var(--ink-3); stroke-width: .25; }
.fp-area text { fill: var(--ink-2); text-anchor: middle; dominant-baseline: central; font-family: var(--sans); font-weight: 600; pointer-events: none; }
.fp-aisle rect { fill: var(--surface); }
.fp-department rect, .fp-wall rect { fill: var(--green-soft); stroke: var(--green-2); }
.fp-checkout rect { fill: var(--blue-soft); stroke: var(--blue-line); }
.fp-other rect { fill: var(--surface-2); stroke-dasharray: 1 .6; }
.fp-hl rect { fill: var(--gold); stroke: var(--ink); stroke-width: .6; animation: fp-pulse 1.4s ease-in-out infinite; }
.fp-hl text { fill: #1f2a1f; }
@keyframes fp-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .fp-hl rect { animation: none; } }
.fp-door circle { fill: var(--red); }
.fp-door text { fill: var(--red); text-anchor: middle; font-family: var(--sans); font-weight: 700; }
.detail-sizes { padding: 0 0 14px; flex-wrap: wrap; overflow: visible; }
.sub-l { display: flex; gap: 0 8px; min-width: 0; overflow: hidden; }
/* One line per store row, so every row is the same height (see .card.steady). */
.offer .sub > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.offer .sub > span:last-child { flex: 0 0 auto; max-width: 60%; }
.sub-l .promo { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.sub-l .o-aisle { flex: 0 1 auto; min-width: 3em; }
/* Multi-size cards keep the height of their largest size (app.js card()). */
.offer.pad { visibility: hidden; }
.more.pad { visibility: hidden; }
.offer { align-items: center; }
.offer > .store, .offer > .price { display: block; height: 20px; line-height: 20px; }
.offer .sub { height: 16px; line-height: 16px; }
.card.steady .title { height: 2.6em; }
.card.steady .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.steady .badges { flex-wrap: nowrap; overflow: hidden; }
.card.steady.has-badges .badges { height: 22px; }
.o-aisle { color: var(--green-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.more-sentinel { min-height: 1px; text-align: center; color: var(--ink-3); font-size: 13px; padding: 12px 0; }
.offer .store small, .check small { color: var(--ink-3); font-weight: 500; }
.check small { display: block; font-size: 11px; line-height: 1.2; }
.store-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 8px 0 2px; }
.store-kind:first-child { margin-top: 0; }
.card-foot { margin-top: auto; padding: 10px 14px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.save { color: var(--green); font-weight: 700; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.empty h3 { font: 600 24px var(--display); color: var(--ink); margin: 0 0 6px; }
.skeleton { height: 240px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .card { transition: none; } }

/* ---------- Size chips ---------- */
.sizes { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: thin; }
.size-chip { flex: 0 0 auto; display: grid; justify-items: start; gap: 1px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 5px 10px; cursor: pointer; text-align: left; line-height: 1.2; }
.size-chip span { font-weight: 600; font-size: 13px; }
.size-chip small { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.size-chip em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .04em; }
.size-chip:hover { border-color: var(--green-2); }
.size-chip.on { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.size-chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ---------- Detail dialog ---------- */
.detail { width: min(720px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgb(0 0 0 / 45%); }
.detail::backdrop { background: rgb(20 25 22 / 55%); backdrop-filter: blur(2px); }
.detail .close { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--ink-3); }
.detail h2 { font: 600 24px/1.2 var(--display); margin: 0 30px 4px 0; }
.detail-head { display: grid; grid-template-columns: 110px 1fr; gap: 18px; margin-bottom: 18px; }
.detail-head .thumb { width: 110px; height: 110px; }
.dtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dtable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dtable td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dtable td.num { text-align: right; white-space: nowrap; }
.dtable tr.best td:first-child .store { color: var(--green); font-weight: 700; }
.dtable a { color: var(--green-2); font-weight: 600; }
.chart { margin-top: 18px; }
.chart h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.table-scroll { overflow-x: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Stores page ---------- */
.page { margin: 0 auto; padding: 28px clamp(20px, 3vw, 48px) 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.page-head h1 { font: 800 clamp(28px, 4vw, 40px)/1.1 var(--display); margin: 0 0 8px; letter-spacing: -0.01em; text-wrap: balance; }
.lede { margin: 0; max-width: 70ch; color: var(--ink-2); font-size: 16px; }
.lede strong { color: var(--ink); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 12px; }
.section-head h2 { font: 600 24px/1.2 var(--display); margin: 0; }
.section-head .hint { margin: 0; font-size: 13px; }
.map-wrap { position: relative; display: grid; gap: 10px; }
.map-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.chip.on { color: var(--ink); border-color: var(--ink-3); }
.chip:not(.on) .dot { opacity: .35; }
.chip small { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip:focus-visible, .zoom button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--st-offline); }
.dot.tracked { background: var(--st-tracked); }
.dot.possible { background: var(--st-possible); }
.zoom { display: flex; gap: 4px; }
.zoom button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1; }
.map { height: min(62vh, 560px); min-height: 320px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--map-bg); }
.map svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
.map svg:active { cursor: grabbing; }
.m-bg { fill: var(--map-bg); }
.road { fill: none; stroke: var(--map-road); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.road.r3 { stroke-width: 1.5px; }
.road.r2 { stroke-width: 2.5px; }
.road.r1 { stroke-width: 3px; stroke: var(--map-road-major); opacity: .7; }
.road.r0 { stroke-width: 4px; stroke: var(--map-road-major); }
/* Detail layer (map-detail.json). The svg gets z1–z4 as you zoom in (public/map.js ZOOMS). */
.park { fill: var(--map-park); }
.water { fill: var(--map-water); fill-rule: nonzero; }
.river, .stream { fill: none; stroke: var(--map-river); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.river { stroke-width: 1.6px; }
.stream { stroke-width: .9px; display: none; }
.rail { fill: none; stroke: var(--map-rail); stroke-width: 1.2px; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.m-minor .road { display: none; }
.m-minor .r4 { stroke-width: 1.4px; }
.m-minor .r5, .m-minor .r6 { stroke-width: 1px; }
.z1 .stream, .z1 .m-minor .road { display: inline; }
.z1 .m-minor .r5 { stroke-width: .6px; stroke-opacity: .75; }
.z2 .m-minor .r5 { stroke-width: 1.2px; stroke-opacity: 1; }
.z2 .m-minor .r4 { stroke-width: 2px; }
.z2 .road.r3 { stroke-width: 2.5px; }
.z2 .road.r2 { stroke-width: 3.5px; }
.z3 .m-minor .r5, .z3 .m-minor .r6 { stroke-width: 2.5px; }
.z3 .m-minor .r4 { stroke-width: 3.5px; }
.z3 .road.r3 { stroke-width: 4.5px; }
.z3 .road.r2 { stroke-width: 5.5px; }
.z3 .road.r1, .z3 .road.r0 { stroke-width: 7px; }
.z3 .stream { stroke-width: 1.5px; }
.z3 .river { stroke-width: 3px; }
.z4 .m-minor .r5, .z4 .m-minor .r6 { stroke-width: 5px; }
.z4 .m-minor .r4 { stroke-width: 7px; }
.z4 .road.r3, .z4 .road.r2 { stroke-width: 9px; }
.z4 .road.r1, .z4 .road.r0 { stroke-width: 11px; }
/* Labels: sized in screen px whatever the zoom (--k = 1 / scale, set by map.js). */
.m-labels { pointer-events: none; }
.m-labels .k { transform: scale(var(--k, 1)); }
.sn { fill: var(--map-label); font: 500 10.5px var(--sans); text-anchor: middle; paint-order: stroke; stroke: var(--map-bg); stroke-width: 3px; stroke-linejoin: round; }
.sn.major { font-weight: 600; font-size: 11px; }
.rt { fill: var(--map-shield); stroke: var(--map-shield-line); stroke-width: 1px; }
.rt.i { fill: var(--map-shield-i); stroke: none; }
.rt-t { fill: var(--map-shield-ink); font: 700 11px var(--sans); text-anchor: middle; font-variant-numeric: tabular-nums; }
.rt-t.i { fill: #fff; }
.place { fill: var(--ink-3); opacity: .85; font-family: var(--sans); font-weight: 600; text-anchor: middle; letter-spacing: .04em; paint-order: stroke; stroke: var(--map-bg); stroke-width: calc(var(--u, 1px) * 3); pointer-events: none; text-transform: uppercase; }
.pin { fill: var(--st-offline); stroke: var(--surface); stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: pointer; }
.pin.tracked { fill: var(--st-tracked); }
.pin.possible { fill: var(--st-possible); }
.pin.sel { stroke: var(--ink); stroke-width: 3px; }
.map-card { position: absolute; right: 12px; top: 56px; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.map-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.map-card .close { position: absolute; right: 6px; top: 2px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink-3); }
.mc-name { display: flex; align-items: center; gap: 8px; font-weight: 700; padding-right: 20px; }
.mc-status { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.mc-link { display: inline-block; margin-top: 4px; color: var(--green-2); font-weight: 600; font-size: 13px; }
.attribution { margin: 0; font-size: 12px; color: var(--ink-3); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stable td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stable tr:last-child td { border-bottom: 0; }
.stable .num { text-align: right; }
.stable a { color: var(--green-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.stable a:hover { text-decoration: underline; }
.store-link { font-size: 15px; color: var(--ink); text-align: left; }
.store-link:hover { color: var(--green-2); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-top: 4px; }
.pill.busy { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--red-soft); color: var(--red); }
.other { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.plain-list { list-style: none; margin: 0; padding: 0; columns: 3 220px; column-gap: 24px; }
.plain-list li { break-inside: avoid; padding: 4px 0; }
.plain-list .link { color: var(--ink); font-weight: 600; text-align: left; }
.plain-list .link:hover { color: var(--green-2); }
.plain-list .meta { margin-left: 6px; }
.other-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.other-group h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.other-group h3 small { color: var(--ink-3); font-weight: 500; }
.other-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.other-group li .link { color: var(--ink); font-weight: 600; text-align: left; }
.other-group li .link:hover { color: var(--green-2); }
.other-group li > .meta { margin-left: 6px; }
.link:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

/* ---------- Footer ---------- */
.foot { margin: 0 auto; padding: 0 clamp(20px, 3vw, 48px) 40px; color: var(--ink-3); font-size: 13px; }
.freshness { padding-top: 16px; border-top: 1px solid var(--line); }
.freshness a, .disclaimer a, .contact a { color: var(--green-2); font-weight: 600; }
.disclaimer, .contact { margin: 10px 0 0; }

/* ---------- Very wide screens ---------- */
/* Full width, but cards grow instead of multiplying into 8+ narrow columns. */
@media (min-width: 1800px) {
  .layout { grid-template-columns: 260px 1fr; gap: 36px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
}
@media (min-width: 2400px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
}

/* ---------- Gas ---------- */
@media (min-width: 861px) { .gas-map-wrap .map { height: min(68vh, 620px); } }
.gpin { cursor: pointer; }
.gpin circle { fill: var(--st-offline); stroke: var(--surface); stroke-width: 1.5px; }
.gpin.cheap { --pin: #1e7a4a; }
.gpin.mid { --pin: #8a6a12; }
.gpin.high { --pin: #b53b2a; }
.gpin.stale { --pin: #7c857f; }
.gpin.cheap circle, .gpin.mid circle, .gpin.high circle, .gpin.stale circle { fill: var(--pin); }
.gpin.tag path { fill: var(--pin); stroke: #fff; stroke-width: 1.5px; }
.gpin.tag text { fill: #fff; font: 700 13px var(--sans); text-anchor: middle; font-variant-numeric: tabular-nums; pointer-events: none; }
.gpin.tag .tenths { font-size: 9px; }
.gpin.tag .foot { stroke-width: 1px; }
.gpin.stale.tag path { opacity: .85; }
.gpin.sel path { stroke: var(--ink); stroke-width: 2.5px; }
.gpin.sel circle { stroke: var(--ink); stroke-width: 2.5px; }
.gme circle { fill: #2563eb; stroke: #fff; stroke-width: 3px; }
.gas-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-right: 8px; }
.gas-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 4px; }
.lg.cheap { background: #1e7a4a; } .lg.mid { background: #8a6a12; } .lg.high { background: #b53b2a; } .lg.none { background: var(--st-offline); border-radius: 50%; }
.gas-card { padding: 0; width: min(380px, calc(100% - 24px)); }
.gas-card .gas-list { gap: 0; }
.gas-card .gas-row { border: 0; box-shadow: none; background: transparent; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 14px 12px; }
.gas-card .gas-price { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding-right: 22px; }
.gas-card .gas-info { grid-column: 1 / -1; grid-row: 2; }
.gas-card .gas-row > .gas-btn { grid-column: 2; grid-row: 1; margin-right: 22px; }
.gas-card > .close { z-index: 1; }
.gas-name { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.gas-name:hover { color: var(--green-2); text-decoration: underline; }
.gas-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gas-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.gas-sort select { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 10px; font: inherit; }
.gas-note { min-height: 1.2em; margin: 0 0 8px; font-size: 13px; }
.gas-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gas-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.gas-row.low { border-color: var(--green-2); }
.gas-row.stale .gas-price b { color: var(--ink-3); }
.gas-price { display: grid; gap: 2px; justify-items: start; }
.gas-price b { font: 800 28px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--ink); }
.gas-price b.none { color: var(--ink-3); font-weight: 600; }
.gas-price sup { font-size: .5em; vertical-align: .9em; margin-left: 1px; }
.gas-price small { font-size: 12px; color: var(--ink-3); }
.gas-tag, .gas-low { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 999px; padding: 2px 7px; }
.gas-tag { background: var(--surface-2); color: var(--ink-2); }
.gas-low { background: var(--green-soft); color: var(--green); }
.gas-info { min-width: 0; }
.gas-info h3 { margin: 0 0 2px; font-size: 17px; }
.gas-brand { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.gas-info p { margin: 0; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.gas-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px !important; font-size: 13px !important; }
.gas-meta sup { font-size: .7em; }
.gas-meta a { color: var(--green-2); font-weight: 600; text-decoration: none; }
.gas-meta a:hover { text-decoration: underline; }
.gas-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 16px; font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; }
.gas-btn:hover { border-color: var(--ink-3); }
.gas-btn.primary { background: var(--green); border-color: var(--green); color: var(--bg); }
.gas-btn:disabled { opacity: .6; cursor: default; }
.gas-btn sup { font-size: .65em; }
.gas-btn:focus-visible, .gas-link:focus-visible, .gas-sort select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.gas-link { border: 0; background: none; padding: 0; color: var(--ink-3); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.gas-form { display: grid; gap: 10px; }
.gas-report { grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.gas-pay { display: flex; gap: 16px; border: 0; padding: 0; margin: 0; font-size: 14px; }
.gas-pay legend { float: left; margin-right: 4px; color: var(--ink-3); }
.gas-pay label { display: flex; align-items: center; gap: 5px; }
.gas-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gas-inputs label, .gas-form > label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.gas-dollar { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 10px; color: var(--ink-3); }
.gas-dollar:focus-within { border-color: var(--green-2); }
.gas-dollar input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; padding: 9px 0; font: 600 16px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.gas-form > label input { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 9px 10px; font: 16px var(--sans); color: var(--ink); min-width: 0; }
.gas-form .hint { margin: 0; }
.gas-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gas-more { margin: 0; font-size: 13px; color: var(--ink-3); }
.gas-msg { margin: 0; min-height: 1.2em; font-size: 14px; font-weight: 600; color: var(--red); }
.gas-msg.ok { color: var(--green-2); }
.gas-empty { padding: 24px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.gas-add details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.gas-add summary { cursor: pointer; font-weight: 600; }
.gas-add .gas-form { margin-top: 12px; max-width: 420px; }
.gas-add .gas-btn { justify-self: start; }
@media (max-width: 560px) {
  .gas-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; gap: 6px 12px; }
  .gas-price { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
  .gas-price small, .gas-price .gas-low, .gas-price .gas-tag { white-space: nowrap; }
  .gas-price b { font-size: 26px; }
  .gas-info { grid-column: 1 / -1; grid-row: 2; }
  .gas-row > .gas-btn { grid-column: 2; grid-row: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .masthead-inner { flex-wrap: wrap; gap: 10px 8px; padding: 10px 16px 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand-text { font-size: 19px; }
  .brand-mark { width: 30px; height: 30px; }
  /* Nav shares the logo's row: compact pills, freshness lives in the footer. */
  .topnav a { padding: 6px 12px; font-size: 15px; }
  .topnav .updated { display: none; }
  /* Department chips scroll sideways instead of wrapping into rows. */
  .depts { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 2px; scrollbar-width: none; }
  .depts::-webkit-scrollbar { display: none; }
  .depts .chip { flex: 0 0 auto; }
  .card-top { grid-template-columns: 64px 1fr; padding: 12px 12px 8px; }
  .card-top .thumb { width: 64px; height: 64px; }
  .offers { padding: 0 12px; }
  .offer { padding: 6px 0; }
  .offer.best { margin: 0 -12px; padding: 6px 12px; }
  .card-foot { padding: 8px 12px; }
  .search-btn { padding: 9px 14px; }
  .layout { grid-template-columns: 1fr; padding: 16px 16px 32px; }
  .filters { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); max-height: none; background: var(--surface); z-index: 40; padding: 20px; box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .2s ease; }
  .filters.open { transform: none; }
  .filters-close { display: block; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 0 0 0 8px; }
  .scrim { display: block; position: fixed; inset: 0; background: rgb(20 25 22 / 45%); z-index: 35; }
  .scrim[hidden] { display: none; }
  .filters-btn { display: inline-block; }
  .results-bar { flex-wrap: wrap; }
  .summary { order: 3; flex-basis: 100%; }
  .grid { grid-template-columns: 1fr; }
  .detail { padding: 18px; }
  .detail-head { grid-template-columns: 80px 1fr; }
  .detail-head .thumb { width: 80px; height: 80px; }
  .detail h2 { font-size: 20px; }
  /* Store table: each store becomes a block — name and details on top, price/unit/status below. */
  .dtable thead { display: none; }
  .dtable tr { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .dtable td { padding: 0; border: 0; }
  .dtable td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .dtable td.num { text-align: left; }
  .dtable td:last-child { text-align: right; }
  .foot { padding: 0 16px 32px; }
  .page { padding: 20px 16px 32px; gap: 28px; }
  .map { height: auto; aspect-ratio: 5 / 6; max-height: 72vh; min-height: 0; }
  .map-card { position: static; width: auto; max-height: none; }
}

/* ---------- Phones: the item popup fills the screen ---------- */
@media (max-width: 560px) {
  .detail { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: 16px 14px 24px; }
  .detail .close { position: fixed; right: 6px; top: 4px; z-index: 2; background: var(--surface); border-radius: 999px; width: 40px; height: 40px; line-height: 1; }
  .detail h2 { font-size: 19px; margin-right: 40px; overflow-wrap: anywhere; }
  .detail-head { grid-template-columns: 64px 1fr; gap: 12px; margin-bottom: 12px; }
  .detail-head .thumb { width: 64px; height: 64px; }
  .dtable td .meta { overflow-wrap: anywhere; }
  .nutrition { max-width: none; }
}

/* ---------- Phones: logo and Deals / Gas / Stores share one row ---------- */
@media (max-width: 430px) {
  .brand { gap: 7px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-text { font-size: 17px; }
  .topnav { gap: 0; }
  .topnav a { padding: 6px 8px; font-size: 14px; }
}
@media (max-width: 360px) {
  .brand { gap: 6px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-text { font-size: 16px; }
  .topnav a { padding: 5px 6px; font-size: 13.5px; }
}
@media (max-width: 335px) {
  .brand-text { font-size: 15px; }
  .topnav a { padding: 5px 5px; font-size: 13px; }
}

/* ---------- Very narrow phones (Galaxy Z Fold cover screen, small Galaxy A, 320–380 px) ---------- */
@media (max-width: 380px) {
  .masthead-inner { gap: 8px 6px; padding: 8px 12px 10px; }
  .search { padding: 3px 3px 3px 10px; }
  .search-icon { width: 18px; height: 18px; }
  .search input { padding: 8px 6px; }
  .search-btn { padding: 8px 12px; font-size: 14px; }
  .layout { padding: 12px 10px 28px; }
  /* The chip row bleeds to the screen edge: match the 10px page padding, or the page gets wider than the screen. */
  .depts { margin: 0 -10px 10px; padding: 0 10px 2px; }
  .results-bar { gap: 8px; }
  .card-top { grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 10px 8px; }
  .card-top .thumb { width: 52px; height: 52px; }
  .offers { padding: 0 10px; }
  .offer.best { margin: 0 -10px; padding: 6px 10px; }
  .offer .price { font-size: 16px; }
  .offer .was { margin-right: 4px; }
  .sizes { padding: 0 10px 8px; }
  .card-foot { padding: 8px 10px; }
  .deal-why { margin: 0 10px 8px; }
  /* Store table: price and unit on one line, stock status under them. */
  .dtable tr { grid-template-columns: auto 1fr; }
  .dtable td:last-child { grid-column: 1 / -1; text-align: left; display: flex; flex-wrap: wrap; gap: 0 8px; }
  .dtable td:last-child .meta { display: inline; }
  .foot { padding: 0 12px 28px; }
}
/* Galaxy Z Fold cover screen: the cart logo alone (the link keeps its label), so the nav fits beside it. */
@media (max-width: 300px) {
  .brand-text { display: none; }
  .brand-mark { width: 28px; height: 28px; }
  .topnav a { padding: 5px 8px; font-size: 14px; }
}

/* ---------- Meat page (meat.html): cuts × kosher markets, price per pound ---------- */
.meat-tools { display: grid; gap: 10px; margin-bottom: 12px; }
.meat-brands .chip { font-weight: 500; }
.meat-empty { padding: 24px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.meat-wrap { overflow-x: auto; }
.meat-board { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.meat-board th, .meat-board td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.meat-board thead th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-2); vertical-align: bottom; line-height: 1.25; }
.meat-board thead th:first-child { border-top-left-radius: var(--radius); }
.meat-board thead th:last-child { border-top-right-radius: var(--radius); }
.meat-board th[scope="row"], .meat-board thead th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; }
.meat-board thead th:first-child { background: var(--surface-2); z-index: 2; }
.meat-board th small, .meat-board td small, .meat-cut small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.meat-board td b { font-size: 15px; }
.meat-board tbody tr:last-child > * { border-bottom: 0; }
.meat-board tbody tr:hover > * { background: var(--surface-2); }
.meat-board .none { color: var(--ink-3); }
b.low { color: var(--green); }
.meat-board td b.low { background: var(--green-soft); border-radius: 6px; padding: 1px 6px; margin-right: -6px; }
.meat-board s, .meat-card s { font-weight: 500; font-size: 11px; color: var(--ink-3); }
.meat-cut { all: unset; cursor: pointer; font-weight: 600; color: var(--ink); }
.meat-cut:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.meat-cut[aria-expanded="true"] { color: var(--green); }
.meat-detail > td { text-align: left; background: var(--surface-2); }
.meat-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.meat-items li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.meat-items .mi-name { min-width: 0; }
.meat-items .mi-name a { color: var(--ink); text-decoration: none; }
.meat-items .mi-name a:hover, .meat-items .mi-name a:focus-visible { color: var(--green-2); text-decoration: underline; }
.meat-items small { display: block; font-size: 11px; color: var(--ink-3); }
.meat-items b { white-space: nowrap; }
.meat-items b small { display: inline; }
.meat-cards { display: none; gap: 12px; }
.meat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.meat-card h3 { margin: 0 0 6px; font-size: 16px; }
.meat-card ol { list-style: none; margin: 0; padding: 0; }
.meat-card > ol li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.meat-card > ol li:last-child { border-bottom: 0; }
.meat-card > ol li small { color: var(--ink-3); font-size: 11px; }
.meat-card .mc-price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meat-card .mc-price small { display: none; }
.meat-card .meat-items { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
@media (max-width: 760px) {
  .meat-board { display: none; }
  .meat-cards { display: grid; }
}

/* ---------- Shopping list (mylist.js, list.html) ---------- */
.card { position: relative; }
.card-top { padding-right: 48px; }
.card-top > :last-child { min-width: 0; } /* a one-line brand/size row must not widen the column under the + */
.add-list { position: absolute; top: 10px; right: 10px; z-index: 1; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--green); font: 700 18px/1 var(--sans); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
.add-list:hover { border-color: var(--green-2); }
.add-list.on { background: var(--green); border-color: var(--green); color: #fff; }
.add-list:focus-visible, .add-list-big:focus-visible, .li-qty button:focus-visible, .li-remove:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.add-list.inline { position: static; width: 28px; height: 28px; font-size: 16px; box-shadow: none; flex: 0 0 auto; }
.detail-actions { margin-top: 10px; }
.add-list-big.on { background: var(--green-soft); border-color: var(--green-2); color: var(--green); }
.list-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 6px 20px -6px rgb(0 0 0 / 45%); }
.list-fab b { background: rgb(255 255 255 / 22%); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.list-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.list-fab[hidden] { display: none; }
body:has(.list-fab:not([hidden])) .foot { padding-bottom: 88px; }
.list-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.li-thumb { width: 48px; height: 48px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.li-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.li-main { min-width: 0; }
.li-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main small { display: block; color: var(--ink-3); font-size: 12px; }
.li-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.li-qty button { border: 0; background: var(--surface-2); color: var(--ink); width: 32px; height: 32px; font-size: 18px; cursor: pointer; }
.li-qty output { min-width: 46px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.li-remove { border: 0; background: none; color: var(--ink-3); font-size: 22px; cursor: pointer; width: 32px; height: 32px; }
.list-empty { padding: 24px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); line-height: 1.6; }
.list-stores { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.list-store { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 8px; align-content: start; }
.list-store.best { border-color: var(--green-2); box-shadow: inset 0 0 0 1px var(--green-2), var(--shadow); }
.list-store header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.list-store h3 { margin: 0; font-size: 16px; }
.list-store header b { font-size: 18px; font-variant-numeric: tabular-nums; }
.list-store .hint { margin: 0; }
.list-send { text-align: center; text-decoration: none; display: block; white-space: normal; line-height: 1.3; }
.list-store details summary { cursor: pointer; font-size: 13px; color: var(--green-2); font-weight: 600; }
.list-links { margin: 6px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.list-links a { color: var(--ink); }
@media (max-width: 480px) {
  .list-item { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .li-thumb { width: 40px; height: 40px; }
  .li-qty { grid-column: 2; justify-self: start; }
  .li-remove { grid-row: 1; grid-column: 3; }
}

/* ---------- Page transitions (router.js) ----------
   The masthead and the list button hold still; the page underneath fades and rises into place. */
.masthead { view-transition-name: masthead; }
.list-fab { view-transition-name: list-fab; }
main { view-transition-name: page; }
main:focus { outline: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }
::view-transition-old(page) { animation: 120ms ease-in both mm-page-out; }
::view-transition-new(page) { animation: 300ms cubic-bezier(.2, .8, .2, 1) both mm-page-in; }
@keyframes mm-page-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes mm-page-in { from { opacity: 0; transform: translateY(12px); } }
/* Browsers without view transitions: the new page still eases in. */
.page-enter { animation: mm-page-in 260ms cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .page-enter { animation: none; }
}
/* "updated 3h ago" under Stores: the line is reserved on every page so nothing shifts when it fills in. */
.updated { min-height: 1.1em; }
body[data-route="/list"] .list-fab { display: none; }
/* First-load stability: the footer starts below the screen while a page's data arrives, and
   rows that fill in late keep their height from the start. */
main { min-height: calc(100dvh - var(--masthead-h, 80px)); }
.meat-brands { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-height: 34px; padding-bottom: 2px; }
.meat-brands::-webkit-scrollbar { display: none; }
.meat-brands .chip { flex: 0 0 auto; }
/* The intro fills in with counts once data arrives: room for it from the start (measured). */
#gas-app .lede, #stores-app .lede { min-height: 2.9em; }
@media (max-width: 480px) { #gas-app .lede { min-height: 7.25em; } #stores-app .lede { min-height: 4.35em; } }
.map-tools { min-height: 36px; }
/* Where to shop: stores with the whole list first; each card says plainly what it has. */
.ls-group { grid-column: 1 / -1; margin: 8px 0 -2px; font: 700 15px/1.3 var(--sans); color: var(--amber); }
.ls-group.ok { color: var(--green); }
.ls-status { margin: 0; justify-self: start; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.ls-status.ok { background: var(--green-soft); color: var(--green); }
.ls-status.part { background: var(--amber-soft); color: var(--amber); }
.ls-gaps { font-size: 12px; overflow-wrap: anywhere; }
/* Green: everything on the list is here. Amber: some of it. */
.list-store { box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }
.list-store.complete { border-color: var(--green-2); box-shadow: inset 4px 0 0 var(--green), var(--shadow); }
.list-store.complete.best { box-shadow: inset 4px 0 0 var(--green), inset 0 0 0 1px var(--green-2), var(--shadow); }
.list-store header b small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); text-align: right; }
.ls-best { margin: 0; justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }

/* ---------- Phones and tablets: a tab bar on top, then the logo mark beside the search ----------
   Four tabs plus the name didn't fit one row on small phones. */
@media (max-width: 860px) {
  .masthead-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "nav nav" "brand search"; gap: 10px 10px; padding: 0 16px 12px; }
  .topnav { grid-area: nav; margin: 0 -16px; padding: 6px 8px; gap: 4px; justify-content: center; background: rgb(0 0 0 / 16%); }
  .topnav a { flex: 1 1 0; max-width: 150px; padding: 7px 4px; font-size: 15px; }
  .brand { grid-area: brand; gap: 0; }
  .brand-text { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .search { grid-area: search; order: 0; flex-basis: auto; max-width: none; }
}
@media (max-width: 360px) {
  .masthead-inner { padding: 0 12px 10px; gap: 8px 8px; }
  .topnav { margin: 0 -12px; padding: 5px 6px; gap: 2px; }
  .topnav a { padding: 6px 2px; font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
}
