/* Theme tokens — the mobile app's design tokens, applied to the website.

   The app is the source of truth: apps/mobile/constants/theme/ (palette.ts
   holds the hexes, roles.ts says what each is for, index.ts the spacing,
   radius, type and shadow scales). Every token below carries its app role
   name — `Colors.action.primary` is `--action-primary` — and the comment
   beside it names the palette step it comes from. To retheme the site, change
   values here and nowhere else; rules below only ever name a token.

   The app ships light-only, so the dark register further down is a companion
   built for the web from the same hues. */
@font-face {
  /* FontFamily.display: Plus Jakarta Sans Bold, for titles and headings only.
     Running text stays on the system face, as it does in the app. */
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/plus-jakarta-sans-700.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* Spacing, radius and type: the same in both colour schemes. */
  --space-2xs: 2px; --space-xs: 4px; --space-sm: 8px; --space-md: 12px;
  --space-base: 16px; --space-lg: 20px; --space-xl: 24px; --space-2xl: 32px;
  --space-3xl: 48px;

  /* sm: chips and thumbnails. md: inputs and small cards. lg: buttons and
     cards. 2xl: sheets and the delivery panel. */
  --radius-xs: 4px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-2xl: 24px; --radius-full: 9999px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* The page's side gutter. Every full-width block takes it, so headings,
     cards and the header line up at any width. */
  --gutter: 1.25rem;
  /* The smallest thing a finger is asked to hit. */
  --tap: 44px;

  /* The coverage map, read by serviceability.js. The same in both colour
     schemes, because the map tiles are always light. */
  --map-area: #264A37;       /* grocer600 */
  --map-highlight: #A64414;  /* clay800 */
}

/* The light roles. Also pinned on the surfaces that stay light whatever the
   visitor's colour scheme: the map embedded in the app, the step tiles, and
   the checker card on the deep green panel. */
:root, html.embed, .tint, .panel .checker {
  /* text */
  --text-primary: #1B1815;        /* ink900 */
  --text-secondary: #463F38;      /* ink700 */
  --text-muted: #6B625A;          /* ink500 */
  --text-on-brand: #FFFFFF;       /* white */
  --text-brand: #316226;          /* basil700: links, green copy */
  --text-brand-strong: #274F1E;   /* basil800: green copy on a green wash */
  --text-price: #1B1815;          /* ink900: a price is ink, not green */
  --text-savings: #316226;        /* basil700: money the shopper keeps */

  /* surface */
  --surface-canvas: #FAFAFA;      /* stone25 */
  --surface-card: #FFFFFF;        /* white */
  --surface-sunken: #F4F3EE;      /* stone50 */
  --surface-brand-deep: #1B3B2B;  /* spruce900: the delivery panel */
  --surface-brand-subtle: #EEF3ED;/* basil50 */

  /* border */
  --border-default: #E6E1D8;      /* stone200 */
  --border-strong: #D1CBBE;       /* stone300 */
  --border-brand: #316226;        /* basil700: the outline button */
  --border-focus: #1B3B2B;        /* spruce900 */

  /* action */
  --action-primary: #264A37;         /* grocer600: the primary button */
  --action-primary-pressed: #1F3D2D; /* grocer700 */
  --action-tonal: #EEF3ED;           /* basil50 */
  --action-tonal-pressed: #DCE8DA;   /* basil100 */

  /* accent — terracotta. Offers and notices, never an action. */
  --accent-primary: #A64414;      /* clay800 */
  --accent-bg: #FDF0E6;           /* clay50 */
  --accent-on-dark: #F0A776;      /* clay300 */
  --accent-offer: #BF4D2B;        /* tangerine700: the discount badge, under white type */

  /* chrome — the home screen's peach header band. */
  --chrome-header: #FBE3D0;       /* peach100 */

  /* The ground behind a product photo: white in both colour schemes, because
     the photos are shot on white. */
  --surface-product-image: #FFFFFF;

  /* overlay */
  --overlay-on-dark-primary: rgba(255, 255, 255, .85);
  --overlay-hairline: rgba(0, 0, 0, .08);

  /* Step tiles: the app's pale washes, each with the ink it carries. */
  --tint-sage: #E6F0E5;           /* sage50 */
  --tint-sage-ink: #274F1E;       /* basil800 */
  --tint-amber: #FCF6EB;          /* amber50 */
  --tint-amber-ink: #7A4405;      /* amber900 */
  --tint-amber-border: #F1E1C8;   /* amber200 */
  --tint-cream: #F7EADF;          /* cream100 */
  --tint-cream-ink: #A64414;      /* clay800 */

  /* Shadow.sm / md / lg, mixed from the warm shadowInk (#4A2B0A). */
  --shadow-sm: 0 1px 2px rgba(74, 43, 10, .06);
  --shadow-md: 0 3px 8px rgba(74, 43, 10, .12);
  --shadow-lg: 0 8px 18px rgba(74, 43, 10, .18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F3EFE6;
    --text-secondary: #D2CBBC;
    --text-muted: #9C9384;
    --text-brand: #78C79A;        /* forest200: the app's green on dark */
    --text-brand-strong: #DCEDE2; /* forest100 */
    --text-price: #F3EFE6;
    --text-savings: #78C79A;

    --surface-canvas: #17150F;
    --surface-card: #1F1C15;
    --surface-sunken: #14120D;
    --surface-brand-subtle: #1C2E24;

    --border-default: #322D24;
    --border-strong: #4A4336;
    --border-brand: #78C79A;
    --border-focus: #78C79A;

    --action-tonal: #1C2E24;
    --action-tonal-pressed: #264A37;

    --accent-primary: #F0A776;    /* clay300 */
    --accent-bg: #332014;

    /* No peach band on a dark page: the header sits on the canvas. */
    --chrome-header: #17150F;
    --overlay-hairline: rgba(255, 255, 255, .14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 3px 8px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 18px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.65 var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-canvas);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* The app's focus ring: the deep forest of the button a field submits to. */
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }

/* Titles and headings take the display face; its one weight is bold. */
h1, h2, h3, .brand { font-family: var(--font-display); font-weight: 700; }

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 25rem) { :root { --gutter: 1rem; } }
.narrow { max-width: 46rem; }

