/* ==========================================================================
   BasketSmart — design system
   --------------------------------------------------------------------------
   Ink on paper, the way a price is written on a market board: the number is
   the loudest thing on the page, the chrome around it stays quiet. Every
   colour, rule and shadow below is a token — if you need a new one, add it
   here, don't inline it.
   ========================================================================== */

:root {
  /* Surfaces — warm paper, not the usual cold #F9FAFB */
  --paper:      #F4F1E9;
  --paper-deep: #EBE6D8;
  --card:       #FFFFFF;

  /* Ink */
  --ink:        #16150F;
  --ink-soft:   #4A4638;
  --muted:      #6C6656;

  /* Rules */
  --line:       #E2DCCC;
  --line-soft:  #EEEAE0;

  /* Cheapest / primary action */
  --green:      #14653F;
  --green-deep: #0E4A2E;
  --green-wash: #E7EFE9;

  /* Savings, offers, anything that should catch the eye second */
  --clay:       #B4442A;
  --clay-wash:  #F8EAE4;

  /* Freshness warnings */
  --gold:       #8A6300;
  --gold-wash:  #F6EDD6;

  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 1px 2px rgba(28, 24, 12, .05), 0 8px 24px -12px rgba(28, 24, 12, .18);
  --shadow-lift:0 2px 4px rgba(28, 24, 12, .06), 0 18px 40px -20px rgba(28, 24, 12, .30);

  --ease:       cubic-bezier(.16, 1, .3, 1);

  --font-ui:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Alegreya Sans', 'Inter', system-ui, sans-serif;

  color-scheme: light;
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; }
button, a, input, select { touch-action: manipulation; }

