/* ============================================================
   Cheap Grocery — "corner market" skin
   One bold element: deal cards finish in a yellow shelf tag.
   Everything else stays quiet: aisle-sign headings, paper chips.
   ============================================================ */
:root {
  --bg: #eef4ee;          /* produce-mist green */
  --surface: #ffffff;
  --ink: #123b2a;         /* spinach */
  --muted: #4e6a5b;
  --line: #d3e1d6;
  --aisle: #1e5b3e;       /* aisle-sign green */
  --aisle-ink: #f3faf5;
  --tag: #ffd43b;         /* shelf-tag yellow */
  --tag-edge: #e2b400;
  --sale: #c8231a;        /* price red */
  --kraft: #c9a06a;       /* paper-bag brown */
  --halal: #0e7a4d;
  --warn: #8a4b00;
  --warn-soft: #fff1cc;
  --error: #b42318;
  --error-soft: #fde4e1;
  --focus: #2563eb;
  --radius-sm: 6px;
  --radius: 12px;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1a13; --surface: #15241b; --ink: #e6f0e8; --muted: #9db5a6; --line: #26392d;
    --aisle: #2c7a53; --aisle-ink: #f3faf5; --kraft: #a98250; --halal: #2e9e6c;
    --warn: #ffd27a; --warn-soft: #3a2c0e; --error: #ffb4ab; --error-soft: #3d1512; --focus: #8ab4ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: var(--aisle); }
code { background: var(--warn-soft); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Storefront: header with awning edge ---------- */
.topbar { background: var(--aisle); color: var(--aisle-ink); position: relative; z-index: 4; }
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 12px;
  background: radial-gradient(circle at 12px 0, var(--aisle) 11px, transparent 12px) 0 0 / 24px 12px repeat-x;
}
.topbar-in { max-width: 1040px; margin: auto; padding: 14px 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--aisle-ink); text-decoration: none; }
/* v4.8 FlyerFox logo: the fox sits on a cream badge (never straight on the green). */
.logo-badge { width: 42px; height: 42px; border-radius: 50%; background: #fff7e8; display: grid; place-items: center; flex: none; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.logo-badge img { width: 33px; height: 33px; margin-top: 2px; display: block; }
.logo .wordmark { font: 800 28px/1 var(--display); letter-spacing: .01em; color: #fff; }
.logo .wordmark .w1 { color: #ffd43b; }
.logo .wordmark .w2 { color: #fff; }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--aisle-ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 7px 14px; border-radius: 999px; white-space: nowrap; opacity: .85; }
.nav a:hover { opacity: 1; }
.nav a.on { background: var(--tag); color: #3a2a00; opacity: 1; }

.wrap { max-width: 1040px; margin: auto; padding: 0 16px; }
.hero { padding: 44px 0 6px; }
.hero h1 { font: 800 clamp(40px, 7vw, 66px)/0.98 var(--display); margin: 0 0 12px; max-width: 15ch; }
.hero p { color: var(--muted); margin: 0; max-width: 56ch; font-size: 18px; }

/* ---------- Sign-up form ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.step { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font: 700 27px/1.1 var(--display); flex-wrap: wrap; }
.step b { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--aisle); color: var(--aisle-ink); font: 800 18px/1 var(--display); flex: none; }
.step .opt { font: 400 15px var(--body); color: var(--muted); }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 14px; max-width: 64ch; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
label.f { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=search], textarea {
  width: 100%; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--aisle); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aisle) 25%, transparent); }
input[readonly] { opacity: .7; }
textarea { min-height: 88px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Chips = little paper price tags with a punched hole */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  position: relative; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px 8px 26px; border-radius: 4px 14px 14px 4px; font: 700 15px/1.2 var(--body); cursor: pointer;
}
.chip::before {
  content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line);
}
.chip:hover { border-color: var(--aisle); }
.chip.on { background: var(--tag); border-color: var(--tag-edge); color: #3a2a00; }
.chip.on::before { box-shadow: inset 0 0 0 1.5px var(--tag-edge); }
.cat { margin-top: 20px; }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cat-head h3 { margin: 0; font: 700 21px/1.1 var(--display); }
.linkbtn { background: none; border: 0; color: var(--aisle); font: 700 14px var(--body); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* Halal preference switch */
.switch { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 10px; margin: 4px 0 6px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + .track { background: var(--halal); }
.switch input:checked + .track::after { left: 23px; }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch b { display: block; }
.switch small { color: var(--muted); font-size: 14px; }

/* Anything marked hidden stays hidden, even if a style gives it display:flex (v3.8) */
[hidden] { display: none !important; }

/* Save bar */
.savebar { position: sticky; bottom: 0; z-index: 20; padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.savebar-in { max-width: 1040px; margin: auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.count { font-size: 15px; color: var(--muted); }
.count b { color: var(--ink); }
.btn { background: var(--aisle); color: var(--aisle-ink); border: 0; border-radius: 10px; padding: 13px 24px; font: 800 21px/1 var(--display); letter-spacing: .02em; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--aisle); box-shadow: inset 0 0 0 2px var(--aisle); }

/* Notices */
.notice { padding: 13px 15px; border-radius: 10px; margin: 14px 0; font-size: 16px; background: color-mix(in srgb, var(--aisle) 12%, var(--surface)); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--error-soft); color: var(--error); }
.done { text-align: center; padding: 44px 20px; }
.done .big { font-size: 52px; }
.done h2 { font: 800 42px/1 var(--display); margin: 10px 0; }
.done p { color: var(--muted); max-width: 46ch; margin: 8px auto; }
.done .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.loading { color: var(--muted); padding: 44px 0; text-align: center; }

/* ---------- Deals page ---------- */
.controls { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 16px 0 10px; }
.controls-row { display: flex; gap: 10px; align-items: center; }
.controls-row input { flex: 1; min-width: 0; }
.store-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.store-chips .chip { flex: none; padding-left: 14px; border-radius: 999px; }
.store-chips .chip::before { display: none; }
.halal-toggle { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 11px 15px; font: 700 15px var(--body); cursor: pointer; white-space: nowrap; }
.halal-toggle .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--halal); }
.halal-toggle[aria-pressed=true] { background: var(--halal); border-color: var(--halal); color: #fff; }
.halal-toggle[aria-pressed=true] .dot { background: #fff; box-shadow: none; }

/* Aisle signs as category headings */
.aisle {
  display: inline-flex; align-items: center; gap: 10px; margin: 36px 0 14px; padding: 9px 18px 8px;
  background: var(--aisle); color: var(--aisle-ink); border-radius: var(--radius-sm);
  font: 800 25px/1 var(--display); letter-spacing: .01em; position: relative;
}
.aisle::before, .aisle::after { content: ""; position: absolute; top: -16px; width: 2px; height: 16px; background: var(--kraft); }
.aisle::before { left: 22px; }
.aisle::after { right: 22px; }
.aisle .ico { font-size: 20px; }
.aisle.hot { background: var(--sale); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

/* The shelf-tag card */
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 4px 4px; display: flex; flex-direction: column; overflow: hidden; }
.deal-main { padding: 14px 16px 12px; flex: 1; }
.deal h4 { margin: 0; font: 700 24px/1.05 var(--display); }
.deal .store { font-weight: 700; margin-top: 6px; font-size: 16px; }
.deal .meta { color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 4px; background: color-mix(in srgb, var(--aisle) 10%, var(--surface)); }
.pill.find { background: color-mix(in srgb, var(--kraft) 32%, var(--surface)); }
.pill.halal { background: var(--halal); color: #fff; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.deal details { margin-top: 10px; font-size: 14px; }
.deal summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.deal ul { list-style: none; padding: 0; margin: 6px 0 0; }
.deal li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.deal li span:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.deal li small { color: var(--muted); font-weight: 400; font-size: 13px; }

.tag { display: flex; align-items: center; gap: 12px; background: var(--tag); color: #2b2000; padding: 10px 16px; border-top: 3px solid var(--tag-edge); }
.tag-price { font: 800 46px/0.9 var(--display); color: var(--sale); display: flex; align-items: flex-start; }
.tag-price .cur { font-size: 22px; margin: 4px 1px 0 0; }
.tag-price .cents { font-size: 23px; margin: 4px 0 0 1px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.tag-side { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.tag-side .unit { font-weight: 700; }
.tag-side .was { text-decoration: line-through; opacity: .75; }
.tag .off { margin-left: auto; background: var(--sale); color: #fff; font: 800 19px/1 var(--display); padding: 7px 9px; border-radius: 4px; transform: rotate(-4deg); white-space: nowrap; }

.empty { color: var(--muted); text-align: center; padding: 56px 0; font-size: 18px; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--aisle); color: var(--aisle-ink); border-radius: var(--radius); padding: 20px 22px; margin: 40px 0 24px; }
.cta b { font: 800 29px/1 var(--display); display: block; margin-bottom: 4px; }
.cta a { background: var(--tag); color: #3a2a00; text-decoration: none; font: 800 21px/1 var(--display); padding: 12px 18px; border-radius: 10px; }
footer { color: var(--muted); font-size: 14px; padding: 8px 0 48px; max-width: 70ch; }

/* Phones: search on its own line, Halal switch below it */
@media (max-width: 560px) {
  .controls-row { flex-wrap: wrap; }
  .controls-row input { flex-basis: 100%; }
  .tag-price { font-size: 42px; }
}

/* ---------- Feedback ---------- */
.fb-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 5;
  background: var(--tag); color: #3a2a00; border: 2px solid var(--tag-edge); border-radius: 999px;
  padding: 10px 16px; font: 800 19px/1 var(--display); letter-spacing: .02em; cursor: pointer;
  box-shadow: 0 6px 18px rgba(18, 59, 42, .22);
}
.fb-fab:hover { filter: brightness(1.04); }
/* While the save bar shows, the floating button moves into the bar so it never covers item chips (v3.8) */
body.has-savebar .fb-fab { display: none; }
html:has(body.has-savebar) { scroll-padding-bottom: 110px; }
.savebar-act { display: flex; align-items: center; gap: 10px; }
.fb-mini { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--tag); font-size: 21px; cursor: pointer; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.fb-mini:hover { filter: brightness(1.04); }
.fb-mini:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-foot { padding-bottom: 40px; }
footer a { color: inherit; font-weight: 700; }
dialog.fb { border: 0; border-radius: 14px; padding: 0; width: calc(100% - 32px); max-width: 520px; background: var(--surface); color: var(--ink); }
dialog.fb::backdrop { background: rgba(10, 30, 20, .55); }
.fb-form { padding: 20px 22px 18px; }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fb-head h2, .fb-thanks h2 { margin: 0 0 6px; font: 800 30px/1 var(--display); }
.fb-x { background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.fb-about { background: var(--bg); border-left: 4px solid var(--tag-edge); padding: 8px 12px; border-radius: 6px; font-size: 15px; margin-bottom: 12px; }
.fb-about span { color: var(--muted); font-size: 13px; font-weight: 700; margin-right: 4px; }
.fb-types { margin: 4px 0 14px; }
.fb-types .chip { padding-left: 12px; border-radius: 999px; }
.fb-types .chip::before { display: none; }
.f .opt { font-weight: 400; color: var(--muted); }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.fb-thanks { text-align: center; }
.fb-thanks .big { font-size: 44px; }
.fb-thanks .fb-actions { justify-content: center; }
.deal .report { background: none; border: 0; padding: 0; margin-top: 10px; color: var(--muted); font: 700 13px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: block; }
.deal .report:hover { color: var(--sale); }

/* ---------- Hero banner with aisle image (v3.3) ---------- */
html, body { overflow-x: clip; }
.hero.scene {
  position: relative; isolation: isolate;
  margin: 0 calc(50% - 50vw);
  padding: 84px max(16px, calc(50vw - 504px)) 44px;   /* 520 wrap half-width − 16 gutter → lines up with the content below */
  min-height: 360px; display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff;
  background-color: #123b2a;
  background-image: var(--hero-img, url("aisle.svg"));
  background-size: cover; background-position: center 55%; background-repeat: no-repeat;
}
.hero.scene::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 34, 23, .9) 0%, rgba(10, 34, 23, .72) 42%, rgba(10, 34, 23, .18) 100%),
    linear-gradient(0deg, rgba(10, 34, 23, .55) 0%, rgba(10, 34, 23, 0) 55%);
}
.hero.scene h1 { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.hero.scene p { color: rgba(255, 255, 255, .9); }
.hero.scene + .controls, .hero.scene + #app { margin-top: 6px; }
@media (max-width: 560px) {
  .hero.scene { min-height: 300px; padding-top: 64px; background-position: 58% 55%; }
  .hero.scene::before { background: linear-gradient(0deg, rgba(10, 34, 23, .9) 0%, rgba(10, 34, 23, .62) 60%, rgba(10, 34, 23, .35) 100%); }
}

/* v3.7: show every store on desktop (wrap), keep a swipeable row with a fade hint on phones */
.store-chips { flex-wrap: wrap; overflow: visible; }
@media (max-width: 560px) {
  .store-chips { flex-wrap: nowrap; overflow-x: auto;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
            mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 24px; }
}

/* ---------- Basket page (v4.2) ---------- */
.tabs { display: flex; gap: 6px; margin: 20px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px; width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: none; color: var(--ink); font: 800 19px/1 var(--display); letter-spacing: .02em; padding: 11px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { background: var(--aisle); color: var(--aisle-ink); }
.budget-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.money { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); padding-left: 12px; }
.money span { font: 800 30px/1 var(--display); color: var(--muted); }
.money input { width: 130px; border: 0; background: none; color: var(--ink); font: 800 34px/1 var(--display); padding: 10px 10px 8px 4px; }
.money input:focus { outline: none; }
.money:focus-within { border-color: var(--aisle); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aisle) 25%, transparent); }
.chips.quick .chip { padding-left: 14px; border-radius: 999px; }
.chips.quick .chip::before { display: none; }
.seg-wrap { margin: 18px 0 12px; }
.seg-wrap .f { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); color: var(--ink); font: 700 15px var(--body); padding: 10px 16px; cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--tag); color: #3a2a00; }
.pick-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.btn.small { font-size: 17px; padding: 9px 14px; }
.picked { list-style: none; padding: 0; margin: 0 0 12px; }
.picked li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.picked li.none { color: var(--muted); font-size: 15px; border: 0; }
.pname { flex: 1; min-width: 0; font-weight: 700; }
.pname small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.pname small.ns { color: var(--warn); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 36px; height: 34px; border: 0; background: var(--surface); color: var(--ink); font: 700 20px/1 var(--body); cursor: pointer; }
.qty button:hover { background: var(--bg); }
.qty b { min-width: 28px; text-align: center; }
.rm { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px 8px; }
.rm:hover { color: var(--sale); }
.chip.add small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.chip.add.other { border-style: dashed; }
.aisle-pick { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.aisle-pick summary { cursor: pointer; font: 700 20px/1.2 var(--display); padding: 4px 0; }
.aisle-pick summary small { font: 400 14px var(--body); color: var(--muted); margin-left: 4px; }
.aisle-pick .chips { margin: 8px 0 6px; }
.lead { font-size: 17px; margin: 0 0 16px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; align-items: start; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 4px 4px; overflow: hidden; }
.plan-head { padding: 14px 16px 12px; }
.plan-kind { display: inline-block; font: 800 14px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--aisle); background: color-mix(in srgb, var(--aisle) 12%, var(--surface)); padding: 5px 8px; border-radius: 4px; }
.plan.low .plan-kind { color: var(--sale); background: color-mix(in srgb, var(--sale) 10%, var(--surface)); }
.plan h3 { margin: 8px 0 2px; font: 700 26px/1.05 var(--display); }
.plan .meta { color: var(--muted); font-size: 14px; margin: 0; }
.plan-list summary { cursor: pointer; font-weight: 700; padding: 12px 16px; color: var(--aisle); }
.plan-list[open] summary { border-bottom: 1px solid var(--line); }
.plan-list .slist, .plan-body .slist { padding: 10px 16px 4px; }
.plan-body { padding-bottom: 8px; }
.slist-head { display: flex; justify-content: space-between; font-size: 16px; border-bottom: 2px solid var(--aisle); padding-bottom: 4px; }
.slist ul { list-style: none; padding: 0; margin: 4px 0 6px; }
.slist li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.slist li:first-child { border-top: 0; }
.slist li small { display: block; color: var(--muted); font-size: 13px; }
.slist li > span:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.slist .pill { font-size: 12px; padding: 1px 7px; vertical-align: 1px; }
.budget-plan { max-width: 640px; }
.rank { margin-top: 22px; }
.rank summary { cursor: pointer; font-size: 17px; }
.rank table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.rank th, .rank td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.rank th:last-child, .rank td:last-child { text-align: right; }
.deal .add-basket { background: none; border: 0; padding: 0; margin-top: 10px; color: var(--aisle); font: 700 13px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-right: 14px; }
.deal-actions { display: flex; flex-wrap: wrap; align-items: baseline; }
.deal-actions .report { margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; z-index: 30; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.toast a { color: var(--tag); margin-left: 8px; }
@media (max-width: 560px) {
  .tabs { width: 100%; }
  .tabs button { flex: 1; font-size: 17px; padding: 11px 8px; }
  .nav { gap: 2px; }
  .nav a { padding: 7px 10px; font-size: 14px; }
  .logo .wordmark { font-size: 24px; }
  .logo-badge { width: 36px; height: 36px; }
  .logo-badge img { width: 28px; height: 28px; }
  .seg { display: flex; width: 100%; flex-wrap: nowrap; }
  .seg button { flex: 1; padding: 10px 4px; font-size: 14px; }
}

/* ---------- Halal meat aisle (v4.3) ---------- */
.aisle.halal { background: var(--halal); }
.aisle-note { color: var(--muted); font-size: 15px; margin: -4px 0 14px; max-width: 64ch; }
.halal-jump { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--halal); background: var(--surface); color: var(--halal); border-radius: 999px; padding: 11px 15px; font: 700 15px var(--body); text-decoration: none; white-space: nowrap; }
.halal-jump:hover { background: var(--halal); color: #fff; }
#halal-meat { scroll-margin-top: 150px; }

/* ---------- "It worked" feedback (v4.3) ---------- */
.chip, .btn, .qty button, .seg button, .tabs button, .add-basket, .halal-jump, .fb-mini, .fb-fab, .rm, .halal-toggle, .switch .track {
  transition: transform .09s ease, background-color .15s ease, color .15s ease;
}
.chip:active, .btn:active, .qty button:active, .seg button:active, .tabs button:active, .add-basket:active,
.halal-jump:active, .fb-mini:active, .fb-fab:active, .rm:active, .halal-toggle:active { transform: scale(.94); }
.switch:active .track { transform: scale(.94); }
.deal .add-basket.added { color: var(--halal); text-decoration: none; }
.nav-count {
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px;
  background: var(--sale); color: #fff; font: 800 13px/20px var(--body); text-align: center; vertical-align: 1px;
}
.nav-count.bump { animation: basket-bump .4s ease; }
@keyframes basket-bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
@media (max-width: 400px) {
  .nav a { padding: 7px 8px; }
  .nav-count { margin-left: 4px; min-width: 18px; height: 18px; font-size: 12px; line-height: 18px; padding: 0 5px; }
}

/* ---------- WhatsApp (v4.4) ---------- */
:root { --wa: #128c4a; }
.wa-follow { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: color-mix(in srgb, var(--wa) 12%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--wa) 35%, var(--surface)); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.wa-follow b { font: 800 26px/1 var(--display); display: block; margin-bottom: 4px; color: var(--wa); }
.wa-btn, .wa-share { display: inline-flex; align-items: center; gap: 7px; background: var(--wa); color: #fff; border: 0; border-radius: 10px; text-decoration: none; cursor: pointer; font: 800 19px/1 var(--display); letter-spacing: .02em; padding: 11px 16px; }
.wa-btn:hover, .wa-share:hover { filter: brightness(1.08); }
.wa-share.small { font-size: 16px; padding: 8px 12px; }
.deal .share-deal { background: none; border: 0; padding: 0; margin-top: 10px; margin-right: 14px; color: var(--wa); font: 700 13px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.deal .share-deal svg { width: 14px; height: 14px; }
.aisle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aisle-row .aisle { margin-bottom: 14px; }
.plan-share { padding: 4px 16px 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.copy-btn { background: none; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); font: 700 14px var(--body); padding: 8px 12px; cursor: pointer; }
.shared-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.shared-note .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chip, .btn, .wa-btn, .wa-share, .copy-btn { transition: transform .09s ease; }
.wa-btn:active, .wa-share:active, .copy-btn:active, .share-deal:active { transform: scale(.94); }

/* ---------- More ways to save (v4.5): a quiet footer note, not a card ---------- */
.more-save { margin: 34px 0 6px; padding: 14px 0 0; border-top: 1px dashed var(--line); max-width: 70ch; }
.more-save h2 { font: 700 20px/1.1 var(--display); margin: 0 0 4px; color: var(--muted); }
.more-save p { margin: 0; color: var(--muted); font-size: 15px; }
.more-save a { color: var(--aisle); font-weight: 700; }
.slist .pill.cond { background: var(--warn-soft); color: var(--warn); }

/* ---------- Front door (v4.6): deals first, sign-up optional ---------- */
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--tag); color: #3a2a00; text-decoration: none; font: 800 19px/1 var(--display); letter-spacing: .02em; padding: 12px 16px; border-radius: 10px; transition: transform .09s ease; }
.hero-btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.hero-btn:hover { filter: brightness(1.06); }
.hero-btn:active { transform: scale(.95); }
.hero.scene .hero-note { margin-top: 10px; font-size: 14px; color: rgba(255, 255, 255, .78); }

/* ---------- Price checks & "Spotted a price?" (v4.7) ---------- */
.spot-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--aisle); background: var(--surface); color: var(--aisle); border-radius: 999px; padding: 11px 15px; font: 700 15px var(--body); cursor: pointer; white-space: nowrap; transition: transform .09s ease; }
.spot-btn:hover { background: color-mix(in srgb, var(--aisle) 8%, var(--surface)); }
.spot-btn:active { transform: scale(.95); }
.pill.seen { background: color-mix(in srgb, var(--focus) 14%, var(--surface)); }
.row3 { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 > div:first-child { grid-column: span 2; } }
dialog.fb select, dialog.fb input[type=number], dialog.fb input[type=text], dialog.fb input[type=email] {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
dialog.fb input[type=file] { width: 100%; font: 15px var(--body); color: var(--muted); }
.money.sm { padding-left: 10px; }
.money.sm span { font-size: 20px; }
.money.sm input { width: 100%; font: 700 18px/1 var(--body); padding: 11px 8px 11px 2px; border: 0; }
dialog.fb { max-height: calc(100vh - 32px); overflow-y: auto; }
.pack-note { font-size: 14px; margin-top: -6px; }
@media (max-width: 560px) { .controls-row { flex-wrap: wrap; } }
dialog.fb .money.sm input { border: 0; background: none; box-shadow: none; padding-left: 2px; }
dialog.fb .money.sm input:focus { box-shadow: none; }
#spPhoto { margin-top: 2px; }

/* ---------- v4.9: FlyerFox everywhere ---------- */
.hero { position: relative; }
.hero-fox { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: #fff7e8;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); margin: 0 0 14px; }
.hero-fox img { width: 66px; height: 66px; margin-top: 4px; display: block; }
@media (min-width: 760px) {
  .hero-fox { position: absolute; right: max(16px, calc(50vw - 504px)); top: 50%; transform: translateY(-38%); width: 170px; height: 170px; margin: 0; }
  .hero-fox img { width: 134px; height: 134px; margin-top: 8px; }
}
.foot-brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.foot-brand img { width: 30px; height: 30px; }
.foot-brand .wordmark { font: 800 22px/1 var(--display); }
.foot-brand .w1 { color: var(--aisle); }
.foot-brand .w2 { color: #e06a1f; }
.foot-brand .foot-tag { font-size: 13px; color: var(--muted); }
.done-fox { width: 120px; height: 120px; display: block; margin: 0 auto 6px; }
.done-brand { font: 800 22px/1 var(--display); color: var(--muted); letter-spacing: .02em; }
.done-brand .w1 { color: var(--aisle); }
.done-brand .w2 { color: #e06a1f; }

/* ---------- v5.0: distances ---------- */
.loc-wrap { margin: 10px 0 4px; }
.locbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
.locbar.on { border-style: solid; }
.loc-title { font-weight: 700; color: var(--ink); }
.loc-gps { border: 0; background: var(--aisle); color: #fff; font: 700 15px var(--body); border-radius: 999px; padding: 9px 15px; cursor: pointer; }
.loc-gps:disabled { opacity: .6; cursor: progress; }
.loc-or { color: var(--muted); font-size: 14px; }
.loc-fsa { display: inline-flex; gap: 6px; }
.loc-fsa input { width: 86px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; font: 700 16px var(--body); text-transform: uppercase; letter-spacing: .06em; background: var(--surface); color: var(--ink); }
.loc-fsa button { border: 1.5px solid var(--aisle); background: var(--surface); color: var(--aisle); font: 700 15px var(--body); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.loc-note { margin: 6px 2px 0; font-size: 13px; color: var(--muted); }
.km-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.km-seg button { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 14px var(--body); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.km-seg button.on { background: var(--tag); border-color: var(--tag-edge); color: #3a2a00; }
.dist { color: var(--muted); font-weight: 400; }
.dist b { color: var(--aisle); font-weight: 700; }
.chip small { font-weight: 400; color: var(--muted); margin-left: 2px; }
.chip.on small { color: #5a4500; }
.near-chip { border-style: dashed; }
.plan-dist { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.plan-dist b { color: var(--aisle); }
@media (prefers-color-scheme: dark) { .dist b, .plan-dist b { color: #8fd3ad; } .loc-fsa button { color: #8fd3ad; border-color: #2c7a53; } }
@media (max-width: 560px) {
  .km-seg { margin-left: 0; width: 100%; }
  .km-seg button { flex: 1; padding: 7px 4px; }
  .locbar { padding: 10px; }
}

/* ---------- v5.1: FlyerFox aisle icons (Option 1: bigger cream tile with a yellow ring) ---------- */
.aisle.has-tile { padding: 5px 18px 5px 5px; gap: 12px; }
.aisle .tile { flex: none; width: 52px; height: 52px; border-radius: 10px; background: #fff7e8; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--tag); }
.aisle .tile img { width: 46px; height: 46px; display: block; }
.halal-jump .jump-ico { width: 26px; height: 26px; display: block; }
@media (max-width: 560px) {
  .aisle .tile { width: 46px; height: 46px; }
  .aisle .tile img { width: 40px; height: 40px; }
}
/* v5.1: on phones and short screens the filter area no longer stays pinned at the top.
   With the location bar it took up half the screen and hid the deals while scrolling. */
@media (max-width: 760px), (max-height: 700px) {
  .controls { position: static; }
}

/* v5.4 */
.tag-price .per { font: 700 18px/1 var(--display); color: var(--sale); margin: 26px 0 0 3px; }
.wait-note { margin: 6px 2px 0; font-size: 13px; color: var(--muted); }
.wait-note:empty { display: none; }
.f .opt { font-weight: 400; color: var(--muted); font-size: 13px; }

/* v5.5: town buttons in the location bar */
.loc-towns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.loc-towns .town { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 14px var(--body); border-radius: 999px; padding: 7px 13px; cursor: pointer; }
.loc-towns .town:hover { border-color: var(--aisle); }
.loc-towns { gap: 5px; }
.loc-towns .town { padding: 6px 11px; }
@media (max-width: 380px) { .loc-towns .town { padding: 6px 8px; font-size: 13px; } }
