/* Frank — design follows Forma: Atkinson Hyperlegible Next, paper #F2EFE9,
   brand blue #1d5fa8, calm surfaces, dark until you choose light. */

@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #F2EFE9;                         /* Forma's paper */
  --surface: #F7F5F0;                    /* cards, a little lighter than the paper */
  --surface-2: oklch(0.93 0.009 85);     /* Forma paper slate-50 */
  --surface-3: oklch(0.905 0.01 85);     /* paper slate-100 */
  --line: oklch(0.87 0.011 85);          /* paper slate-200 */
  --line-strong: oklch(0.82 0.012 85);   /* paper slate-300 */
  --field: oklch(0.6 0 0);
  --ink: oklch(0.215 0.011 220);         /* slate-900 */
  --ink-2: oklch(0.36 0.013 220);        /* slate-700 */
  --muted: oklch(0.5 0.011 220);         /* slate-400 on paper, 4.5:1 */
  --accent: oklch(0.84 0.13 247);        /* buttons, dark ink on it */
  --accent-hover: oklch(0.78 0.13 246);
  --accent-ink: #1d5fa8;                 /* Forma's brand blue: links, logo */
  --accent-strong: oklch(0.62 0.12 250); /* focus ring, chart line */
  --accent-soft: oklch(0.945 0.04 250);  /* selected tab */
  --accent-soft-ink: oklch(0.42 0.08 253);
  --promo: oklch(0.55 0.16 55);          /* orange text */
  --promo-soft: oklch(0.95 0.05 75);
  --promo-band: oklch(0.88 0.12 85 / 0.45);
  --danger: oklch(0.55 0.235 27);
  --shadow: 0 1px 2px oklch(0.2 0.01 220 / 0.06), 0 4px 16px oklch(0.2 0.01 220 / 0.06);
  /* health: Nutri-Score style green → red */
  --g-a: oklch(0.55 0.13 150); --g-b: oklch(0.68 0.15 135); --g-c: oklch(0.82 0.15 95);
  --g-d: oklch(0.72 0.15 60);  --g-e: oklch(0.6 0.19 35);
  --g-a-ink: #fff; --g-b-ink: oklch(0.2 0.02 140); --g-c-ink: oklch(0.25 0.04 90);
  --g-d-ink: oklch(0.22 0.04 60); --g-e-ink: #fff;
  --radius: 8px;
  --radius-lg: 12px;
  font-family: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root.dark {
  color-scheme: dark;
  --bg: oklch(0.16 0.009 220);           /* slate-950 */
  --surface: oklch(0.215 0.011 220);     /* slate-900 */
  --surface-2: oklch(0.19 0.01 220);
  --surface-3: oklch(0.28 0.011 220);    /* slate-800 */
  --line: oklch(0.28 0.011 220);
  --line-strong: oklch(0.36 0.013 220);
  --field: oklch(0.56 0 0);
  --ink: oklch(0.962 0.003 220);
  --ink-2: oklch(0.868 0.007 220);
  --muted: oklch(0.66 0.011 220);
  --accent-ink: oklch(0.865 0.1 248);
  --accent-strong: oklch(0.72 0.12 248);
  --accent-soft: oklch(0.35 0.065 254 / 0.7);
  --accent-soft-ink: oklch(0.9 0.07 249);
  --promo: oklch(0.8 0.13 70);
  --promo-soft: oklch(0.32 0.05 65 / 0.6);
  --promo-band: oklch(0.75 0.12 80 / 0.18);
  --danger: oklch(0.704 0.191 22.2);
  --shadow: none;
}
/* Colour-blind palette: blue (good) → orange (bad) instead of green → red */
:root[data-colors="safe"] {
  --g-a: oklch(0.5 0.13 255);  --g-b: oklch(0.68 0.11 245); --g-c: oklch(0.84 0.04 240);
  --g-d: oklch(0.78 0.12 70);  --g-e: oklch(0.6 0.16 50);
  --g-a-ink: #fff; --g-b-ink: oklch(0.2 0.03 250); --g-c-ink: oklch(0.25 0.02 240);
  --g-d-ink: oklch(0.22 0.04 60); --g-e-ink: #fff;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  accent-color: var(--accent-strong);
}
::selection { background: oklch(0.9 0.07 249); color: oklch(0.215 0.011 220); }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
.num, table { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.75rem; }
.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; }
.skip-link { position: absolute; left: 12px; top: 12px; z-index: 50; transform: translateY(-80px); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.skip-link:focus-visible { transform: none; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 992px; margin: 0 auto; padding: 0 16px; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.logo { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; margin-right: auto; white-space: nowrap; }
.logo { display: inline-flex; align-items: center; min-width: 0; }
.logo-text span { color: var(--accent-ink); }
.logo-icon { display: none; width: 30px; height: 30px; border-radius: 8px; }
.nav { flex-wrap: nowrap; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .icon-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--radius); background: none; color: var(--ink-2); font: inherit; font-size: 0.875rem; cursor: pointer;
}
.nav a:hover, .icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent-soft-ink); background: var(--accent-soft); }
.icon-btn { width: 40px; justify-content: center; padding: 0; }
.icon-btn[aria-pressed="true"] { color: var(--accent-soft-ink); background: var(--accent-soft); }
.badge-count {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: oklch(0.215 0.011 220); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}
.badge-count:empty, .badge-count[data-count="0"] { display: none; }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
/* icons only below 900 px: the labels (long in German) do not fit next to each other */
@media (max-width: 900px) {
  .nav a .nav-label { display: none; }
  .nav a { width: 40px; justify-content: center; padding: 0; }
}
@media (max-width: 440px) {
  .site-header .wrap { gap: 4px; padding: 0 10px; }
  .logo { font-size: 1rem; }
  .nav { gap: 0; }
  .nav a, .icon-btn { width: 36px; }
}
@media (max-width: 400px) {
  .logo-text { display: none; }
  .logo-icon { display: block; }
  .nav a, .icon-btn { width: 34px; }
  .nav-sep { display: none; }
  .nav-help { display: none !important; }   /* "How it works" is in the footer too */
}
main { flex: 1; padding: 32px 0 64px; }
.site-footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 0.8125rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 12px;
  border-radius: var(--radius); border: 1px solid var(--line-strong); background: none; color: var(--ink-2);
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: transparent; color: oklch(0.215 0.011 220); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-lg { min-height: 44px; padding: 8px 18px; font-size: 1rem; }
.input, .select {
  width: 100%; min-height: 36px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--field);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 0.875rem;
}
:root.dark .input, :root.dark .select { background: var(--surface); }
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-strong); }
.select { width: auto; padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.search-bar { position: relative; display: flex; gap: 8px; }
.search-bar .input { min-height: 48px; padding-left: 44px; font-size: 1rem; border-radius: 10px; }
.search-bar .icon { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.search-bar .btn { min-height: 48px; padding: 0 20px; font-size: 1rem; border-radius: 10px; }

/* segmented pill tabs (Forma: "Active rooms | Archived rooms") */
.tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; flex-wrap: wrap; }
.tabs a, .tabs button {
  border: 0; background: none; font: inherit; font-size: 0.8125rem; color: var(--muted); padding: 5px 12px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-selected="true"], .tabs [aria-pressed="true"], .tabs [aria-current="page"] { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 0.8125rem; color: var(--ink-2); text-transform: capitalize; user-select: none;
}
.chip span.plain { padding-left: 11px; text-transform: none; }
.chip input:checked + span { background: var(--accent-soft); border-color: transparent; color: var(--accent-soft-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 16px 0 24px; }
/* Swiss / Bio / vegan / vegetarian chips (website _macros.flag_chips, app flagChips): their own line */
.flag-filter { flex-basis: 100%; display: grid; gap: 6px; }
.flag-note { margin: 0; line-height: 1.4; }
.filters + .flag-note { margin: -12px 0 16px; }
.section-title + .flag-note { margin: -4px 0 10px; }
/* the same chips on Better choices, under the healthier alternatives and in the basket */
.better-flags, .alt-flags { margin: 0 0 16px; }
.alt-flags { margin-top: -4px; }
.alt-none { margin: 0 0 8px; line-height: 1.45; }
/* a phone held sideways: the grid right under the search box, the chips after it */
@media (max-height: 500px) {
  .basket-card { display: flex; flex-direction: column; }
  .basket-card > .pick-box { order: 1; }
  .basket-card > .basket-flags { order: 2; }
  .basket-card > .basket-items { order: 3; }
}
.chip input:disabled + span { opacity: 0.75; cursor: default; }
.filters label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-2); }