/* ── Header ─────────────────────────────────────────────────────────── */
/* The app's home header band: peach, with a hairline where it meets the page. */
header {
  border-bottom: 1px solid var(--overlay-hairline);
  position: sticky; top: 0;
  background: var(--chrome-header);
  z-index: 10;
}
header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
/* The brand: the logo's basket mark beside the name, on every page. The name
   is two words set with a gap; the mark sits a little further off. */
.brand {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em;
  color: var(--text-primary); text-decoration: none;
}
.brand span { color: var(--text-brand); }
.brand img { width: 40px; height: 40px; flex: none; margin-right: .2rem; }
nav { display: flex; gap: 1.25rem; font-size: .95rem; }
nav a { color: var(--text-secondary); text-decoration: none; }
nav a:hover { color: var(--text-primary); }

/* The phone menu. A checkbox and its label, so it opens without a script;
   from 40rem up both are gone and the links sit in the header as before. */
.menu-toggle, .menu-button { display: none; }
@media (max-width: 40rem) {
  header .wrap { flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
  .brand { min-height: var(--tap); align-items: center; }
  /* Kept in the page for the keyboard and screen readers, drawn as the label. */
  .menu-toggle {
    display: block; position: absolute; width: 1px; height: 1px;
    margin: -1px; opacity: 0; pointer-events: none;
  }
  .menu-button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--tap); padding: 0 var(--space-base);
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
    background: var(--surface-card); color: var(--text-primary);
    font-size: .9375rem; font-weight: 600; cursor: pointer; user-select: none;
  }
  .menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--border-focus); outline-offset: 3px; }
  .menu-toggle:checked + .menu-button { background: var(--surface-sunken); }
  .menu-toggle ~ nav { display: none; }
  .menu-toggle:checked ~ nav {
    display: flex; flex-direction: column; gap: 0; flex-basis: 100%;
    border-top: 1px solid var(--overlay-hairline); margin-top: .5rem; font-size: 1rem;
  }
  .menu-toggle ~ nav a {
    display: flex; align-items: center; min-height: 48px;
    color: var(--text-primary); font-weight: 600;
  }
  .menu-toggle ~ nav a + a { border-top: 1px solid var(--overlay-hairline); }

  /* A header with only a link or two keeps them beside the brand. */
  header nav a { display: inline-flex; align-items: center; min-height: var(--tap); }

  footer nav { flex-wrap: wrap; gap: 0 1.25rem; }
  footer nav a { display: inline-flex; align-items: center; min-height: var(--tap); white-space: nowrap; }
}

/* ── Hero ───────────────────────────────────────────────────────────── */
/* The header's peach band carries on behind the hero, edge to edge: the shadow
   paints the band out to both sides and the clip keeps it to the hero's own
   height, so the markup stays a plain centred column. */
