:root {
  /* Mand brand palette — derived from the basket logo (green + produce orange) */
  --brand: #2f9e44;          /* primary green (basket) */
  --brand-dark: #1f7a37;     /* deep green (header gradient end) */
  --brand-deep: #16602b;     /* darkest green (pressed/text on tint) */
  --brand-tint: #eaf6ee;     /* soft green wash (selected/active backgrounds) */
  --lime: #8fce4a;           /* basket-rim lime accent */
  --orange: #ef7d18;         /* produce orange (deals / call-to-action) */
  --orange-tint: #fff2e3;

  --bg: #f3f5f4; --card: #fff; --ink: #16201a;
  --muted: #6b7480; --red: #d12b2b; --green: #1a7f37; --line: #e7eae8;

  --radius: 14px;
  --shadow: 0 1px 3px rgba(20,40,25,.08), 0 1px 2px rgba(20,40,25,.04);
  --shadow-lift: 0 4px 14px rgba(20,40,25,.10);

  --skel: #e9edea;           /* loading-placeholder base */
  --skel-hi: #f4f7f5;        /* loading-placeholder shimmer */
  --amber: #a15c00;          /* stale-data warning text */
}

/* ---- Dark mode ----
   Only the variables change; every component below is written against them, so
   the whole app follows the phone's system setting. Greens are lightened because
   the brand green is too dark to read on a dark surface. */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4ab861; --brand-dark: #3a9c4f; --brand-deep: #8fe0a2;
    --brand-tint: #1b2a20; --lime: #9bd75c; --orange: #ff9440; --orange-tint: #33240f;
    --bg: #14171a; --card: #1d2125; --ink: #e6eae7;
    --muted: #96a0a8; --red: #ff6b6b; --green: #5fd07c; --line: #2c3238;
    --shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
    --shadow-lift: 0 4px 16px rgba(0,0,0,.5);
    --skel: #252b31; --skel-hi: #2f363d;
    --amber: #ffc266;
  }
}
/* Tell the browser which scheme we are in, so its own form widgets, autofill
   colours, scrollbars and text-selection follow suit instead of staying light. */
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { color-scheme: dark; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Inputs inherit the browser's default BLACK text unless told otherwise, which
   in dark mode is black-on-dark -- what you type has to be readable. */
input, textarea, select, button { font: inherit; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { padding-bottom: 76px; }

/* ---- Header ---- */
header { position: sticky; top: 0; z-index: 5; color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  box-shadow: 0 2px 10px rgba(20,80,40,.18); }
.brand { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.brand-logo { width: 30px; height: 30px; background: #fff; border-radius: 9px; padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.brand-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .005em; }
header h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.summary { margin-top: 5px; font-size: 12.5px; opacity: .92; line-height: 1.35; }

.summary .fresh { color: rgba(255,255,255,.85); }
.summary .fresh.stale { color: #ffd9a0; font-weight: 700; }

main { padding: 14px 12px; max-width: 720px; margin: 0 auto; }
.loading { text-align: center; color: var(--muted); padding: 44px 0; }

/* ---- Loading skeletons ---- */
.skel-card { pointer-events: none; }
.skel-line { height: 12px; border-radius: 6px; background: var(--skel);
  background-image: linear-gradient(90deg, var(--skel) 0%, var(--skel-hi) 50%, var(--skel) 100%);
  background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel-title { width: 62%; height: 14px; margin-bottom: 9px; }
.skel-meta { width: 38%; }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-line { animation: none; } }

/* ---- Filter chips & search ---- */
.controls { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: none; -ms-overflow-style: none; }
.controls::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink); transition: background .12s, color .12s, border-color .12s; }
.chip:active { transform: scale(.97); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(47,158,68,.28); }
/* Sort control: an outlined chip, so it reads as "how the list is ordered" and
   not as another active filter. */
.chip-sort { border-color: var(--brand); color: var(--brand-dark); font-weight: 700; background: transparent; }
@media (prefers-color-scheme: dark) { .chip-sort { color: var(--brand-deep); } }
.search { width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; font-size: 15px; margin-bottom: 12px; background: var(--card);
  outline: none; transition: border-color .12s, box-shadow .12s; }
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

/* ---- Cards ---- */
.card { background: var(--card); border-radius: var(--radius); padding: 13px 15px;
  margin-bottom: 11px; box-shadow: var(--shadow); border: 1px solid rgba(20,40,25,.04); }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
/* Deal card: the name column may shrink and wrap, the price column never does,
   so long product names stop pushing the price onto its own line. */
.card.deal .row { align-items: flex-start; }
.deal-main { min-width: 0; flex: 1 1 auto; }
.deal-price { flex: 0 0 auto; text-align: right; }
.deal-price .was { display: block; margin: 1px 0 0; }
.deal-price .save { font-size: 11.5px; margin-top: 1px; white-space: nowrap; }
/* A deal that links through to the shop: a footer row is the affordance, since
   a whole tappable card has no other visible cue. */
.deal-link { cursor: pointer; }
.deal-link:active { background: var(--brand-tint); }
.deal-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.deal-go { display: flex; align-items: center; justify-content: flex-end; gap: 2px;
  margin: 8px -15px -13px; padding: 8px 15px; border-top: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--brand-dark); }
.deal-go .chev { font-size: 16px; line-height: 1; }
@media (prefers-color-scheme: dark) { .deal-go { color: var(--brand-deep); } }
/* A single deal ROW that links through (Voor jou, Nieuw, the favourites pop-up).
   Here the chevron next to the price is the affordance -- these rows sit inside
   a shared card, so they cannot each carry a footer. */
.deal-line-link { cursor: pointer; margin: 0 -15px; padding-left: 15px; padding-right: 15px; }
.deal-line-link:active { background: var(--brand-tint); }
.deal-line-link:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.deal-line-link .chev { color: var(--brand-dark); font-size: 15px; margin-left: 5px; }
@media (prefers-color-scheme: dark) { .deal-line-link .chev { color: var(--brand-deep); } }
.card .name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
.store { display: inline-block; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 6px; padding: 2px 7px; vertical-align: middle; }
.price { font-size: 19px; font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.was { color: var(--muted); text-decoration: line-through; font-size: 13px; margin-left: 6px; }
.disc { display: inline-block; color: #fff; background: var(--orange); font-weight: 700;
  font-size: 11.5px; border-radius: 6px; padding: 1px 7px; vertical-align: middle; }
.save { color: var(--brand-dark); font-weight: 700; }
.valid { color: var(--muted); font-size: 11.5px; margin-top: 3px; }

.group-title { font-weight: 800; font-size: 15px; margin: 18px 4px 7px; letter-spacing: -.01em; }
.group-sub { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.deal-line { display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.deal-line:first-child { border-top: none; }
/* Product photo thumbnail (deal cards, Voor jou rows). Photos are flattened
   onto white by photos.py, so the frame is white too; with no photo the square
   stays as a neutral placeholder with a faint outline glyph. */
.thumb { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 9px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); position: relative; }
.thumb-ico { position: absolute; inset: 0; margin: auto; width: 55%; height: 55%; fill: none; stroke: var(--muted);
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.thumb-img { position: relative; background: #fff; display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb-sm { width: 40px; height: 40px; border-radius: 7px; }
.card.deal .row > .thumb { margin-top: 1px; }
.deal-line.has-thumb { align-items: center; }
.deal-line.has-thumb .deal-main { flex: 1 1 auto; min-width: 0; }
.empty { color: var(--muted); text-align: center; padding: 34px 14px; line-height: 1.5; }

/* ---- Shopping-list planner ---- */
.plan-input { display: flex; gap: 8px; margin: 2px 0 12px; }
.plan-input input { flex: 1; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; outline: none; background: var(--card);
  transition: border-color .12s, box-shadow .12s; }
.plan-input input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.plan-input button { flex: 0 0 auto; border: none; background: var(--brand); color: #fff;
  border-radius: 12px; padding: 0 18px; font-size: 18px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(47,158,68,.28); }
.plan-input button:active { transform: scale(.97); }
.plan-input button .btn-ic { width: 20px; height: 20px; display: block; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* Store identity dot, in the chain's brand colour (connect buttons). */
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 7px; vertical-align: 0; }
.litems { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 6px; }
.litem { display: inline-flex; align-items: center; gap: 6px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 6px 7px 6px 12px; font-size: 13.5px; }
.litem .qty { color: var(--muted); }
.litem .x { cursor: pointer; border: none; background: var(--brand-tint); color: var(--brand-deep);
  border-radius: 50%; width: 20px; height: 20px; line-height: 18px; font-size: 13px; font-weight: 700; }
.plan-total { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 18px; font-weight: 800; padding: 6px 2px; }
.sectlabel { font-weight: 700; font-size: 12px; color: var(--muted); margin: 14px 4px 7px;
  text-transform: uppercase; letter-spacing: .04em; }

/* ---- Section headings (spending view) ---- */
.subhead { margin: 16px 4px 4px; font-size: 14px; font-weight: 700; color: var(--brand-dark);
  letter-spacing: -.01em; }

/* ---- Price history ---- */
.pc-wrap { position: relative; padding-left: 52px; }
.pc-yaxis { position: absolute; left: 0; top: 0; height: 150px; width: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 9px 5px 13px 0; box-sizing: border-box; text-align: right;
  font-size: 10.5px; color: var(--muted); }
.pricechart { width: 100%; height: 150px; display: block; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 2px 0; font-size: 12.5px; }
.pc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pc-xaxis { display: flex; justify-content: space-between; font-size: 10.5px;
  color: var(--muted); margin-top: 5px; }

/* ---- Favourites star + on-open pop-up ---- */
.fav { border: none; background: none; cursor: pointer; font-size: 17px; line-height: 1;
  color: #c9ccce; padding: 0 2px; vertical-align: -1px; }
.fav.on { color: #f5b50a; }
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 420px;
  max-height: 80vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal-h { display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 16px; padding: 15px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card); }
.modal-x { border: none; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.modal-b { padding: 6px 16px 14px; }

/* ---- Unmatched list item resolver ---- */
.card.unmatched { border: 1px solid #f0c36d; background: #fffaf0; }
.card.unmatched .litems { margin-top: 6px; }
.pc-now { font-size: 13px; color: var(--muted); }

/* ---- Variant picker (Prijs step 1) ---- */
.variant-row { cursor: pointer; margin-bottom: 8px; }
.variant-row:active { background: var(--bg); }
.variant-row .chev { color: var(--muted); font-size: 20px; align-self: center; }
.vform { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--green); border: 1px solid var(--green);
  border-radius: 6px; padding: 0 5px; margin-left: 4px; vertical-align: middle; }
.backlink { color: var(--green); font-weight: 600; font-size: 14px; cursor: pointer;
  padding: 6px 2px 2px; }
.backlink:active { opacity: .6; }

/* ---- Prijs: flavour cards + package chips (step 1/2) ---- */
.flav-row .row { align-items: center; gap: 12px; }
.flav-main { flex: 1; min-width: 0; }
.vthumb { position: relative; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.vthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  background: #fff; }
.vthumb-ph { width: 24px; height: 24px; fill: none; stroke: var(--muted); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.flav-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.flav-head .vthumb { width: 56px; height: 56px; }
.flav-head .group-title { margin: 0; }
.pkg-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 12px; }
.pkg-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pkg-n { font-size: 11px; font-weight: 700; min-width: 18px; padding: 1px 5px; border-radius: 999px;
  background: var(--bg); color: var(--muted); text-align: center; }
.pkg-chip.active .pkg-n { background: rgba(255,255,255,.25); color: #fff; }

/* ---- Connect bar: store needing reconnect ---- */
.chip.needs-relogin { border-color: var(--red); color: var(--red); font-weight: 700; }

/* ---- Bottom tab bar ---- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(20,40,25,.05); }
.tab { flex: 1; border: none; background: none; padding: 9px 0 8px; color: var(--muted);
  font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center;
  gap: 3px; position: relative; transition: color .12s; }
/* Inline SVG line icons: they take their colour from the tab (currentColor), so
   active/inactive and light/dark all follow the text colour automatically. */
.tab .ic { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--brand); }
.tab.active .ic { stroke-width: 2; }
.tab.active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.badge { position: absolute; top: 4px; right: 50%; margin-right: -26px; min-width: 16px;
  height: 16px; padding: 0 4px; border-radius: 9px; background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; display: none;
  box-shadow: 0 0 0 2px var(--card); }
.badge.show { display: inline-block; }

/* ---- Bars (spending) ---- */
.barrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.catrow { cursor: pointer; border-radius: 8px; transition: background .12s; }
.catrow:hover { background: var(--brand-tint); }
.catrow:active { opacity: .7; }
.catrow .barval { color: var(--brand-dark); }
.pickrow { cursor: pointer; border-radius: 8px; transition: background .12s; padding-left: 4px; padding-right: 4px; }
.pickrow:hover { background: var(--brand-tint); }
.pickrow:active { opacity: .7; }
.pickrow.active { background: var(--brand-tint); font-weight: 700; }
.pickrow.active .barlabel::before { content: "✓ "; color: var(--brand-dark); }
.acc-head { cursor: pointer; user-select: none; }
.acc-head:active { opacity: .6; }
.acc-arrow { display: inline-block; width: 1em; color: var(--brand-dark); }
.barlabel { flex: 0 0 38%; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bartrack { flex: 1; background: var(--brand-tint); border-radius: 6px; height: 15px; overflow: hidden; }
.barfill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--lime)); border-radius: 6px; }
.barval { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--ink); min-width: 56px; text-align: right; }
.tag-new { background: var(--brand); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.tag-drop { background: var(--orange); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

/* ---- Dark-mode component fixes ----
   The brand green and orange are lightened for dark backgrounds, so the badges
   that print white-on-brand need dark ink instead to stay readable. */
@media (prefers-color-scheme: dark) {
  .chip.active, .disc, .tag-new, .tag-drop,
  .plan-input button { color: #10180f; }
  .chip.active { box-shadow: none; }
  .plan-input button { box-shadow: none; }
  .card { border-color: var(--line); }
  .fav { color: #5a636b; }
  .card.unmatched { border-color: #7a5a1e; background: #2a2214; }
  .brand-logo { background: #f2f7f3; }
}

/* Sugar-/alcohol-free flavour cards on Prijs: a quiet outline badge. */
.diet-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--green);
  border-radius: 10px; color: var(--green); font-size: 11px; font-weight: 600; vertical-align: 2px; }

/* Search suggestions: our own list right BELOW the search box (in the page flow,
   never over the text being typed). */
.suggest-box { margin: -6px 0 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; }
.suggest-box[hidden] { display: none; }
.suggest-item { display: block; width: 100%; text-align: left; padding: 11px 14px; border: 0;
  border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 15px; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:active { background: var(--line); }
/* "Geen exacte match ... gezocht op ..." under the Prijs search */
.ph-note { color: var(--muted); font-size: 13px; margin: 2px 2px 10px; }
.freq-row { cursor: pointer; }
/* "Druk nogmaals om af te sluiten" */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 20px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: .92; }
/* Prijs rows: keep "EUR 1,83 per l" on one line next to a long product name. */
.deal-line > div:last-child .meta { white-space: nowrap; }

/* ---- Instellingen ---- */
.settings-btn { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 10px; padding: 7px;
  background: rgba(255,255,255,.16); color: #fff; cursor: pointer; }
.settings-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.settings-btn:active { background: rgba(255,255,255,.28); }
.set-card { padding: 6px 15px 10px; }
.set-hint { color: var(--muted); font-size: 13px; margin: 8px 0 6px; line-height: 1.45; }
.set-group { margin-top: 8px; }
.set-group-t { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin: 6px 0 2px; }
.set-check { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-card .set-check:last-child, .set-group .set-check:last-child { border-bottom: 0; }
.set-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.set-check-t { display: block; font-size: 15px; }
.set-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 15px; }
.set-row-wrap { flex-direction: column; align-items: flex-start; }
.set-seg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.set-seg .chip { padding: 5px 11px; font-size: 13px; }
.set-actions { padding: 8px 0 2px; }
.set-link { color: inherit; text-decoration: none; }
.set-foot { color: var(--muted); font-size: 12.5px; text-align: center; margin: 14px 0 26px; }

/* Thema keuze: "Licht" / "Donker" overrule the phone's own setting (Systeem). */
:root[data-theme="light"] {
  --brand: #2f9e44; --brand-dark: #1f7a37; --brand-deep: #16602b; --brand-tint: #eaf6ee;
  --lime: #8fce4a; --orange: #ef7d18; --orange-tint: #fff2e3;
  --bg: #f3f5f4; --card: #fff; --ink: #16201a; --muted: #6b7480; --red: #d12b2b; --green: #1a7f37; --line: #e7eae8;
  --shadow: 0 1px 3px rgba(20,40,25,.08), 0 1px 2px rgba(20,40,25,.04);
  --shadow-lift: 0 4px 14px rgba(20,40,25,.10);
  --skel: #e9edea; --skel-hi: #f4f7f5; --amber: #a15c00;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #4ab861; --brand-dark: #3a9c4f; --brand-deep: #8fe0a2;
  --brand-tint: #1b2a20; --lime: #9bd75c; --orange: #ff9440; --orange-tint: #33240f;
  --bg: #14171a; --card: #1d2125; --ink: #e6eae7;
  --muted: #96a0a8; --red: #ff6b6b; --green: #5fd07c; --line: #2c3238;
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lift: 0 4px 16px rgba(0,0,0,.5);
  --skel: #252b31; --skel-hi: #2f363d; --amber: #ffc266;
  color-scheme: dark;
}

/* Lijst: pinned item ("Kies precies") + the picker */
.litem.pinned { border-color: var(--brand); }
.litem-pin { color: var(--brand-deep); font-size: 12px; font-weight: 600; margin-left: 4px; }
.litem .litem-kies { font-size: 12px; font-weight: 600; color: var(--brand-deep); padding: 0 6px; width: auto; }
.pin-modal { max-height: 86vh; display: flex; flex-direction: column; }
.pin-modal .modal-b { overflow-y: auto; }
.flav-row.active { outline: 2px solid var(--brand); }
.pin-any .name { color: var(--brand-deep); }

/* ---- Deals: category picker ("Selecteer categorieën") ----
   A button in the filter row opens a full-screen sheet: macro categories with a
   tri-state tick (all / some / none of their groups), tap the name to expand the
   product groups, sticky footer "Wis alles" + "Toon N aanbiedingen". */
.chip-cat { display: inline-flex; align-items: center; gap: 6px; }
.chip-ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; }
.catsel { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.catsel:empty { display: none; }
.catsel .chip { padding: 5px 10px; font-size: 12.5px; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-tint);
  border-color: var(--brand); color: var(--brand-deep); }
.chip-x .x { font-size: 15px; line-height: 1; opacity: .8; }
.chip-clear { background: transparent; border-color: transparent; color: var(--muted);
  text-decoration: underline; }
body.sheet-open { overflow: hidden; }
.catsheet { position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.catsheet-h { display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 17px; padding: 14px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); }
.catsheet-b { flex: 1; overflow-y: auto; padding: 10px 16px 16px; -webkit-overflow-scrolling: touch; }
.catsheet-f { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); }
.catsheet-f button { border-radius: 12px; padding: 13px 14px; font-size: 15px; font-weight: 700;
  cursor: pointer; }
.cs-clear { flex: 0 0 auto; background: transparent; border: 1px solid var(--line); color: var(--ink); }
.cs-apply { flex: 1; background: var(--brand); border: 1px solid var(--brand); color: #fff; }
.cs-macro { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 8px; overflow: hidden; }
.cs-mrow { display: flex; align-items: stretch; }
.cs-mrow button, .cs-sub { border: none; background: none; cursor: pointer; color: var(--ink); }
.cs-tick { flex: 0 0 auto; padding: 14px 6px 14px 14px; display: flex; align-items: center; }
.cs-mname { flex: 1; display: flex; align-items: center; gap: 8px; padding: 14px 14px 14px 8px;
  text-align: left; font-weight: 700; font-size: 15.5px; min-width: 0; }
.cs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.cs-chev { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.cs-macro.open .cs-chev { transform: rotate(90deg); }
.cs-subs { border-top: 1px solid var(--line); padding: 2px 0 4px; }
.cs-sub { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 14px 11px 46px; font-size: 14.5px; }
.cbox { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted);
  display: inline-flex; align-items: center; justify-content: center; background: var(--card); }
.cbox.on, .cbox.some { background: var(--brand); border-color: var(--brand); }
.cbox svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; }
/* Deals: next page */
.deals-more { display: block; margin: 6px auto 18px; padding: 9px 18px; font-weight: 600; }
