:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f3ece1;
  --text: #2b2420;
  --muted: #7a6d63;
  --line: #e6dccd;
  --accent: #c2562f;
  --accent-ink: #ffffff;
  --accent-soft: #f6e1d6;
  --green: #3f7d4e;
  --green-soft: #e1efe2;
  --ah: #00a0e2;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .07);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1916; --surface: #262220; --surface-2: #2f2a26; --text: #f1ebe3; --muted: #a89c90;
    --line: #3b3530; --accent: #e07a52; --accent-soft: #3d2a20; --green: #7cbf8a; --green-soft: #22342a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); padding-bottom: 90px; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1rem; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.topbar nav a.active { background: var(--surface-2); color: var(--text); }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; text-align: center; }
.pill.soft { background: var(--green); }

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ah { background: var(--ah); border-color: var(--ah); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { color: #b3261e; }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=password], input[type=url], select, textarea {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 10px; border-radius: 10px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label.field { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }

/* Overzicht */
.hero { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: grid; gap: 12px; margin-bottom: 22px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.f-search { position: relative; display: flex; gap: 10px; align-items: center; }
.f-search input[type=search] { flex: 1; padding-left: 34px; height: 40px; background: var(--bg); border-radius: 999px; }
.f-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.15rem; pointer-events: none; }
.f-search .chip { height: 40px; padding: 0 16px; white-space: nowrap; }
.f-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.f-label { width: 64px; flex: none; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.f-label-gap { width: auto; margin-left: 14px; }
.f-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 1 auto; min-width: 0; }
.f-row > .f-chips:last-child { flex: 1 1 0; min-width: 200px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.seg-btn { border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 14px; cursor: pointer; font-size: .9rem; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--text); color: var(--bg); }
.chip-n { display: inline-block; min-width: 1.5em; margin-left: 2px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: .78rem; text-align: center; }
.chip.on .chip-n { background: rgba(127,127,127,.25); }
@media (max-width: 760px) {
  .filters { padding: 12px; }
  .f-row { gap: 6px; }
  .f-label, .f-label-gap { width: 100%; margin: 4px 0 0; }
  .f-row > .f-chips:last-child { flex-basis: 100%; min-width: 0; }
  .seg { max-width: 100%; overflow-x: auto; }
  .f-search .surprise-txt { display: none; }
}
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .9rem; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; position: relative; outline: 3px solid transparent; transition: outline-color .15s, transform .15s; }
.card.selected { outline-color: var(--accent); }
.card .photo { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--surface-2); cursor: pointer; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 1.08rem; margin: 0; cursor: pointer; }
.card .meta { font-size: .82rem; color: var(--muted); }
.card .actions { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--surface); padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; box-shadow: var(--shadow); }
.check-badge { position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--accent-ink); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.stepper button { border: 0; background: transparent; width: 30px; height: 30px; cursor: pointer; font-size: 1.05rem; }
.stepper span { min-width: 54px; text-align: center; font-size: .85rem; font-weight: 500; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }


/* Receptdetail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; }
.detail .photo { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.detail .subtitle { font-family: var(--serif); font-size: 1.15rem; color: var(--muted); margin: -4px 0 12px; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.fact { background: var(--surface-2); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .amt { min-width: 84px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ingredients .pantry { color: var(--muted); }
.subhead { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 14px 0 4px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 46px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-family: var(--serif); }
.steps h4 { margin: 4px 0 4px; font-size: 1rem; }
.steps p { margin: 0; }
.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.nutri div { background: var(--surface-2); border-radius: 10px; padding: 8px 4px; }
.nutri b { display: block; font-size: 1.1rem; font-family: var(--serif); }
.cards-thumbs { display: flex; gap: 10px; }
.cards-thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--line); }
.tip { background: var(--green-soft); border-radius: 10px; padding: 10px 14px; font-size: .92rem; }

/* Boodschappenlijst */
.list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.shop-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.shop-item.have .name { text-decoration: line-through; color: var(--muted); }
.shop-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.shop-item .name { font-weight: 500; }
.shop-item .from { font-size: .78rem; color: var(--muted); }
.link-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.store-tag { font-size: .75rem; border-radius: 6px; padding: 2px 7px; border: 1px solid var(--line); cursor: pointer; background: var(--surface); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-tag.ah.ok { border-color: var(--ah); color: var(--ah); }
.store-tag.missing { border-style: dashed; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; }
.qty input { width: 52px; padding: 4px 6px; text-align: center; }
.sticky { position: sticky; top: 76px; }
.store-box h3 { display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* Modal */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(30, 20, 10, .45); }
#modal-body { padding: 20px; }
dialog.wide { width: min(1000px, calc(100% - 24px)); }
.results { display: grid; gap: 8px; max-height: 50vh; overflow: auto; margin-top: 12px; }
.result { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); text-align: left; }
.result:hover { border-color: var(--accent); }
.result img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; }
.tabs { display: flex; gap: 6px; margin: 10px 0; }

