/* Voorraad – kleuren uit de kruidenkast */
:root {
  --bg: #EEF2EC;
  --surface: #FFFFFF;
  --surface-2: #F6F8F4;
  --ink: #18241C;
  --muted: #5B6B60;
  --line: #D6DED3;
  --basil: #2F5D3A;
  --basil-ink: #FFFFFF;
  --basil-soft: #DCE8DA;
  --turmeric: #D99412;
  --turmeric-soft: #FBEFD0;
  --paprika: #C2412D;
  --paprika-soft: #F8DDD7;
  --shadow: 0 1px 0 rgba(24, 36, 28, .06), 0 6px 18px -10px rgba(24, 36, 28, .25);
  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 68px;
  --ah: #00A0E2; --jumbo: #B98A00;
  color-scheme: light;
}
/* Donker: automatisch (volgt het toestel) of zelf gekozen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1611; --surface: #18221B; --surface-2: #1E2A21; --ink: #E7EEE6; --muted: #9AAA9E;
    --line: #2A372D; --basil: #8CC797; --basil-ink: #0F1611; --basil-soft: #22382A;
    --turmeric: #F0B640; --turmeric-soft: #3A2F14; --paprika: #EF6B55; --paprika-soft: #3D1F1A;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.6);
    --ah: #5CC8F5; --jumbo: #F5C842;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0F1611; --surface: #18221B; --surface-2: #1E2A21; --ink: #E7EEE6; --muted: #9AAA9E;
    --line: #2A372D; --basil: #8CC797; --basil-ink: #0F1611; --basil-soft: #22382A;
    --turmeric: #F0B640; --turmeric-soft: #3A2F14; --paprika: #EF6B55; --paprika-soft: #3D1F1A;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.6);
    --ah: #5CC8F5; --jumbo: #F5C842;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--basil); outline-offset: 2px; border-radius: 8px; }
img { display: block; max-width: 100%; }
a { color: var(--basil); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 0 12px;
}
.top h1 { font: 700 2.1rem/1 var(--display); letter-spacing: -.02em; margin: 0; }
.top .sub { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }
.top-actions { display: flex; gap: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 700; padding: 8px 0; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; position: relative;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--paprika); color: #fff; font: 700 .72rem/20px var(--text);
}
.icon-btn .dot.soon { background: var(--turmeric); color: #241A00; }

/* ---------- bottom nav ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line);
}
nav.tabs .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 84px 1fr 1fr; align-items: center; }
nav.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
  color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 700; position: relative;
}
nav.tabs a svg { width: 24px; height: 24px; }
nav.tabs a.on { color: var(--basil); }
nav.tabs a .badge {
  position: absolute; top: 0; left: calc(50% + 6px); background: var(--basil); color: var(--basil-ink);
  font-size: .68rem; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center; padding: 0 4px;
}
.scan-fab {
  justify-self: center; width: 66px; height: 66px; border-radius: 50%; border: 0; margin-top: -26px;
  background: var(--basil); color: var(--basil-ink); display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--basil) 70%, transparent), 0 0 0 5px var(--bg);
}
.scan-fab svg { width: 30px; height: 30px; }
.scan-fab:active { transform: scale(.95); }

/* ---------- controls ---------- */
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 12px; height: 48px; margin-bottom: 12px;
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { border: 0; background: none; outline: none; flex: 1; height: 100%; font-size: 1rem; min-width: 0; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 19px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .92rem;
  white-space: nowrap; text-decoration: none; color: var(--ink);
}
.chip .n { color: var(--muted); font-weight: 400; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.on .n { color: inherit; opacity: .7; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; text-decoration: none; color: var(--ink);
}
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--basil); color: var(--basil-ink); border-color: var(--basil); }
.btn.danger { color: var(--paprika); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns > .btn { flex: 1; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--basil); background: var(--surface); }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); height: 40px; }
.stepper button { width: 40px; height: 100%; border: 0; background: none; display: grid; place-items: center; color: var(--ink); }
.stepper button svg { width: 18px; height: 18px; }
.stepper output { min-width: 28px; text-align: center; font: 700 1.05rem var(--display); font-variant-numeric: tabular-nums; }
.stepper.big { height: 52px; }
.stepper.big button { width: 52px; }
.stepper.big output { min-width: 48px; font-size: 1.4rem; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--basil); }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- section & empty ---------- */
h2.sec { font: 700 1.15rem var(--display); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
h2.sec .n { color: var(--muted); font: 400 .95rem var(--text); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 2.4rem; }
.empty p { margin: 8px auto 16px; max-width: 32ch; }

/* ---------- alert strip ---------- */
.alerts { display: grid; gap: 8px; margin-bottom: 12px; }
.alert {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--turmeric-soft); border: 1px solid color-mix(in srgb, var(--turmeric) 35%, transparent);
}
.alert.bad { background: var(--paprika-soft); border-color: color-mix(in srgb, var(--paprika) 35%, transparent); }
.alert b { font-family: var(--display); font-size: 1.05rem; }
.alert .go { margin-left: auto; color: var(--muted); }