.hero {
  padding: 5rem var(--gutter) 4.5rem;
  background: var(--chrome-header);
  box-shadow: 0 0 0 100vmax var(--chrome-header);
  clip-path: inset(0 -100vmax);
}
.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.25rem); line-height: .98;
  letter-spacing: -.02em; font-weight: 700;
  margin: 0 0 1.25rem; text-wrap: balance;
}
/* The brand name leads the headline for search engines, set small so the
   promise stays the headline a visitor reads. */
.h1-brand {
  display: block; margin-bottom: .9rem; color: var(--text-brand);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; line-height: 1;
}
/* One word in the headline carries the brand green. */
.hl { color: var(--text-brand); }
/* The logo, large, beside the headline where there is room for it; on a phone
   the header's mark does that job. */
.hero-mark { display: none; }
@media (min-width: 48rem) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2rem; align-content: center; }
  .hero > * { grid-column: 1; }
  .hero-mark { display: block; grid-column: 2; grid-row: 1 / span 3; align-self: center; width: clamp(11rem, 24vw, 16rem); height: auto; }
}
.hero p { font-size: 1.2rem; color: var(--text-secondary); margin: 0 0 2rem; max-width: 46ch; }
/* A notice above a page's headline: terracotta, the app's colour for anything
   asking to be noticed. */
.pill {
  display: inline-block; padding: .35rem .8rem; border-radius: var(--radius-full);
  background: var(--accent-bg); color: var(--accent-primary);
  font-size: .82rem; font-weight: 700; margin-bottom: 1.5rem;
  box-shadow: inset 0 0 0 1px currentColor;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
/* Pressed and hovered states darken rather than lighten: pressing a control
   should look like pushing it into the page. */
.btns { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
/* On a phone a pair of buttons stacks, each the full width of the column. */
@media (max-width: 30rem) {
  .btns { flex-direction: column; align-items: stretch; }
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;
  font-size: 1.0625rem; font-weight: 700; text-decoration: none;
  padding: var(--space-sm) var(--space-xl); border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  transition: background-color 120ms ease, transform 120ms ease;
}
.btn:active { transform: translateY(1px); }
/* The app's Button variants: primary is the one filled action, secondary the
   outline on a card ground, tonal the quiet green wash. */
.btn-primary { background: var(--action-primary); color: var(--text-on-brand); }
.btn-primary:hover { background: var(--action-primary-pressed); }
.btn-secondary { background: var(--surface-card); color: var(--text-brand); border-color: var(--border-brand); }
.btn-secondary:hover { background: var(--surface-brand-subtle); }
.btn-tonal { background: var(--action-tonal); color: var(--text-brand-strong); }
.btn-tonal:hover { background: var(--action-tonal-pressed); }

/* ── Sections ───────────────────────────────────────────────────────── */
section { padding: 4rem 0; border-top: 1px solid var(--border-default); }
section.flush { border-top: 0; padding-top: 1rem; }
/* A phone gets the same order of things with less air between them. */
@media (max-width: 40rem) {
  section { padding: 2.5rem 0; }
  .hero { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .hero p { font-size: 1.1rem; margin-bottom: 1.5rem; }
  .page-head { padding-top: 2rem; }
  .legal { padding-top: 2rem; }
  .panel { padding: 1.5rem 1.25rem; }
  .panel .checker { margin-top: 1.25rem; }
  .checker { padding: 1rem; }
  .card { padding: 1.15rem; }
  /* A step: its number on the left, the words beside it. */
  .tint { display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: start; }
  .tint .card-head { display: contents; }
  .tint .badge { grid-row: 1 / span 3; margin-top: .1rem; }
  .tint .step, .tint h3, .tint p { grid-column: 2; }
  .tint .step { margin-bottom: .35rem; }
}
section h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -.02em;
  font-weight: 700; margin: 0 0 .5rem;
}
section .lede { color: var(--text-secondary); margin: 0 0 2rem; max-width: 52ch; font-size: 1.05rem; }
section a:not(.btn) { color: var(--text-brand); }
section a:not(.btn):hover { color: var(--text-brand-strong); }

/* ── Delivery panel ─────────────────────────────────────────────────── */
/* The app's deep forest surface (surface.brandDeep), the same in both colour
   schemes. Type on it is white; the highlight is the warm accent the app sets
   on dark surfaces. */
.panel {
  background: var(--surface-brand-deep); color: var(--text-on-brand);
  border-radius: var(--radius-2xl); padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--shadow-md);
}
.panel h2 { color: var(--text-on-brand); }
.panel .lede { color: var(--overlay-on-dark-primary); margin: 0; max-width: 54ch; }
.hl-on-dark { color: var(--accent-on-dark); font-weight: 600; }

/* ── Step tiles ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  padding: 1.5rem; background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 .4rem; font-size: 1.15rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* One wash per step. A tint pins the light roles (see the token block), so the
   row reads as colour in dark mode too rather than as three grey boxes. */
.tint { border-color: transparent; color: var(--text-primary); }
.tint p { color: var(--text-secondary); }
.tint-sage { background: var(--tint-sage); --ink: var(--tint-sage-ink); }
.tint-amber { background: var(--tint-amber); border-color: var(--tint-amber-border); --ink: var(--tint-amber-ink); }
.tint-cream { background: var(--tint-cream); --ink: var(--tint-cream-ink); }

.card-head { display: flex; align-items: center; gap: .625rem; margin-bottom: .9rem; }
.badge {
  width: 30px; height: 30px; border-radius: var(--radius-full);
  display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--text-on-brand);
  font-weight: 700; font-size: .875rem;
}
.step {
  font-family: var(--font-mono); font-size: .6875rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink);
}

