/* Raff — supermarket shelf prices, side by side.
   Signature element: the shelf-edge price tag (.tag) and the store colour rails. Everything else stays calm:
   cool neutral paper, white surfaces, one cedar green for "cheapest", shelf-label yellow for offers. */

:root {
  --paper: #f3f5f3;
  --surface: #ffffff;
  --surface-2: #f6f8f6;
  --ink: #13201a;
  --muted: #5a6861;
  --faint: #86938c;
  --line: #e0e6e2;
  --line-strong: #c2ccc6;
  --cedar: #12704a;
  --cedar-strong: #0c5a3a;
  --cedar-ink: #ffffff;
  --cedar-soft: #e3f1e9;
  --promo: #f6c51b;
  --promo-ink: #2a2200;
  --danger: #b42318;
  --warn: #a15c07;
  --focus: #1d4ed8;
  --img-bg: #ffffff;
  --img-filter: none;

  --s-spinneys: #0f7a3d;
  --s-promarche: #c2410c;
  --s-aoun: #9f1239;
  --s-hachem: #1d4ed8;

  --radius-tag: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 26, 0.06);
  --shadow-md: 0 1px 2px rgba(16, 36, 26, 0.05), 0 10px 28px -12px rgba(16, 36, 26, 0.18);
  --shadow-lg: 0 2px 4px rgba(16, 36, 26, 0.05), 0 24px 48px -20px rgba(16, 36, 26, 0.28);
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 64px;
  color-scheme: light;
}