/* ---------- inventory rows: the label band ---------- */
.list { display: grid; gap: 8px; }
.swipe { position: relative; border-radius: 14px; overflow: hidden; touch-action: pan-y; }
.swipe .act {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  font-weight: 700; color: #fff;
}
.swipe .act .l, .swipe .act .r { display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .15s; }
.swipe .act svg { width: 22px; height: 22px; }
.swipe[data-dir="right"] .act { background: var(--basil); color: var(--basil-ink); }
.swipe[data-dir="left"] .act { background: var(--paprika); }
.swipe[data-dir="right"] .act .l, .swipe[data-dir="left"] .act .r { opacity: 1; }
.swipe .face { position: relative; background: var(--surface); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.swipe.dragging .face { transition: none; }

.item {
  display: grid; grid-template-columns: 6px 48px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 10px 10px 0; min-height: 70px; border: 1px solid var(--line); border-radius: 14px;
}
.item .band { align-self: stretch; border-radius: 0 6px 6px 0; background: var(--line); }
.item.ok .band { background: var(--basil); }
.item.soon .band { background: var(--turmeric); }
.item.bad .band { background: var(--paprika); }
.item.zero { opacity: .55; }
.thumb {
  width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center;
  font: 700 1.2rem var(--display); color: var(--muted); overflow: hidden; border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.item .info { min-width: 0; border: 0; background: none; text-align: left; padding: 0; }
.item .name { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .meta { color: var(--muted); font-size: .86rem; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 10px; }
.item .exp { font-weight: 700; }
.item.soon .exp { color: color-mix(in srgb, var(--turmeric) 70%, var(--ink)); }
.item.bad .exp { color: var(--paprika); }

/* ---------- shopping ---------- */
.add-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.add-bar .search { flex: 1; margin: 0; }
.add-bar .btn { width: 48px; padding: 0; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.suggest button { border: 1px dashed var(--line); background: none; border-radius: 16px; padding: 6px 12px; font-size: .9rem; }
.shop {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px; border: 1px solid var(--line); border-radius: 14px;
}
.check {
  width: 28px; height: 28px; flex: none; border-radius: 9px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; color: transparent;
}
.check svg { width: 18px; height: 18px; }
.shop.done .check { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); }
.shop.done .t { text-decoration: line-through; color: var(--muted); }
.shop .t { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; }
.shop .t b { display: block; }
.shop .t small { color: var(--muted); }
.shop .q { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- recipes ---------- */
.cook-cta {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; margin-bottom: 16px;
  border-radius: 18px; border: 0; background: var(--basil); color: var(--basil-ink);
}
.cook-cta svg { width: 34px; height: 34px; flex: none; }
.cook-cta b { display: block; font: 700 1.2rem var(--display); }
.cook-cta span { opacity: .85; font-size: .92rem; }
.cook-cta.on { background: var(--ink); color: var(--bg); }

.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.rcard { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.rcard .img, .hero { background: var(--basil-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F5D3A' stroke-opacity='.35' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10h16v5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5z'/%3E%3Cpath d='M2 10h20M9 6c0-1 1-1 1-2M14 6c0-1 1-1 1-2'/%3E%3C/svg%3E") center / 64px no-repeat; }
.rcard .img { aspect-ratio: 16/9; position: relative; }
.rcard .img img { width: 100%; height: 100%; object-fit: cover; }
.rcard .body { padding: 12px 14px 14px; }
.rcard h3 { font: 700 1.15rem/1.2 var(--display); margin: 0 0 4px; }
.rcard .meta { color: var(--muted); font-size: .88rem; }
.match { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; }
.bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--basil); border-radius: 4px; }
.miss { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.tag-use { position: absolute; left: 10px; bottom: 10px; background: var(--turmeric-soft); color: var(--ink); font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 10px; }

.hero { margin: 0 -16px; aspect-ratio: 4/3; max-height: 46vh; width: calc(100% + 32px); position: relative; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .back-float {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(8px); display: grid; place-items: center; color: var(--ink);
}
.hero .back-float svg { width: 22px; height: 22px; }
.rhead { padding: 18px 0 4px; }
.rhead h1 { font: 700 2rem/1.05 var(--display); letter-spacing: -.02em; margin: 0 0 8px; }
.rhead p { color: var(--muted); margin: 0; max-width: 60ch; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: .9rem; }
.fact b { font-family: var(--display); }

.avail {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--basil-soft); margin: 8px 0 4px;
}
.avail .ring { --p: 50; width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--basil) calc(var(--p) * 1%), color-mix(in srgb, var(--basil) 18%, transparent) 0); }
.avail .ring span { width: 40px; height: 40px; border-radius: 50%; background: var(--basil-soft); display: grid; place-items: center; font: 700 .9rem var(--display); }
.avail .txt { flex: 1; }
.avail .txt b { display: block; }
.avail .txt small { color: var(--muted); }

.ing { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; min-height: 54px; }
.ing .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.ing .st svg { width: 16px; height: 16px; }
.ing.have .st { background: var(--basil); color: var(--basil-ink); }
.ing.staple .st { background: var(--basil-soft); color: var(--basil); }
.ing.listed .st { background: var(--turmeric-soft); color: var(--ink); }
.ing.missing .st { border: 2px dashed var(--line); }
.ing .nm { min-width: 0; }
.ing .nm small { display: block; color: var(--muted); font-size: .84rem; }
.ing .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ing.struck .nm, .ing.struck .amt { text-decoration: line-through; opacity: .5; }
.ing .add { border: 0; background: var(--surface-2); border-radius: 10px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--basil); }
.ing .add svg { width: 20px; height: 20px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; margin: 6px 0 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
h3.grp { font: 700 1rem var(--display); color: var(--muted); margin: 14px 0 8px; }

ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 10px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
ol.steps li::before { content: counter(s); width: 36px; height: 36px; border-radius: 50%; background: var(--basil-soft); color: var(--basil); display: grid; place-items: center; font: 700 1rem var(--display); }
ol.steps li b { display: block; margin-bottom: 4px; }
ol.steps li p { margin: 0; line-height: 1.55; }
ol.steps li.done { opacity: .5; }
ol.steps li.done::before { content: "✓"; background: var(--basil); color: var(--basil-ink); }
.note-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; white-space: pre-line; }

/* ---------- sheet (bottom drawer) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 12, .45); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto;
}
.sheet.open { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { font: 700 1.5rem var(--display); margin: 0 0 14px; }
.sheet .p-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.sheet .p-head .thumb { width: 72px; height: 72px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font-size: .88rem; font-weight: 700; }
.loc-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-pick label { position: relative; }
.loc-pick input { position: absolute; opacity: 0; }
.loc-pick span { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; background: var(--surface-2); }
.loc-pick input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.loc-pick input:focus-visible + span { outline: 3px solid var(--basil); outline-offset: 2px; }
.choice { display: grid; gap: 8px; }
.choice button { text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }

/* ---------- scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame {
  position: absolute; left: 50%; top: 42%; width: min(78vw, 360px); height: min(40vw, 190px); transform: translate(-50%, -50%);
  border-radius: 20px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5);
}
.scanner .frame::before { content: ""; position: absolute; inset: 0; border: 3px solid rgba(255,255,255,.9); border-radius: 20px; }
.scanner .frame::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: #8CC797; box-shadow: 0 0 12px #8CC797; animation: sweep 1.6s ease-in-out infinite alternate; }
.scanner.hit .frame::before { border-color: #8CC797; }
@keyframes sweep { from { transform: translateY(-70px); } to { transform: translateY(70px); } }
@media (prefers-reduced-motion: reduce) { .scanner .frame::after { animation: none; } }
.scanner .bar-top { position: relative; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.scanner .bar-top button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); }
.scanner .bar-top button svg { width: 24px; height: 24px; }
.scanner .bar-top button.on { background: #fff; color: #000; }
.seg { display: flex; background: rgba(255,255,255,.16); border-radius: 14px; padding: 4px; backdrop-filter: blur(8px); }
.seg button { width: auto !important; height: 38px !important; border-radius: 10px !important; padding: 0 14px; background: none !important; font-weight: 700; }
.seg button.on { background: #fff !important; color: #000 !important; }
.scanner .bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); text-align: center; }
.scanner .msg { min-height: 48px; font-size: 1.05rem; margin-bottom: 12px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.scanner .bottom .btn { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; backdrop-filter: blur(8px); }
.scanner .ean-in { display: flex; gap: 8px; max-width: 420px; margin: 0 auto 10px; }
.scanner .ean-in input { flex: 1; height: 48px; border-radius: 12px; border: 0; padding: 0 14px; background: rgba(255,255,255,.9); color: #000; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px; width: 100%;
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 12px 12px 16px; box-shadow: var(--shadow);
  animation: pop .22s ease-out;
}
.toast span { flex: 1; }
.toast button { border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); padding: 8px 12px; border-radius: 10px; font-weight: 700; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* ---------- settings ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 6px 16px; margin-bottom: 14px; }
.card.pad { padding: 16px; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .ic { font-size: 1.5rem; width: 36px; text-align: center; }
.lrow .tx { flex: 1; min-width: 0; }
.lrow .tx small { display: block; color: var(--muted); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.3rem; }
.emoji-pick button.on { border: 2px solid var(--basil); background: var(--basil-soft); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; }
.login .mark { width: 72px; height: 72px; margin-bottom: 18px; }
.login h1 { font: 700 2.2rem/1 var(--display); margin: 0 0 8px; letter-spacing: -.02em; }
.login p { color: var(--muted); margin: 0 0 22px; }
.err { color: var(--paprika); font-weight: 700; margin: 8px 0; }

@media (min-width: 720px) {
  .top h1 { font-size: 2.6rem; }
  .hero { margin: 16px 0 0; width: 100%; border-radius: 22px; overflow: hidden; }
}

/* ===================== v2: rollen, aanbiedingen, weekmenu, slepen ===================== */
.still { position: relative; border-radius: 14px; }
.still > .act { display: none; }
.qty-ro { font: 700 1.05rem var(--display); color: var(--muted); padding: 0 10px; font-variant-numeric: tabular-nums; }
.thumb { position: relative; }
.thumb .emo { font-size: 1.6rem; line-height: 1; }
.thumb img { position: absolute; inset: 0; }
.shop .thumb { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.shop .thumb .emo { font-size: 1.35rem; }
.sheet .p-head .thumb .emo { font-size: 2.4rem; }

.offers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.offer {
  display: inline-flex; align-items: baseline; gap: 4px; font-size: .78rem; line-height: 1.2; padding: 3px 8px; border-radius: 8px;
  background: var(--turmeric-soft); color: var(--ink); max-width: 100%;
}
.offer b { font-weight: 700; }
.offer.ah b { color: var(--ah); }
.offer.jumbo b { color: var(--jumbo); }
.offer i { font-style: normal; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch; }

.grip { width: 36px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: grab; touch-action: none; flex: none; }
.grip svg { width: 20px; height: 20px; }
.grip:active { cursor: grabbing; }
[data-locs] .lrow { background: var(--surface); transition: transform .15s ease; position: relative; }
[data-locs] .lrow.lifting { transition: none; z-index: 2; box-shadow: var(--shadow); border-radius: 12px; }

.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.role-opt input { margin-top: 4px; accent-color: var(--basil); width: 18px; height: 18px; flex: none; }
.role-opt small { display: block; color: var(--muted); }
.role-opt:has(input:checked) { border-color: var(--basil); background: var(--basil-soft); }

/* weekmenu */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.week-nav .chip { text-decoration: none; }
.days { display: grid; gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 10px; }
.day h2 { font: 700 1.05rem var(--display); margin: 2px 4px 10px; }
.day.today { border-color: var(--basil); box-shadow: 0 0 0 1px var(--basil) inset; }
.day.today h2 { color: var(--basil); }
.day.past { opacity: .6; }
.day .list { margin-bottom: 8px; }
.add-meal { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; border: 1px dashed var(--line); background: none; color: var(--muted); font-weight: 700; }
.add-meal svg { width: 18px; height: 18px; }
.meal { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--ink); width: 100%; text-align: left; min-height: 60px; }
.mimg { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; background: var(--basil-soft); display: grid; place-items: center; font-size: 1.5rem; }
.mimg { position: relative; }
.mimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-locs] { -webkit-user-select: none; user-select: none; }
.mt { min-width: 0; flex: 1; }
.mt b { display: block; line-height: 1.25; }
.mt small { color: var(--muted); font-size: .85rem; }
.seg-tabs { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg-tabs button { flex: 1; border: 0; background: none; height: 40px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pick-list { display: grid; gap: 8px; max-height: 52dvh; overflow-y: auto; }
.pick-list button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.day-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.day-pick button { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; }
.day-pick small { color: var(--muted); font-size: .78rem; }
.chips button.chip { cursor: pointer; }
nav.tabs .in.ro { grid-template-columns: repeat(4, 1fr); }

/* ===================== v3 ===================== */
/* vulgraad + memo */
.memo-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: .84rem; color: var(--muted); }
.memo-line .note { font-style: italic; }
.fill { --f: 50; display: inline-block; width: 26px; height: 9px; border-radius: 5px; border: 1.5px solid var(--muted); position: relative; overflow: hidden; vertical-align: middle; flex: none; }
.fill::after { content: ""; position: absolute; inset: 0; width: calc(var(--f) * 1%); background: var(--basil); }
.level-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.level-pick button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 10px; font-size: .88rem; font-weight: 700; }
.level-pick button[aria-checked="true"] { border-color: var(--basil); background: var(--basil-soft); }
.min-badge { display: inline-block; font: 700 .7rem var(--text); background: var(--turmeric-soft); color: var(--ink); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }

/* microfoon in de invoerbalk */
.search .mic { border: 0; background: none; color: var(--muted); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.search .mic.on { color: #fff; background: var(--paprika); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .search .mic.on { animation: none; } }

/* inruimen (mandje / kassabon) */
.stock-list { display: grid; gap: 8px; max-height: 58dvh; overflow-y: auto; }
.stock-row { display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.stock-row.off { opacity: .55; }
.stock-row .ck input { width: 22px; height: 22px; accent-color: var(--basil); margin-top: 10px; }
.sr-name { width: 100%; border: 1px solid transparent; background: transparent; font-weight: 700; padding: 6px 8px; border-radius: 8px; }
.sr-name:focus { border-color: var(--basil); background: var(--surface); outline: none; }
.sr-ctl { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.sr-ctl select { flex: 1; min-width: 120px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; }
.sheet .bar { height: 10px; margin-top: 8px; }

/* receptideeën */
.idea-cta { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; margin: -6px 0 16px; border-radius: 18px; border: 1px dashed var(--basil); background: var(--basil-soft); color: var(--ink); }
.idea-cta svg { width: 34px; height: 34px; color: var(--basil); flex: none; }
.idea-cta b { display: block; font: 700 1.2rem var(--display); }
.idea-cta span span { color: var(--muted); font-size: .9rem; }
.sug-loading { display: flex; align-items: center; gap: 10px; padding: 30px 0; justify-content: center; color: var(--muted); font-weight: 700; }
.sug-loading svg { width: 24px; height: 24px; color: var(--basil); animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sug-loading svg { animation: none; } }
.sug-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.sug { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.sug-img { aspect-ratio: 16/8; background: var(--basil-soft); position: relative; display: grid; place-items: center; font-size: 2rem; }
.sug-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sug-src { position: absolute; left: 8px; top: 8px; font: 700 .72rem var(--text); background: var(--surface); color: var(--ink); padding: 3px 8px; border-radius: 8px; }
.sug-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.sug h3 { font: 700 1.05rem/1.2 var(--display); margin: 0; }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .86rem; }
.why li::before { content: "✓ "; color: var(--basil); font-weight: 700; }

/* voedingswaarde */
.nutri { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.nutri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.nutri-grid b { display: block; font: 700 1.25rem var(--display); }
.nutri-grid small { color: var(--muted); font-size: .78rem; }

/* editor: foto */
.img-field { display: flex; gap: 8px; }
.img-field input { flex: 1; min-width: 0; }

/* weekmenu */
.meal-row { display: flex; align-items: center; gap: 6px; background: transparent; }
.meal-row > .meal { flex: 1; min-width: 0; }
.meal-x { width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.meal-x svg { width: 18px; height: 18px; }
.day-actions { display: flex; gap: 8px; }
.day-actions .add-meal { flex: 1 1 auto; width: auto; min-width: 0; white-space: nowrap; padding: 0 12px; }
.day-actions .add-meal.idea { flex: 0 0 auto; color: var(--basil); border-color: color-mix(in srgb, var(--basil) 45%, var(--line)); }
.howto { padding-left: 20px; display: grid; gap: 6px; margin: 0 0 14px; }
.add-bar .search { min-width: 0; }
.shop .t small.for { display: block; color: var(--basil); font-weight: 700; font-size: .8rem; margin-top: 1px; }
/* ideeënblok even groot als "Wat kan ik maken?" */
.idea-cta { margin: 0 0 16px; }
.idea-cta span span { font-size: .92rem; }
/* ingrediënt: naam | hoeveelheid | winkelwagentje op één regel */
.ing { grid-template-columns: 28px 1fr auto auto; }
/* "Ideeën uit de aanbiedingen": zelfde vorm als "Wat kan ik maken?", lichte variant */
.cook-cta.idea { background: var(--basil-soft); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--basil) 40%, transparent); }
.cook-cta.idea svg { color: var(--basil); }
.cook-cta.idea span span { color: var(--muted); opacity: 1; }
.ok-msg { color: var(--basil); font-weight: 700; }
.email-row { display: flex; gap: 8px; align-items: flex-end; }
.email-row .btn { flex: none; }
details summary { list-style: revert; }
.login { position: relative; }
.theme-toggle { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 8px 14px; font-weight: 700; font-size: .88rem; }
/* versie */
.ver-now { font: 700 1.3rem var(--display); }
.ver-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.ver { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.ver.hoofd { border-left-color: var(--basil); }
.ver-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ver-head b { font: 700 1.05rem var(--display); }
.ver-type { font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.ver.hoofd .ver-type { background: var(--basil-soft); color: var(--basil); }
.ver-head small { color: var(--muted); margin-left: auto; }
.ver-title { font-weight: 700; margin-top: 2px; }
.ver ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
