/* ============================================================
   Vondstje (voorheen Folderfee) — v7 "warm" design, BBE-familielogo
   Whimsical wrapper, serious numbers: cream paper, bling pink,
   butter-yellow deal stickers, hand-drawn squiggles — while the
   receipt & math stay precise (money is green, tabular, honest).
   ============================================================ */

:root {
  --paper: #faf3e6;
  --card: #fffdf8;
  --hair: #eadfc9;
  --ink: #2c2318;
  --muted: #8a7a66;
  --fee: #d23f7d;
  --fee-deep: #a8265c;
  --fee-soft: #fce8f1;
  --fee-bright: #ee4e94;
  --green: #0e6b3d;
  --green-deep: #0a5230;
  --green-soft: #e9f3ea;
  --deal-bg: #ffe9a8;
  --deal-text: #7a5200;
  --danger: #b3261e;
  --skip: #a49a89;
  --display: "Fraunces", Georgia, serif;
  --money: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.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;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
/* hand-drawn squiggle under section titles */
.card > h2::after, .map-head h2::after {
  content: "";
  display: block;
  width: 74px;
  height: 7px;
  margin-top: 4px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="74" height="7" viewBox="0 0 74 7"><path d="M2 4.5 Q8 1 14 4 T26 4 T38 4 T50 4 T62 4 T72 3" fill="none" stroke="%23d23f7d" stroke-width="2.2" stroke-linecap="round"/></svg>') no-repeat;
}
h3 { font-family: var(--display); font-weight: 600; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.fee-note {
  font-family: var(--hand);
  font-size: 16px;
  color: var(--fee);
  font-weight: 600;
}

/* ---------- header ---------- */
.app-header {
  background: var(--card);
  border-bottom: 1px solid var(--hair);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-glyph { color: var(--fee); display: block; }
.brand-name {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.pot-chip[hidden] { display: none; }
.pot-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--green);
  background: var(--green-soft);
  color: var(--green-deep);
  font-family: var(--money);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.pot-chip:hover { background: #ddeee0; }

/* account chip: same pill as the spaarpot, but in brand pink */
.auth-chip {
  border-color: var(--fee);
  background: var(--fee-soft);
  color: var(--fee-deep);
  font-size: 13.5px;
  font-weight: 600;
}
.auth-chip:hover { background: #e4daf7; }
.auth-chip span {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* when both chips show, only the first one pushes right */
.auth-chip + .pot-chip { margin-left: 0; }

.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fbeae9; }

.steps { display: flex; gap: 4px; }
.step-tab,
.category-game-tab {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px 8px;
  cursor: pointer;
  min-height: 44px;
}
.category-game-tab {
  display: inline-flex;
  align-items: center;
  color: var(--fee-deep);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.step-tab:hover,
.category-game-tab:hover { color: var(--ink); }
.step-tab.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--fee);
}

/* ---------- pages / layout ---------- */
.page { display: none; padding: 28px 20px 48px; }
.page.active { display: block; }
.narrow { max-width: 600px; margin: 0 auto; display: grid; gap: 18px; }
.wide { max-width: 1060px; margin: 0 auto; display: grid; gap: 18px; }

/* plan page: map first, receipt + spaarpot beside it on wide screens */
.plan-grid { display: grid; gap: 18px; align-items: start; }
.plan-side { display: grid; gap: 18px; }
#plan-summary { min-width: 0; }
@media (min-width: 900px) {
  .plan-grid { grid-template-columns: 3fr 2fr; }
}

.card {
  background: var(--card);
  border: 1.5px solid var(--hair);
  border-radius: 10px;
  padding: 24px;
}

.hint { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.empty-state { color: var(--muted); padding: 12px 0; font-size: 14.5px; }
#plan-empty { padding: 24px; }
.list-intro {
  max-width: 520px;
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.estimate-note, .legacy-note {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid #e8cf78;
  border-radius: 8px;
  background: var(--deal-bg);
  color: var(--deal-text);
  font-size: 13px;
  line-height: 1.45;
}
.estimate-note strong, .legacy-note strong { font-weight: 700; }
.legacy-note {
  border-color: var(--hair);
  background: var(--paper);
  color: var(--muted);
}

/* ---------- forms ---------- */
.add-row { display: flex; gap: 10px; align-items: flex-end; }
.add-row.wrap { flex-wrap: wrap; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.grow { flex: 1; min-width: 150px; }
.qty-field { width: 68px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--muted); }

input, select {
  height: 44px;
  padding: 0 12px;
  font-size: 15px;
  font-family: var(--body);
  border: 1.5px solid var(--hair);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input::placeholder { color: #b5a78f; }
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--fee);
  outline-offset: 1px;
}
.small-input { width: 104px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease-out, background 120ms ease-out;
  /* Rows move after removal; tell Safari that repeated taps are button taps,
     not a double-tap-to-zoom gesture. Panning and pinch zoom stay available. */
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--fee); color: #fff; }
.btn-primary:hover { background: var(--fee-deep); }
.btn-primary:disabled { background: var(--muted); cursor: wait; }
.btn-big { height: 54px; width: 100%; font-size: 16.5px; }
.btn-secondary { background: #fff; color: var(--fee-deep); border-color: var(--fee); }
.btn-secondary:hover { background: var(--fee-soft); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  height: 36px;
  padding: 0 10px;
  font-weight: 500;
}
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-remove { font-size: 13px; }
.btn-remove:hover { color: var(--danger); }

/* ---------- scan ---------- */
.scan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1.5px dashed var(--hair);
}
#scan-status { margin: 0; }

/* ---------- shopping list ---------- */
.item-list { list-style: none; margin: 16px 0 0; padding: 0; }
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
  min-height: 48px;
}
.item-row:last-child { border-bottom: none; }
.item-name { flex: 1; font-size: 15px; }
.no-price-badge {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.stepper { display: flex; align-items: center; border: 1.5px solid var(--hair); border-radius: 8px; }
.stepper .qty {
  min-width: 32px;
  text-align: center;
  font-family: var(--money);
  font-weight: 600;
  font-size: 14.5px;
}
.stepper .btn {
  font-size: 17px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
}

/* ---------- unmatched / resolver ---------- */
.unmatched-block {
  margin-top: 16px;
  border: 1.5px solid var(--hair);
  border-left: 4px solid var(--deal-text);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fffaf0;
}
.unmatched-block > p { margin: 0 0 4px; font-weight: 600; font-size: 14px; }
.unmatched-block > .hint { margin: 0 0 10px; }
.unmatched-row { padding: 10px 0; border-top: 1px solid var(--hair); }
.unmatched-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.unmatched-text { flex: 1; font-size: 14.5px; }
.unmatched-text q { font-style: normal; font-weight: 600; }
.unmatched-row input { height: 40px; font-size: 14.5px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestion {
  border: 1.5px solid var(--hair);
  background: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13.5px;
  font-family: var(--body);
  cursor: pointer;
  min-height: 36px;
}
.suggestion:hover { border-color: var(--fee); }
.suggestion .avail { color: var(--deal-text); font-size: 12px; }

/* ---------- rules ---------- */
.rule { padding: 16px 0; border-bottom: 1px solid var(--hair); }
.rule:last-child { border-bottom: none; }
.rule-label { display: block; margin: 0 0 10px; font-weight: 600; font-size: 14.5px; }
.rule-sub { font-weight: 400; color: var(--muted); font-size: 13px; }

.seg { display: flex; border: 1.5px solid var(--hair); border-radius: 8px; overflow: hidden; width: fit-content; background: #fff; }
.seg-btn {
  min-width: 56px;
  height: 44px;
  border: none;
  border-right: 1px solid var(--hair);
  background: transparent;
  font-family: var(--money);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active { background: var(--fee); color: #fff; }

#preferred-store { max-width: 280px; }
.plan-context > input[type="date"] { width: min(100%, 220px); }
.plan-context > .hint { margin: 7px 0 0; }
.loyalty-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}
.loyalty-cards legend {
  width: 100%;
  margin-bottom: 2px;
  font-size: 14.5px;
  font-weight: 600;
}
.loyalty-cards label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1.5px solid var(--hair);
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  cursor: pointer;
}
.loyalty-cards label:has(input:checked) { border-color: var(--fee); background: var(--fee-soft); }
.loyalty-cards input { width: 18px; height: 18px; accent-color: var(--fee); }

.slider-row { display: flex; align-items: center; gap: 16px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--fee); height: 44px; }
.slider-row output {
  font-family: var(--money);
  font-size: 19px;
  font-weight: 700;
  min-width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.advanced summary { cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted); padding: 2px 0; }
.advanced .slider-row { margin-top: 12px; justify-content: space-between; }

/* ---------- receipt (still serious — money is money) ---------- */
.receipt {
  background: var(--card);
  border: 1.5px solid var(--hair);
  border-radius: 10px;
  padding: 20px 24px;
}
.receipt-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: 14.5px;
}
.receipt-line .leader {
  flex: 1;
  border-bottom: 2px dotted var(--hair);
  transform: translateY(-4px);
}
.receipt-line .amt {
  font-family: var(--money);
  font-weight: 600;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.receipt-line.total { border-top: 1px solid var(--hair); margin-top: 4px; padding-top: 12px; font-weight: 600; }
.receipt-line.total .amt { font-size: 19px; font-weight: 700; }
.receipt-line.save { color: var(--green-deep); font-weight: 600; }
.receipt-line.save .leader { border-color: #cfe2d6; }
.receipt-line.save .amt { color: var(--green-deep); font-size: 19px; font-weight: 700; }
.receipt-line.save .amt::after { content: " ✨"; }
.receipt-line.above { color: #9a3b12; font-weight: 600; }
.receipt-line.above .leader { border-color: #efc7b4; }
.receipt-line.above .amt { color: #9a3b12; }

.market-summary {
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid #cfe2d6;
  border-radius: 9px;
  background: var(--green-soft);
}
.market-summary .eyebrow { margin: 0 0 5px; color: var(--green-deep); }
.market-summary .receipt-line { padding: 5px 0; }
.market-summary .receipt-line .amt { font-size: 15px; }
.market-summary .receipt-line.save .amt { font-size: 17px; }
.market-summary-note,
.market-summary > p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.market-summary.market-unavailable {
  border-color: var(--hair);
  background: var(--paper);
}
.market-summary.market-unavailable .eyebrow { color: var(--muted); }
.comparison-actions { width: 100%; height: 38px; margin-top: 10px; }

.no-price-title {
  margin: 0 0 10px;
  font-family: var(--money);
  font-size: 18px;
  font-weight: 700;
}
.price-data-note {
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--hair);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
.price-data-note strong { font-weight: 700; }
.price-data-note p { margin: 4px 0 0; color: var(--muted); }
.price-data-note ul { margin: 8px 0 0; padding-left: 19px; }
.price-data-note li + li { margin-top: 3px; }
.plan-date-note {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--fee-soft);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.4;
}
.plan-date-note strong { font-weight: 700; }
.constraint-note {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-left: 3px solid var(--deal-text);
  border-radius: 0 8px 8px 0;
  background: var(--deal-bg);
  color: var(--deal-text);
  font-size: 13px;
  line-height: 1.45;
}
.constraint-note strong { font-weight: 700; }

/* ---------- spaarpot ---------- */
.pot-card { border-color: var(--green); border-width: 1.5px; }
.pot-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pot-jar { font-size: 40px; line-height: 1; }
.pot-info { flex: 1; min-width: 160px; }
.pot-total {
  margin: 0;
  font-family: var(--money);
  font-size: 26px;
  font-weight: 700;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}
.pot-total .fee-note { font-size: 15px; margin-left: 6px; }
.pot-streak {
  font-family: var(--body);
  font-weight: 700;
  font-size: 14px;
  background: var(--deal-bg);
  color: var(--deal-text);
  border-radius: 999px;
  padding: 6px 12px;
  transform: rotate(-2deg);
}
.pot-card .btn { margin-top: 14px; }
.pot-banked {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 600;
  font-size: 14.5px;
}

/* ---------- show the math ---------- */
.math { max-width: 100%; min-width: 0; margin-top: 12px; border-top: 1px solid var(--hair); padding-top: 12px; }
.math summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.math summary:hover { color: var(--ink); }
.math .eyebrow { margin: 18px 0 10px; }

.cmp { display: grid; gap: 7px; }
.cmp-row {
  display: grid;
  grid-template-columns: minmax(96px, 128px) 1fr 74px;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  min-height: 20px;
}
.cmp-label { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-row.plan .cmp-label { font-weight: 600; }
.cmp-fill {
  display: block;
  height: 14px;
  background: #948a76;
  border-radius: 0 4px 4px 0;
  min-width: 3px;
}
.cmp-row.plan .cmp-fill { background: var(--green); }
.cmp-amt {
  font-family: var(--money);
  font-weight: 600;
  font-size: 13.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cmp-row.plan .cmp-amt { font-weight: 700; }
.cmp-row.missing .cmp-note { grid-column: 2 / 4; color: var(--muted); font-size: 12.5px; }

.loyalty-note {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-left: 3px solid var(--deal-text);
  background: var(--deal-bg);
  color: var(--deal-text);
  font-size: 13px;
  border-radius: 0 8px 8px 0;
}

.table-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.table-scroll:focus-visible {
  outline: 2px solid var(--fee);
  outline-offset: 3px;
}
.math-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.math-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 0 6px 10px;
  border-bottom: 1px solid var(--hair);
}
.math-table td {
  padding: 7px 0 7px 10px;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
.math-table th:first-child, .math-table td:first-child { padding-left: 0; }
.math-table th:nth-child(n+2), .math-table td:nth-child(n+2) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.math-sub { display: block; font-size: 11.5px; color: var(--muted); }
.math-table .pos { color: var(--green-deep); font-weight: 600; }
.math-table .neg { color: #9a3b12; font-weight: 600; }
.math-table .dash { color: var(--muted); }
.math-table tfoot td { font-weight: 600; }
.math-table tfoot tr:first-child td { border-top: 2px solid var(--hair); }
.math-table tfoot tr td { border-bottom: none; padding: 6px 0 2px 10px; }
.math-table tfoot tr td:first-child { padding-left: 0; }
.math-table .grand td { font-weight: 700; padding-top: 8px; }
.math-table .grand .pos { font-size: 14.5px; }

/* ---------- map ---------- */
.map-card { padding: 0; overflow: hidden; }
.map-head { padding: 22px 24px 14px; }
.map-head h2 { margin-bottom: 12px; }
.home-row { display: flex; gap: 10px; }
.home-row input { flex: 1; min-width: 0; }
#geo-status { margin: 8px 0 0; }
#geo-status.error { color: var(--danger); font-weight: 500; }

.leaflet-map { height: 420px; width: 100%; }
.pin { background: none; border: none; }
.pin span {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  color: #fff;
  font-family: var(--money);
  font-weight: 700;
  font-size: 13px;
}
.pin-home {
  display: grid;
  place-items: center;
  background: var(--ink) !important;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.pin-skip span { opacity: 0.75; }
.pin-other .dot {
  width: 11px; height: 11px;
  margin: 9px;
  border-radius: 50%;
  background: #cfc4ae;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.leaflet-popup-content { font-size: 13.5px; line-height: 1.5; font-family: var(--body); }

/* SVG fallback map */
#route-map svg { width: 100%; height: auto; display: block; }
.map-path { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-dasharray: 7 6; stroke-linecap: round; }
.map-home-box { fill: var(--ink); }
.map-label { font-size: 13px; text-anchor: middle; fill: var(--ink); font-weight: 600; font-family: var(--body); }
.map-label.skip { fill: var(--skip); }
.map-sub { font-size: 11px; text-anchor: middle; fill: var(--muted); font-family: var(--body); }
.map-num { font-size: 12px; text-anchor: middle; fill: #fff; font-weight: 700; dominant-baseline: central; font-family: var(--body); }
.map-initial { font-size: 11px; text-anchor: middle; fill: #fff; font-weight: 700; dominant-baseline: central; font-family: var(--body); }
.map-dealcount { font-size: 10px; text-anchor: middle; font-weight: 600; fill: var(--deal-text); font-family: var(--body); }
.map-leg { font-size: 11px; text-anchor: middle; fill: var(--green-deep); font-weight: 600; font-family: var(--body); }

/* ---------- baskets ---------- */
.baskets-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .baskets-grid { grid-template-columns: 1fr 1fr; } }
.basket { background: var(--card); border: 1.5px solid var(--hair); border-radius: 10px; padding: 20px; }
.basket-head { display: flex; align-items: center; gap: 10px; }
.basket-head h3 { margin: 0; font-size: 17px; flex: 1; }
.basket-subtotal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--money);
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.basket-subtotal small {
  color: var(--muted);
  font-family: var(--body);
  font-size: 10.5px;
  font-weight: 500;
}
.stop-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--money);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.basket-addr { font-size: 12.5px; font-weight: 400; color: var(--muted); font-family: var(--body); }
.basket-items { list-style: none; margin: 12px 0 0; padding: 0; }
.basket-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14.5px;
}
.basket-items li:last-child { border-bottom: none; }
.price {
  font-variant-numeric: tabular-nums;
  font-family: var(--money);
  font-weight: 600;
  white-space: nowrap;
}
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.choice-detail strong { color: var(--ink); font-weight: 600; }
.market-reference,
.action-reference {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 5px 8px;
  border-left: 3px solid var(--green);
  border-radius: 0 6px 6px 0;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}
.market-reference strong { font-family: var(--money); font-weight: 700; }
.market-reference em { color: var(--green-deep); font-style: normal; font-weight: 700; }
.market-reference.above { border-left-color: #d36b3f; background: #fff2eb; }
.market-reference.above em { color: #9a3b12; }
.market-reference.unavailable {
  border-left-color: var(--muted);
  background: var(--paper);
  color: var(--muted);
}
.action-reference {
  border-left-color: var(--deal-text);
  background: var(--deal-bg);
  color: var(--deal-text);
  font-weight: 600;
}
.deal-name { font-size: 12px; color: var(--muted); }
.no-deals { color: var(--muted); }
.worth-line {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 13.5px;
  font-weight: 500;
}
.usual-line {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--fee-soft);
  color: var(--fee-deep);
  font-size: 13.5px;
  font-weight: 500;
}
.basket.skipped { border-style: dashed; background: transparent; }
.basket.skipped .basket-head h3 { color: var(--muted); }
.skip-line { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: 1px;
  transform: rotate(-1.5deg);
}
.badge-deal { background: var(--deal-bg); color: var(--deal-text); box-shadow: 0 1px 0 rgba(122,82,0,.25); }
.badge-info { background: var(--fee-soft); color: var(--fee-deep); transform: none; }
.expiry {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fde3d3;
  color: #9a3b12;
  font-size: 11px;
  font-weight: 700;
}
.expiry.expired { background: #eee7da; color: var(--muted); }
/* "wacht even" hint: this product gets a deal next week (folder preview) */
.upcoming {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--fee-soft);
  color: var(--fee-deep);
  font-size: 11px;
  font-weight: 700;
}
.tip { color: var(--green-deep); font-size: 13px; font-weight: 600; font-family: var(--hand); font-size: 15px; }
.store-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---------- shopper reports ---------- */
.row-side { display: flex; align-items: center; gap: 6px; }
.btn-report { font-size: 12px; height: 28px; padding: 0 8px; }
.report-panel[hidden] { display: none; }
.report-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--hair);
  border-radius: 8px;
  background: var(--paper);
}
.report-panel .btn { height: 32px; font-size: 12.5px; padding: 0 8px; color: var(--ink); }
.report-panel .btn:hover { color: var(--danger); }
.report-or { font-size: 12px; color: var(--muted); }
.report-panel input { width: 76px; height: 32px; font-size: 13px; padding: 0 8px; }
.report-error { flex-basis: 100%; color: var(--danger); font-size: 12px; }
.pending-chip {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--deal-bg);
  color: var(--deal-text);
  font-size: 11.5px;
  font-weight: 600;
  width: fit-content;
}

/* ---------- Plus (subscription) ---------- */
.plus-tag {
  display: inline-block;
  font-family: var(--body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fee-deep);
  background: var(--fee-soft);
  border-radius: 4px;
  padding: 1px 4px;
  vertical-align: 2px;
}
.seg-btn.active .plus-tag { background: rgba(255,255,255,.25); color: #fff; }
#scan-btn.locked::after {
  content: "Plus";
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fee-deep);
  background: var(--fee-soft);
  border-radius: 4px;
  padding: 1px 4px;
}
.plus-dialog {
  border: 1.5px solid var(--hair);
  border-radius: 12px;
  padding: 28px;
  max-width: 420px;
  width: calc(100vw - 48px);
  font-family: var(--body);
  color: var(--ink);
  background: var(--card);
}
.plus-dialog::backdrop { background: rgba(44, 35, 24, 0.5); }
.plus-dialog h2 { margin: 0 0 6px; }
.plus-price { margin: 0 0 14px; font-size: 15px; }
.plus-price strong { font-family: var(--money); font-size: 26px; font-weight: 700; color: var(--fee-deep); }
.plus-perks { margin: 0 0 12px; padding-left: 20px; }
.plus-perks li { padding: 3px 0; font-size: 14.5px; }
.plus-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- deals editor ---------- */
.deals-editor summary { cursor: pointer; }
.deals-editor summary h2 { display: inline-block; margin: 0; font-size: 18px; }
.deals-directory {
  width: min(100%, 900px);
  margin: 0 auto;
  display: grid;
  gap: 26px;
}
.deal-discovery-hero {
  padding: 18px 0 4px;
}
.deal-discovery-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.08;
}
.deal-discovery-hero > p {
  max-width: 620px;
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.deal-discovery-hero > .eyebrow { margin-bottom: 7px; }
.deal-discovery-hero .folder-list-summary {
  max-width: 680px;
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}
.folder-scope-switch {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #f5ecde;
}
.folder-scope-switch button {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 700 12px var(--body);
  cursor: pointer;
}
.folder-scope-switch button:hover,
.folder-scope-switch button:focus-visible { color: var(--ink); }
.folder-scope-switch button:focus-visible { outline: 3px solid var(--fee-soft); }
.folder-scope-switch button.active {
  background: var(--card);
  color: var(--fee-deep);
  box-shadow: 0 1px 5px rgba(44, 35, 24, .12);
}
.folder-search-primary {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  max-width: 680px;
  min-height: 54px;
  padding: 0 15px;
  border: 2px solid var(--fee);
  border-radius: 14px;
  color: var(--fee-deep);
  background: var(--card);
  box-shadow: 0 8px 28px rgba(168, 38, 92, .08);
}
.folder-search-primary:focus-within {
  outline: 4px solid var(--fee-soft);
}
.folder-search-primary input {
  min-height: 50px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
}
.folder-search-primary input:focus {
  border: 0;
  outline: 0;
}
.folder-product-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.folder-group-chip {
  min-height: 42px;
  padding: 8px 15px;
  border: 1.5px solid var(--hair);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 600 13px/1.2 var(--body);
  cursor: pointer;
}
.folder-group-chip:hover,
.folder-group-chip:focus-visible {
  border-color: var(--fee);
  outline: 0;
}
.folder-group-chip.active {
  border-color: var(--fee);
  background: var(--fee-soft);
  color: var(--fee-deep);
}
.folder-group-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 22px;
  padding: 22px 0;
  border-block: 1px solid var(--hair);
}
.folder-group-summary h2 { margin: 0 0 4px; font-size: 28px; }
.folder-group-summary p { margin: 0; color: var(--muted); }
.folder-store-breakdown,
.folder-subtype-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.folder-store-breakdown button,
.folder-subtype-choices button {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: 600 11.5px var(--body);
  cursor: pointer;
}
.folder-store-breakdown button:hover,
.folder-store-breakdown button:focus-visible,
.folder-subtype-choices button:hover,
.folder-subtype-choices button:focus-visible {
  border-color: var(--fee);
  outline: 2px solid var(--fee-soft);
}
.folder-store-breakdown strong,
.folder-subtype-choices strong { margin-left: 5px; color: var(--fee-deep); font-family: var(--money); }
.folder-subtype-choices > span { width: 100%; color: var(--muted); font-size: 11px; font-weight: 700; }
.folder-group-actions {
  display: grid;
  justify-items: stretch;
  gap: 7px;
}
.folder-group-actions .btn { width: 100%; }
.folder-group-feedback {
  min-height: 18px;
  color: var(--green-deep);
  font-size: 12px;
  text-align: center;
}
.folder-group-next {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.folder-exact-best {
  display: grid;
  width: fit-content;
  gap: 1px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-deep);
}
.folder-exact-best span,
.folder-exact-best small { font-size: 11.5px; }
.folder-exact-best strong { font-family: var(--money); }
.folder-results {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: rgba(255, 253, 248, .66);
}
.folder-refine {
  margin-top: 14px;
  border-top: 1px solid var(--hair);
}
.folder-refine > summary {
  min-height: 44px;
  padding: 12px 2px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.folder-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.folder-preview-head h2 { margin: 0; }
.folder-count {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ffd61f;
  color: #3c2d00;
  font-family: var(--money);
  font-size: 12px;
  font-weight: 700;
}
.folder-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 4px 0 12px;
}
.folder-search {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.folder-filter {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.folder-search input {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1.5px solid var(--hair);
  border-radius: 9px;
  color: var(--ink);
  background: var(--card);
  font: inherit;
}
.folder-search input:focus {
  border-color: var(--fee);
  outline: 3px solid var(--fee-soft);
}
.folder-offer-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.folder-offer {
  min-width: 0;
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: var(--card);
  overflow: clip;
}
.folder-offer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
}
.folder-offer-top::-webkit-details-marker { display: none; }
.folder-offer[open] { border-color: #d9c697; }
.folder-offer-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.folder-offer-chain {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.4;
  text-transform: uppercase;
}
.folder-offer-title strong {
  min-width: 0;
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
}
.folder-offer-title small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.folder-offer-title .folder-offer-summary-status {
  color: var(--green-deep);
  font-weight: 700;
}
.folder-offer-title .folder-offer-summary-status.waiting { color: #7a5200; }
.folder-offer-title .folder-offer-group-status {
  color: #704900;
  font-weight: 700;
}
.folder-offer-price {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 55%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--deal-bg);
  color: var(--deal-text);
  font-family: var(--money);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}
.folder-offer-body {
  padding: 0 13px 12px;
  border-top: 1px solid var(--hair);
}
.folder-offer-previous,
.folder-offer-note,
.folder-offer-source-warning {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.45;
}
.folder-offer-previous { color: var(--muted); }
.folder-offer-note { color: #5f503d; }
.folder-offer-source-warning {
  padding: 7px 9px;
  border-left: 3px solid #be7b00;
  color: #704900;
  background: #fff4d2;
}
.folder-offer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.folder-tag {
  padding: 2px 6px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--muted);
  background: var(--card);
  font-size: 10.5px;
  font-weight: 600;
}
.folder-tag.extra { border-color: #efb5ce; color: var(--fee-deep); background: var(--fee-soft); }
.folder-tag.age { border-color: #c7b99d; color: #4d4030; }
.folder-tag.plan-ready { border-color: #a8d8b7; color: var(--green-deep); background: var(--green-soft); }
.folder-tag.plan-waiting { border-color: #e6c887; color: #704900; background: #fff4d2; }
.folder-plan-comparison {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--paper);
  font-size: 12px;
  line-height: 1.45;
}
.folder-plan-comparison > div { display: flex; flex-direction: column; }
.folder-plan-comparison strong { font-size: 12.5px; }
.folder-plan-comparison span { color: var(--muted); }
.folder-plan-comparison em { color: var(--green-deep); font-style: normal; font-weight: 600; }
.folder-plan-comparison small { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.folder-more { width: 100%; margin-top: 12px; }
.folder-next-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.folder-trust-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.deal-store { border: 1.5px solid var(--hair); border-radius: 10px; padding: 16px; }
.deal-store .basket-head h3 { font-size: 15px; }

/* ---------- partner-advertentie kaart ---------- */
.partner-card { border: 1.5px dashed var(--hair); }
.ad-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--card);
  vertical-align: middle;
}
.partner-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 10px 0 14px;
}
.partner-emoji {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--deal-bg);
  border-radius: 12px;
  transform: rotate(-3deg);
}
.partner-body h3 { margin: 0 0 6px; font-size: 17px; }
.partner-math { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
.app-footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.app-footer p { flex: 1; min-width: 240px; margin: 0; }
.app-footer .fee-note { display: block; margin-top: 4px; }

/* maker credit */
.maker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.maker-gem { color: var(--fee); flex: none; }
.maker strong {
  font-family: var(--money);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* Compact layouts: keep controls within the viewport down to 320px. */
@media (max-width: 520px) {
  /* iOS zooms the page when a form control below 16px receives focus. */
  input, select, textarea { font-size: 16px; }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 8px;
    padding: 8px 12px 0;
  }
  .brand {
    min-width: 0;
    overflow: hidden;
  }
  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pot-chip {
    margin-left: 0;
    max-width: 110px;
    height: 34px;
    padding: 0 9px;
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
  }
  .auth-chip { max-width: 104px; }
  .auth-chip span { max-width: 58px; }
  .steps {
    grid-column: 1 / -1;
    display: flex;
    min-width: 0;
    width: 100%;
    border-top: 1px solid var(--hair);
  }
  .step-tab,
  .category-game-tab {
    min-width: 0;
    justify-content: center;
    padding: 8px 4px 6px;
    font-size: clamp(10.5px, 3.5vw, 12px);
    letter-spacing: -0.01em;
  }
  .step-tab { flex: 1 1 0; }
  .category-game-tab { flex: 1.25 1 0; }

  .page { padding: 18px 12px 36px; }
  .narrow, .wide, .plan-grid, .plan-side { gap: 14px; min-width: 0; }
  .card { min-width: 0; padding: 18px; }
  .map-head { padding: 18px 18px 14px; }

  #add-item-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    align-items: end;
  }
  #add-item-form .field.grow { min-width: 0; }
  #add-item-form > .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .home-row {
    flex-direction: column;
    align-items: stretch;
  }
  .home-row .btn { width: 100%; }

  .seg { width: 100%; }
  .seg-btn { flex: 1; min-width: 44px; }
  .slider-row { gap: 10px; }

  .plus-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 20px;
    overflow-y: auto;
  }
  .plus-dialog .add-row {
    flex-direction: column;
    align-items: stretch;
  }
  .plus-dialog .field.grow { width: 100%; min-width: 0; }
  .plus-actions { flex-wrap: wrap; }

  .deals-editor .add-row.wrap > .field {
    flex: 1 1 140px;
    min-width: 0;
  }
  .deals-editor .add-row.wrap > .btn { width: 100%; }
  .deals-directory { gap: 18px; }
  .deal-discovery-hero { padding-top: 6px; }
  .deal-discovery-hero h2 { font-size: 32px; }
  .deal-discovery-hero > p { margin-bottom: 14px; }
  .folder-search-primary { min-height: 52px; padding-inline: 13px; }
  .folder-search-primary input { min-height: 48px; }
  .folder-product-groups {
    flex-wrap: nowrap;
    margin-inline: -12px;
    padding: 0 12px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .folder-product-groups::-webkit-scrollbar { display: none; }
  .folder-group-chip { flex: none; }
  .folder-group-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
  }
  .folder-group-summary h2 { font-size: 25px; }
  .folder-results {
    margin-inline: -4px;
    padding: 17px 12px;
    border-radius: 12px;
  }
  .folder-preview-head { gap: 8px; }
  .folder-toolbar { grid-template-columns: minmax(0, 1fr); }
  .folder-offer-top { gap: 8px; }
  .folder-scope-switch { display: flex; width: 100%; }
  .folder-scope-switch button { flex: 1; }
  .folder-next-actions { flex-direction: column-reverse; }
  .folder-next-actions .btn { width: 100%; }
}

@media (max-width: 360px) {
  .header-inner { padding-inline: 10px; }
  .brand-glyph { display: none; }
  .brand-name { font-size: 19px; }
  .auth-chip { max-width: 92px; }
  .pot-chip { max-width: 88px; }
  .page { padding-inline: 8px; }
  .card { padding: 16px; }
  .map-head { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