/* Light by default; dark only when chosen with the header switch (html[data-theme="dark"], set by js/theme.js). */
:root[data-theme="dark"] {
  --paper: #0c1210;
  --surface: #141c18;
  --surface-2: #19231f;
  --ink: #e6ede9;
  --muted: #9aa9a1;
  --faint: #6c7a73;
  --line: #24302b;
  --line-strong: #394842;
  --cedar: #3fb67f;
  --cedar-strong: #5fcb97;
  --cedar-ink: #05140d;
  --cedar-soft: #142a1f;
  --promo: #f6c51b;
  --promo-ink: #2a2200;
  --danger: #f97066;
  --warn: #f0b44c;
  --focus: #93b4ff;
  --img-bg: #eef1ef;
  --img-filter: brightness(0.94);
  --s-spinneys: #34b36a;
  --s-promarche: #f0773a;
  --s-aoun: #e5486f;
  --s-hachem: #6b93ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* No tabular figures: in Schibsted Grotesk "tnum" also widens commas and points. */

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.wordmark-mark { flex: none; display: block; }
.mark-body { fill: var(--cedar); }
.mark-hole { fill: var(--surface); }
.mark-glyph { stroke: var(--cedar-ink); fill: none; }
.wordmark-text { display: flex; flex-direction: column; font-weight: 800; font-size: 21px; letter-spacing: -0.035em; line-height: 1; }
.wordmark-text small { font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.nav { display: flex; gap: 2px; margin-right: auto; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 8px 12px;
  border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 15px;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: calc((var(--header-h) - 38px) / -2); height: 3px;
  border-radius: 3px 3px 0 0; background: var(--cedar);
}
.nav-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--cedar); color: var(--cedar-ink);
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1;
}
.nav-count[hidden] { display: none; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.rate-chip {
  font-size: 13px; color: var(--muted); white-space: nowrap; margin: 0; padding: 7px 12px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.rate-chip strong { color: var(--ink); font-weight: 700; }

.theme-toggle {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.theme-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

body { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { padding-bottom: 24px; flex: 1 0 auto; }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
.lede { color: var(--muted); max-width: 64ch; margin: 10px 0 0; font-size: 17px; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font-size: 0.92em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }

.page-head { padding: 36px 0 22px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.page-head .crumbs { margin-bottom: 12px; }

/* ---------- buttons & inputs ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 15px; border-radius: var(--radius-md); padding: 11px 18px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.2; white-space: nowrap;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}
.btn:hover { background: var(--cedar); border-color: var(--cedar); color: var(--cedar-ink); }
.btn-primary { background: var(--cedar); border-color: var(--cedar); color: var(--cedar-ink); }
.btn-primary:hover { background: var(--cedar-strong); border-color: var(--cedar-strong); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
.btn-small { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn-danger { background: transparent; color: var(--danger); border-color: currentColor; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-add { background: var(--cedar-soft); color: var(--cedar); border-color: transparent; }
.btn-add:hover { background: var(--cedar); color: var(--cedar-ink); border-color: var(--cedar); }
.btn-primary.btn-add { background: var(--cedar); color: var(--cedar-ink); border-color: var(--cedar); }
.btn-primary.btn-add:hover { background: var(--cedar-strong); border-color: var(--cedar-strong); }
.btn[data-added] { background: var(--surface); border-color: var(--cedar); color: var(--cedar); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--cedar); }

.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 19px; padding: 13px 14px 13px 46px;
  border: 0; border-radius: 11px; background: transparent; color: var(--ink);
}
.search-input:focus { outline: none; }
.search-input::placeholder { color: var(--faint); }
.search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 16px; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field label { font-size: 14px; font-weight: 600; }
.inline-field input {
  font: inherit; font-size: 14.5px; width: 220px; height: 38px; padding: 0 12px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
}

.after-results { margin-top: 44px; }

/* ---------- store freshness strip ---------- */
.freshness {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 34px;
}
.freshness > div {
  padding: 12px 14px 12px 16px; background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--store, var(--line)); border-radius: var(--radius-sm) var(--radius-md) var(--radius-md) var(--radius-sm);
}
.freshness .name { font-weight: 700; display: flex; align-items: center; }
.freshness .meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.status-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.status-working { background: var(--cedar); box-shadow: 0 0 0 3px var(--cedar-soft); }
.status-partial { background: #d99a06; box-shadow: 0 0 0 3px rgba(217, 154, 6, 0.18); }
.status-manual { background: var(--faint); }

.s-spinneys { --store: var(--s-spinneys); }
.s-promarche { --store: var(--s-promarche); }
.s-aoun { --store: var(--s-aoun); }
.s-hachem { --store: var(--s-hachem); }

/* ---------- section heads ---------- */
.section-head, .block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.block-head h2 { font-size: 18px; }
.section-head { margin-top: 10px; }
.section-link { font-size: 14px; font-weight: 600; color: var(--cedar); text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* ---------- aisle chips ---------- */
.aisles {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 24px 16px; margin: 0 -24px 18px; scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 48px), transparent 100%);
}
.aisles::-webkit-scrollbar { display: none; }
.aisle-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 8px 14px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
  white-space: nowrap; box-shadow: var(--shadow-sm);
}
.aisle-chip span { color: var(--faint); font-weight: 500; font-size: 13px; }
.aisle-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.aisle-chip[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.aisle-chip[aria-current="page"] span { color: var(--paper); opacity: 0.7; }

/* ---------- product image boxes ---------- */
.pimg {
  position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1 / 1; width: 100%;
  background: var(--img-bg); border-radius: var(--radius-md);
}
.pimg img { width: 100%; height: 100%; object-fit: contain; padding: 8%; filter: var(--img-filter); display: block; }
.pimg.is-placeholder { background: var(--surface-2); color: var(--line-strong); }
.pimg.is-placeholder svg { width: 38%; height: 38%; max-width: 64px; }
.pimg-sm { border-radius: 8px; }
.pimg-sm img { padding: 6%; }
.pimg-sm.is-placeholder svg { width: 52%; height: 52%; }
.pimg-lg { border-radius: var(--radius-lg); border: 1px solid var(--line); }

/* ---------- comparison grid (search results, biggest gaps) ---------- */
.compare {
  --compare-cols: minmax(260px, 1.7fr) repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 18px; box-shadow: var(--shadow-sm);
}
.compare.cols-1 { --compare-cols: minmax(260px, 1.7fr) repeat(1, minmax(0, 1fr)); }
.compare.cols-2 { --compare-cols: minmax(260px, 1.7fr) repeat(2, minmax(0, 1fr)); }
.compare.cols-3 { --compare-cols: minmax(260px, 1.7fr) repeat(3, minmax(0, 1fr)); }
.compare-head, .compare-row { display: grid; grid-template-columns: var(--compare-cols); gap: 10px; align-items: stretch; }
.compare-head { font-size: 13px; color: var(--muted); padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.compare-head span { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.compare-head span[class^="s-"]::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--store); flex: none; }
.compare-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.compare-row:last-child { border-bottom: 0; }
.product-cell { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.product-thumb, .ledger-thumb { flex: none; width: 64px; display: block; border: 1px solid var(--line); border-radius: 9px; }
.product-text { min-width: 0; }
.product-name { font-weight: 600; text-decoration: none; line-height: 1.3; display: block; }
.product-name:hover { text-decoration: underline; }
.product-cell .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.saving {
  display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--cedar); font-weight: 700;
  background: var(--cedar-soft); padding: 2px 8px; border-radius: 99px;
}
.brand-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.brand-link:hover { color: var(--cedar); border-bottom-color: var(--cedar); text-decoration: none; }

/* ---------- the shelf tag ---------- */
.tag {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--store, var(--line-strong));
  border-radius: var(--radius-tag); padding: 9px 11px 8px; min-height: 80px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.tag .store-label { display: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.tag .usd { font-size: 23px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.tag .usd sup { font-size: 0.55em; font-weight: 700; vertical-align: 0.6em; margin-right: 1px; }
.tag .alt { font-size: 12.5px; color: var(--muted); }
.tag .when { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tag.is-cheapest { background: var(--cedar); border-color: var(--cedar); color: var(--cedar-ink); border-top-color: var(--store); box-shadow: 0 6px 16px -8px var(--cedar); }
.tag.is-cheapest .alt, .tag.is-cheapest .when, .tag.is-cheapest .store-label { color: var(--cedar-ink); opacity: 0.88; }
.tag.is-empty { background: transparent; border-style: dashed; border-top-style: solid; color: var(--faint); justify-content: center; font-size: 13px; box-shadow: none; }
.tag.is-out { opacity: 0.6; }
.tag .flag {
  position: absolute; top: -4px; right: 8px; background: var(--promo); color: var(--promo-ink); font-size: 11.5px; font-weight: 700;
  padding: 2px 7px 3px; border-radius: 0 0 4px 4px;
}
.tag .was { text-decoration: line-through; }
.tag-best { font-size: 11.5px; font-weight: 700; }

/* ---------- product page ---------- */
.product-hero.no-media { grid-template-columns: minmax(0, 1fr); }
.product-hero { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 40px; align-items: start; padding: 18px 0 30px; }
.product-info { min-width: 0; padding-top: 8px; }
.product-head .meta { color: var(--muted); margin: 10px 0 0; }
.product-brand { margin: 0 0 8px; font-size: 15px; }
.product-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.crumbs + .product-hero { margin-top: 0; }
.site-main > .crumbs { padding-top: 24px; }
.tags-lg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tags-lg .tag { min-height: 128px; padding: 14px 16px 12px; }
.tags-lg .tag .store-label { display: block; font-size: 14px; }
.tags-lg .tag .usd { font-size: 34px; }
.verdict {
  margin: 22px 0 0; font-size: 17px; padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--cedar-soft); border: 1px solid color-mix(in srgb, var(--cedar) 30%, transparent); max-width: 60ch;
}
.verdict strong { color: var(--cedar); }
.verdict-quiet { background: var(--surface); border-color: var(--line); color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; margin-top: 24px; box-shadow: var(--shadow-sm); }
.panel > h2 { margin-bottom: 12px; }
.chart-box { position: relative; height: 300px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table thead th:first-child { border-top-left-radius: 8px; }
.table thead th:last-child { border-top-right-radius: 8px; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.num { text-align: right; white-space: nowrap; }
.store-name-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.store-name-cell::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--store); flex: none; }
.listed-as { display: flex; gap: 10px; align-items: flex-start; }
.listed-thumb { width: 40px; height: 40px; object-fit: contain; background: var(--img-bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px; flex: none; filter: var(--img-filter); }
.store-out { font-weight: 600; color: var(--cedar); text-decoration: none; white-space: nowrap; }
.store-out:hover { text-decoration: underline; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill-success { color: var(--cedar); border-color: currentColor; background: var(--cedar-soft); }
.pill-partial, .pill-running { color: var(--warn); border-color: currentColor; }
.pill-failed { color: var(--danger); border-color: currentColor; }

/* ---------- empty states ---------- */
.empty { padding: 24px 0; color: var(--muted); margin: 0; }
.empty-state { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 12px 24px; text-align: center; }

/* ── Basket ── (/basket: list on the left, sticky result column on the right, bottom bar on phones) */
.basket-head { padding-bottom: 26px; }
.basket-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); gap: 24px; padding-bottom: 40px; align-items: start; }
.basket-panel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.basket-panel h2 { font-size: 19px; }
.basket-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.basket-count { font-size: 14px; font-weight: 500; }

/* the list panel wears the four store colours along its top edge, like the homepage search */
.basket-list-panel { padding-top: 24px; }
.basket-list-panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
  background: linear-gradient(to right, var(--s-spinneys) 0 25%, var(--s-promarche) 25% 50%, var(--s-aoun) 50% 75%, var(--s-hachem) 75% 100%);
}

/* add-item search */
.suggest { position: relative; margin-top: 14px; }
.suggest .search-icon { left: 16px; }
.suggest .search-input {
  width: 100%; height: 52px; font-size: 17px; padding: 0 14px 0 46px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2);
}
.suggest .search-input:hover { border-color: var(--faint); }
.suggest .search-input:focus { border-color: var(--cedar); background: var(--surface); box-shadow: 0 0 0 4px var(--cedar-soft); }
.suggest-list {
  list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; left: 0; right: 0; z-index: 20; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md); max-height: min(440px, 60vh); overflow-y: auto; box-shadow: var(--shadow-lg);
}
.suggest-list > li.muted { padding: 12px; }
.suggest-list li button { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.suggest-list li button:hover, .suggest-list li button:focus-visible { background: var(--surface-2); outline: none; }
.suggest-list li button:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.suggest-text { flex: 1 1 auto; min-width: 0; }
.suggest-name { font-weight: 600; line-height: 1.3; }
.suggest-list .meta { font-size: 13px; color: var(--muted); }
.suggest-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.suggest-price { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.suggest-store, .basket-line-store { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.suggest-store::before, .basket-line-store::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--store, var(--faint)); flex: none; }
.suggest-on { font-size: 11.5px; font-weight: 700; color: var(--cedar); background: var(--cedar-soft); padding: 1px 7px; border-radius: 99px; margin-top: 2px; }
.mini-thumb { flex: none; width: 48px; height: 48px; border-radius: 8px; background: var(--img-bg); object-fit: contain; padding: 3px; border: 1px solid var(--line); filter: var(--img-filter); }
.mini-thumb.is-placeholder, .basket-thumb.is-placeholder { display: grid; place-items: center; background: var(--surface-2); color: var(--faint); filter: none; }

/* list lines */
.basket-list { list-style: none; margin: 18px 0 0; padding: 0; }
.basket-list:empty { display: none; }
.basket-line {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 92px; gap: 16px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.basket-line:first-child { border-top: 0; padding-top: 4px; }
.basket-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--img-bg); object-fit: contain; padding: 4px; border: 1px solid var(--line); filter: var(--img-filter); display: block; }
.basket-line-main { min-width: 0; }
.basket-line-name { font-weight: 600; text-decoration: none; line-height: 1.3; display: block; }
.basket-line-name:hover { text-decoration: underline; }
.basket-line-meta { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.basket-line-where { font-size: 13px; color: var(--muted); margin-top: 5px; }
.basket-line-where:empty { display: none; }
.basket-line-where .basket-line-store { color: var(--ink); font-size: 13px; }
.basket-line-where.is-missing { color: var(--warn); font-weight: 600; }
.basket-line-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.basket-line-price { font-size: 18px; font-weight: 800; letter-spacing: -0.025em; white-space: nowrap; }

.qty { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); padding: 2px; }
.qty button { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; font-weight: 700; font-size: 17px; border-radius: 99px; color: var(--ink); }
.qty button:hover { background: var(--surface-2); }
.qty button:disabled { cursor: default; color: var(--faint); background: transparent; }
.qty button:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.qty output { min-width: 26px; text-align: center; font-weight: 700; }
.remove { all: unset; cursor: pointer; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 99px; color: var(--faint); }
.remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.remove:focus-visible { outline: 3px solid var(--focus); }
.basket-list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.basket-list-foot[hidden] { display: none; }

/* empty list */
.basket-empty { text-align: center; padding: 34px 20px 30px; margin-top: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-2); }
.basket-empty[hidden] { display: none; }
.basket-empty p { margin: 0; }
.basket-empty-title { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.basket-empty .muted { margin-top: 4px; }
.basket-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.basket-try-chip {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 7px 14px; border-radius: 99px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.basket-try-chip:hover { border-color: var(--cedar); color: var(--cedar); }
.basket-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* result column */
.basket-summary { position: sticky; top: 20px; display: grid; gap: 16px; }

/* the headline result is a big shelf tag: store colour along the top, cedar when it is the cheapest whole list */
.basket-best {
  position: relative; margin: 0; padding: 20px 22px 22px; border-radius: 6px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-top: 6px solid var(--store, var(--line-strong)); box-shadow: var(--shadow-md);
  transition: opacity 160ms ease;
}
.basket-best p { margin: 0; }
.basket-best-kicker { font-size: 14px; font-weight: 600; color: var(--muted); }
.basket-best-store { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin-top: 2px; }
.basket-best-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 10px; }
.basket-best-total .usd { font-size: 48px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.basket-best-total .lbp { font-size: 15px; font-weight: 500; opacity: 0.8; }
.basket-best-note { margin-top: 12px; font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.basket-best.is-idle { border-style: dashed; border-top-style: solid; border-top-color: var(--line-strong); box-shadow: none; background: transparent; }
.basket-best.is-idle .basket-best-store { font-size: 20px; color: var(--muted); }
.basket-best.is-idle .basket-best-note { color: var(--muted); }
.basket-best.is-found { background: var(--cedar); border-color: var(--cedar); border-top-color: var(--store); color: var(--cedar-ink); box-shadow: 0 18px 36px -20px color-mix(in srgb, var(--cedar) 70%, transparent); }
.basket-best.is-found .basket-best-kicker { color: var(--cedar-ink); opacity: 0.85; }
.basket-best.is-found .basket-best-note { padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--cedar-ink) 22%, transparent); }
.basket-best.is-partial .basket-best-kicker { color: var(--warn); }
.basket-best.is-partial .basket-best-note { color: var(--muted); }
.basket-best.is-error .basket-best-kicker { color: var(--danger); }
.basket-best.is-loading { opacity: 0.72; }

/* totals by store, ranked */
.totals { list-style: none; margin: 12px 0 0; padding: 0; }
.totals li { padding: 12px 12px; margin: 0 -12px; border-top: 1px solid var(--line); }
.totals li:first-child { border-top: 0; }
.totals li.is-best + li { border-top-color: transparent; }
.totals .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.totals .store-name { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.totals .store-name::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--store); flex: none; }
.totals .amount { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; white-space: nowrap; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; margin: 8px 0 6px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar span { display: block; height: 100%; width: 0; background: var(--store); border-radius: 99px; transition: width 400ms cubic-bezier(.2,.7,.2,1); }
.totals li.is-best { background: var(--cedar-soft); border-radius: var(--radius-md); border-top-color: transparent; }
.totals li.is-best .amount { color: var(--cedar); }
.totals li.is-best [data-detail] { color: var(--ink); }
/* a store missing some items: hatched bar and a quieter total, since it is not a like-for-like price */
.totals li.is-incomplete .amount { color: var(--muted); font-size: 18px; }
.totals li.is-incomplete .bar span {
  background: repeating-linear-gradient(135deg, var(--store) 0 6px, color-mix(in srgb, var(--store) 45%, transparent) 6px 10px);
}
.totals li.is-none { opacity: 0.6; }
.basket-layout.is-empty .totals .bar, .basket-layout.is-empty .totals [data-detail] { display: none; }
.basket-layout.is-empty .totals .amount { color: var(--faint); font-size: 18px; }
.basket-layout.is-empty .totals li { padding-top: 10px; padding-bottom: 10px; }

/* cheapest split across stores, grouped by store */
.basket-split[hidden] { display: none; }
.split-total { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }
.split-line { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; text-wrap: pretty; }
.split-groups { display: grid; gap: 10px; margin-top: 14px; }
.split-group { border: 1px solid var(--line); border-left: 4px solid var(--store); border-radius: var(--radius-sm) var(--radius-md) var(--radius-md) var(--radius-sm); padding: 10px 12px 8px 14px; }
.split-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.split-group-head .store-name { font-weight: 700; }
.split-group-total { font-weight: 800; }
.split-items { list-style: none; margin: 6px 0 0; padding: 0; }
.split-items li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; border-top: 1px dashed var(--line); }
.split-item-name { min-width: 0; }
.split-item-price { white-space: nowrap; font-weight: 600; }
.split-unavailable { margin: 2px 0 0; color: var(--warn); }

/* phones and tablets: result card under the list, a bottom bar with the winner that jumps to it */
.basket-bar { display: none; }
@media (max-width: 960px) {
  .basket-layout { grid-template-columns: 1fr; padding-bottom: 96px; }
  .basket-summary { position: static; }
  .basket-bar {
    position: fixed; z-index: 25; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-lg); background: var(--ink); color: var(--paper); text-decoration: none;
    border-top: 4px solid var(--store, var(--cedar)); box-shadow: var(--shadow-lg);
  }
  .basket-bar[hidden] { display: none; }
  .basket-bar { transition: transform 200ms ease, opacity 200ms ease; }
  .basket-bar.is-tucked { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .basket-summary { scroll-margin-top: 12px; }
  .basket-bar.is-found { background: var(--cedar); color: var(--cedar-ink); }
  .basket-bar.is-partial { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-top: 4px solid var(--store, var(--warn)); }
  .basket-bar-text { display: flex; flex-direction: column; min-width: 0; }
  .basket-bar-label { font-size: 12.5px; opacity: 0.75; }
  .basket-bar-store { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .basket-bar-total { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
}
@media (max-width: 760px) {
  .basket-panel { padding: 16px; }
  .basket-list-panel { padding-top: 20px; }
  .basket-line { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; }
  .basket-thumb { width: 56px; height: 56px; }
  .basket-line .qty { grid-column: 2; justify-self: start; }
  .basket-line-end { grid-column: 3; grid-row: 1 / span 2; flex-direction: column-reverse; justify-content: space-between; align-self: stretch; }
  .basket-best-total .usd { font-size: 40px; }
  .suggest-side .suggest-store { display: none; }
  .basket-line-where-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .basket-best, .basket-bar { transition: none; }
}

/* ---------- admin (light touch) ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.store-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--store); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); }
.store-card .big { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; }
.store-card form { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.store-card input[type="file"] { max-width: 100%; }
.flash { margin: 18px 0 0; padding: 12px 16px; border-radius: var(--radius-md); background: var(--cedar-soft); border: 1px solid var(--cedar); }
.errors { margin: 18px 0 0; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.field input { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.field input:focus { border-color: var(--cedar); outline: none; box-shadow: 0 0 0 3px var(--cedar-soft); }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }
.log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 8px; max-height: 480px; overflow: auto; }
.login-box { max-width: 400px; margin: 64px auto; }
.login-box .panel { margin-top: 22px; }
.admin-top { margin-top: 28px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); align-items: center; }
.admin-top .nav { margin: 0; }
.admin-top .nav a[aria-current="page"] { background: var(--surface-2); }
.admin-top .nav a[aria-current="page"]::after { display: none; }
.admin-top + h1 { margin-top: 26px; }
.panel-gap { margin-top: 20px; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; }
.search-form > .search-input { flex: 1 1 320px; padding-left: 16px; border: 1px solid var(--line-strong); background: var(--surface); }

/* ---------- pager ---------- */
.pager { display: flex; gap: 6px; justify-content: center; padding: 32px 0 8px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: inline-grid; place-items: center; text-align: center; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; background: var(--surface); font-weight: 600; font-size: 15px; }
.pager a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.pager span[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }
.pager .pager-gap { border-color: transparent; background: transparent; min-width: 0; padding: 0 2px; color: var(--muted); }
.pager-note { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 24px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 56px; padding: 32px 0 40px; font-size: 13.5px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 24px 48px; align-items: start; }
.site-footer p { margin: 0 0 6px; max-width: 72ch; }
.footer-name { font-weight: 800; font-size: 18px; letter-spacing: -0.03em; color: var(--ink); }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { text-decoration: none; font-weight: 600; color: var(--ink); }
.footer-links a:hover { text-decoration: underline; }

/* ---------- aisle page & product cards ---------- */
.aisle-head { padding-bottom: 18px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; gap: 7px;
}
.filter-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.filter-chip.s-spinneys::before, .filter-chip.s-promarche::before, .filter-chip.s-aoun::before, .filter-chip.s-hachem::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--store);
}
.filter-chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.brand-form { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 99px; text-decoration: none;
  background: var(--cedar-soft); color: var(--cedar); border: 1px solid color-mix(in srgb, var(--cedar) 35%, transparent);
  font-size: 14px; font-weight: 700;
}
.active-chip-label { font-weight: 500; opacity: 0.8; }
.active-chip-x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 15px; line-height: 1; }
.active-chip:hover .active-chip-x { background: currentColor; color: var(--surface); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow 160ms, border-color 160ms;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-media { display: block; padding: 10px 10px 0; }
.card-media .pimg { aspect-ratio: 4 / 3; border-radius: var(--radius-md); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-meta { margin: 0; font-size: 13px; color: var(--muted); }
.card-prices { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.card-prices li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 9px;
  border-left: 3px solid var(--store); background: var(--surface-2); border-radius: 3px 7px 7px 3px; font-size: 14px;
}
.card-prices li.is-cheapest { background: var(--cedar); color: var(--cedar-ink); }
.card-prices li.is-out { opacity: 0.55; }
.card-store { font-weight: 500; min-width: 0; }
.card-price { font-weight: 800; text-align: right; white-space: nowrap; }
.card-price small { display: block; font-weight: 500; font-size: 11.5px; opacity: 0.8; }
.card-offer { background: var(--promo); color: var(--promo-ink); font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-right: 4px; vertical-align: 1px; }
.card-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-note { font-size: 12.5px; color: var(--cedar); font-weight: 700; }
.card-note-quiet { color: var(--muted); font-weight: 500; }

/* ---------- browse: every item (ledger) ---------- */
.toolbar {
  display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(4, minmax(130px, 1fr)) auto auto; gap: 10px 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm);
}
.toolbar-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.toolbar-field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.toolbar input[type="search"], .toolbar select, .inline-field input {
  font: inherit; font-size: 15px; width: 100%; min-width: 0; height: 42px; padding: 0 12px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 9px;
}
.inline-field input { width: 220px; height: 38px; font-size: 14.5px; background: var(--surface); }
.toolbar select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.toolbar input[type="search"]:hover, .toolbar select:hover, .inline-field input:hover { border-color: var(--faint); }
.toolbar input[type="search"]:focus, .toolbar select:focus, .inline-field input:focus { border-color: var(--cedar); outline: none; box-shadow: 0 0 0 3px var(--cedar-soft); background-color: var(--surface); }
.toolbar-check { margin: 0; height: 42px; white-space: nowrap; font-size: 14px; }
.toolbar .btn { height: 42px; }

.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 16px; }
.view-bar-end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.segmented a { text-decoration: none; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.clear-link { font-size: 14px; color: var(--muted); font-weight: 500; }

.aisle-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 30px; }
.aisle-tile {
  display: grid; gap: 2px; text-decoration: none; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line); transition: border-color 120ms, box-shadow 120ms;
}
.aisle-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.aisle-tile-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.aisle-tile-count { font-size: 13px; color: var(--muted); }
.aisle-tile-compared { font-size: 12.5px; font-weight: 600; color: var(--cedar); }