/* ── Legal pages ────────────────────────────────────────────────────── */
.legal { padding: 3rem var(--gutter) 4rem; }
.legal h1 { font-size: 2rem; margin: 0 0 .35rem; letter-spacing: -.02em; font-weight: 700; }
.legal .meta { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.15rem; margin: 2.25rem 0 .6rem; letter-spacing: -.01em; }
.legal ul { padding-left: 1.15rem; }
.legal li { margin: .3rem 0; }
.legal a { color: var(--text-brand); }
.legal a:hover { color: var(--text-brand-strong); }
.legal table {
  border-collapse: collapse; width: 100%; font-size: .95rem;
  display: block; overflow-x: auto;
}
.legal th, .legal td {
  text-align: left; padding: .5rem .6rem;
  border-bottom: 1px solid var(--border-default); vertical-align: top;
}
.legal th { font-weight: 600; background: var(--surface-sunken); }

/* Labels that the placeholder already says out loud, kept for screen readers. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ── Page heading (non-legal inner pages) ───────────────────────────── */
.page-head { padding: 3.5rem var(--gutter) 0; }
.page-head h1 {
  font-size: clamp(2.1rem, 6vw, 3rem); line-height: 1.05;
  letter-spacing: -.02em; font-weight: 700; margin: 0 0 .75rem;
  text-wrap: balance;
}
.page-head p { font-size: 1.1rem; color: var(--text-secondary); margin: 0; max-width: 52ch; }

/* ── Serviceability checker ─────────────────────────────────────────── */
/* Its own surface rather than a plain .card, because the same component sits
   both on the page ground and inside the deep green delivery panel. */
.checker {
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem); background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}
.checker h2, .checker h3 {
  margin: 0 0 .35rem; font-size: 1.15rem;
  letter-spacing: -.01em; font-weight: 700;
}
.checker .checker-lede { margin: 0 0 1.15rem; color: var(--text-muted); font-size: .95rem; }

.checker-form { display: flex; flex-wrap: wrap; gap: .75rem; }
.checker-field { position: relative; flex: 1 1 17rem; min-width: 0; }
.checker-form input {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--text-primary);
  padding: .8rem 1rem; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong); background: var(--surface-canvas);
  transition: border-color 120ms ease;
}
.checker-form input::placeholder { color: var(--text-muted); }
.checker-form input:hover { border-color: var(--text-muted); }
.checker-form button { border: 1.5px solid transparent; cursor: pointer; font: inherit; }
.checker-form button[disabled] { opacity: .6; cursor: progress; }
.checker-hint { margin: .7rem 0 0; font-size: .85rem; color: var(--text-muted); }
/* Once the button wraps onto its own line it may as well be a full-width tap
   target. */
@media (max-width: 30rem) {
  .checker-form button { width: 100%; justify-content: center; }
}