/* Browser surfaces the design still owns. */
::selection { background: #D8E3D6; color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}
* { scrollbar-color: #C9C2AE var(--paper-deep); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb {
  background: #C9C2AE; border-radius: 99px;
  border: 3px solid var(--paper-deep);
}
::-webkit-scrollbar-thumb:hover { background: #B0A891; }

/* --- typography ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.021em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.1vw, 2rem); }
h3 { font-size: 1.125rem; letter-spacing: -.012em; }
p  { margin: 0; }

a { color: inherit; }
.link {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(20, 101, 63, .3);
  font-weight: 600;
}
.link:hover { text-decoration-color: var(--green); }

.lede {
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 62ch;
}
.small   { font-size: .8125rem; }
.muted   { color: var(--muted); }
.label {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
}

/* Prices always line up: one column of digits, never proportional. */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.price {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.price-xl { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); font-weight: 700; line-height: 1; }
.price-lg { font-size: 1.375rem; }
.price-md { font-size: 1.0625rem; }
.price-cheap { color: var(--green-deep); }

/* --- layout --------------------------------------------------------------- */
.wrap  { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.wrap-narrow { width: 100%; max-width: 820px; margin-inline: auto; padding-inline: 20px; }
.main  { flex: 1; overflow-x: hidden; }
.stack > * + * { margin-top: var(--gap, 16px); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: .9375rem; font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-deep); }
.btn-ghost { border-color: var(--line); background: var(--card); color: var(--ink); }
.btn-ghost:hover { border-color: #CFC7B2; background: #FCFBF7; }
.btn-quiet { color: var(--muted); padding-inline: 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--paper-deep); }
.btn-sm { padding: 7px 13px; font-size: .8125rem; border-radius: 8px; }
.btn-lg { padding: 15px 26px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* --- icons ---------------------------------------------------------------- */
.ic {
  width: 20px; height: 20px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 16px; height: 16px; stroke-width: 1.75; }

/* --- header --------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: rgba(244, 241, 233, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 14px; height: 62px; }

.brand {
  display: inline-flex; align-items: baseline; gap: 1px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.3125rem; letter-spacing: -.03em;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand em { font-style: normal; color: var(--green); }
.brand-mark {
  width: 26px; height: 26px; margin-right: 8px;
  align-self: center; flex: none;
}

.head-search { flex: 1; min-width: 0; max-width: 460px; }
.head-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .875rem; font-weight: 600;
  color: var(--ink-soft); text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover { background: var(--paper-deep); color: var(--ink); }
.icon-btn .count {
  min-width: 19px; height: 19px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  border-radius: 99px; font-size: .6875rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.icon-btn.is-basket { background: var(--green); color: #fff; }
.icon-btn.is-basket:hover { background: var(--green-deep); color: #fff; }
.icon-btn.is-basket .count { background: rgba(255,255,255,.22); color: #fff; }

/* --- search field --------------------------------------------------------- */
.search { position: relative; }
.search input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px 10px 40px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search input::placeholder { color: #8C8674; }
.search input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(20, 101, 63, .13);
}
.search .search-ic {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #8C8674; pointer-events: none;
}
.search-hero input {
  font-size: 1.125rem;
  padding: 19px 20px 19px 52px;
  border-radius: 14px;
  border-color: #D8D1BE;
  box-shadow: var(--shadow);
}
.search-hero .search-ic { left: 19px; }
.search-hero .search-ic .ic { width: 22px; height: 22px; }
@media (max-width: 640px) {
  /* 16px minimum keeps iOS Safari from zooming in on focus (it never zooms back) */
  .search input { font-size: 1rem; }
  .search-hero input { font-size: 1.0625rem; padding: 16px 16px 16px 46px; }
  .search-hero .search-ic { left: 15px; }
}

.search-tools {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px;
}
.search-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%;
  background: none; color: #8C8674; cursor: pointer;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.search-tool:hover { color: var(--green); background: var(--green-wash); }
.search-tool.is-live { color: var(--clay); }

/* --- autocomplete --------------------------------------------------------- */
.ac {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 70;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  overflow: hidden auto;
  max-height: min(52vh, 420px);
  overscroll-behavior: contain;
}
.ac[hidden] { display: none; }
.ac-item {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; min-height: 46px;
  text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item.is-active, .ac-item:hover { background: var(--green-wash); }
.ac-name {
  flex: 1; min-width: 0; font-size: .9375rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ac-meta { flex: none; text-align: right; line-height: 1.25; }
.ac-price { font-size: .9375rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ac-stores { font-size: .6875rem; color: var(--muted); white-space: nowrap; }

/* --- store identity ------------------------------------------------------- */
.store {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 600; color: var(--ink);
  min-width: 0;
}
.store-dot {
  width: 23px; height: 23px; flex: none;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .6875rem; font-weight: 700; letter-spacing: -.03em;
  color: #fff;
}
.store-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- badges --------------------------------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .6875rem; font-weight: 700;
  white-space: nowrap;
  background: var(--paper-deep); color: var(--ink-soft);
}
.tag-cheap { background: var(--green); color: #fff; }
.tag-offer { background: var(--clay-wash); color: var(--clay); }
.tag-stale { background: var(--gold-wash); color: var(--gold); }
.tag-outline { background: none; border: 1px solid var(--line); color: var(--muted); }

/* --- price rows (the core comparison table) ------------------------------- */
.prices { display: block; }
.prow {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--line-soft);
  position: relative;
  transition: background-color .16s var(--ease);
}
.prow:first-child { border-top: 0; }
.prow:hover { background: #FBFAF6; }
.prow-cheap { background: var(--green-wash); }
.prow-cheap:hover { background: #E1EBE2; }
.prow-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; flex: 1; }
.prow-right { display: flex; align-items: center; gap: 10px; margin-left: auto; text-align: right; }
.prow-unit { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.prow-out {
  display: inline-flex; padding: 6px; border-radius: 8px;
  color: #A79F89;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.prow-out:hover { color: var(--green); background: var(--card); }

@media (max-width: 480px) {
  .prow { padding: 12px 16px; gap: 8px; }
  .prow-left { gap: 7px; }
}

/* --- product result card -------------------------------------------------- */
.result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.result:hover { border-color: #D5CDB8; box-shadow: var(--shadow); }
.result-head { display: flex; gap: 16px; padding: 18px 20px 15px; align-items: flex-start; }
.result-thumb {
  width: 62px; height: 62px; flex: none;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.result-thumb img { width: 100%; height: 100%; object-fit: contain; }
.result-title {
  font-family: var(--font-display);
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -.012em; line-height: 1.25;
  color: var(--ink); text-decoration: none;
  display: inline-block;
}
.result-title:hover { color: var(--green); }
.result-figure { flex: none; text-align: right; }
.result-more {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 11px 20px;
  background: #FBFAF6; border: 0; border-top: 1px solid var(--line-soft);
  font-family: var(--font-ui); font-size: .8125rem; font-weight: 600; color: var(--muted);
  cursor: pointer; text-align: left;
}
.result-more:hover { color: var(--green); background: var(--green-wash); }
.result-more .ic { transition: transform .2s var(--ease); }

@media (max-width: 560px) {
  .result-head { padding: 15px 16px 12px; gap: 12px; }
  .result-thumb { width: 50px; height: 50px; }
}

/* --- the verdict block on /compare --------------------------------------- */
.verdict {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 28px;
  padding: 22px 24px;
  background: var(--green);
  color: #fff;
}
.verdict-label { font-size: .8125rem; color: rgba(255,255,255,.72); margin-bottom: 3px; }
.verdict-store { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.verdict-price { margin-left: auto; text-align: right; }
.verdict-save {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border-radius: 999px;
  padding: 5px 12px; font-size: .8125rem; font-weight: 600;
}
@media (max-width: 560px) {
  .verdict { padding: 18px 16px; gap: 14px; }
  .verdict-price { margin-left: 0; text-align: left; width: 100%; }
}

/* --- chips ---------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .875rem; font-weight: 600; color: var(--ink-soft);
  text-decoration: none;
  transition: border-color .18s var(--ease), color .18s var(--ease), background-color .18s var(--ease);
}
.chip:hover { border-color: var(--green); color: var(--green); background: var(--card); }

/* --- notices -------------------------------------------------------------- */
.notice {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: .875rem; color: var(--ink-soft);
}
.notice-strong { border-color: #D6CFB9; background: #FCFBF7; }
.notice a { font-weight: 600; }

.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--card);
}
.flash-success { background: var(--green-wash); border-color: #C8DCCB; color: var(--green-deep); }
.flash-error   { background: var(--clay-wash); border-color: #EBCDC2; color: var(--clay); }
.flash-warning { background: var(--gold-wash); border-color: #E7D6AC; color: var(--gold); }
.flash button { background: none; border: 0; font-size: 1.25rem; line-height: 1; color: inherit; opacity: .5; cursor: pointer; }
.flash button:hover { opacity: 1; }

/* --- empty state ---------------------------------------------------------- */
.empty { text-align: center; padding: 72px 20px; }
.empty .ic { width: 34px; height: 34px; color: #A79F89; margin-bottom: 14px; stroke-width: 1.3; }

/* --- footer --------------------------------------------------------------- */
.site-foot {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 40px 0 48px;
  font-size: .875rem;
  color: var(--muted);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-grid nav { display: flex; flex-direction: column; gap: 9px; }
.site-foot a { text-decoration: none; color: var(--ink-soft); }
.site-foot a:hover { color: var(--green); }
.foot-note { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .8125rem; }
@media (max-width: 700px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}

/* --- mobile basket bar ---------------------------------------------------- */
.fab {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 55;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px;
  background: var(--green); color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  text-decoration: none; font-weight: 650;
}
@media (min-width: 1024px) { .fab { display: none; } }

/* --- one authored moment: the comparison lands, cheapest first ------------ */
@media (prefers-reduced-motion: no-preference) {
  .reveal > * {
    animation: reveal .5s var(--ease) backwards;
  }
  .reveal > :nth-child(1) { animation-delay: .02s }
  .reveal > :nth-child(2) { animation-delay: .06s }
  .reveal > :nth-child(3) { animation-delay: .10s }
  .reveal > :nth-child(4) { animation-delay: .14s }
  .reveal > :nth-child(5) { animation-delay: .18s }
  .reveal > :nth-child(6) { animation-delay: .21s }
  .reveal > :nth-child(n+7) { animation-delay: .24s }
  @keyframes reveal {
    from { opacity: 0; transform: translateY(7px); filter: blur(2px); }
    to   { opacity: 1; transform: none; filter: none; }
  }
}

/* --- utilities (few, on purpose) ------------------------------------------ */
.row      { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread   { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grow     { flex: 1; min-width: 0; }
.hide-sm  { display: initial; }
.only-sm  { display: none; }
@media (max-width: 780px) {
  .hide-sm { display: none; }
  .only-sm { display: initial; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- hidden attribute (used instead of a .hidden class) ------------------- */
[hidden] { display: none !important; }

/* --- favourite (heart) toggle -------------------------------------------- */
.fav {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: #A79F89; cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.fav:hover { color: var(--clay); border-color: #E0C8BE; }
.fav.is-on { color: var(--clay); border-color: #E0C8BE; }

/* --- barcode scanner overlay --------------------------------------------- */
.scan-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: #100F0C;
  overscroll-behavior: contain;
}
.scan-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; flex: none;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem;
}
.scan-bar button {
  background: none; border: 0; color: rgba(255,255,255,.75);
  font-size: 2rem; line-height: 1; padding: 4px 10px; cursor: pointer;
}
.scan-bar button:hover { color: #fff; }
.scan-view { flex: 1; width: 100%; max-width: 440px; margin-inline: auto; min-height: 0; }
.scan-view video { object-fit: cover; }
.scan-status {
  flex: none; text-align: center; color: rgba(255,255,255,.85);
  font-size: .875rem; padding: 20px 24px;
}

/* --- PWA install card ----------------------------------------------------- */
.install-card {
  position: fixed; left: 16px; bottom: 16px; z-index: 45;
  display: flex; align-items: center; gap: 12px;
  max-width: 340px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
}
@media (max-width: 640px) { .install-card { right: 16px; max-width: none; bottom: 84px; } }

/* ==========================================================================
   Homepage
   ========================================================================== */
.hero {
  background:
    repeating-linear-gradient(to bottom,
      transparent 0 27px, rgba(22, 21, 15, .045) 27px 28px),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: clamp(48px, 7vw, 92px) 20px clamp(40px, 5vw, 60px); }
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 54ch; }

.hero-form {
  display: flex; gap: 10px; align-items: stretch;
  margin-top: 30px; max-width: 620px;
}
.hero-form .search { flex: 1; min-width: 0; }
.hero-form .btn { flex: none; }
@media (max-width: 560px) {
  .hero-form { flex-direction: column; }
  .hero-form .btn { width: 100%; }
}

.hero-stats {
  margin-top: 26px; color: var(--muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero-stats strong { color: var(--ink); font-weight: 650; }
.hero-stats .dot {
  width: 3px; height: 3px; border-radius: 50%; background: #B9B2A0; display: inline-block;
}

.band {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 26px 0 28px;
}
.store-strip {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin-top: 16px;
}
.store-strip .store { font-size: .8125rem; color: var(--ink-soft); }

.section { padding: clamp(44px, 6vw, 68px) 20px 0; }
.section:last-child { padding-bottom: clamp(44px, 6vw, 68px); }

.basics {
  margin-top: 22px;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.basic {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: .9375rem;
  transition: border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.basic .ic { color: #B9B2A0; transition: transform .2s var(--ease), color .18s var(--ease); }
.basic:hover { border-color: var(--green); color: var(--green); }
.basic:hover .ic { color: var(--green); transform: translateX(3px); }

.why {
  margin-top: 26px;
  display: grid; gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.why-item {
  display: flex; gap: 14px;
  background: var(--card);
  padding: 24px 22px;
}
.why-item .ic { color: var(--green); margin-top: 2px; }
.why-item h3 { margin-bottom: 7px; }

.sources {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 26px 26px;
}
@media (max-width: 720px) {
  .sources { flex-direction: column; align-items: flex-start; }
  .sources .btn { width: 100%; }
}

/* ==========================================================================
   Results page
   ========================================================================== */
.results-page { padding: 26px 20px 20px; }
.results-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.results-q {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.results-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .results-layout { grid-template-columns: minmax(0, 1fr); } }
.results-side { min-width: 0; }
.side-sticky { position: sticky; top: 86px; }

.result-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--line-soft);
  background: #FBFAF6;
}
@media (max-width: 480px) {
  .result-foot { padding: 12px 16px; }
  .result-foot .link { font-size: .75rem; }
}
.result-rest > summary { list-style: none; cursor: pointer; }
.result-rest > summary::-webkit-details-marker { display: none; }
.result-rest[open] > summary .ic { transform: rotate(180deg); }
.result-rest > summary .ic { transition: transform .2s var(--ease); }

/* ==========================================================================
   Compare page
   ========================================================================== */
:root { --on-green-soft: #CBDCD3; }

.compare-page { padding: 22px 20px 20px; }
.compare-page > * + * { margin-top: 14px; }

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .8125rem; color: var(--muted); margin-bottom: 16px;
}
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.crumbs > span[aria-hidden] { color: #C2BBA8; }
.crumbs > .muted {
  color: var(--ink-soft); max-width: 44ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.compare-head { display: flex; gap: 18px; padding: 22px 24px 20px; align-items: flex-start; }
.compare-thumb {
  width: 84px; height: 84px; flex: none;
  border: 1px solid var(--line-soft); border-radius: 12px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.compare-thumb img { width: 100%; height: 100%; object-fit: contain; }
.compare-title { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.75rem); line-height: 1.18; overflow-wrap: anywhere; }
.verdict-label { color: var(--on-green-soft); }
@media (max-width: 560px) {
  .compare-head { padding: 18px 16px 16px; gap: 14px; }
  .compare-thumb { width: 64px; height: 64px; }
}

.compare-note {
  padding: 14px 24px;
  background: var(--gold-wash);
  border-top: 1px solid #E7D6AC;
  font-size: .875rem; color: var(--gold);
}
.compare-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 16px 24px; background: #FBFAF6;
  border-top: 1px solid var(--line-soft);
}
@media (max-width: 560px) { .compare-foot { padding: 14px 16px; } }
.compare-legal { padding: 6px 4px 8px; max-width: 68ch; }

/* --- disclosures (history, price alert) ---------------------------------- */
.disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px;
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700;
  cursor: pointer; list-style: none;
  border-radius: var(--radius-lg);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--green); }
.disclosure > summary .ic { color: var(--green); }
.disclosure > summary .chev { color: var(--muted); transition: transform .2s var(--ease); }
.disclosure[open] > summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.disclosure[open] > summary .chev { transform: rotate(180deg); }
.disclosure-body { padding: 20px 22px 22px; }

/* --- form fields ---------------------------------------------------------- */
.field { position: relative; display: block; }
.field input {
  width: 100%;
  font-family: var(--font-ui); font-size: .9375rem; color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input::placeholder { color: #8C8674; }
.field input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(20, 101, 63, .13);
}
.field-price { width: 150px; flex: none; }
.field-price input { padding-right: 30px; font-variant-numeric: tabular-nums; }
.field-suffix {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .875rem; pointer-events: none;
}
.alert-form { display: flex; flex-direction: column; gap: 14px; }
.alert-fields { display: flex; gap: 10px; align-items: stretch; }
.alert-fields .btn { flex: none; }
@media (max-width: 620px) {
  .alert-fields { flex-direction: column; }
  .field-price { width: 100%; }
  .alert-fields .btn { width: 100%; }
}

@media (max-width: 780px) {
  .why { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Basket
   ========================================================================== */
.basket-page { padding: 26px 20px 20px; }
.basket-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; align-items: start; }
@media (max-width: 940px) { .basket-layout { grid-template-columns: minmax(0, 1fr); } }

.basket-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.basket-item-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button {
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink-soft);
  font-size: 1rem; font-weight: 600; line-height: 1; cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.stepper button:hover { border-color: var(--green); color: var(--green); }
.stepper span { min-width: 30px; text-align: center; font-weight: 650; }

.scenarios {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px; margin-top: 14px;
}
.scenario {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.scenario:hover { border-color: #CFC7B2; }
.scenario.is-active { border-color: var(--green); background: var(--green-wash); }
.scenario-save { font-size: .75rem; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

.pick-store { margin-top: 14px; }
.pick-store > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.pick-store > summary:hover { color: var(--green); }
.chip.is-active { border-color: var(--green); color: var(--green); }

.totals { display: flex; gap: 28px; padding: 16px 22px; }
.plan-store { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.plan-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plan-items li { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.plan-items .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: #FBFAF6; border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
  /* the store-filter notice: let the action drop to its own line instead of
     squeezing the sentence into a 3-line column beside the icon */
  .notice { flex-wrap: wrap; }
  .notice .grow { flex: 1 1 100%; }
  .notice .ic { display: none; }
}

/* --- legacy pages (still authored in Tailwind classes) --------------------
   They keep working on the CDN build; these few rules stop them from drifting
   away from the design system: the store pill they share with the redesigned
   pages, and paper instead of Tailwind's cold gray page background. */
.sm-badge {
  display: inline-flex; align-items: center;
  font-size: .6875rem; font-weight: 700; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 999px;
}
body .bg-gray-50 { background-color: var(--paper); }
body .bg-white { background-color: var(--card); }
body .rounded-2xl { border-radius: var(--radius-lg); }
body .border-gray-200 { border-color: var(--line); }
body .border-gray-100 { border-color: var(--line-soft); }