.ledger {
  --ledger-cols: minmax(240px, 1.8fr) repeat(4, minmax(0, 1fr)) minmax(180px, 1.25fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 16px 4px; box-shadow: var(--shadow-sm);
}
.ledger.cols-1 { --ledger-cols: minmax(240px, 1.8fr) minmax(0, 1fr) minmax(180px, 1.25fr); }
.ledger.cols-2 { --ledger-cols: minmax(240px, 1.8fr) repeat(2, minmax(0, 1fr)) minmax(180px, 1.25fr); }
.ledger.cols-3 { --ledger-cols: minmax(240px, 1.8fr) repeat(3, minmax(0, 1fr)) minmax(180px, 1.25fr); }
.ledger-section {
  display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap;
  font-size: 22px; font-weight: 800; letter-spacing: -0.025em; padding: 30px 0 10px; scroll-margin-top: 12px;
}
.ledger-section:first-child { padding-top: 18px; }
.ledger-section span { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ledger-head, .ledger-row { display: grid; grid-template-columns: var(--ledger-cols); gap: 10px; align-items: center; }
.ledger-head {
  position: sticky; top: 0; z-index: 2; background: var(--surface); font-size: 12.5px; font-weight: 600;
  padding: 12px 0 10px; border-bottom: 1px solid var(--line-strong); color: var(--muted);
}
.ledger-head span[class^="s-"] { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.ledger-head span[class^="s-"]::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--store); flex: none; }
.ledger-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-item { min-width: 0; display: flex; gap: 12px; align-items: center; }
.ledger-thumb { width: 52px; }
.ledger-text { min-width: 0; }
.ledger-name { font-weight: 600; text-decoration: none; line-height: 1.3; }
.ledger-name:hover { text-decoration: underline; }
.ledger-item .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.aisle-tag { display: inline-block; margin-top: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }

.ledger-price {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 7px 36px 7px 9px; border-radius: 3px 8px 8px 3px;
  border-left: 3px solid var(--store); background: var(--surface-2); min-height: 44px; align-content: center;
}
.ledger-usd { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.ledger-price small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.ledger-price.is-cheapest { background: var(--cedar); color: var(--cedar-ink); }
.ledger-price.is-cheapest small { color: var(--cedar-ink); opacity: 0.85; }
.ledger-price.is-out { opacity: 0.55; }
.ledger-price.is-empty { background: transparent; border-left-color: var(--line); color: var(--line-strong); font-weight: 600; padding-right: 9px; }
.ledger-offer { background: var(--promo); color: var(--promo-ink); font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.01em; }
/* "check at the store" button on each browse price */
.ledger-link {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%); display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px; color: var(--muted); border: 1px solid var(--line); background: var(--surface);
}
.ledger-link:hover { color: var(--ink); border-color: var(--ink); }
.ledger-price.is-cheapest .ledger-link { color: var(--cedar-ink); background: transparent; border-color: color-mix(in srgb, var(--cedar-ink) 35%, transparent); }
.ledger-price.is-cheapest .ledger-link:hover { border-color: var(--cedar-ink); }

.ledger-gap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gap-figure { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.gap-figure strong { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--cedar); }
.gap-figure span { font-size: 12.5px; color: var(--muted); }
.gap-none { font-size: 13px; color: var(--muted); }
.check-match { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; color: var(--warn); border: 1px solid currentColor; cursor: help; }

/* price range: every store's price as a dot between the cheapest (left) and dearest (right) */
.range { position: relative; height: 12px; margin: 0 6px; }
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; border-radius: 2px; background: linear-gradient(to right, var(--cedar), var(--line-strong)); }
.range-dot { position: absolute; top: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--store); border: 2px solid var(--surface); box-sizing: border-box; }
.range-dot.p0 { left: 0%; } .range-dot.p1 { left: 5%; } .range-dot.p2 { left: 10%; } .range-dot.p3 { left: 15%; }
.range-dot.p4 { left: 20%; } .range-dot.p5 { left: 25%; } .range-dot.p6 { left: 30%; } .range-dot.p7 { left: 35%; }
.range-dot.p8 { left: 40%; } .range-dot.p9 { left: 45%; } .range-dot.p10 { left: 50%; } .range-dot.p11 { left: 55%; }
.range-dot.p12 { left: 60%; } .range-dot.p13 { left: 65%; } .range-dot.p14 { left: 70%; } .range-dot.p15 { left: 75%; }
.range-dot.p16 { left: 80%; } .range-dot.p17 { left: 85%; } .range-dot.p18 { left: 90%; } .range-dot.p19 { left: 95%; }
.range-dot.p20 { left: 100%; }