/* ── Checker result ─────────────────────────────────────────────────── */
/* Empty until answered, so the live region announces only a real result. */
.result:empty { display: none; }
.result {
  margin-top: 1.15rem; padding: .95rem 1.1rem;
  border-radius: var(--radius-md); font-size: .95rem;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.result strong { display: block; font-size: 1rem; margin-bottom: .15rem; }
.result span { display: block; font-weight: 400; opacity: .85; }
/* Forest for a yes, terracotta for the answer that has to be noticed. */
.result-yes { background: var(--surface-brand-subtle); color: var(--text-brand-strong); }
.result-no { background: var(--accent-bg); color: var(--accent-primary); }
.result-flat { background: var(--surface-sunken); color: var(--text-secondary); box-shadow: inset 0 0 0 1.5px var(--border-strong); }

/* On the deep green panel the card pins the light roles (see the token block),
   the way the step tiles do: a muted dark card there would read as grey. */
.panel .checker {
  margin-top: 1.75rem;
  background: var(--surface-canvas); color: var(--text-primary);
}
.panel .checker input { background: var(--surface-card); }

/* ── Address suggestions ────────────────────────────────────────────── */
/* Same shape as the app's address search: a debounced list under the field,
   picked with the mouse or the arrow keys. */
.suggestions {
  position: absolute; z-index: 20; top: calc(100% + .4rem); left: 0; right: 0;
  margin: 0; padding: .3rem; list-style: none;
  max-height: 17rem; overflow-y: auto;
  background: var(--surface-canvas); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.suggestions[hidden] { display: none; }

.suggestion {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm); cursor: pointer;
}
.suggestion:hover, .suggestion.is-active { background: var(--surface-brand-subtle); }
.suggestion-title { font-size: .95rem; font-weight: 600; }
.suggestion-sub { font-size: .82rem; color: var(--text-muted); }
.suggestion.is-active .suggestion-sub { color: var(--text-secondary); }

.suggestion-status {
  padding: .55rem .7rem; font-size: .9rem; color: var(--text-muted);
}

/* ── Coverage map ───────────────────────────────────────────────────── */
/* A framed picture, same radius and stroke as the cards around it. The height
   is fixed so the page does not jump when tiles arrive; on a phone it is the
   width of the screen and about as tall, which fits the served suburbs. */
.coverage-map {
  position: relative; height: 26rem; max-height: 70vh;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-sunken); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  /* Leaflet sets its own font on the container; keep the page's. */
  font: inherit;
}
@media (max-width: 40rem) { .coverage-map { height: 22rem; } }
.coverage-map .map-status {
  position: absolute; inset: 0; margin: 0; padding: 1.25rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text-muted); font-size: .95rem;
}
.map-note { margin: .8rem 0 0; font-size: .85rem; color: var(--text-muted); max-width: 60ch; }

/* Tiles are drawn for a light page. On the dark register they are toned down
   only slightly — enough to take the edge off the glare, not enough to read as
   a shadow — and never inverted, so place names stay legible and the forest
   fill still reads as forest. */
@media (prefers-color-scheme: dark) {
  .coverage-map .leaflet-tile-pane { filter: brightness(.9); }
}
/* Leaflet's chrome, in the page's own palette. */
.coverage-map .leaflet-container { font: inherit; background: var(--surface-sunken); }
.coverage-map .leaflet-control-zoom a {
  background: var(--surface-canvas); color: var(--text-primary); border-color: var(--border-strong);
}
.coverage-map .leaflet-control-zoom a:hover { background: var(--surface-card); }
.coverage-map .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface-canvas) 85%, transparent); color: var(--text-muted); font-size: .7rem;
}
.coverage-map .leaflet-control-attribution a { color: var(--text-brand); }
.coverage-map .leaflet-tooltip {
  background: var(--surface-canvas); color: var(--text-primary); border-color: var(--border-strong);
  border-radius: var(--radius-sm); font-weight: 600; font-size: .85rem; box-shadow: var(--shadow-sm);
}

/* ── Embed (the app's "Where we deliver" screen) ────────────────────── */
/* ?embed=1 puts the map alone in the viewport: the app draws its own header
   and caption around it. The light roles are pinned (see the token block)
   whatever the phone prefers, because the app around the map is light. */