/* Editor */
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ing-row { display: grid; grid-template-columns: 80px 90px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.step-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-bottom: 10px; }

.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

@media (max-width: 820px) {
  .detail, .list-layout { grid-template-columns: 1fr; }
  .sticky { position: static; order: -1; }
  .editor-grid { grid-template-columns: 1fr; }
  .ing-row { grid-template-columns: 64px 74px minmax(0, 1fr) auto; }
  .ing-row .pantry-label { grid-column: 1 / -1; }
  .nutri { grid-template-columns: repeat(2, 1fr); }
  .topbar nav a { padding: 6px 9px; font-size: .9rem; white-space: nowrap; }
  .topbar nav { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
}

@media print {
  .topbar, .no-print, .btn { display: none !important; }
  body { background: #fff; padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
  .detail { grid-template-columns: 1fr 1.3fr; }
  .print-break { page-break-after: always; }
}

/* Voorraad */
.vr-row { display: grid; grid-template-columns: 1fr 90px auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.vr-row:last-child { border-bottom: 0; }
.vr-row input, .vr-row select { padding: 5px 8px; }
.vr-name { font-weight: 500; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.stock-tag.ok { border-color: var(--green); color: var(--green); }
.stock-tag.low { border-color: var(--accent); color: var(--accent); }
.stock-tag.add { border-style: dashed; }
.stock-tag.add.prominent { border-style: solid; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.done-head, .done-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; }
.done-head { padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.done-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 480px) { .vr-row { grid-template-columns: 1fr 68px auto auto; gap: 6px; } }

/* Koppelen */
.kp-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kp-row:last-child { border-bottom: 0; }
.kp-name { flex: 1; min-width: 0; overflow-wrap: break-word; }
details.panel > summary { cursor: pointer; list-style-position: outside; }
@media (max-width: 480px) { .kp-row { flex-wrap: wrap; } .kp-name { flex-basis: 100%; } }
.kp-recipes { position: relative; cursor: help; border-bottom: 1px dotted currentColor; }
.kp-tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: max-content; max-width: min(340px, 80vw);
  padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kp-tip span { display: block; padding: 2px 0; white-space: normal; }
.kp-recipes:hover .kp-tip, .kp-recipes:focus .kp-tip { display: block; }

/* Favorieten */
.fav { position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow);
  cursor: pointer; font-size: 1.05rem; line-height: 1; display: grid; place-items: center; color: var(--muted); }
.fav.on, .fav-btn.on { color: var(--accent); }
.card .check-badge { right: 48px; }

/* Voedingsdoelen */
.chip.chip-fav { --c: #d9546e; } .chip.rest { --c: var(--green); } .chip.bonus { --c: var(--accent); }
.chip.chip-fav:not(.on), .chip.rest:not(.on), .chip.bonus:not(.on) { border-color: var(--c); color: var(--c); }
.chip.chip-fav.on, .chip.rest.on, .chip.bonus.on { background: var(--c); border-color: var(--c); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.chip-fav { --c: #ec7f95; } .chip.chip-fav.on, .chip.rest.on, .chip.bonus.on { color: var(--bg); } }
.chip.surprise { font-weight: 600; background: var(--surface-2); }
.chip.surprise:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip.surprise:disabled { opacity: .45; cursor: default; }
.goal-hint { margin: -10px 0 16px; max-width: 760px; }
.goal-info { cursor: help; margin-left: 2px; color: var(--muted); }
.goal-info:hover, .goal-info:focus { color: var(--accent); outline: none; }
.grid-head { margin: 8px 0 12px; font-size: 1.15rem; }
.grid + .grid-head { margin-top: 28px; }
.macros .hl { color: var(--text); font-weight: 600; }
.nutri-edit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
@media (max-width: 480px) { .nutri-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Restjes en houdbaarheid */
.lo-badge { font-size: .8rem; color: var(--green); background: var(--green-soft); border-radius: 8px; padding: 3px 8px; align-self: flex-start; }
.exp-tag { font-size: .72rem; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 1px 6px; margin-left: 4px; cursor: pointer; color: var(--muted); vertical-align: 1px; }
.exp-tag.soon { border-color: var(--accent); color: var(--accent); }
.exp-tag.expired { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.warn-panel { border-left: 4px solid var(--accent); }
.vr-row.exp-row { grid-template-columns: 1fr auto auto; }

/* Kookboek (bladeren) */
:root { --paper: #fffcf5; --paper-edge: #e9dfcc; --cover: #8a3d22; }
@media (prefers-color-scheme: dark) { :root { --paper: #2c2723; --paper-edge: #3d3631; --cover: #5a2a18; } }
.view-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.view-toggle input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; color-scheme: light dark; }
.book-wrap { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 14px; margin-top: 8px; }
.book-nav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); color: var(--text); }
.book-nav:disabled { opacity: .3; cursor: default; }
.book-cover { padding: 12px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(0,0,0,.15), transparent 8%, transparent 92%, rgba(0,0,0,.15)), var(--cover);
  box-shadow: 0 18px 40px rgba(60, 30, 10, .28), inset 0 0 0 2px rgba(255,255,255,.06); }
/* Zo hoog als het scherm toelaat; zelfde formule als bookHeight() in app.js */
.book { position: relative; height: clamp(440px, calc(100vh - 176px), 720px); }
.book-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 12px; padding: 0 58px; }
.book-foot-left { justify-self: start; display: flex; gap: 6px; flex-wrap: wrap; }
.book-foot .to-start { color: var(--muted); }
.book-foot .to-start:hover { color: var(--accent); border-color: var(--accent); }
.book-foot .to-start.away { visibility: hidden; }
@media (max-width: 760px) { .book-foot { padding: 0; } }
.page, .face { position: absolute; top: 0; bottom: 0; overflow: hidden; }
.page.left { left: 0; width: 50%; border-radius: 4px 0 0 4px; box-shadow: -1px 1px 0 var(--paper-edge), -3px 2px 0 var(--paper), -4px 3px 0 var(--paper-edge), -6px 4px 0 var(--paper), -7px 5px 0 var(--paper-edge); }
.page.right { left: 50%; width: 50%; border-radius: 0 4px 4px 0; box-shadow: 1px 1px 0 var(--paper-edge), 3px 2px 0 var(--paper), 4px 3px 0 var(--paper-edge), 6px 4px 0 var(--paper), 7px 5px 0 var(--paper-edge); }
.page.single { left: 0; width: 100%; border-radius: 0 4px 4px 0; box-shadow: 1px 1px 0 var(--paper-edge), 3px 2px 0 var(--paper), 4px 3px 0 var(--paper-edge), 6px 4px 0 var(--paper); }
.paper { background-color: var(--paper); }
.paper.is-left { background-image: linear-gradient(to left, rgba(60,35,15,.16), rgba(60,35,15,.04) 5%, transparent 12%); }
.paper.is-right { background-image: linear-gradient(to right, rgba(60,35,15,.16), rgba(60,35,15,.04) 5%, transparent 12%); }

.flip-layer { position: absolute; inset: 0; z-index: 5; }
.leaf { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; will-change: transform; }
.leaf.r { left: 50%; transform-origin: left center; }
.leaf.l { left: 0; transform-origin: right center; }
.leaf.s { left: 0; width: 100%; transform-origin: left center; }
.face { left: 0; right: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.leaf.r .face.front, .leaf.s .face.front { border-radius: 0 4px 4px 0; }
.leaf.l .face.front { border-radius: 4px 0 0 4px; }
.shade { position: absolute; inset: 0; background: #3a2412; opacity: 0; pointer-events: none; }
.flip-layer .page-content, .flip-layer button { pointer-events: none; }

.page-content { position: absolute; inset: 0; padding: 26px 30px 44px; display: flex; flex-direction: column; overflow: hidden; }
.page-num { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-family: var(--serif); font-size: .85rem; color: var(--muted); }
.ornament { font-family: "Segoe UI Symbol", "Apple Symbols", serif; font-size: 1.6rem; color: var(--accent); text-align: center; opacity: .8; }
.page-content.blank { justify-content: center; align-items: center; text-align: center; gap: 10px; }

.chapter { text-align: center; }
.chapter-kicker { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 18px; }
.chapter-title { font-size: clamp(2rem, 4vw, 2.8rem); margin: 6px 0 4px; }
.chapter-extra { color: var(--muted); font-size: .9rem; }
.chapter .ornament { margin: 10px 0 6px; }
.chapter .subhead { margin-bottom: 10px; }
.toc { list-style: none; padding: 0; margin: 0; text-align: left; overflow: hidden; min-height: 0; }
.toc button { width: 100%; display: flex; align-items: flex-end; gap: 6px; border: 0; background: none; padding: 4px 0; cursor: pointer; text-align: left; font-size: .9rem; color: var(--text); }
.toc button:hover .toc-title { color: var(--accent); text-decoration: underline; }
.toc-title { min-width: 0; line-height: 1.4; }
.toc-dots { flex: 1; border-bottom: 1px dotted var(--muted); opacity: .6; transform: translateY(-5px); min-width: 12px; }
.toc-head button { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 0 4px; }
.toc-head button:hover { color: var(--accent); }
.toc-more { margin-top: 6px; }
/* Titelpagina van een hoofdstuk */
.chapter-open { justify-content: center; gap: 4px; }
.chapter-open p { max-width: 300px; margin: 8px auto 0; }

.book-recipe { padding-top: 22px; }
.rp-photo { position: relative; flex: 0 0 44%; border-radius: 6px; overflow: hidden; background: var(--surface-2); box-shadow: 0 2px 8px rgba(60,35,15,.15); }
.rp-photo img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.book-recipe .check-badge { right: 48px; }
.rp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 16px; }
.rp-title { font-size: 1.45rem; margin: 0; cursor: pointer; }
.rp-title:hover { color: var(--accent); }
.rp-sub { font-family: var(--serif); color: var(--muted); font-size: 1.02rem; margin-top: -2px; }
.book-recipe .meta { font-size: .84rem; color: var(--muted); }
.book-recipe .actions { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

@media (max-width: 760px) {
  .book-wrap { grid-template-columns: 1fr 1fr; gap: 10px; }
  .book-wrap .book-stage { grid-column: 1 / -1; grid-row: 1; }
  .book-wrap .book-cover { padding: 8px 10px 8px 8px; }
  .book-wrap .book-nav[data-book="-1"] { justify-self: end; }
  .page-content { padding: 18px 18px 40px; }
}
@media print { .book-wrap, .book-foot, .view-toggle { display: none !important; } }


/* Voorwoord */
.voorwoord { text-align: left; }
.voorwoord .chapter-kicker, .voorwoord .chapter-title, .voorwoord .ornament { text-align: center; }
.voorwoord p { margin: 0 0 .7em; font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.voorwoord .initial { float: left; font-size: 3.2rem; line-height: .85; padding: 4px 8px 0 0; color: var(--accent); font-weight: 700; }
.voorwoord .signature { margin-top: auto; text-align: right; font-style: italic; color: var(--accent); font-size: 1.15rem; }

/* Koppelen: recepten in de tooltip zijn klikbaar */
.kp-tip::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.kp-tip a { display: block; padding: 3px 6px; margin: 0 -6px; border-radius: 6px; text-decoration: none; white-space: normal; }
.kp-tip a:hover, .kp-tip a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.kp-recipes:focus-within .kp-tip { display: block; }

/* Recept: één ingrediënt uitgelicht */
.ing-focus { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }
.ing-focus-x { margin-left: auto; text-decoration: none; color: var(--muted); padding: 0 4px; }
.ing-focus-x:hover { color: var(--accent); }
.ingredients li.hl { background: var(--accent-soft); border-radius: 8px; margin: 2px -8px; padding: 6px 8px; border-bottom-color: transparent; font-weight: 600; }
.steps mark { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 4px; padding: 0 3px; }

/* Voorraad: zoekbalk met suggesties */
.vr-search-panel { position: relative; z-index: 5; }
.vr-bar { position: relative; display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 6px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(60,40,20,.05); transition: border-color .15s, box-shadow .15s; }
.vr-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.vr-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.vr-icon { width: 20px; height: 20px; color: var(--muted); margin: 0 6px 0 8px; flex: none; }
.vr-bar:focus-within .vr-icon { color: var(--accent); }
.vr-bar input, .vr-bar select { border: 0 !important; background: transparent !important; box-shadow: none; outline: none; padding: 8px 6px; border-radius: 0; }
.vr-bar #vr-name { flex: 1; min-width: 0; font-size: 1rem; }
.vr-clear { border: 0; background: var(--surface-2); color: var(--muted); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: .75rem; flex: none; margin-right: 4px; }
.vr-clear:hover { color: var(--text); }
.vr-divider { width: 1px; height: 24px; background: var(--line); flex: none; }
.vr-bar .vr-amount { width: 76px; text-align: right; }
.vr-bar .vr-unit { width: auto; color: var(--muted); cursor: pointer; padding-left: 2px; }
.vr-submit { border-radius: 999px; padding: 9px 18px; flex: none; }

.vr-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(40, 25, 10, .18); padding: 6px; max-height: 360px; overflow: auto; animation: vr-pop .14s ease-out; }
.vr-sugg.closed { display: none; }
@keyframes vr-pop { from { opacity: 0; transform: translateY(-4px); } }
.vr-opt { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; text-align: left;
  border: 0; background: none; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.vr-opt:hover, .vr-opt.active { background: var(--surface-2); }
.vr-opt-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-opt-name mark { background: none; color: var(--accent); font-weight: 700; }
.vr-opt-meta { font-size: .78rem; color: var(--muted); }
.vr-opt-tag { font-size: .75rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 2px 9px; white-space: nowrap; opacity: .75; }
.vr-opt:hover .vr-opt-tag, .vr-opt.active .vr-opt-tag { opacity: 1; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.vr-opt-tag.in { color: var(--green); border-color: var(--green-soft); }
.vr-opt:hover .vr-opt-tag.in, .vr-opt.active .vr-opt-tag.in { background: var(--green); border-color: var(--green); color: #fff; }
.vr-opt.new { border-top: 1px dashed var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.vr-opt.new:first-child { border-top: 0; margin-top: 0; border-radius: 10px; }
.vr-opt.new .vr-opt-name { font-weight: 400; color: var(--muted); }
.merge-bar { border-radius: 12px; }
.merge-sugg { position: static; box-shadow: none; animation: none; max-height: 300px; margin-top: 8px; }
.vr-opt.chosen { background: var(--accent-soft); }
.vr-sugg-empty { padding: 8px 12px 4px; font-size: .85rem; color: var(--muted); }
@media (max-width: 560px) {
  .vr-bar { flex-wrap: wrap; border-radius: 18px; }
  .vr-field { flex-basis: 100%; }
  .vr-divider { display: none; }
  .vr-bar .vr-amount { flex: 1; text-align: left; border-top: 1px solid var(--line) !important; }
  .vr-bar .vr-unit { border-top: 1px solid var(--line) !important; }
  .vr-opt { grid-template-columns: minmax(0, 1fr) auto; }
  .vr-opt-meta { display: none; }
}

/* Hardcover: voorkant, achterkant en open-/dichtklappen */
:root { --gold: #e3c27a; --gold-soft: rgba(227, 194, 122, .55); }
.book-stage { position: relative; }
.book-cover.hide-left { clip-path: inset(-80px -80px -80px 50%); }
.book-cover.hide-right { clip-path: inset(-80px 50% -80px -80px); }
.book-stage.is-closed { transform: translateX(-25%); }
.book-stage.is-back { transform: translateX(25%); }
.book-stage.is-closed .book-cover, .book-stage.is-back .book-cover { visibility: hidden; }
.hc { position: absolute; top: 0; bottom: 0; width: 50%; display: none; cursor: pointer; }
.hc-front { left: 50%; }
.hc-back { left: 0; }
.book-stage.is-closed .hc-front, .book-stage.is-back .hc-back { display: block; animation: hc-in .4s ease; }
.book-stage.single.is-closed, .book-stage.single.is-back { transform: none; }
.book-stage.single .hc { left: 0; width: 100%; }
.hc:hover .hc-face { transform: translateY(-3px); box-shadow: 0 28px 50px rgba(40, 20, 5, .4); }
@keyframes hc-in { from { opacity: 0; } }

.hc-leaf { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; z-index: 10; transform-origin: left center; transform-style: preserve-3d; will-change: transform; pointer-events: none; }
.hc-leaf.s { left: 0; width: 100%; }
.hc-side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hc-side.back { transform: rotateY(180deg); }
.hc-side .shade { border-radius: 12px; }

.hc-face { position: absolute; inset: 0; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease;
  background:
    radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(90% 70% at 80% 90%, rgba(0,0,0,.25), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 2px, rgba(0,0,0,.025) 2px 4px),
    var(--cover);
  color: var(--gold); }
.cover-front { border-radius: 4px 12px 12px 4px; box-shadow: 0 18px 40px rgba(40, 20, 5, .35), inset -3px 0 0 rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.05); }
.cover-back { border-radius: 12px 4px 4px 12px; box-shadow: 0 18px 40px rgba(40, 20, 5, .35), inset 3px 0 0 rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.05); }
.hc-spine { position: absolute; top: 0; bottom: 0; left: 0; width: 26px;
  background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.15) 55%, rgba(255,255,255,.08) 70%, rgba(0,0,0,.2)); }
.hc-spine::before, .hc-spine::after { content: ""; position: absolute; left: 4px; right: 4px; height: 3px; border-radius: 2px; background: var(--gold-soft); }
.hc-spine::before { top: 14%; } .hc-spine::after { bottom: 14%; }
.hc-spine.right { left: auto; right: 0; transform: scaleX(-1); }
.hc-frame { position: absolute; inset: 26px 26px 26px 44px; border: 2px solid var(--gold-soft); border-radius: 6px; outline: 1px solid var(--gold-soft); outline-offset: -8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 30px 24px; }
.cover-back .hc-frame { inset: 26px 44px 26px 26px; }
.hc-corner { position: absolute; font-family: "Segoe UI Symbol", "Apple Symbols", serif; font-size: 1.1rem; color: var(--gold); line-height: 1; }
.hc-corner.tl { top: 14px; left: 16px; } .hc-corner.tr { top: 14px; right: 16px; }
.hc-corner.bl { bottom: 14px; left: 16px; } .hc-corner.br { bottom: 14px; right: 16px; }
.hc-emblem { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 0 6px var(--cover), 0 0 0 7px var(--gold-soft);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 3rem; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.hc-emblem.small { width: 58px; height: 58px; font-size: 1.8rem; }
.hc-title { font-size: clamp(2.4rem, 4.2vw, 3.4rem); color: var(--gold); margin: 4px 0 0; line-height: 1.02; letter-spacing: .01em;
  text-shadow: 0 1px 0 rgba(255,255,255,.15), 0 -1px 0 rgba(0,0,0,.5); }
.hc-rule { width: 90px; height: 0; border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); padding-top: 3px; }
.hc-sub { font-family: var(--serif); font-style: italic; font-size: 1.1rem; }
.hc-blurb { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; max-width: 300px; margin: 0; color: #f3e3c0; }
.hc-barcode { position: absolute; right: 22px; bottom: 20px; background: #fffaf0; color: #222; border-radius: 3px; padding: 6px 8px 4px; font-size: .58rem; letter-spacing: .05em; font-family: var(--sans); }
.hc-barcode .bars { width: 96px; height: 30px; margin-bottom: 3px;
  background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 3px, #222 3px 4px, transparent 4px 7px, #222 7px 10px, transparent 10px 11px); }

/* Binnenkant van de kaft tijdens het openklappen: bord met de pagina erop */
.hc-face.board { color: inherit; padding: 12px 0 12px 14px; border-radius: 12px 0 0 12px; }
.hc-face.board.r { padding: 12px 14px 12px 0; border-radius: 0 12px 12px 0; }
.board-page { position: relative; height: 100%; overflow: hidden; border-radius: 4px 0 0 4px; }
.board.r .board-page { border-radius: 0 4px 4px 0; }
.hc-leaf .page-content, .hc-leaf button { pointer-events: none; }

@media (max-width: 760px) {
  .hc-frame { inset: 18px 18px 18px 36px; padding: 20px 14px; }
  .cover-back .hc-frame { inset: 18px 36px 18px 18px; }
  .hc-emblem { width: 76px; height: 76px; font-size: 2.4rem; }
}

/* ================= Bonussen ================= */
.bonus-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.bonus-row:last-child { border-bottom: 0; }
.bonus-head { margin-bottom: 8px; }
.bonus-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bonus-side { text-align: left; font: inherit; color: inherit; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: grid; gap: 6px; min-width: 0; }
.bonus-side:hover { border-color: var(--muted); }
.bonus-side.gekoppeld.chosen { border-color: var(--ah); background: color-mix(in srgb, var(--ah) 8%, var(--surface)); }
.bonus-side.bonus.chosen { border-color: var(--accent); background: var(--accent-soft); }
.bonus-row.open .bonus-side { border-style: dashed; }
.bonus-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bonus-side.bonus .bonus-label { color: var(--accent); }
.bonus-side.gekoppeld .bonus-label { color: var(--ah); }
.bonus-check { text-transform: none; letter-spacing: 0; }
.bonus-prod { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; }
.bonus-prod > span:last-child { display: grid; gap: 1px; min-width: 0; }
.bonus-prod img, .bonus-noimg { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; }
.bonus-name { font-weight: 600; overflow-wrap: anywhere; }
.bonus-price { font-weight: 600; }
.bonus-deal { display: inline-block; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 0 6px; font-size: .8rem; font-weight: 600; }
.store-tag.ah.ok.bonus { border-color: var(--accent); color: var(--accent); }
@media (max-width: 560px) { .bonus-prod { grid-template-columns: minmax(0, 1fr); align-items: start; } .bonus-prod img, .bonus-noimg { width: 48px; height: 48px; } .bonus-side { padding: 8px; align-content: start; } .bonus-pair { gap: 8px; } }
.bonus-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.bonus-diff { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: none; letter-spacing: 0; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.bonus-diff.goedkoper { color: #fff; background: var(--green); }
.bonus-diff.duurder { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.bonus-diff.gelijk { color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .bonus-diff.goedkoper { color: var(--bg); } }
.bonus-side.prijs-goedkoper .bonus-unit { color: var(--green); font-weight: 600; }
.kp-product { color: var(--ah); text-decoration: none; }
.kp-product:hover { text-decoration: underline; }
.has-notif { position: relative; }
.notif { position: absolute; top: -3px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e0352b; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.notif[hidden] { display: none; }
.kp-row:has(.kp-sugg) { flex-wrap: wrap; }
.kp-sugg { flex-basis: 100%; display: grid; gap: 4px; margin-top: -2px; }
.kp-sugg-item { display: flex; align-items: center; gap: 6px; font-size: .85rem; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--surface-2); }
.kp-sugg-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-sugg-item .btn.small { padding: 2px 10px; font-size: .78rem; }
.kp-sugg-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .75rem; padding: 2px 4px; }
.kp-sugg-x:hover { color: var(--text); }
.bonus-week { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bonus-week-tag { display: inline-block; padding: 5px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }

/* Restjes opmaken */
.lo-card { background: var(--surface-2); border-radius: 12px; padding: 0 12px; margin-top: 8px; }
.lo-card[open] { padding-bottom: 4px; }
.lo-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 6px; padding: 10px 0; cursor: pointer; list-style: none; }
.lo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.lo-head::-webkit-details-marker { display: none; }
.lo-count { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.lo-count::after { content: " ›"; display: inline-block; transition: transform .15s; }
.lo-card[open] .lo-count::after { transform: rotate(90deg); }
.lo-tag { font-size: .75rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 8px; color: var(--muted); white-space: nowrap; }
.lo-tag.date { border-color: var(--accent); color: var(--accent); }
.lo-rec { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.lo-rec-title { color: var(--text); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-rec-title:hover { text-decoration: underline; }
.lo-rec-use { font-size: .8rem; color: var(--muted); white-space: nowrap; text-align: right; }
.lo-all { color: var(--green); font-weight: 600; margin-right: 8px; }
.lo-more { border-top: 1px solid var(--line); }
.lo-more summary { font-size: .8rem; color: var(--muted); cursor: pointer; padding: 6px 0; }
.lo-more[open] summary { padding-bottom: 2px; }
.lo-none { font-size: .82rem; color: var(--muted); margin-top: 12px; }
.lo-none b { color: var(--text); font-weight: 500; }
@media (max-width: 560px) {
  .lo-rec { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .lo-rec-title { grid-column: 1 / -1; white-space: normal; }
  .lo-rec-use { text-align: left; }
}

/* Restjespagina in het boek */
.restjes-page { justify-content: flex-start; text-align: left; }
.restjes-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; margin-right: -8px; padding-right: 8px; }
/* Halve boekpagina is smal: titel op een eigen regel, hoeveelheid en knop eronder */
.restjes-page .lo-rec { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
.restjes-page .lo-rec-title { grid-column: 1 / -1; white-space: normal; }
.restjes-page .lo-rec-use { text-align: left; }
.restjes-page .chapter-kicker, .restjes-page .chapter-title, .restjes-page .ornament { text-align: center; }
.restjes-page .restjes-intro { text-align: center; margin: 0 0 4px; }

/* Restjes-tweeluik: producten om te kiezen */
.lo-pick { display: block; width: 100%; text-align: left; border: 1px solid transparent; color: inherit; font: inherit; cursor: pointer; }
.lo-pick .lo-head { cursor: inherit; }
.lo-pick:hover:not(:disabled) { border-color: var(--line); }
.lo-pick.on { border-color: var(--accent); background: var(--surface); }
.lo-pick:disabled { opacity: .55; cursor: default; }
.restjes-tags { justify-content: center; margin: 2px 0 2px; }
.restjes-leeg { justify-content: center; text-align: center; gap: 14px; }

/* Voorraad inspreken */
.vr-mic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-right: 2px; border: 0; border-radius: 50%; background: transparent; color: var(--accent); cursor: pointer; transition: background .15s, color .15s; }
.vr-mic svg { width: 19px; height: 19px; }
.vr-mic:hover, .vr-mic:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }

.speak h2 { margin: 0; }
.speak-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.speak-head > div { flex: 1; min-width: 0; }
.speak-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.speak-head p b { color: var(--accent); font-weight: 600; }
.speak-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: .8rem; }
.speak-x:hover { color: var(--text); }

/* Stap 1: microfoon en tekst */
.speak-stage { display: grid; justify-items: center; gap: 10px; padding: 8px 0 20px; }
.speak-mic { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .15s; }
.speak-mic:hover { transform: scale(1.04); }
.speak-mic:active { transform: scale(.97); }
.speak-mic svg { width: 36px; height: 36px; position: relative; z-index: 1; }
.speak-mic .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
.speak-mic.on .ring { animation: speak-ring 1.8s ease-out infinite; }
.speak-mic.on .ring.r2 { animation-delay: .9s; }
@keyframes speak-ring { from { transform: scale(1); opacity: .6; } to { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .speak-mic.on .ring { animation: none; opacity: .5; transform: scale(1.25); } }
.speak-hint { font-size: .9rem; color: var(--muted); font-weight: 500; min-height: 1.3em; }
.speak-mic.on + .speak-hint { color: var(--accent); }
.speak-box textarea { width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical; font-size: 1rem; line-height: 1.5; padding: 14px 16px;
  border: 1.5px solid transparent; border-radius: 14px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.speak-box textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.speak-status { display: flex; gap: 8px; align-items: flex-start; min-height: 1.2em; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.speak-status:empty { margin-top: 0; }
.speak-status svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--accent); }
.speak-status.warn { color: var(--accent); }
.speak-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }

/* Stap 2: controleren */
.speak-list { display: grid; gap: 6px; max-height: min(52vh, 520px); overflow-y: auto; margin: 0 -6px; padding: 2px 6px; }
.speak-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); transition: opacity .15s; }
.speak-row.check, .speak-row.new { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.speak-row.off { opacity: .45; }
.speak-check { position: relative; display: grid; place-items: center; cursor: pointer; }
.speak-check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.speak-check span { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.speak-check input:checked + span { background: var(--green); border-color: var(--green); }
.speak-check input:checked + span::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.speak-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.speak-prod { min-width: 0; }
.speak-prod select { width: 100%; max-width: 100%; border: 0; background-color: transparent; padding: 2px 22px 2px 0; font-weight: 600; font-size: 1rem; cursor: pointer;
  text-overflow: ellipsis; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.speak-prod select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.speak-said { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; font-size: .78rem; color: var(--muted); }
.speak-said > span:not(.speak-tag) { overflow-wrap: anywhere; }
.speak-tag { font-weight: 600; font-size: .72rem; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.speak-has { color: var(--green); }
.speak-qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.speak-qty:focus-within { border-color: var(--accent); }
.speak-qty input, .speak-qty select { border: 0 !important; background: transparent !important; box-shadow: none; outline: none; border-radius: 0; padding: 7px 6px; }
.speak-qty input { width: 62px; text-align: right; font-weight: 600; }
.speak-qty select { width: auto; color: var(--muted); padding-left: 0; cursor: pointer; }
@media (max-width: 560px) {
  .speak-row { gap: 10px; padding: 10px; }
  .speak-prod select { font-size: .95rem; }
  .speak-qty input { width: 46px; padding: 7px 4px; }
  .speak-list { max-height: 58vh; }
}
.kp-own { color: var(--green); font-weight: 500; }

/* Online (Supabase): inloggen en ingediende recepten */
#uitloggen[hidden], .topbar nav a[hidden] { display: none !important; }
.kb-status { border-left: 4px solid var(--accent); }
.kb-status.afgewezen { border-left-color: #e0352b; }
.kb-label { display: inline-block; width: fit-content; justify-self: start; align-self: flex-start; margin: 2px 0 4px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 500;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