/* ---------- homepage search ---------- */
.home-head { padding-bottom: 18px; }
.home-head.is-compact { padding: 24px 0 14px; }
.home-head.is-compact h1 { font-size: clamp(24px, 3vw, 32px); }
.home-head.is-compact .lede { font-size: 15px; margin-top: 4px; }
.home-search {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 16px 14px; box-shadow: var(--shadow-sm);
}
/* the four store colours as a shelf-edge rail along the top of the search panel */
.home-search::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 4px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(to right, var(--s-spinneys) 0 25%, var(--s-promarche) 25% 50%, var(--s-aoun) 50% 75%, var(--s-hachem) 75% 100%);
}
.home-search-bar { position: relative; display: flex; gap: 10px; align-items: stretch; }
.home-search-bar .search-icon { left: 18px; }
.home-search .search-input {
  height: 58px; font-size: 19px; padding: 0 16px 0 52px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2);
}
.home-search .search-input:hover { border-color: var(--faint); }
.home-search .search-input:focus { border-color: var(--cedar); background: var(--surface); box-shadow: 0 0 0 4px var(--cedar-soft); }
.home-search-bar .btn { height: 58px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.home-search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 12px; }
.search-form > .search-input:focus { border-color: var(--cedar); box-shadow: 0 0 0 3px var(--cedar-soft); }
.home-search + .freshness { margin-top: 20px; }
.list-head { margin-top: 6px; }
.ledger-home .ledger-thumb { width: 76px; border-radius: 10px; }
.ledger-home .ledger-name { font-size: 16px; }