html.embed { color-scheme: light; }
html.embed body { margin: 0; }
html.embed header, html.embed footer, html.embed .page-head,
html.embed main > section:not(#coverage-map-section),
html.embed #coverage-map-section h2, html.embed #coverage-message, html.embed .map-note { display: none; }
html.embed #coverage-map-section { padding: 0; border-top: 0; }
html.embed #coverage-map-section .wrap { max-width: none; padding: 0; }
html.embed .coverage-map {
  height: 100vh; height: 100dvh; max-height: none;
  border: 0; border-radius: 0; box-shadow: none;
}
/* No dark-mode dim either: the tiles sit in a light app. */
html.embed .coverage-map .leaflet-tile-pane { filter: none; }
/* The shopper's own address, so the map answers "how far am I from it". */
.coverage-map .leaflet-tooltip.you-are-here {
  background: var(--map-highlight); color: var(--text-on-brand); border-color: var(--map-highlight);
}
.coverage-map .leaflet-tooltip-top.you-are-here::before { border-top-color: var(--map-highlight); }

/* ── ZIP code coverage list ─────────────────────────────────────────── */
.zip-groups { display: grid; gap: 1.5rem; margin: 0; padding: 0; }
/* Grouped by town, the list is a table: the town and how many ZIP codes it
   has on the left, the codes themselves on the right, a hairline between
   rows. One column on a phone, two from 48rem, so seventeen towns fit in
   about a screen instead of three. */
.zip-groups.by-place { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--border-default); }
@media (min-width: 48rem) { .zip-groups.by-place { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }
.by-place .zip-group {
  display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); column-gap: 1rem;
  align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--border-default);
}
.by-place .zip-group h3 { grid-column: 1; align-self: end; margin: 0; font-size: 1rem; line-height: 1.3; }
.by-place .zip-group .zip-count {
  grid-column: 1; align-self: start; margin: 0; font-family: var(--font-sans); font-size: .8125rem; font-weight: 400;
  letter-spacing: 0; text-transform: none;
}
.by-place .zip-list { grid-column: 2; grid-row: 1 / span 2; gap: .35rem; }
.by-place .zip { font-size: .875rem; padding: .25rem .55rem; }
.zip-group h3 {
  margin: 0 0 .2rem; font-size: 1.05rem;
  letter-spacing: -.01em; font-weight: 700;
}
.zip-group .zip-count {
  font-family: var(--font-mono); font-size: .6875rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted); display: block; margin-bottom: .85rem;
}
.zip-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.zip {
  font-family: var(--font-mono); font-size: .9375rem; font-weight: 600;
  padding: .4rem .7rem; border-radius: var(--radius-sm);
  background: var(--surface-sunken); color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
/* Placeholder rows while the live list loads, so the section keeps its height. */
.zip-skeleton {
  color: transparent; border-color: transparent;
  background: var(--surface-sunken); width: 4.4rem; height: 2.05rem;
}
.zip-status { color: var(--text-muted); font-size: .95rem; margin: 0; }

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-default);
  padding: 2.5rem 0; color: var(--text-muted); font-size: .9rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: space-between; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text-primary); }
footer nav { gap: 1.25rem; }
/* Who the site belongs to, said again at the foot of every page: the logo,
   the one-line promise, the two store listings and the copyright line. */
.footer-brand { display: grid; gap: .6rem; justify-items: start; }
.footer-brand p { margin: 0; }
.footer-brand .store-badges { margin: .25rem 0; gap: .5rem; }
.footer-brand .store-badges img { height: 2.5rem; }
.footer-brand .store-badges img.play { height: 3.1rem; margin: -.3rem; }
.footer-legal { font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Store badges (get-app page) ────────────────────────────────────── */
/* Official Apple and Google badges, matched by eye: the Play artwork carries
   its own transparent margin, so it gets a little more height. */
.store-badges { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 0 0 1.5rem; }
.store-badges a { display: inline-block; line-height: 0; border-radius: var(--radius-sm); }
.store-badges a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.store-badges img { display: block; height: 3.25rem; width: auto; }
.store-badges img.play { height: 4rem; margin: -.375rem; }
.store-links { color: var(--text-secondary); font-size: .95rem; margin: 0; }

/* ── Shop ───────────────────────────────────────────────────────────── */
/* The catalogue pages, generated at deploy time (infra/scripts/lib/
   catalog-pages.mjs). Tiles follow the app's cards: white, a soft line, a
   small warm shadow. */
.crumbs {
  display: flex; align-items: center; font-size: .9rem; color: var(--text-muted); margin: 0 0 1rem;
  white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
@media (max-width: 40rem) {
  .crumbs { margin: 0 calc(-1 * var(--gutter)) .25rem; padding: 0 var(--gutter); }
  .crumbs a, .crumbs [aria-current] { display: inline-flex; align-items: center; min-height: var(--tap); }
}
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text-primary); }
.crumb-sep { margin: 0 .45rem; }
.crumbs [aria-current] { color: var(--text-secondary); }

.as-of, .page-head .as-of { margin: 1rem 0 0; font-size: .85rem; color: var(--text-muted); max-width: 60ch; }