/* tips popover */
details.tips { font-size: 0.875rem; color: var(--muted); }
details.tips summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
details.tips summary::-webkit-details-marker { display: none; }
details.tips[open] summary { color: var(--ink); }
details.tips ul { margin: 8px 0 0; padding: 12px 16px 12px 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: var(--ink); }

/* ---------- cards & lists ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
:root:not(.dark) .card { box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 32px 0 12px; }
.section-title h2 { font-size: 1.0625rem; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 40px 20px; text-align: center; color: var(--muted); overflow-wrap: anywhere; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .15s;
}
.item:hover { border-color: var(--line-strong); }
.item.is-promo { border-left: 3px solid var(--promo); }
/* picture tiles: square, white (a photo card, also in dark mode), the whole pack visible */
.thumb { width: 56px; height: 56px; flex: none; border-radius: var(--radius); background: #fff; object-fit: contain; padding: 3px; border: 1px solid var(--line); }
.thumb.blank { display: grid; place-items: center; color: oklch(0.62 0.01 220); background: #fff; }
:root.dark .thumb { border-color: transparent; }
.item-main { min-width: 0; }
.item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: 0.8125rem; color: var(--muted); }
.item-price { text-align: right; white-space: nowrap; }
.price { font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.unit-price { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.old-price { font-size: 0.8125rem; color: var(--muted); text-decoration: line-through; margin-right: 4px; }
@media (max-width: 560px) {
  .item { grid-template-columns: 48px 1fr; }
  .thumb { width: 48px; height: 48px; }
  .item-price { grid-column: 2; text-align: left; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
}

.shop { display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize; }
.shop-dot { width: 16px; height: 16px; border-radius: 4px; flex: none; object-fit: contain; background: #fff; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.pill-promo { background: var(--promo-soft); color: var(--promo); }
.pill-accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.pill-quiet { background: var(--surface-3); color: var(--ink-2); font-weight: 500; }
/* the small Swiss cross before the name of a product we know is Swiss (website and apps) */
.swiss-mark { display: inline-block; vertical-align: -2px; line-height: 0; }
.swiss-mark svg { border-radius: 3px; }
.product-title .swiss-mark svg { width: 0.8em; height: 0.8em; }

/* compare-by-shop grid */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.shop-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
:root:not(.dark) .shop-card { box-shadow: var(--shadow); }
.shop-card.is-best { border-color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent-strong); }
.shop-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.shop-card-head .shop-dot { width: 20px; height: 20px; }
.shop-card-body { padding: 16px; display: grid; grid-template-columns: 72px 1fr; gap: 14px; }
.shop-card-body .thumb { width: 72px; height: 72px; }
.shop-card-price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 16px 14px; }
.shop-card-price .price { font-size: 1.375rem; }
.shop-card-price .unit-price { font-size: 0.9375rem; color: var(--ink-2); font-weight: 600; }
.shop-card details { border-top: 1px solid var(--line); margin-top: auto; }
.shop-card summary { cursor: pointer; padding: 10px 16px; font-size: 0.8125rem; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.shop-card summary::-webkit-details-marker { display: none; }
.shop-card summary:hover { color: var(--ink); }
.more { list-style: none; margin: 0; padding: 0 8px 8px; }
.more a { display: flex; gap: 10px; justify-content: space-between; padding: 6px 8px; border-radius: var(--radius); font-size: 0.875rem; }
.more a:hover { background: var(--surface-3); }
.more .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- health ---------- */
.score {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 3px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.score i { width: 10px; height: 10px; border-radius: 50%; margin-left: 3px; }
.score.excellent i { background: var(--g-a); } .score.good i { background: var(--g-b); }
.score.poor i { background: var(--g-d); } .score.bad i { background: var(--g-e); }
.score.unsure { font-weight: 500; }
.ns { display: inline-flex; width: 20px; height: 20px; border-radius: 5px; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.ns-a { background: var(--g-a); color: var(--g-a-ink); } .ns-b { background: var(--g-b); color: var(--g-b-ink); }
.ns-c { background: var(--g-c); color: var(--g-c-ink); } .ns-d { background: var(--g-d); color: var(--g-d-ink); }
.ns-e { background: var(--g-e); color: var(--g-e-ink); }

.health { display: grid; grid-template-columns: 180px 1fr; gap: 24px; }
@media (max-width: 720px) { .health { grid-template-columns: 1fr; } }
.ring { --p: 0; --c: var(--muted); position: relative; width: 132px; height: 132px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; margin: 0 auto; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.ring > div { position: relative; text-align: center; }
.ring b { display: block; font-size: 2.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.ring.excellent { --c: var(--g-a); } .ring.good { --c: var(--g-b); } .ring.poor { --c: var(--g-d); } .ring.bad { --c: var(--g-e); }
.rating-word { text-align: center; margin-top: 10px; font-weight: 700; text-transform: capitalize; }
.scale { display: flex; gap: 4px; }
.scale span { flex: 1; text-align: center; padding: 4px 0; border-radius: 6px; font-weight: 800; font-size: 0.875rem; opacity: .35; text-transform: uppercase; }
.scale span.on { opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.scale .n1 { background: var(--g-a); color: var(--g-a-ink); } .scale .n2 { background: var(--g-b); color: var(--g-b-ink); }
.scale .n3 { background: var(--g-d); color: var(--g-d-ink); } .scale .n4 { background: var(--g-e); color: var(--g-e-ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 28px; }
.fact h3 { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.levels { list-style: none; margin: 0; padding: 0; }
.levels li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.levels li:last-child { border-bottom: 0; }
.levels .v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.low { background: var(--g-a); } .dot.medium { background: var(--g-c); } .dot.high { background: var(--g-e); }
.dot.risk-high { background: var(--g-e); } .dot.risk-moderate { background: var(--g-d); } .dot.risk-low { background: var(--g-b); }
.lvl { font-size: 0.75rem; color: var(--muted); width: 56px; text-align: right; }

/* ---------- product page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.875rem; margin-bottom: 20px; }
.back:hover { color: var(--ink); }
.product-top { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
@media (max-width: 720px) { .product-top { grid-template-columns: 1fr; gap: 20px; } .product-img { max-width: 220px; } }
.product-img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 12px; }
.product-img.blank { display: grid; place-items: center; color: oklch(0.62 0.01 220); background: #fff; }
.product-img.blank .icon { width: 48px; height: 48px; }
.product-title { font-size: 1.75rem; }
.big-price { font-size: 2.25rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 120px; }
.stat small { display: block; color: var(--muted); font-size: 0.75rem; }
.stat b { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }

/* ---------- chart ---------- */
.pc-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8125rem; color: var(--muted); }
.pc-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pc-chart { position: relative; }
.pc svg { width: 100%; height: auto; display: block; touch-action: pan-y; overflow: visible; }
.pc-line { fill: none; stroke: var(--accent-strong); stroke-width: 2.5; stroke-linejoin: round; }
.pc-area { fill: var(--accent-strong); opacity: .08; }
.pc-hl { fill: var(--promo-band); }
.pc-grid { stroke: var(--line); }
.pc-label { font-size: 12px; fill: var(--muted); font-family: inherit; }
.pc-dot { fill: var(--accent-strong); stroke: var(--surface); stroke-width: 2; }
.pc-cursor { stroke: var(--muted); stroke-dasharray: 3 3; }
.pc-tip { position: absolute; display: none; pointer-events: none; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px));
  background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: var(--radius); font-size: 0.8125rem; }
.pc-tip small { display: block; opacity: .75; }
.pc-legend { margin-top: 8px; font-size: 0.8125rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pc-legend i { width: 12px; height: 12px; background: var(--promo-band); border-radius: 3px; border: 1px solid var(--promo); }
.pc-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 0.875rem; }

/* ---------- basket ---------- */
.basket-add { display: flex; gap: 8px; }
.basket-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.basket-items li { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--surface-3); font-size: 0.875rem; }
.basket-items button { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 999px; width: 26px; height: 26px; display: grid; place-items: center; }
.basket-items button:hover { background: var(--line-strong); color: var(--ink); }
.basket-items li.is-pick { padding-left: 4px; }
.basket-items .basket-line { width: auto; max-width: 100%; height: auto; min-height: 26px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 2px; color: var(--ink); font: inherit; text-align: left; }
.basket-items .basket-line > span:not(.tiny) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.basket-items .tiny { text-transform: capitalize; }
.tiny-thumb { width: 26px; height: 26px; padding: 1px; border-radius: 999px; }
.tiny-thumb.blank svg { width: 14px; height: 14px; }
/* the grid of products to pick from while typing a basket word: 3 columns on a phone */
.pick-box { display: grid; gap: 8px; }
.basket-add { scroll-margin-top: 76px; }
.pick-any { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.pick-hint { margin: 0; }
.pick-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.pick { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pick:hover, .pick:focus-visible { border-color: var(--accent-strong); }
.pick.is-promo { border-color: var(--promo-soft); }
.pick-tile { position: relative; display: block; margin-bottom: 4px; }
.pick .pick-img { display: grid; width: 100%; height: auto; aspect-ratio: 1; padding: 4px; }
.pick-promo { position: absolute; top: 4px; left: 4px; font-size: 0.6875rem; padding: 0 6px; }
.pick-price { font-weight: 700; font-size: 0.9375rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pick-shop { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 0.75rem; line-height: 1.35; }
.pick-shop .shop-dot { width: 13px; height: 13px; }
.pick-shop .num { color: var(--muted); }
.pick-unit { font-size: 0.6875rem; color: var(--muted); line-height: 1.3; }
.pick-name { font-size: 0.6875rem; color: var(--muted); line-height: 1.25; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pick-more-row { margin: 0; text-align: center; }
@media (max-width: 560px) { .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .pick { padding: 5px; } }
@media (max-height: 520px) and (orientation: landscape) { .pick-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; } .pick { padding: 5px; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.money { text-align: right; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.table .cheapest { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 700; }
.table .cell-name { display: block; font-size: 0.75rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .missing { color: var(--muted); }

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

/* ---------- language menu ---------- */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.02em; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { background: var(--accent-soft); color: var(--accent-soft-ink); }
.lang-menu ul, .menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 150px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 0 8px 28px oklch(0.2 0.01 220 / 0.18);
}
.lang-menu a { display: block; padding: 8px 12px; border-radius: var(--radius); font-size: 0.9375rem; color: var(--ink); }
.lang-menu a:hover { background: var(--surface-3); }
.lang-menu a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }
/* the header's button sizes must not reach the menu entries */
.nav .lang-menu a { display: block; width: auto; height: auto; white-space: nowrap; padding: 8px 12px; }
/* display menu: dark mode and colour-blind colours as labelled switches */
.menu-panel { width: 290px; max-width: calc(100vw - 24px); display: grid; gap: 2px; }
.menu-switch {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; min-height: 48px;
  border: 0; border-radius: var(--radius); background: none; color: var(--ink); font: inherit; font-size: 0.9375rem; text-align: left; cursor: pointer;
}
.menu-switch:hover { background: var(--surface-3); }
.menu-switch > span { flex: 1; display: grid; gap: 4px; }
.menu-switch small { color: var(--ink-2); font-size: 0.8125rem; line-height: 1.35; }
.menu-switch i { flex: none; position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.menu-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.menu-switch[aria-checked="true"] i { background: var(--accent-strong); }
.menu-switch[aria-checked="true"] i::after { transform: translateX(16px); }
.swatch { display: flex; height: 10px; border-radius: 999px; overflow: hidden; max-width: 160px; }
.swatch b { flex: 1; }
.swatch b:nth-child(1) { background: var(--g-a); } .swatch b:nth-child(2) { background: var(--g-b); } .swatch b:nth-child(3) { background: var(--g-c); }
.swatch b:nth-child(4) { background: var(--g-d); } .swatch b:nth-child(5) { background: var(--g-e); }
.select { text-overflow: ellipsis; }
.field-hint { display: block; margin-top: 6px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 400; }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cat-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); min-height: 56px;
}
.cat-tile:hover { border-color: var(--accent-strong); }
.cat-icon { grid-row: span 2; font-size: 1.5rem; line-height: 1; }
.cat-name { font-weight: 600; font-size: 0.875rem; line-height: 1.25; overflow-wrap: anywhere; }
.cat-count { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 400px) { .cat-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- related results ---------- */
details.related { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
details.related > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-weight: 600; padding: 8px 0; }
details.related > summary::-webkit-details-marker { display: none; }
details.related[open] > summary .icon { transform: rotate(180deg); }
details.related .list { margin-top: 8px; opacity: .92; }

/* ---------- health page ---------- */
.health-top { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: start; }
@media (max-width: 640px) { .health-top { grid-template-columns: 1fr; gap: 16px; } }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; background: var(--surface-3);
  font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.badge:not(:has(.ns)) { padding-left: 10px; }
.badge.good { background: color-mix(in oklch, var(--g-a) 18%, transparent); color: var(--ink); }
.badge.bad { background: color-mix(in oklch, var(--g-e) 20%, transparent); color: var(--ink); }
.badge .ns { width: 22px; height: 22px; }
details.how summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; display: inline-flex; gap: 6px; align-items: center; list-style: none; }
details.how summary::-webkit-details-marker { display: none; }
details.how[open] summary { color: var(--ink); }
.health-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; margin-top: 24px; }
@media (max-width: 720px) { .health-cols { grid-template-columns: 1fr; } }
.col-title { font-size: 1rem; display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
details.nutri, .nutri.static { border-bottom: 1px solid var(--line); }
details.nutri > summary, .nutri.static { display: grid; grid-template-columns: 1fr auto 12px 18px; align-items: center; gap: 10px;
  padding: 10px 0; cursor: pointer; list-style: none; min-height: 52px; }
.nutri.static { grid-template-columns: 1fr auto 12px 18px; cursor: default; }
details.nutri > summary::-webkit-details-marker { display: none; }
details.nutri > summary .icon { color: var(--muted); transition: transform .15s; }
details.nutri[open] > summary .icon { transform: rotate(180deg); }
.nutri-main { display: flex; flex-direction: column; min-width: 0; }
.nutri-main b { font-size: 0.9375rem; }
.nutri-value { font-weight: 600; white-space: nowrap; }
.nutri .dot { width: 12px; height: 12px; }
.bar { position: relative; margin: 6px 0 26px; padding-top: 10px; }
.bar-bands { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; }
.bar-bands span { display: block; height: 100%; }
.bar-mark { position: absolute; top: 0; width: 0; height: 0; transform: translateX(-50%);
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--ink); }
.bar-labels { position: relative; height: 16px; margin-top: 4px; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bar-labels span:first-child { transform: none; }
details.nutri > p { margin: -14px 0 10px; }
.additives { display: flex; flex-direction: column; }
details.additive { border-bottom: 1px solid var(--line); }
details.additive > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; list-style: none; min-height: 48px; font-size: 0.9375rem; }
details.additive > summary::-webkit-details-marker { display: none; }
details.additive > summary .icon { color: var(--muted); flex: none; }
details.additive[open] > summary .icon { transform: rotate(180deg); }
details.additive > summary > span:nth-child(3) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.additive-body { padding: 0 0 14px 18px; }
.additive-body a { overflow-wrap: anywhere; }
.ingredients { max-height: 9em; overflow: auto; overflow-wrap: anywhere; }
.alt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.alt { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.alt:hover { border-color: var(--accent-strong); }
.alt .thumb { width: 100%; height: 110px; }
.alt .item-title { font-size: 0.875rem; }
.alt-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; }
.alt .pill { align-self: flex-start; }

/* ---------- method page ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.toc a { font-size: 0.8125rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.toc a:hover { border-color: var(--accent-strong); color: var(--ink); }
.method section { scroll-margin-top: 16px; }
.method-text p { margin-top: 8px; color: var(--ink-2); }
.method-text .table { margin-top: 10px; }
.method-text { overflow-x: auto; }
.changes { margin: 8px 0 0; padding-left: 18px; }
.changes li { margin-top: 8px; color: var(--ink-2); }

/* ---------- shopping lists ---------- */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.list-card { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; min-height: 56px; }
button.list-card:hover { border-color: var(--accent-strong); }
div.list-card { grid-template-columns: 1fr auto auto; cursor: default; }
.list-card > span:not(.cat-icon) { display: flex; flex-direction: column; min-width: 0; }
.list-card .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card .btn { min-height: 32px; padding: 4px 10px; }

/* ---------- my needs ---------- */
.needs-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-items: end; }
.needs-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.needs-form .select { width: 100%; }
.needs-form .wide { grid-column: 1 / -1; }
.needs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.need { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.need small { color: var(--muted); font-size: 0.8125rem; }
.need b { font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.need.good { border-left: 3px solid var(--g-a); }
.need.limit { border-left: 3px solid var(--g-d); }
.need a { overflow-wrap: anywhere; }
.pyramid { margin: 0; padding-left: 20px; }
.pyramid li { margin-top: 6px; color: var(--ink-2); }

/* ---------- barcode scanner ---------- */
.scan-btn { min-height: 48px; padding: 0 14px; border-radius: 10px; }
* { -webkit-tap-highlight-color: transparent; }   /* no blue flash over tapped areas on Android */
html.scanning, html.scanning body { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.scanner-frame { position: relative; width: min(82vw, 380px); aspect-ratio: 16 / 9; }
.scanner-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 6px; }
.scanner-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scanner-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scanner-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scanner-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scanner-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #ff5a4f; box-shadow: 0 0 8px #ff5a4f; animation: scanline 1.8s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 18%; } to { top: 82%; } }
.scanner.no-camera .scanner-frame { display: none; }
.scanner-frame i { filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); }   /* the corners stay visible on light packs */
.scanner-hint { position: relative; max-width: 420px; text-align: center; font-weight: 600; text-shadow: 0 1px 3px #000; }
.scanner-help { position: relative; display: grid; gap: 12px; width: min(100%, 420px); }
.scanner-help[hidden] { display: none; }
.scanner-help .btn-primary { justify-content: center; min-height: 52px; font-size: 1rem; }
.scanner-type { display: flex; gap: 8px; }
.scanner-type .input { flex: 1; background: #fff; color: #111; font-size: 1.0625rem; letter-spacing: .04em; }
.scanner-type .btn, .scanner .scanner-close { background: #fff; color: #111; border: 0; }
.scanner .scanner-close { position: relative; min-height: 48px; padding: 0 28px; font-size: 1rem; }

/* price chart: where the recorded prices start */
.pc-start { fill: var(--accent-strong); }
.pc-note { flex-basis: 100%; color: var(--ink-2); font-size: 0.8125rem; }

/* favourites */
.fav-row { display: flex; align-items: center; gap: 6px; }
.fav-row > .item { flex: 1; min-width: 0; }
.fav-star { flex: none; }
.fav-star[aria-pressed="true"] .icon, .fav-btn[aria-pressed="true"] .icon { fill: var(--promo); stroke: var(--promo); }
.fav-star[aria-pressed="true"] { background: none; color: var(--promo); }

/* home: a big scan button (the most used thing in the shop) and a short category row */
.scan-cta {
  display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 12px; padding: 14px 18px; min-height: 76px;
  border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent-soft-ink); font: inherit; text-align: left; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--accent-strong);
}
.scan-cta[hidden] { display: none; }
.scan-cta:hover { filter: brightness(1.08); }
.scan-cta .icon { width: 36px; height: 36px; flex: none; }
.scan-cta span { display: grid; gap: 2px; }
.scan-cta b { font-size: 1.125rem; }
.scan-cta small { font-size: 0.8125rem; opacity: 0.85; }
.cat-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.cat-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 8px 4px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-align: center;
  font-size: 0.75rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere;
}
.cat-chip:hover { border-color: var(--accent-strong); }
.cat-chip .cat-icon { font-size: 1.5rem; }
@media (max-width: 440px) { .cat-quick { grid-template-columns: repeat(4, 1fr); } }
.more-cats { margin-top: 10px; }
.more-cats > summary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; color: var(--accent-ink); font-weight: 600; font-size: 0.9375rem; cursor: pointer; list-style: none; }
.more-cats > summary::-webkit-details-marker { display: none; }
.more-cats[open] > summary .icon { transform: rotate(180deg); }
.more-cats .cat-grid { margin-top: 6px; }

.gap-note { margin: -4px 0 10px; }
.fav-row > .btn { flex: none; }
@media (max-width: 440px) { .fav-row > .btn { padding: 0 10px; font-size: 0.8125rem; } }

/* after a scan: which shop product is it? */
.link-box { margin-bottom: 20px; }
.link-box h2 { font-size: 1.125rem; }
.link-box .fav-row form { flex: none; }
.link-box .fav-row { flex-direction: column; align-items: stretch; gap: 0; }
.link-box .fav-row > .item { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.link-box .fav-row > .btn, .link-box .fav-row form .btn { width: 100%; justify-content: center; border-top-left-radius: 0; border-top-right-radius: 0; }
.link-box .list { gap: 12px; }

.add-own { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.add-own > summary, .add-photos > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--accent-ink); list-style: none; }
.add-own > summary::-webkit-details-marker, .add-photos > summary::-webkit-details-marker { display: none; }
.add-own .needs-form { margin-top: 10px; }
.add-photos { margin-top: 20px; }
.add-photos > summary h2 { font-size: 1.0625rem; margin: 0; }
.needs-form label.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; font-weight: 500; text-align: left; }
.needs-form .check input { width: 20px; height: 20px; }

/* ---------- app structure: tab bar (bottom on phones, in the header on wide screens), scan button ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); }
.site-header .wrap { height: 60px; }
.tabbar { display: flex; align-items: center; gap: 4px; }
.tabbar a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--radius);
  color: var(--ink-2); font-size: 0.9375rem; font-weight: 600;
}
.tabbar a:hover { background: var(--surface-3); color: var(--ink); }
.tabbar a[aria-current="page"] { color: var(--accent-soft-ink); background: var(--accent-soft); }
.tabbar .badge-count { top: 2px; right: 2px; }
.settings-btn { margin-left: 8px; }
.settings-btn[aria-current="page"] { color: var(--accent-soft-ink); background: var(--accent-soft); }
.fab-scan {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent-ink); color: #fff; font: inherit; font-size: 1rem; font-weight: 700;
  box-shadow: 0 4px 14px oklch(0.2 0.05 250 / 0.35);
}
:root.dark .fab-scan { background: var(--accent); color: oklch(0.215 0.011 220); box-shadow: 0 4px 18px oklch(0 0 0 / 0.5); }
.fab-scan:hover { filter: brightness(1.08); }
.fab-scan:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; border-radius: 999px; }
.fab-scan .icon { width: 26px; height: 26px; }
.fab-scan[hidden], html.scanning .fab-scan { display: none; }
@media (max-width: 899px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; gap: 0; display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(64px + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  :root:not(.dark) .tabbar { box-shadow: 0 -2px 12px oklch(0.2 0.01 220 / 0.06); }
  .tabbar a { flex-direction: column; justify-content: center; gap: 2px; height: 56px; padding: 0 2px; font-size: 0.75rem; background: none !important; }
  .tabbar a span:not(.badge-count) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a .icon { width: 24px; height: 24px; padding: 0; box-sizing: content-box; border-radius: 999px; padding: 3px 16px; transition: background-color .15s; }
  .tabbar a[aria-current="page"] .icon { background: var(--accent-soft); }
  .tabbar a[aria-current="page"] { color: var(--accent-soft-ink); }
  .tabbar .badge-count { top: 3px; right: calc(50% - 26px); }
  .settings-btn { margin-left: auto; width: 44px; height: 44px; }
  .fab-scan { right: 16px; bottom: calc(64px + 16px + env(safe-area-inset-bottom)); width: 64px; height: 64px; padding: 0; justify-content: center; }
  .fab-scan span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .fab-scan .icon { width: 30px; height: 30px; }
  main { padding: 20px 0 104px; }
  .site-footer { padding-bottom: 96px; }
}
@media (max-width: 400px) { .logo-text { display: inline; } .logo-icon { display: none; } }

/* ---------- health as dot + word ---------- */
.verdict { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.verdict i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.verdict.excellent i { background: var(--g-a); } .verdict.good i { background: var(--g-b); }
.verdict.poor i { background: var(--g-d); } .verdict.bad i { background: var(--g-e); }
.verdict.none { font-weight: 500; color: var(--muted); }
.verdict .mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; flex: none; }
.verdict .mark .icon { width: 13px; height: 13px; stroke-width: 3.2; }
/* better choices: ✗ on the product, ✓ on its better alternative (whatever their words say) */
.is-bad .verdict .mark { background: var(--g-e); color: var(--g-e-ink); }
.is-good .verdict .mark { background: var(--g-a); color: var(--g-a-ink); }

/* ---------- scans ---------- */
.page-head-bar { flex-wrap: nowrap; align-items: flex-start; }
.star-filter { flex: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); }
.star-filter[aria-pressed="true"] { background: var(--promo-soft); color: var(--promo); border-color: transparent; }
.star-filter[aria-pressed="true"] .icon { fill: currentColor; }
.scan-row { position: relative; display: flex; align-items: center; gap: 2px; padding-right: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.scan-row:hover { border-color: var(--line-strong); }
.scan-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px 6px 10px 10px; border-radius: var(--radius-lg); }
.scan-link .thumb { width: 72px; height: 72px; }
.scan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 0.8125rem; color: var(--ink-2); }
.scan-price { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scan-price b { color: var(--ink); }
.scan-row .item-meta { margin-top: 1px; }
.scan-row [data-ago]:empty { display: none; }
.scan-row [data-ago] { margin-top: 2px; }
.row-menu { position: relative; flex: none; }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] summary { background: var(--surface-3); }
.row-menu .menu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: auto; min-width: 230px; }
.row-menu.up .menu-panel { top: auto; bottom: calc(100% + 4px); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--radius);
  background: none; color: var(--ink); font: inherit; font-size: 0.9375rem; text-align: left; cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: var(--surface-3); }
@media (max-width: 560px) {
  .scan-link { gap: 12px; }
  .scan-link .thumb { width: 64px; height: 64px; }
  .scan-row .icon-btn { width: 38px; }
}

/* ---------- better choices: pairs ---------- */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
@media (max-width: 899px) { .pairs { grid-template-columns: 1fr; } }
.pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
:root:not(.dark) .pair { box-shadow: var(--shadow); }
.pair-side { display: flex; flex-direction: column; gap: 4px; padding: 14px; min-width: 0; border-radius: var(--radius-lg); }
.pair-side:hover .pair-name { text-decoration: underline; text-underline-offset: 2px; }
.pair-side.is-bad { border-right: 1px solid var(--line); border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pair-side.is-good { background: color-mix(in oklch, var(--g-a) 7%, transparent); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.pair-img.thumb { width: 100%; height: auto; aspect-ratio: 1; max-width: 150px; align-self: center; margin-bottom: 6px; padding: 8px; }
.pair-name { font-weight: 600; font-size: 0.9375rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pair-meta { font-size: 0.8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair-price { margin-top: auto; padding-top: 4px; font-size: 0.875rem; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pair-price b { color: var(--ink); font-size: 1rem; }
.pair-swap { position: absolute; left: 50%; top: 82px; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 8px oklch(0.2 0.01 220 / 0.15); }
.pair-swap:hover { background: var(--surface-3); }
@media (max-width: 560px) { .pair-side { padding: 12px 10px; } .pair-img.thumb { max-width: 104px; } .pair-swap { top: 56px; } }
/* what the alternative is when it is not one of the same kind rated good; products without a pair and why */
.pair-note { font-size: 0.75rem; font-weight: 600; line-height: 1.3; color: var(--ink-2); background: var(--surface-3); border-radius: 999px; padding: 2px 8px; }
.better-sec .section-title { margin-top: 24px; }
.better-row { display: flex; flex-direction: column; min-width: 0; }
.better-row > .item:not(:last-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.better-why { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface-2);
  font-size: 0.8125rem; color: var(--ink-2); }
.better-why .btn { min-height: 34px; padding: 4px 10px; font-size: 0.8125rem; background: var(--surface); }

/* sheets (the side-by-side comparison) */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 150; background: oklch(0.1 0.01 220 / 0.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(100%, 560px); max-height: 88vh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px oklch(0 0 0 / 0.3); }
@media (min-width: 900px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

/* Nutri-Score, NOVA and Eco-score badges open a short explanation (scripts/badges.js); "?" = missing, tappable too */
.ns-q { background: var(--surface-3); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ns.ns-wide { width: auto; min-width: 20px; padding: 0 4px; }
.badge .ns.ns-wide { min-width: 22px; }
button.badge, button.ns { border: 0; font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
button.ns { font-size: 0.75rem; font-weight: 800; padding: 0; }
[data-badge] { cursor: pointer; }
.badge[data-badge]:hover { background: var(--line); }
.badge.badge-q { color: var(--muted); }
.bsheet { position: fixed; inset: 0; z-index: 170; display: flex; align-items: flex-end; justify-content: center; }
.bsheet-backdrop { position: absolute; inset: 0; background: oklch(0.1 0.01 220 / 0.55); }
.bsheet-box { position: relative; width: min(100%, 460px); max-height: 85vh; max-height: 85dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--ink); border-radius: 18px 18px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px oklch(0 0 0 / 0.3); display: flex; flex-direction: column; gap: 10px; }
.bsheet-box:focus { outline: none; }
@media (min-width: 721px), (orientation: landscape) and (min-width: 600px) { .bsheet { align-items: center; } .bsheet-box { border-radius: 18px; } }
@media (orientation: landscape) and (max-height: 500px) { .bsheet-box { max-height: calc(100dvh - 16px); width: min(100% - 32px, 560px); gap: 8px; } }
.bsheet-head { display: flex; align-items: center; gap: 10px; }
.bsheet-head h2 { flex: 1; margin: 0; font-size: 1.125rem; }
.bsheet-head .ns { width: 28px; height: 28px; font-size: 0.9375rem; border-radius: 7px; }
.bsheet-head .ns.ns-wide { width: auto; min-width: 28px; }
.bsheet-scale { display: flex; gap: 4px; flex-wrap: wrap; }
.bsheet-scale .ns { opacity: 0.4; }
.bsheet-scale .ns.on { opacity: 1; transform: scale(1.2); margin: 0 3px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink-2); }
.bsheet-mine { font-size: 0.9375rem; }
.bsheet-box p { margin: 0; line-height: 1.45; }
.table.compare { table-layout: fixed; }
.table.compare th[scope="row"] { width: 32%; font-weight: 600; color: var(--ink-2); font-size: 0.8125rem; }
.table.compare th[scope="row"] small { font-weight: 400; color: var(--muted); }
.table.compare thead th { background: none; vertical-align: top; white-space: normal; color: var(--ink); font-size: 0.8125rem; }
.table.compare thead a { display: flex; flex-direction: column; gap: 4px; }
.table.compare thead .thumb { width: 64px; height: 64px; }
.table.compare thead small { color: var(--muted); font-weight: 500; }
.table.compare td { font-variant-numeric: tabular-nums; }

/* ---------- settings ---------- */
.settings { display: grid; gap: 16px; max-width: 720px; }
.settings-group { padding: 16px; display: grid; gap: 8px; }
.settings-group h2 { font-size: 1rem; margin-bottom: 2px; }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 6px 12px 10px; }
.setting-label { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9375rem; }
.lang-pick { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.lang-pick a { display: grid; place-items: center; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 0.875rem; color: var(--ink-2); }
.lang-pick a:hover { border-color: var(--accent-strong); color: var(--ink); }
.lang-pick a[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-soft-ink); font-weight: 700; }
@media (max-width: 560px) { .setting { padding-right: 0; } .lang-pick { width: 100%; grid-template-columns: repeat(2, 1fr); } }
.setting-link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: var(--radius); color: var(--ink); }
.setting-link:hover { background: var(--surface-3); }
.setting-link > span { flex: 1; display: grid; gap: 2px; font-size: 0.9375rem; }
.setting-link small { color: var(--ink-2); font-size: 0.8125rem; }
.setting-link > .icon:first-child { color: var(--muted); }
.setting-link > .icon:last-child { color: var(--muted); width: 18px; height: 18px; }
.settings-group .chips { padding: 4px 0; }
.settings-group .chip span { padding: 6px 13px 6px 9px; font-size: 0.875rem; }

/* ---------- photo editor (scripts/photo-editor.js): crop, rotate, straighten before a photo goes to OFF ---------- */
html.photo-editing, html.photo-editing body { overflow: hidden; }
.pe { position: fixed; inset: 0; z-index: 210; display: flex; flex-direction: column; background: #0b0f12; color: #f2f5f7; }
.pe .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pe-top { display: flex; align-items: flex-start; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 12px 6px 16px; }
.pe-head { flex: 1; min-width: 0; }
.pe-head h2 { font-size: 1rem; margin: 0; color: #fff; }
.pe-hint { margin: 2px 0 0; font-size: 0.95rem; font-weight: 600; color: #ffd84d; }
.pe-x, .pe-tool { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; }
.pe-x:hover, .pe-tool:hover { background: rgba(255,255,255,.16); }
.pe-stage { position: relative; flex: 1; min-height: 160px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.pe-stage > canvas:first-child { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-layer { position: absolute; inset: 0; }
.pe-drawing .pe-layer { cursor: crosshair; }
.pe-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-weight: 600; background: rgba(0,0,0,.45); }
.pe-wait[hidden] { display: none; }
.pe-h { position: absolute; width: 52px; height: 52px; margin: -26px 0 0 -26px; padding: 0; border: 0; background: transparent; touch-action: none; cursor: grab; z-index: 2; }
.pe-h[hidden], .pe-move[hidden] { display: none; }
.pe-corner::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #fff; border: 3px solid #1d5fa8; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.pe-q::after { background: #ffd84d; border-color: #111; }
.pe-edge::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 8px; margin: -4px 0 0 -15px; border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.pe-l::after, .pe-r::after { width: 8px; height: 30px; margin: -15px 0 0 -4px; }
.pe-h:focus-visible, .pe-move:focus-visible { outline: 3px solid #ffd84d; outline-offset: -6px; border-radius: 50%; }
.pe-move:focus-visible { border-radius: 0; outline-offset: 2px; }
.pe-move { position: absolute; padding: 0; border: 0; background: transparent; cursor: move; touch-action: none; z-index: 1; }
.pe-loupe { position: absolute; top: 10px; left: 10px; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.7); pointer-events: none; z-index: 3; }
.pe-loupe.pe-right { left: auto; right: 10px; }
.pe-loupe[hidden] { display: none; }
.pe-tools { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 12px 0; }
.pe-seg { display: flex; width: min(100%, 460px); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; overflow: hidden; }
.pe-seg button { flex: 1; min-height: 44px; padding: 6px 8px; border: 0; border-left: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.pe-seg button:first-child { border-left: 0; }
.pe-seg button[aria-pressed="true"] { background: #fff; color: #0b0f12; }
.pe-help { margin: 0; min-height: 1.2em; font-size: 0.85rem; color: #c9d2d8; text-align: center; }
.pe-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.pe-row [hidden], .pe-fine[hidden] { display: none; }
.pe-fine { display: flex; align-items: center; gap: 10px; width: min(100%, 420px); font-size: 0.9rem; }
.pe-fine input { flex: 1; min-width: 80px; height: 36px; accent-color: #ffd84d; }
.pe-fine output { width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }
.pe .pe-small { min-height: 44px; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.pe-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 10px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer; }
.pe-switch i { position: relative; width: 44px; height: 26px; border-radius: 13px; background: rgba(255,255,255,.3); transition: background .15s; }
.pe-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.pe-switch[aria-checked="true"] i { background: #ffd84d; }
.pe-switch[aria-checked="true"] i::after { left: 21px; background: #111; }
.pe-bottom { display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.pe-bottom .btn { flex: 1; justify-content: center; min-height: 52px; font-size: 1.05rem; }
.pe-bottom .btn:not(.btn-primary) { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.pe button:focus-visible, .pe input:focus-visible { outline: 3px solid #ffd84d; outline-offset: 2px; }
.pe-thumb { display: block; max-width: 160px; max-height: 160px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
.pe-thumb[hidden] { display: none; }
@media (min-width: 900px) { .pe-tools { flex-direction: row; flex-wrap: wrap; justify-content: center; } .pe-help { width: 100%; order: -1; } .pe-seg { width: auto; } .pe-seg button { padding: 6px 18px; white-space: nowrap; } .pe-row { width: auto; } .pe-bottom { justify-content: center; } .pe-bottom .btn { flex: 0 1 280px; } }
.pe [hidden] { display: none !important; }

/* a phone held sideways: the picture on the left, the tools and the buttons on the right */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 899px) {
  .pe:not(.bgw) { display: grid; grid-template-columns: 1fr 300px; grid-template-rows: auto 1fr auto; }
  .pe:not(.bgw) .pe-stage { grid-column: 1; grid-row: 1 / 4; min-height: 0; }
  .pe:not(.bgw) .pe-top { grid-column: 2; grid-row: 1; padding-top: 6px; }
  .pe:not(.bgw) .pe-tools { grid-column: 2; grid-row: 2; overflow-y: auto; min-height: 0; }
  .pe:not(.bgw) .pe-bottom { grid-column: 2; grid-row: 3; padding-top: 6px; }
  .pe:not(.bgw) .pe-hint { font-size: 0.8rem; }
}
/* ---------- product page: "Price in every shop" (website and apps) ---------- */
.ps { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 10px 12px 6px; }
.ps-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ps-head h2 { font-size: 1.0625rem; }
.ps-group { margin: 8px 0 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ps-list { list-style: none; margin: 0; padding: 0; }
.ps-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 6.6em; align-items: center; gap: 2px 10px;
  margin: 0 -6px; padding: 6px; border-radius: var(--radius); border-top: 1px solid var(--line); font-size: 0.875rem; }
.ps-list li:first-child .ps-row { border-top-color: transparent; }
.ps-row:hover { background: var(--surface-2); }
.ps-row.is-me { background: var(--surface-3); }
.ps-row.is-best { box-shadow: inset 3px 0 0 var(--g-a); background: color-mix(in oklch, var(--g-a) 12%, transparent); }
.ps-shop { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; font-weight: 600; }
.ps-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ps-tags .pill { font-size: 0.6875rem; padding: 0 6px; }
.ps-size { color: var(--muted); white-space: nowrap; }
.ps-pack { white-space: nowrap; text-align: right; }
.ps-unit { white-space: nowrap; text-align: right; color: var(--ink-2); font-size: 0.8125rem; }
.ps-unit b { color: var(--ink); font-size: 0.9375rem; }
.pill-best { background: color-mix(in oklch, var(--g-a) 22%, transparent); color: var(--ink); }
.pill-best .icon { width: 12px; height: 12px; }
@media (max-width: 380px) { .ps-row { grid-template-columns: minmax(0, 1fr) auto 6.2em; } .ps-size { grid-column: 1; grid-row: 2; font-size: 0.75rem; } }

/* ---------- "Healthier alternatives": one row that scrolls sideways (touch, wheel, mouse drag, arrows) ---------- */
.alt-wrap { position: relative; }
.alt-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 2px 2px 10px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.alt-row > .alt { flex: 0 0 156px; scroll-snap-align: start; user-select: none; }
.alt-row > .alt img { -webkit-user-drag: none; }
.alt-row.dragging { scroll-snap-type: none; cursor: grabbing; }
.alt-row.dragging > .alt { pointer-events: none; }
.alt-row .alt .thumb { height: 96px; }
.alt-row .alt .item-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-btn { display: none; position: absolute; top: 40px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; place-items: center; box-shadow: 0 1px 4px oklch(0.2 0.01 220 / 0.2); }
.side-btn[data-side="-1"] { left: -8px; } .side-btn[data-side="1"] { right: -8px; }
@media (hover: hover) and (pointer: fine) { .side-btn { display: grid; } .alt-row { cursor: grab; } }
.pe:not(.bgw) .pe-help { color: #ffd84d; font-weight: 600; }
.pe-bottom .btn, .wz-foot .btn { min-width: 0; white-space: normal; line-height: 1.15; }
.pe-seg button { min-width: 0; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