/* "Lowest" and the struck-through regular price inside a ledger price cell */
.ledger-best {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--cedar-ink) 20%, transparent); color: var(--cedar-ink);
}
.ledger-was { font-size: 11.5px; color: var(--muted); }
.ledger-price.is-cheapest .ledger-was { color: var(--cedar-ink); opacity: 0.8; }

/* ---------- header: price-update status ---------- */
.update-status { position: relative; }
.status-pill {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 38px;
  padding: 0 14px 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.status-pill:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.status-pill:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.status-pill[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.status-clock { flex: none; }
.status-spinner {
  display: none; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--cedar) 25%, transparent); border-top-color: var(--cedar);
  animation: raff-spin 0.8s linear infinite;
}
.update-status.is-updating .status-spinner { display: block; }
.update-status.is-updating .status-clock { display: none; }
.update-status.is-updating .status-pill { color: var(--cedar); background: var(--cedar-soft); border-color: color-mix(in srgb, var(--cedar) 35%, transparent); }
.status-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 360px; padding: 14px 14px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.status-panel[hidden] { display: none; }
.status-panel-head { display: flex; flex-direction: column; gap: 1px; padding: 0 4px 10px; border-bottom: 1px solid var(--line); }
.status-panel-head strong { font-size: 15px; }
.status-stores { list-style: none; margin: 0; padding: 0; }
.status-stores li { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.status-stores li:last-child { border-bottom: 0; }
.status-store-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.status-store-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.status-store-name::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--store, var(--faint)); flex: none; }
.status-store-state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.status-stores li.is-running .status-store-state { color: var(--cedar); font-weight: 700; }
.status-store-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; padding-left: 18px; }
.status-bar { position: relative; height: 6px; margin: 8px 0 4px 18px; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.status-bar i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--store, var(--cedar)); transition: width 400ms ease; }
.status-bar i.w0 { width: 0%; } .status-bar i.w1 { width: 5%; } .status-bar i.w2 { width: 10%; } .status-bar i.w3 { width: 15%; } 
.status-bar i.w4 { width: 20%; } .status-bar i.w5 { width: 25%; } .status-bar i.w6 { width: 30%; } .status-bar i.w7 { width: 35%; } 
.status-bar i.w8 { width: 40%; } .status-bar i.w9 { width: 45%; } .status-bar i.w10 { width: 50%; } .status-bar i.w11 { width: 55%; } 
.status-bar i.w12 { width: 60%; } .status-bar i.w13 { width: 65%; } .status-bar i.w14 { width: 70%; } .status-bar i.w15 { width: 75%; } 
.status-bar i.w16 { width: 80%; } .status-bar i.w17 { width: 85%; } .status-bar i.w18 { width: 90%; } .status-bar i.w19 { width: 95%; } 
.status-bar i.w20 { width: 100%; } 
.status-bar.is-indeterminate i { width: 35%; animation: raff-slide 1.3s ease-in-out infinite; }
.status-refresh { display: flex; justify-content: flex-end; padding: 10px 4px 2px; border-top: 1px solid var(--line); }
.status-refresh[hidden] { display: none; }
@keyframes raff-spin { to { transform: rotate(360deg); } }
@keyframes raff-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar-search { grid-column: span 2; }
  .toolbar-check { grid-column: span 3; }
}