/* The shop's directory: one aisle per row at every width, so the list reads
   top to bottom and every row is as tall as its neighbours. On a phone a row
   is the aisle (picture, name over count, chevron) with its subcategories in
   a strip underneath; from 48rem the subcategories sit beside it instead,
   wrapping across the rest of the row. */
.aisles { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) {
  .aisle.card { display: grid; grid-template-columns: 17rem minmax(0, 1fr); align-items: center; column-gap: 1.5rem; padding: .9rem 1.25rem .9rem .9rem; }
  /* With the subcategories beside it the row itself says "there is more". */
  .aisle-go { display: none; }
  .aisle .chips { margin-top: 0; gap: .4rem; }
  .aisle .chip { padding: .3rem .7rem; font-size: .8125rem; }
  .aisle-link img { width: 72px; height: 72px; }
}
.aisle.card { padding: 1rem; min-width: 0; }
.aisle-link { display: flex; align-items: center; gap: .9rem; min-height: 64px; text-decoration: none; color: inherit; }
.aisle-link img { width: 64px; height: 64px; border-radius: var(--radius-md); object-fit: cover; background: var(--surface-sunken); flex: none; }
.aisle-text { flex: 1; min-width: 0; }
.aisle-name { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; display: block; color: var(--text-primary); }
.aisle-count { font-size: .875rem; color: var(--text-muted); display: block; margin-top: .15rem; }
.aisle-go { flex: none; font-size: 1.5rem; line-height: 1; color: var(--text-muted); }
.aisle-link:hover .aisle-name { color: var(--text-brand); }
/* The label is for screen readers; on screen the chips speak for themselves. */
.aisle-subs-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.aisle .chips { margin-top: .75rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .8rem; border-radius: var(--radius-full);
  background: var(--action-tonal); color: var(--text-brand-strong);
  font-size: .875rem; font-weight: 600; text-decoration: none;
}
.chip span { font-family: var(--font-mono); font-size: .7rem; opacity: .8; }
.chip:hover { background: var(--action-tonal-pressed); }
@media (max-width: 40rem) {
  .chip { min-height: var(--tap); padding: 0 1rem; white-space: nowrap; }
  /* A strip of chips stays on one line and scrolls sideways, out to the edge
     of whatever holds it; the fade says there is more. */
  .chip-strip {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-right: calc(-1 * var(--bleed, var(--gutter))); padding-right: var(--bleed, var(--gutter));
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
  }
  .chip-strip::-webkit-scrollbar { display: none; }
  .chip-strip .chip { flex: none; }
  .aisle { --bleed: 1rem; }
}

.catalog { padding: 1.5rem var(--gutter) 4rem; }
.group { padding: 1.5rem 0 0; border-top: 0; }
.group-head { display: flex; align-items: baseline; gap: .6rem; margin: 0 0 1rem; }
.group h2 { font-size: 1.3rem; margin: 0; }
.group-count { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.group h2 a { color: inherit; text-decoration: none; }
.group h2 a:hover { color: var(--text-brand); }

/* Two to a row on a phone, three from 30rem, then as many 10rem tiles as fit. */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 30rem) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .tiles { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); } }
.tile { min-width: 0; }
.tile a {
  display: flex; flex-direction: column; gap: .25rem; height: 100%;
  padding: .65rem; border-radius: var(--radius-lg);
  border: 1px solid var(--border-default); background: var(--surface-card);
  color: inherit; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, transform 120ms ease;
}
@media (min-width: 48rem) { .tile a { padding: .9rem; } }
.tile a:hover { border-color: var(--border-brand); transform: translateY(-1px); }
/* height: auto lets the square win over the height the tag declares. */
.tile img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius-md); background: var(--surface-product-image); margin-bottom: .35rem; }
.tile-name {
  font-weight: 600; font-size: .9rem; line-height: 1.3; color: var(--text-primary);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.tile-size { font-size: .8rem; color: var(--text-muted); }
.tile-price { margin-top: auto; padding-top: .35rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .4rem; }

/* As in the app: a price is ink, and green is kept for what the shopper saves. */
.price { font-weight: 700; color: var(--text-price); }
.was { color: var(--text-muted); font-weight: 400; }
/* The app's discount badge: one saffron fill under white type. */
.save {
  font-size: .72rem; font-weight: 700; line-height: 1; white-space: nowrap;
  padding: .2rem .4rem; border-radius: var(--radius-xs);
  background: var(--accent-offer); color: var(--text-on-brand);
}
.price-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.price-line .save { font-size: .85rem; padding: .3rem .5rem; align-self: center; }

.shop-cta { margin: 2.5rem 0 0; }

/* Product page */
.product { padding: 2.5rem var(--gutter) 4rem; }
.product-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
@media (max-width: 44rem) { .product-grid { grid-template-columns: 1fr; } }
.gallery { margin: 0; }
.gallery > img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
  border-radius: var(--radius-lg); background: var(--surface-product-image); border: 1px solid var(--border-default);
}
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
@media (max-width: 44rem) {
  .product { padding-top: 1rem; }
  .product-grid { gap: 1.25rem; }
  .thumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumbs img { flex: none; }
  .facts { max-width: none; }
  .facts th { width: 45%; }
}
.thumbs img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-product-image); border: 1px solid var(--border-default); }
.eyebrow { margin: 0 0 .4rem; font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow a { color: var(--text-brand); text-decoration: none; }
.product h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .5rem; text-wrap: balance; }
.product .size { margin: 0 0 1rem; color: var(--text-secondary); }
.price-line { font-size: 1.6rem; margin: 0 0 1rem; }
.price-line .was { font-size: 1.1rem; }
.snap {
  display: inline-block; margin: 0 0 1.25rem; padding: .25rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface-brand-subtle); color: var(--text-brand-strong); font-size: .8rem; font-weight: 700;
}
.product .description { margin: 1.5rem 0 0; color: var(--text-secondary); font-size: 1.05rem; max-width: 60ch; }

.variants, .info { padding: 2rem 0 0; border-top: 1px solid var(--border-default); margin-top: 2rem; }
.variants h2, .info h2 { font-size: 1.15rem; margin: 0 0 .75rem; letter-spacing: -.01em; }
.variant-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.variant-list a { color: var(--text-brand); }
.variant-price { color: var(--text-muted); font-size: .9rem; margin-left: .4rem; }
.info-note { margin: 0 0 .75rem; color: var(--text-muted); font-size: .9rem; }
.facts { border-collapse: collapse; width: 100%; max-width: 40rem; font-size: .95rem; }
.facts th, .facts td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border-default); vertical-align: top; }
.facts th { font-weight: 600; width: 40%; }
.facts td { color: var(--text-secondary); }
.nutrition .calories th, .nutrition .calories td { font-weight: 700; color: var(--text-primary); }
.nutrition .indent-1 th { padding-left: 1.6rem; font-weight: 400; }
.nutrition .indent-2 th { padding-left: 2.6rem; font-weight: 400; }

/* Search on /shop: the checker's field and button, in a row. Hidden until
   shop-search.js has the catalogue feed. */
.shop-search { display: flex; gap: .5rem; margin: 1.25rem 0 0; }
.shop-search[hidden] { display: none; }
.shop-search input {
  flex: 1 1 0; min-width: 0;
  font: inherit; font-size: 1rem; color: var(--text-primary);
  padding: .8rem 1rem; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong); background: var(--surface-card);
  transition: border-color 120ms ease;
}
.shop-search input::placeholder { color: var(--text-muted); }
.shop-search input:hover { border-color: var(--text-muted); }
.shop-search button { flex: none; border: 1.5px solid transparent; cursor: pointer; font: inherit; font-weight: 700; padding-inline: var(--space-lg); }
.search-status { margin: 0 0 1rem; color: var(--text-secondary); font-size: .95rem; }
.search-status[hidden], .search-results[hidden], .aisles[hidden] { display: none; }
.search-results { margin-bottom: 1rem; }

/* ── Order bar (phones) ─────────────────────────────────────────────── */
/* On the shop's aisle and product pages a phone keeps "Order in the app"
   pinned to the bottom of the screen: the one thing the page is for, always
   within reach of a thumb. Wider screens show the in-page button only. */
.app-bar { display: none; }
@media (max-width: 40rem) {
  .app-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
    padding: .65rem var(--gutter) calc(.65rem + env(safe-area-inset-bottom));
    background: var(--surface-canvas); border-top: 1px solid var(--border-default);
    box-shadow: 0 -3px 8px rgba(74, 43, 10, .08);
  }
  .app-bar .btn { width: 100%; }
  /* Room for the bar, so it never covers the last line of the footer. */
  .has-app-bar footer { padding-bottom: calc(2.5rem + 72px + env(safe-area-inset-bottom)); }
  /* The bar is that button, so the copy of it in the page steps aside. */
  .has-app-bar .shop-cta, .has-app-bar .product .btns .btn-primary { display: none; }
}