@media (max-width: 960px) {
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-hero { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 2fr; }
  .footer-links { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
  .wordmark-text small { display: none; }
  .header-bar { gap: 16px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .aisles { margin: 0 -16px 14px; padding-left: 16px; padding-right: 16px; }
  .header-bar { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
  .wordmark-text small { display: none; }
  .header-tools { margin-left: auto; }
  .rate-chip { display: block; padding: 5px 10px; font-size: 12px; }
  .nav { order: 3; width: 100%; margin: 6px -12px 0; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 10px 12px; }
  .nav a[aria-current="page"]::after { bottom: 0; }

  .search-filters { gap: 12px; }
  .inline-field { width: 100%; }
  .inline-field input { flex: 1; width: auto; }

  .freshness { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

  .compare { padding: 0 12px; }
  .compare-head { display: none; }
  .compare-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px 0; }
  .compare-row .product-cell { grid-column: 1 / -1; }
  .compare-row .tag.is-empty { display: none; } /* phones: only the stores that sell it */
  .product-thumb { width: 56px; }
  .tag .store-label { display: block; }
  .tag { min-height: 0; }

  .product-hero { grid-template-columns: 1fr; gap: 18px; padding-top: 12px; }
  .product-media { max-width: 320px; width: 100%; margin: 0 auto; }
  .product-media .pimg-lg { aspect-ratio: 4 / 3; }
  .product-info { padding-top: 0; }
  .tags-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tags-lg .tag .usd { font-size: 26px; }
  .panel { padding: 16px; }

  .page-head { padding: 24px 0 16px; }
  .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .filter-chip { flex: none; }
  .brand-form { margin-left: 0; width: 100%; }
  .brand-form .inline-field { flex: 1; min-width: 0; }
  .inline-field input { min-width: 0; }
  .active-chip { align-self: flex-start; }

  .toolbar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .toolbar-search, .brand-field { grid-column: 1 / -1; }
  .toolbar-check { grid-column: 1 / -1; height: auto; }
  .toolbar .btn { grid-column: 1 / -1; }
  .ledger { padding: 0 12px 4px; }
  .ledger-head { display: none; }
  .ledger-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 14px 0; }
  .ledger-item, .ledger-gap { grid-column: 1 / -1; }
  .ledger-item { margin-bottom: 4px; }
  .ledger-gap { order: 9; margin-top: 4px; }
  .ledger-price.is-empty { display: none; }
  .ledger-price::before { content: attr(data-store); flex-basis: 100%; font-size: 11px; font-weight: 600; opacity: 0.75; }
  .ledger-price .visually-hidden { display: none; }
  .ledger-price { padding-right: 44px; }
  .ledger-link { width: 32px; height: 32px; }
  .ledger-section { font-size: 19px; }

  .footer-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-media { padding: 6px 6px 0; }
  .card-body { padding: 10px; }
  .card-title { font-size: 14px; }
  .card-prices li { flex-direction: column; gap: 0; padding: 4px 7px; font-size: 12.5px; }
  .card-store { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .card-price { text-align: left; }
  .card-foot .btn { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .freshness > div { padding: 10px 10px 10px 12px; }
  .freshness .meta { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar span, .card, .aisle-tile, .btn { transition: none; }
}

@media (max-width: 1100px) {
  .status-pill { padding: 0 12px 0 10px; }
}

@media (max-width: 760px) {
  .home-search { padding: 16px 12px 12px; }
  .home-head.is-compact .lede { display: none; }
  .home-search-bar { flex-wrap: wrap; }
  .home-search .search-input { flex-basis: 100%; height: 52px; font-size: 17px; padding-left: 46px; }
  .home-search-bar .search-icon { top: 26px; left: 15px; }
  .home-search-bar .btn { width: 100%; height: 48px; }
  .home-search-filters .inline-field { width: 100%; }
  .ledger-home .ledger-thumb { width: 64px; }
  .status-pill { width: 38px; padding: 0; justify-content: center; }
  .status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .status-panel { position: fixed; left: 12px; right: 12px; top: 58px; width: auto; max-height: calc(100vh - 80px); overflow-y: auto; }
  .header-tools { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-spinner { animation-duration: 2.4s; }
  .status-bar.is-indeterminate i { animation: none; width: 100%; opacity: 0.45; }
  .status-bar i { transition: none; }
}

/* ── Brand combobox ── (built by public/js/app.js around the brand <input>; the datalist is the no-JS fallback) */
.combo { position: relative; width: 100%; min-width: 0; }
.inline-field .combo { width: 260px; }
.combo input.combo-input[type="search"] { width: 100%; padding-left: 36px; padding-right: 36px; }
.combo .combo-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.combo-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.combo.is-open .combo-icon, .combo:focus-within .combo-icon { color: var(--cedar); }
.combo-clear {
  all: unset; box-sizing: border-box; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); cursor: pointer;
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; color: var(--muted); background: var(--surface-2);
}
.combo-clear[hidden] { display: none; }
.combo-clear:hover { color: var(--ink); background: var(--line); }
.combo-clear:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.combo.is-open .combo-input { border-color: var(--cedar); box-shadow: 0 0 0 3px var(--cedar-soft); background-color: var(--surface); }

.combo-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: max(100%, 320px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden;
}
.combo-panel[hidden] { display: none; }
.combo-list { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.combo-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 700; color: var(--faint); }
.combo-group:first-child { padding-top: 4px; }
.combo-option {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 7px;
  cursor: pointer; font-size: 14.5px; line-height: 1.3;
}
.combo-option.is-active { background: var(--cedar-soft); }
.combo-option.is-active .combo-name { color: var(--cedar); }
.combo-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.combo-name mark { background: transparent; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--cedar) 55%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.combo-count { flex: none; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.combo-option.is-current .combo-name { font-weight: 700; }
.combo-option.is-current .combo-name::after { content: " ✓"; color: var(--cedar); }
.combo-foot { margin: 0; padding: 9px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-2); }
.combo-foot[hidden] { display: none; }

@media (max-width: 760px) {
  .inline-field .combo { width: auto; flex: 1; }
  .combo-panel { width: 100%; }
  .combo-list { max-height: min(340px, 50vh); }
  .combo-option { padding: 10px; }
}

/* ── Aisle icons ── (partials/aisle-icon: Lucide line icons in a tinted square; one hue per aisle in --ai) */
.ai-fruit-veg { --ai: #3b8a2a; }
.ai-meat-fish { --ai: #c2372e; }
.ai-dairy-deli { --ai: #3c64c8; }
.ai-bakery { --ai: #c27526; }
.ai-pantry { --ai: #9a7a1c; }
.ai-snacks { --ai: #c43d7c; }
.ai-drinks { --ai: #0f8a86; }
.ai-frozen { --ai: #1f8fc4; }
.ai-alcohol { --ai: #8e2d4f; }
.ai-baby { --ai: #6d5bd0; }
.ai-beauty { --ai: #a24bb5; }
.ai-household { --ai: #4f6b85; }
.ai-pets { --ai: #c4572a; }
.ai-other { --ai: #66736c; }
[class*="ai-"] { --ai-fg: var(--ai); --ai-bg: color-mix(in srgb, var(--ai) 12%, var(--surface)); --ai-ring: color-mix(in srgb, var(--ai) 20%, transparent); }
:root[data-theme="dark"] [class*="ai-"] {
  --ai-fg: color-mix(in srgb, var(--ai) 55%, #ffffff); --ai-bg: color-mix(in srgb, var(--ai) 26%, var(--surface));
  --ai-ring: color-mix(in srgb, var(--ai) 38%, transparent);
}

.aisle-icon { display: block; width: 100%; height: 100%; flex: none; }
.aisle-mark {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 5px; border-radius: 8px;
  background: var(--ai-bg, var(--surface-2)); color: var(--ai-fg, var(--muted)); box-shadow: inset 0 0 0 1px var(--ai-ring, var(--line));
}
.aisle-mark-lg { width: 46px; height: 46px; padding: 11px; border-radius: 13px; }
.aisle-mark-xl { width: 52px; height: 52px; padding: 12px; border-radius: 15px; }

/* chips (/ and aisle pages) */
.aisle-chip { padding: 5px 14px 5px 5px; }
.aisle-chip .aisle-mark { width: 30px; height: 30px; padding: 6px; border-radius: 99px; color: var(--ai-fg); }
.aisle-chip .aisle-chip-count { color: var(--faint); font-weight: 500; font-size: 13px; }
.aisle-chip:hover { border-color: color-mix(in srgb, var(--ai-fg) 40%, var(--line)); }
.aisle-chip[aria-current="page"] .aisle-mark { background: color-mix(in srgb, var(--paper) 16%, transparent); color: var(--paper); box-shadow: none; opacity: 1; }

/* /browse aisle tiles */
.aisle-index { grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 10px; }
.aisle-tile { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px 12px 12px; }
.aisle-tile:hover { border-color: color-mix(in srgb, var(--ai-fg) 45%, var(--line)); }
.aisle-tile:hover .aisle-mark { background: color-mix(in srgb, var(--ai) 18%, var(--surface)); }
:root[data-theme="dark"] .aisle-tile:hover .aisle-mark { background: color-mix(in srgb, var(--ai) 34%, var(--surface)); }
.aisle-tile-text { display: grid; gap: 1px; min-width: 0; }
.aisle-tile-name { line-height: 1.25; }

/* /browse grouped section headings */
.ledger-section .ledger-section-title { display: inline-flex; align-items: center; gap: 12px; font-size: inherit; font-weight: inherit; letter-spacing: inherit; color: var(--ink); }
.ledger-section { align-items: center; }
.ledger-section .aisle-mark { width: 38px; height: 38px; padding: 8px; border-radius: 11px; }

/* aisle page header */
.aisle-title { display: flex; align-items: center; gap: 14px; }

/* small aisle tag on ledger rows (flat /browse) */
.aisle-tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; color: var(--ai-fg, var(--muted)); background: var(--ai-bg, var(--surface-2)); border-color: var(--ai-ring, var(--line)); }
.aisle-tag .aisle-icon { width: 13px; height: 13px; }
.aisle-tag span { color: var(--muted); }

@media (max-width: 760px) {
  .aisle-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .aisle-tile { align-items: start; gap: 9px; padding: 10px; }
  .aisle-tile-name { font-size: 14px; }
  .aisle-tile-count, .aisle-tile-compared { font-size: 12px; }
  .aisle-mark-lg { width: 34px; height: 34px; padding: 7px; border-radius: 10px; }
  .aisle-mark-xl { width: 44px; height: 44px; padding: 10px; border-radius: 13px; }
  .ledger-section .aisle-mark { width: 32px; height: 32px; padding: 7px; border-radius: 10px; }
  .ledger-section .ledger-section-title { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .aisle-chip, .aisle-tile, .aisle-mark { transition: none; }
}
