:root {
  /* Huisstijl Ricetta: trattoria met invloeden uit een Napolitaans pizzaboek */
  --bg: #f7f2e8;          /* papier */
  --surface: #fffdf8;
  --text: #2b1d14;        /* espresso */
  --muted: #8a7666;
  --line: #e4d9c6;
  --accent: #c62d1f;      /* pomodoro */
  --accent-dark: #8e1a12;
  --accent-soft: #f2ddd6;
  --teal: #5fa3a0;        /* kaderlijn */
  --mustard: #a8821f;     /* gespatieerde hoofdletters */
  --done: #b0a291;
  --radius: 4px;
  --font-title: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --font-label: 'Oswald', 'Arial Narrow', sans-serif;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1611;
    --surface: #2a211b;
    --text: #f4ecdd;
    --muted: #b3a493;
    --line: #42352b;
    --accent: #e04a38;
    --accent-dark: #a8261a;
    --accent-soft: #4a2620;
    --teal: #6fb7b3;
    --mustard: #d6b25a;
    --done: #76695c;
  }
}

@font-face { font-family: 'Bebas Neue'; font-weight: 400; font-display: swap; src: url(fonts/bebas-neue-400.woff2) format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 500; font-display: swap; src: url(fonts/oswald-500.woff2) format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 600; font-display: swap; src: url(fonts/oswald-600.woff2) format('woff2'); }

[hidden] { display: none !important; }

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

html, body { margin: 0; }

body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

/* Kopbalk */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  min-height: 52px;
  flex-wrap: wrap;
}
.topbar h1 {
  flex: 1; margin: 0 4px; font-size: 20px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: 2px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent);
}
.icon-btn:active { background: var(--accent-soft); }
.icon-btn.active svg { fill: var(--accent); }
.text-btn { color: var(--accent); font-weight: 600; padding: 8px 10px; }

main { max-width: 720px; margin: 0 auto; padding: 12px 16px; }

/* Zoeken + filters */
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; color: var(--muted);
}
.search input {
  flex: 1; border: 0; background: none; color: var(--text);
  font: inherit; padding: 11px 0; outline: none; min-width: 0;
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 4px; padding: 0 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 14px; border-radius: 999px; font-size: 15px;
  background: var(--surface); border: 1px solid var(--line);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Receptenlijst: foto links, gegevens rechts, geen kaartjes */
.cards {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px;
}
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cards > li { min-width: 0; border-bottom: 1px solid var(--line); }
.card {
  display: flex; gap: 14px; align-items: center; padding: 12px 0; min-width: 0;
}
.card:active { opacity: .6; }
.thumb {
  width: 88px; height: 88px; border-radius: 14px; overflow: hidden; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 34px; font-weight: 700;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { flex: 1; min-width: 0; }
.card-title {
  font-size: 17px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}
.card-meta { color: var(--muted); font-size: 14px; margin-top: 3px; }
.card-chevron { flex: none; color: var(--line); display: grid; }
.card-chevron svg { width: 18px; height: 18px; transform: rotate(-90deg); stroke-width: 2.4; }
.fav { color: var(--accent); }
.none { color: var(--muted); text-align: center; padding: 32px 0; }

.empty { text-align: center; padding: 56px 16px; }
.empty-emoji { font-size: 56px; }
.empty h2 { margin: 8px 0 4px; }
.empty p { color: var(--muted); margin: 0 0 20px; }

/* Zwevende knop */
.fab {
  position: fixed; right: 20px; bottom: calc(20px + var(--safe-bottom));
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgb(0 0 0 / .22);
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:active { transform: scale(.94); }

/* Knoppen */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 16px; border-radius: 12px; font-weight: 600;
  background: var(--accent); color: #fff;
}
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: none; color: #d23b3b; border: 1px solid currentColor; margin-top: 12px; }
.empty .btn { width: auto; display: inline-flex; }
.link { color: var(--accent); padding: 4px 0; font-size: 15px; }
.link.danger { color: #d23b3b; }

/* Detail */
.hero {
  display: block; width: calc(100% + 32px); margin: -12px -16px 0;
  aspect-ratio: 4 / 3; object-fit: cover; max-height: 420px;
}
@media (min-width: 752px) { .hero { width: 100%; margin: 0; border-radius: var(--radius); } }
.detail-title { font-size: 28px; line-height: 1.15; margin: 16px 0 6px; }
.lead { color: var(--muted); margin: 0 0 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 14px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 16px; height: 16px; }
.pill { background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; font-weight: 600; }


h3 { font-size: 20px; margin: 26px 0 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.section-head h3 { margin-bottom: 10px; }
.copy-btn { margin: 16px auto 0 -4px; width: 34px; height: 34px; }
.copy-btn svg { width: 20px; height: 20px; transition: transform .15s; }
.copy-btn.copied svg { transform: scale(1.15); stroke-width: 2.6; }
.stepper {
  display: flex; align-items: center; gap: 4px; margin-top: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.stepper button { width: 30px; height: 34px; font-size: 22px; color: var(--accent); }
.stepper span { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; min-width: 40px; justify-content: center; }
.stepper svg { width: 18px; height: 18px; }
.cook-btn { margin: 16px 0 0; width: 36px; height: 36px; transition: background .15s, color .15s; }
.cook-btn svg { width: 23px; height: 23px; }
.cook-btn.on { background: var(--accent); color: #fff; }
.cook-btn.on:active { background: var(--accent); }

.ingredients, .steps { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.ingredients li.sub, .steps li.sub {
  border: 0; padding: 14px 0 2px; font-weight: 700; color: var(--muted);
  font-size: 13px; text-transform: uppercase; letter-spacing: .05em; cursor: default;
}
.check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  flex: none; margin-top: 1px; display: grid; place-items: center;
}
.done .check { background: var(--accent); border-color: var(--accent); }
.done .check::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.ingredients li.done > span:last-child, .steps li.done p { color: var(--done); text-decoration: line-through; }

.steps li { display: flex; gap: 14px; padding: 10px 0; cursor: pointer; }
.steps li.sub { display: block; padding-top: 18px; }
.steps p { margin: 0; }
.num {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
  display: grid; place-items: center;
}
.steps li.done .num { background: var(--line); color: var(--done); }

.notes { background: var(--surface); border-radius: 12px; padding: 12px 14px; margin: 0; border: 1px solid var(--line); }
.detail-actions { margin-top: 28px; }

/* Kookmodus: grotere tekst */
body.cook .ingredients li:not(.sub), body.cook .steps li:not(.sub) { font-size: 21px; }
body.cook .steps li { padding: 14px 0; }

/* Kookmodus: alleen naam, ingrediënten en bereiding (plus de kookmodusknop) */
body.cook .hero, body.cook .lead, body.cook .meta,
body.cook #copyBtn, body.cook .stepper,
body.cook .notes-head, body.cook .notes, body.cook .detail-actions, body.cook .source,
body.cook #topActions { display: none; }

/* Kookstand: twee schermen, te kiezen met de vaste balk bovenin */
.cook-tabs { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.segmented {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  background: var(--line); border-radius: 12px;
}
.segmented button { padding: 9px 0; border-radius: 9px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.cook-tabs .cook-btn { margin: 0; flex: none; }
body.cook .part-ingr .section-head, body.cook .part-steps > h3 { display: none; }
body.cook .ingredients, body.cook .steps { margin-top: 8px; }
body.cook.cook-tab-steps .part-ingr, body.cook:not(.cook-tab-steps) .part-steps { display: none; }
body.cook .detail-title { margin-top: 8px; }

/* Formulier */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.form label small { font-weight: 400; color: var(--muted); }
.form input:not([type=file]), .form textarea {
  font: inherit; font-size: 17px; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; width: 100%; outline: none; -webkit-appearance: none; appearance: none;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.form textarea { resize: vertical; line-height: 1.5; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-pick { cursor: pointer; }
.photo-preview {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1.5px dashed var(--line);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.photo-empty svg { width: 32px; height: 32px; }
#removePhoto { justify-self: start; margin-top: -8px; }

/* Instellingen */
.settings { display: grid; gap: 14px; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-box h3 { margin: 0 0 8px; }
.card-box p { margin: 0 0 14px; color: var(--muted); }
.card-box .btn + .btn { margin-top: 10px; }
.file-btn { cursor: pointer; }
.howto { margin: 0; padding-left: 20px; }
.howto li { margin: 4px 0; }
.howto svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }

/* Melding */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 15px;
  transition: .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.file-btn.busy { opacity: .5; pointer-events: none; }

.version { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* iPhone zoomt in op velden met tekst kleiner dan 16px */
input, textarea, select { font-size: max(16px, 1em); }

/* Heel smalle schermen: ingrediëntenkop compacter */
@media (max-width: 359px) {
  .section-head h3 { font-size: 18px; }
  .stepper svg { display: none; }
}

/* Kookwekker */
.time-chip {
  display: inline; padding: 1px 8px; margin: 0 1px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap;
}
.time-chip:active { filter: brightness(.95); }
.steps li.done .time-chip { background: none; color: inherit; }

.timer-tray {
  position: fixed; z-index: 20; left: 16px; right: 92px;
  bottom: calc(18px + var(--safe-bottom));
  display: grid; gap: 8px; pointer-events: none;
}
body.no-fab .timer-tray { right: 16px; }
@media (min-width: 752px) { .timer-tray { left: calc(50% - 344px); right: auto; width: 420px; } }
body.has-timers { padding-bottom: calc(110px + var(--tray-h, 0px) + var(--safe-bottom)); }

.timer {
  pointer-events: auto; position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 0;
  background: var(--text); color: var(--bg); border-radius: 16px;
  box-shadow: 0 6px 20px rgb(0 0 0 / .2);
}
.timer::before {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  width: var(--pct, 0%); background: var(--accent); transition: width .25s linear;
}
.timer-main { flex: 1; min-width: 0; text-align: left; padding: 6px 4px 6px 14px; color: inherit; }
.timer-label { display: block; font-size: 13px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-time { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.timer.paused .timer-time { opacity: .6; }
.timer-btn {
  flex: none; min-width: 44px; height: 40px; padding: 0 10px; border-radius: 12px;
  background: rgb(255 255 255 / .12); color: inherit; font-weight: 700; font-size: 17px;
}
.timer.done { background: var(--accent); color: #fff; animation: timer-pulse 1s ease-in-out infinite; }
.timer.done::before { display: none; }
.timer.done .timer-btn { background: #fff; color: var(--accent); padding: 0 18px; }
@keyframes timer-pulse { 50% { transform: scale(1.02); } }
@media (prefers-color-scheme: dark) { .timer-btn { background: rgb(0 0 0 / .1); } }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 0);
  display: flex; align-items: flex-end; justify-content: center; transition: background .2s;
}
.sheet-backdrop.open { background: rgb(0 0 0 / .35); }
.sheet {
  width: 100%; max-width: 520px; background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(20px + var(--safe-bottom));
  transform: translateY(100%); transition: transform .2s ease-out;
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { margin: 10px 0; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset {
  padding: 14px 0; border-radius: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.preset:active { background: var(--accent-soft); }
.sheet-custom { display: flex; gap: 8px; margin-top: 12px; }
.sheet-custom .btn { width: auto; padding: 0 22px; }
.sheet input {
  font: inherit; font-size: 17px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0; outline: none;
}
.sheet input:focus { border-color: var(--accent); }
.sheet-label { display: grid; gap: 6px; margin-top: 12px; font-weight: 600; font-size: 15px; }

.sheet-mode { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.sheet-mode .link { font-size: 15px; }
.choice { display: grid; gap: 8px; margin-bottom: 12px; }
.choice label {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.choice small { display: block; color: var(--muted); font-size: 14px; }
.howto-box summary { color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; }
.howto-box .howto { margin: 10px 0 14px; }
.howto-box .howto li { margin: 6px 0; }
.small-note { font-size: 14px; margin: 10px 0 0 !important; }

/* Categorie kiezen in het formulier */
.cat-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.cat-choices .chip { font-size: 15px; padding: 6px 12px; }

/* Online back-up */
.sync-form { display: grid; gap: 10px; }
.sync-form input {
  font: inherit; font-size: 17px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; outline: none;
}
.sync-form input:focus { border-color: var(--accent); }
.sync-form .btn:disabled { opacity: .5; }
.sync-msg { margin: 0 !important; color: var(--text) !important; font-size: 15px; }
.sync-state { font-weight: 600; margin-bottom: 6px !important; }
.sync-state.good { color: #2e7d4f !important; }
.sync-state.bad { color: #d23b3b !important; }
@media (prefers-color-scheme: dark) { .sync-state.good { color: #6cc495 !important; } }
#signOutBtn { margin-top: 10px; display: block; }
.settings-btn { position: relative; }
body.sync-problem .settings-btn::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: #d23b3b; border: 2px solid var(--bg);
}

/* Inklapbare blokken in de instellingen */
details.fold { padding: 0; }
details.fold > summary {
  display: flex; align-items: center; gap: 10px; padding: 16px; cursor: pointer;
  list-style: none; -webkit-user-select: none; user-select: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { flex: 1; margin: 0; font-size: 18px; }
.fold-badge { font-size: 14px; font-weight: 600; white-space: nowrap; }
.badge-muted { color: var(--muted); font-weight: 500; }
.badge-good { color: #2e7d4f; }
.badge-bad { color: #d23b3b; }
@media (prefers-color-scheme: dark) { .badge-good { color: #6cc495; } }
.fold-chevron { color: var(--muted); display: grid; transition: transform .2s; }
.fold-chevron svg { width: 20px; height: 20px; }
details.fold[open] > summary .fold-chevron { transform: rotate(180deg); }
.fold-body { padding: 0 16px 16px; }
.settings { gap: 10px; }

/* Favorietenfilter: alleen een hartje */
.chip-fav { display: grid; place-items: center; padding: 6px 12px; color: var(--accent); }
.chip-fav svg { width: 20px; height: 20px; }
.chip-fav.on { color: #fff; }
.chip-fav.on svg { fill: #fff; }

/* ================= Huisstijl Ricetta ================= */

/* Zachte papierstructuur */
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .28 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23p)'/%3E%3C/svg%3E");
}

/* Kop: markies, glanzende titel, dubbele kaderlijn */
.topbar {
  padding-top: calc(var(--safe-top) + 14px + 6px);
  background-color: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 4px double var(--teal);
}
.topbar::before {
  content: ''; position: absolute; left: 0; right: 0; top: var(--safe-top); height: 14px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 18px, transparent 18px 36px);
}
.topbar h1 {
  font: 400 26px/1.1 var(--font-label); text-transform: uppercase; letter-spacing: .03em;
}
body:not(.no-fab) .topbar h1 {
  font: 400 40px/1 var(--font-title); letter-spacing: .05em;
  background: linear-gradient(100deg, var(--accent-dark) 0%, var(--accent) 32%, #f0624f 46%, var(--accent) 60%, var(--accent-dark) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.icon-btn:active { background: var(--accent-soft); }

/* Zoeken en filters */
.search { border: 1.5px solid var(--text); border-radius: 2px; background: var(--surface); }
.chip {
  font: 500 14px var(--font-label); text-transform: uppercase; letter-spacing: .06em;
  border: 1.5px solid var(--text); border-radius: 3px; background: transparent; color: var(--text);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-fav { color: var(--accent); }

/* Receptenlijst: rechte foto's zonder rand */
.cards > li { border-bottom-color: var(--line); }
.thumb { border-radius: 0; background: #ecdfca; color: var(--accent); font: 400 44px var(--font-title); }
@media (prefers-color-scheme: dark) { .thumb { background: #3a2d23; } }
.card-title { font: 500 18px/1.22 var(--font-label); text-transform: uppercase; letter-spacing: .01em; }
.card-meta { font: 500 12px var(--font-label); text-transform: uppercase; letter-spacing: .14em; color: var(--mustard); margin-top: 5px; }
.card-chevron { color: var(--muted); opacity: .5; }

/* Knoppen */
.fab { border-radius: 6px; box-shadow: none; }
.btn { border-radius: 3px; font: 500 16px var(--font-label); text-transform: uppercase; letter-spacing: .06em; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.text-btn { font-family: var(--font-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }

/* Recept */
.hero { border-radius: 0 !important; }
@media (min-width: 752px) { .hero { width: calc(100% + 32px); margin: -12px -16px 0; } }
.detail-title { font: 400 40px/1 var(--font-title); letter-spacing: .02em; margin: 18px 0 8px; }
.lead { font-style: italic; }
.pill { background: var(--accent); color: #fff; border-radius: 2px; font: 500 12px var(--font-label); text-transform: uppercase; letter-spacing: .12em; padding: 3px 8px; }
.meta { font: 500 12px var(--font-label); text-transform: uppercase; letter-spacing: .12em; color: var(--mustard); }
.meta svg { width: 14px; height: 14px; }
.tag { color: var(--muted); text-transform: none; letter-spacing: 0; font: 400 14px -apple-system, system-ui, sans-serif; }

/* Kopjes als strak rood lint */
.detail h3, .detail-ribbon {
  display: inline-block; background: var(--accent); color: #fffdf8;
  font: 400 22px/1 var(--font-title); letter-spacing: .12em; padding: 7px 14px 5px; margin: 26px 0 10px;
}
.section-head h3 { margin-bottom: 10px; }
.stepper { border: 1.5px solid var(--text); border-radius: 3px; background: var(--surface); }
.stepper span { font-family: var(--font-label); font-weight: 500; }
.stepper button { color: var(--text); }
.cook-btn { border-radius: 4px; }
.check { border-radius: 2px; border: 1.5px solid var(--text); }
.ingredients li, .steps li { border-bottom: 1px dashed var(--line); }
.ingredients li.sub, .steps li.sub { font: 500 13px var(--font-label); letter-spacing: .14em; color: var(--mustard); border: 0; }
.num { border-radius: 2px; background: transparent; color: var(--accent); font: 400 24px/1 var(--font-title); width: 26px; place-items: start center; }
.steps li.done .num { background: transparent; color: var(--done); }
.notes { border-radius: 2px; border-color: var(--line); }
.time-chip { border-radius: 3px; }

/* Kookstand-balk */
.segmented { border-radius: 4px; background: var(--line); }
.segmented button { font: 500 15px var(--font-label); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; }
.segmented button.on { box-shadow: none; }

/* Formulier en instellingen */
.form input:not([type=file]), .form textarea, .sheet input, .sync-form input { border-radius: 3px; }
.form label { font-family: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
.form label small { text-transform: none; letter-spacing: 0; font-family: -apple-system, system-ui, sans-serif; }
.photo-preview { border-radius: 0; }
.card-box { border-radius: 4px; }
details.fold > summary h3 { font: 500 17px var(--font-label); text-transform: uppercase; letter-spacing: .06em; }
.choice label { border-radius: 4px; }
.preset { border-radius: 3px; font-family: var(--font-label); }
.sheet { border-radius: 8px 8px 0 0; }
.sheet-head h3 { font: 400 26px var(--font-title); letter-spacing: .06em; }
.timer { border-radius: 6px; }
.timer-time { font-family: var(--font-label); font-weight: 600; }
.empty h2 { font: 400 34px var(--font-title); letter-spacing: .04em; }
/* Invulvelden houden de gewone, goed leesbare letter */
.form input:not([type=file]), .form textarea, .sheet input, .sync-form input, .search input {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  text-transform: none; letter-spacing: normal;
}

/* Recept toevoegen (plusknop) */
.add-sheet { max-height: 88vh; overflow-y: auto; }
.add-part h4 { margin: 8px 0 8px; font: 500 15px var(--font-label); text-transform: uppercase; letter-spacing: .1em; color: var(--mustard); }
.add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.add-row input { flex: 1; }
.btn.small { width: auto; padding: 0 16px; }
.add-msg { margin: 10px 0 0; font-size: 15px; line-height: 1.4; }
.add-msg.warn { color: var(--text); background: var(--accent-soft); padding: 10px 12px; border-radius: 3px; }
.add-msg.bad { color: #d23b3b; }
.add-msg a { color: var(--accent); font-weight: 600; }
.add-help { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.add-part textarea {
  width: 100%; font: 16px/1.4 -apple-system, system-ui, sans-serif; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; margin-bottom: 10px; resize: vertical;
}
.add-part + .add-part { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.add-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--muted); font: 500 13px var(--font-label); text-transform: uppercase; letter-spacing: .14em; }
.add-or::before, .add-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.add-alt { display: grid; gap: 6px; justify-items: center; }
.btn:disabled { opacity: .6; }
.source { margin: 22px 0 0; font-size: 14px; color: var(--muted); }
.source a { color: var(--accent); }

/* Boodschappenlijst */
.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font: 600 11px/18px var(--font-label); text-align: center;
}
.shop-add { display: flex; gap: 8px; margin: 4px 0 8px; }
.shop-add input {
  flex: 1; min-width: 0; font: 17px -apple-system, system-ui, sans-serif; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--text); border-radius: 2px; padding: 11px 12px; outline: none;
}
.shop-add .btn.small { font-size: 24px; padding: 0 18px; }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.shop-text { flex: 1; min-width: 0; }
.shop-text { font-size: 18px; line-height: 1.3; color: var(--text); }
.shop-text b { font-weight: 700; }
.shop-text small { display: block; margin-top: 3px; font: italic 400 13px/1.3 -apple-system, system-ui, sans-serif; color: var(--muted); }
.shop-item.done .shop-text { color: var(--done); text-decoration: line-through; }
.shop-item.done .shop-text small { text-decoration: none; }
.shop-del { flex: none; width: 32px; height: 28px; margin: -3px -6px 0 0; color: var(--muted); font-size: 22px; line-height: 1; }
.shop-done-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 22px; }
.shop-done-head h3 { margin: 0; font: 500 15px var(--font-label); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.shop-actions { display: grid; gap: 10px; justify-items: center; margin-top: 26px; }
.shop .empty { padding: 40px 16px; }

/* Heel smalle schermen: porties en kookstand onder het lint */
@media (max-width: 359px) {
  .section-head { flex-wrap: wrap; row-gap: 0; }
  .section-head h3 { margin-bottom: 4px; }
  .section-head .stepper { margin-left: auto; margin-top: 4px; }
  .section-head .cook-btn { margin-top: 4px; }
}

/* Gang (voor-, tussen-, hoofd-, nagerecht, patisserie) */
.course-chips { margin-top: 10px; margin-bottom: -4px; }
.chip-course { border-style: dashed; }
.chip-course.on { background: var(--text); border-color: var(--text); border-style: solid; color: var(--bg); }
.pill.pill-course { background: var(--text); color: var(--bg); }
.field { display: grid; gap: 8px; }
.field-label { font: 500 14px var(--font-label); text-transform: uppercase; letter-spacing: .06em; }
.field-label small { text-transform: none; letter-spacing: 0; font: 400 13px -apple-system, system-ui, sans-serif; color: var(--muted); }
.course-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.course-choices .chip { font-size: 15px; padding: 6px 12px; }

/* Instellingen → Gangen */
.course-admin { list-style: none; margin: 0 0 12px; padding: 0; }
.course-admin li { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ca-name { flex: 1; min-width: 0; font: 500 16px var(--font-label); text-transform: uppercase; letter-spacing: .05em; }
.ca-name small { display: block; font: 400 12px -apple-system, system-ui, sans-serif; text-transform: none; letter-spacing: 0; color: var(--muted); }
.ca-btn { width: 36px; height: 34px; border-radius: 3px; color: var(--text); font-size: 18px; }
.ca-btn:disabled { opacity: .25; }
.ca-btn:active:not(:disabled) { background: var(--accent-soft); }
.ca-del { color: var(--accent); font-size: 22px; }

/* Postvak: recepten uit Safari */
.inbox-banner {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; padding: 10px 6px 10px 14px;
  background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 2px;
}
.inbox-text { flex: 1; min-width: 0; font-size: 15px; }
.inbox-text small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-banner .btn.small { padding: 8px 14px; font-size: 14px; }
.inbox-del { width: 34px; height: 34px; color: var(--muted); font-size: 22px; flex: none; }
.howto code { font: 600 14px ui-monospace, Menlo, monospace; background: var(--line); padding: 1px 5px; border-radius: 2px; }

/* Instellingen: icoontje voor de kopjes, tussenkopjes in een blok */
.fold-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; color: var(--accent); }
.fold-icon svg { width: 22px; height: 22px; }
.sub-head { margin: 4px 0 8px; font: 500 14px var(--font-label); text-transform: uppercase; letter-spacing: .1em; color: var(--mustard); }
.sub-head ~ .sub-head { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }

/* Gang hernoemen */
.ca-edit svg { width: 17px; height: 17px; }
.ca-rename { display: flex; align-items: center; gap: 4px; flex: 1; }
.ca-rename input {
  flex: 1; min-width: 0; font: 17px -apple-system, system-ui, sans-serif; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--text); border-radius: 2px; padding: 7px 10px; outline: none;
}
.ca-ok { color: var(--accent); font-size: 20px; font-weight: 700; }
/* Gangenlijst past ook met vijf knopjes: smallere knopjes, lange naam inkorten */
.course-admin li { gap: 2px; }
.course-admin .ca-btn { width: 32px; flex: none; }
.ca-name { overflow: hidden; }
.ca-name, .ca-name small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* Instellingen: raster nooit breder dan het scherm */
.settings { grid-template-columns: minmax(0, 1fr); }
.ca-rename { min-width: 0; }
.ca-rename input { width: 0; }

/* Kruisje in het zoekveld */
.search-clear {
  flex: none; align-self: stretch; width: 36px; margin-right: -8px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--muted);
}
.search-clear[hidden] { display: none; }
.search-clear svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.search-clear:active { color: var(--text); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

/* Eet smakelijk! als banner (zoals op het app-icoon), na de laatste afgestreepte stap */
.bon-appetit {
  display: flex; justify-content: center; margin: 28px 0 10px; padding: 6px 0 12px;
  isolation: isolate; /* staartjes achter het lint, maar boven de achtergrond */
}
.bon-appetit[hidden] { display: none; }
.ba-ribbon { position: relative; display: block; animation: ba-bounce .9s cubic-bezier(.3, 0, .3, 1) both; }
.ba-band {
  position: relative; z-index: 1; display: block;
  background: var(--accent); color: #fff8ee;
  font: 400 32px/1 var(--font-title); letter-spacing: .07em; white-space: nowrap;
  padding: 10px 26px 8px;
  outline: 1.5px solid rgba(255, 248, 238, .85); outline-offset: -5px;
}
.ba-ribbon::before, .ba-ribbon::after {
  content: ''; position: absolute; z-index: 0; top: 10px; height: 100%; width: 34px;
  background: color-mix(in srgb, var(--accent) 70%, #000);
}
.ba-ribbon::before { left: -24px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 32% 50%); }
.ba-ribbon::after { right: -24px; clip-path: polygon(0 0, 100% 0, 68% 50%, 100% 100%, 0 100%); }
@keyframes ba-bounce {
  0%   { opacity: 0; transform: translateY(-40px) scale(.6); }
  35%  { opacity: 1; transform: translateY(0) scale(1.08); }
  52%  { transform: translateY(-14px) scale(.98); }
  68%  { transform: translateY(0) scale(1.02); }
  82%  { transform: translateY(-5px); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .ba-ribbon { animation: none; } }

/* Kookstand bereiding: vorige stappen lichter, huidige stap uitgelicht en in het midden */
body.cook .steps li:not(.sub) { transition: opacity .3s, background-color .3s; }
body.cook .steps li.done p { text-decoration: none; color: var(--text); }
body.cook .steps li.done { opacity: .35; }
body.cook .steps li.done .num { color: var(--accent); }
body.cook .steps li.current {
  background: var(--surface); margin: 0 -12px; padding: 18px 12px 18px 9px;
  border-left: 3px solid var(--accent); border-bottom-color: transparent;
  box-shadow: 0 1px 0 var(--line), 0 -1px 0 var(--line);
}
body.cook .steps li.current p { font-weight: 600; }
body.cook .steps li.current .num { font-size: 30px; }
body.cook .part-steps { padding-bottom: 40vh; } /* ruimte zodat ook de laatste stap in het midden kan */

/* ================= Magazine op iPad en laptop ================= */
.list-tools { display: flex; gap: 12px; align-items: stretch; }
.list-tools .search { flex: 1; min-width: 0; }
.surprise, .add-top { display: none; }

@media (min-width: 700px) {
  body[data-page=list] { --page-w: 1320px; }
  body[data-page=list] main { max-width: var(--page-w); padding: 22px 32px 64px; }
  body[data-page=list] .topbar { padding-left: max(24px, calc((100% - var(--page-w)) / 2 + 24px)); padding-right: max(24px, calc((100% - var(--page-w)) / 2 + 32px)); }
  body[data-page=list] .fab { display: none; }
  body[data-page=list] .topbar-actions { align-items: center; gap: 6px; }
  .add-top {
    display: grid; place-items: center; width: 44px; height: 44px; margin-left: 6px;
    background: var(--accent); color: #fff; border-radius: 3px;
  }
  .add-top svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
  .add-top:active { background: var(--accent-dark); }
  .list-tools .search { max-width: 620px; }
  .surprise {
    display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 3px;
    border: 1.5px solid var(--accent); color: var(--accent);
    font: 500 15px var(--font-label); letter-spacing: .08em; text-transform: uppercase;
  }
  .surprise svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .surprise:active { background: var(--accent-soft); }
  body[data-page=list] .chips { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
  body[data-page=list] .chip { cursor: pointer; }

  .cards.mag {
    margin-top: 26px; display: grid; gap: 26px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cards.mag > li { border: 0; }
  .cards.mag > li.none { grid-column: 1 / -1; }

  /* Uitgelicht recept: foto + witte pagina met vaandel, in een gouden lijst met een zachte schaduw */
  .mag-hero {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr);
    background: var(--surface); margin: 6px 0 22px;   /* even breed als de kolommen eronder */
  }
  .cards.mag > li.mag-hero {
    border: 7px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box,
      linear-gradient(135deg, #8f6b1e 0%, #e9c96f 22%, #b08427 45%, #f5e2a0 62%, #a57a22 82%, #d9b45a 100%) border-box;
    box-shadow: inset 0 0 0 1px rgba(143, 107, 30, .5), 0 14px 30px -12px rgba(60, 40, 10, .35);
  }
  .mh-photo { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
  .mh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .mh-text { padding: 28px 34px 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
  .mh-lead { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 52ch; }
  .mh-actions { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
  .mh-open { width: auto; padding: 12px 24px; }
  .mh-next { font: 500 15px var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 10px 0; }
  .mag-kicker { font: 500 13px var(--font-label); letter-spacing: .18em; text-transform: uppercase; color: var(--mustard); }
  .mag-meta { font: 500 13px var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

  /* Vaandel met gevouwen staartjes, zoals op het app-icoon */
  .flag { position: relative; isolation: isolate; margin: 4px 30px 10px 26px; max-width: calc(100% - 56px); font-weight: 400; }
  .flag a, .flag > span {
    position: relative; z-index: 1; display: block; background: var(--accent); color: #fff8ee;
    font: 400 clamp(40px, 4.6vw, 62px)/1 var(--font-title); letter-spacing: .04em;
    padding: 14px 26px 10px; outline: 2px solid rgba(255, 248, 238, .85); outline-offset: -7px;
    overflow-wrap: anywhere;
  }
  .flag::before, .flag::after {
    content: ''; position: absolute; z-index: 0; top: 14px; height: 100%; width: 40px;
    background: color-mix(in srgb, var(--accent) 70%, #000);
  }
  .flag::before { left: -28px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 32% 50%); }
  .flag::after { right: -28px; clip-path: polygon(0 0, 100% 0, 68% 50%, 100% 100%, 0 100%); }

  /* Receptkaarten: vierkante foto met papieren label */
  .mag-card a { display: block; position: relative; }
  .mc-photo { aspect-ratio: 1; overflow: hidden; background: #ecdfca; display: grid; place-items: center; }
  .mc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
  .mag-nophoto { color: var(--muted); opacity: .5; }
  .mag-nophoto svg { width: 72px; height: 72px; fill: none; stroke: currentColor; stroke-width: 1.2; }
  .mc-fav {
    position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--accent); display: grid; place-items: center;
  }
  .mc-fav svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
  .mc-label {
    position: absolute; left: 14px; right: 14px; bottom: 14px; text-align: center;
    background: var(--surface); padding: 11px 12px 10px; outline: 3px double var(--teal); outline-offset: -6px;
  }
  .mc-label h3 {
    margin: 3px 0 2px; font: 400 26px/1.02 var(--font-title); letter-spacing: .03em; color: var(--text);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere;
  }
  .mc-label .mag-kicker { font-size: 11px; }
  .mc-label .mag-meta { font-size: 11px; }
  @media (hover: hover) {
    .mag-card a:hover img, .mh-photo:hover img { transform: scale(1.035); }
    .mh-photo img { transition: transform .5s ease; }
  }
  .mag-card a:active { opacity: .85; }
}
@media (min-width: 700px) and (prefers-color-scheme: dark) { .mc-photo { background: #3a2d23; } }

/* iPad liggend en laptop: foto en pagina naast elkaar, 3 kolommen met grote kaarten */
@media (min-width: 1000px) {
  .cards.mag { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mag-card.big a, .mag-card.big .mc-photo { height: 100%; aspect-ratio: auto; }
  .mag-card.big .mc-label h3 { font-size: 40px; }
  .mag-card.big .mc-label { left: 18px; right: 18px; bottom: 18px; padding: 14px 16px 12px; }
  .mag-hero { grid-template-columns: 3fr 2fr; }
  .mh-photo { aspect-ratio: 4 / 3; }
  .mh-text { justify-content: center; padding: 36px 34px 34px 0; }
  .mh-text > :not(.flag) { margin-left: 34px; }
  .mag-hero .flag { margin-left: -26px; } /* vaandel steekt over de foto heen */
}
@media (min-width: 1380px) { .cards.mag { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Titel-label boven als het eten onderin de foto staat */
@media (min-width: 700px) {
  .mc-label { transition: opacity .25s; }
  .mag-card.focusing .mc-label { opacity: 0; }
  .mag-card.label-top .mc-label { top: 14px; bottom: auto; }
  .mag-card.label-top .mc-fav { top: auto; bottom: 12px; }
}
@media (min-width: 1000px) {
  .mag-card.big.label-top .mc-label { top: 18px; bottom: auto; }
}

/* Uitsnede: foto geschoven/ingezoomd binnen het vierkant */
@media (min-width: 700px) {
  .mc-photo, .mh-photo { position: relative; }
  .mc-photo img.cropped, .mh-photo img.cropped { position: absolute; max-width: none; object-fit: fill; }
  .mag-card.big a { height: 100%; }
  .mag-card.big .mc-photo { height: 100%; }
  /* Opvultegel: zelfde vierkant, papier met kader */
  .mag-filler { min-width: 0; }
  .mag-filler button {
    width: 100%; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface); outline: 3px double var(--teal); outline-offset: -10px; color: var(--accent); padding: 20px; text-align: center;
  }
  .mag-filler svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mag-filler b { font: 400 30px/1 var(--font-title); letter-spacing: .05em; }
  .mag-filler small { font: 500 12px var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .mag-filler button:active { background: var(--accent-soft); }
}

/* iPad en laptop: zoekbalk en filters blijven bovenaan staan */
@media (min-width: 700px) {
  body[data-page=list] .list-head {
    position: sticky; top: calc(var(--topbar-h, 72px) - 2px); z-index: 5;   /* 2px onder de kop schuiven: geen kier */
    margin-top: -22px; padding: 18px 0 14px;
    background: var(--bg);
  }
  /* balk over de volle breedte met dubbele turquoise lijn; inhoud blijft in het midden */
  body[data-page=list] { --gutter: max(32px, calc((100% - var(--page-w)) / 2 + 32px)); }
  body[data-page=list] main { max-width: none; padding-left: 0; padding-right: 0; }
  body[data-page=list] .topbar { background-color: var(--bg); }   /* kop en filters één vlak */
  body[data-page=list] .list-head { padding-left: var(--gutter); padding-right: var(--gutter); }
  body[data-page=list] .cards, body[data-page=list] .inbox-banner, body[data-page=list] .empty { margin-left: var(--gutter); margin-right: var(--gutter); }
}

/* Zoeken en filters in- en uitklappen */
.list-head { display: grid; grid-template-rows: 1fr; }   /* de animatie zit in foldFilters() */
.list-head.closed { grid-template-rows: 0fr; padding-top: 2px !important; padding-bottom: 0 !important; }
.lh-inner { min-height: 0; overflow: hidden; padding: 2px 16px; margin: -2px -16px; }   /* ruimte voor focusranden en de veegbalk tot de rand */
@media (min-width: 700px) { .lh-inner { padding: 2px; margin: -2px; } }
.list-head.closed .lh-inner { visibility: hidden; }
.filter-toggle { position: relative; }
.filter-toggle svg { fill: none; }
.filter-toggle.on { background: var(--accent-soft); }
.filter-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* Mooiere regelval in titels (regels ongeveer even lang) */
.flag a, .mc-label h3 { text-wrap: balance; }

/* iPhone: zoeken en filters blijven nu ook bovenaan staan (in te klappen met het filtericoon) */
@media (max-width: 699.98px) {
  body[data-page=list] .topbar { background-color: var(--bg); }
  body[data-page=list] .list-head {
    position: sticky; top: calc(var(--topbar-h, 72px) - 2px); z-index: 5;
    margin: -12px -16px 12px; padding: 14px 16px 10px;
    background: var(--bg);
  }
}

/* Schaduwrandje onder het uitgeklapte filtermenu: verschil met de pagina die eronder scrolt */
body[data-page=list] .list-head { box-shadow: 0 8px 10px -8px rgba(40, 20, 10, .28); }
body[data-page=list] .list-head.closed { box-shadow: none; }

/* Titel in het vaandel gecentreerd */
.flag a, .flag > span { text-align: center; }

/* iPad en laptop: logo twee keer zo groot, met hetzelfde verloopje als op de iPhone
   (de titel is daar net zo breed als het woord, zodat het verloop niet over de hele kop wordt uitgerekt) */
@media (min-width: 700px) {
  body:not(.no-fab) .topbar h1 {
    flex: 0 1 auto; margin-right: auto; padding-right: .3em;
    font-size: 80px; line-height: .95;
    background-size: 125% 100%;
  }
}

/* Receptpagina op iPad liggend en laptop: foto (met titel) links vast, recept rechts dat scrolt.
   In de kookmodus en op smallere schermen blijft alles onder elkaar. */
@media (min-width: 900px) {
  /* foto staat vast op het scherm (ook aan het eind van de pagina); het recept krijgt de rechterkant */
  body[data-page=detail]:not(.cook) main { max-width: none; padding: 0 0 0 40%; }
  body[data-page=detail]:not(.cook) .photo-col {
    position: fixed; left: 0; top: var(--topbar-h); width: 40%; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h));
    overflow: hidden; background: #2a1a10;
  }
  body[data-page=detail]:not(.cook) .photo-col.no-photo {
    background: repeating-linear-gradient(45deg, #2a1a10 0 22px, #33210f 22px 44px);
  }
  body[data-page=detail]:not(.cook) .photo-col .hero {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0 !important;
    max-height: none; max-width: none; aspect-ratio: auto; object-fit: cover;
  }
  /* uitsnede zo dat het eten boven de titel valt (berekend in PhotoFocus) */
  body[data-page=detail]:not(.cook) .photo-col .hero.cropped { right: auto; bottom: auto; object-fit: fill; }
  body[data-page=detail]:not(.cook) .photo-cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 140px 36px 34px;
    background: linear-gradient(to top, rgba(20, 10, 5, .85), rgba(20, 10, 5, .55) 55%, transparent);
    color: #fff8ee;
  }
  body[data-page=detail]:not(.cook) .photo-cap .detail-title {
    color: #fff8ee; font-size: clamp(44px, 4vw, 64px); margin: 0 0 10px; text-wrap: balance; overflow-wrap: anywhere;
  }
  body[data-page=detail]:not(.cook) .photo-cap .lead { color: rgba(255, 248, 238, .9); font-size: 18px; margin: 0 0 14px; }
  body[data-page=detail]:not(.cook) .photo-cap .meta,
  body[data-page=detail]:not(.cook) .photo-cap .meta span,
  body[data-page=detail]:not(.cook) .photo-cap .tag { color: #fff8ee; }
  body[data-page=detail]:not(.cook) .photo-cap .meta svg { stroke: #fff8ee; }
  body[data-page=detail]:not(.cook) .photo-cap .pill { background: var(--accent); color: #fff; }
  body[data-page=detail]:not(.cook) .photo-cap .pill.pill-course { background: #fff8ee; color: #2a1a10; }
  body[data-page=detail]:not(.cook) .detail { padding: 44px clamp(32px, 4vw, 64px) 96px; max-width: 760px; }
  body[data-page=detail]:not(.cook) .part-steps { margin-top: 36px; }
}

/* Receptpagina iPad/laptop: kop staat (net als de foto) vast aan het scherm, zodat hij bij het
   omlaagtrekken van de pagina (rubberband op de iPad) niet over de foto schuift. */
@media (min-width: 900px) {
  html:has(body[data-page=detail]:not(.cook)), body[data-page=detail]:not(.cook) { overscroll-behavior-y: none; }
  body[data-page=detail]:not(.cook) .topbar { position: fixed; left: 0; right: 0; top: 0; }
  body[data-page=detail]:not(.cook) main { margin-top: var(--topbar-h); }
}

/* Kookstand op iPad liggend en laptop: gesplitst scherm met een rode lijn. Links de naam en de
   ingrediënten, rechts de bereiding; elk scrolt apart. Geen schakelknoppen zoals op de iPhone. */
@media (min-width: 900px) {
  html:has(body.cook), body.cook { overflow: hidden; overscroll-behavior: none; }
  body.cook #cookTabs { flex-basis: auto; margin-left: auto; padding-top: 0; }
  body.cook #cookTabs .segmented { display: none; }
  body.cook main {
    max-width: none; padding: 0; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h));
    display: grid; grid-template-columns: minmax(340px, 40%) 1fr; grid-template-rows: auto minmax(0, 1fr);
  }
  body.cook .detail { display: contents; }
  body.cook .photo-col { grid-column: 1; grid-row: 1; padding: 28px 36px 6px; }
  body.cook .detail-title { margin: 0; font-size: 44px; text-wrap: balance; }
  body.cook .part-ingr, body.cook.cook-tab-steps .part-ingr {
    grid-column: 1; grid-row: 2; display: block; overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 36px 48px;
  }
  body.cook .part-steps, body.cook:not(.cook-tab-steps) .part-steps {
    grid-column: 2; grid-row: 1 / 3; display: block; overflow-y: auto; overscroll-behavior: contain;
    padding: 28px 44px 40vh; border-left: 1.5px solid var(--accent);
  }
  body.cook .part-ingr .section-head { display: flex; }
  body.cook .part-ingr .section-head > :not(h3) { display: none; }
  body.cook .part-steps > h3 { display: inline-block; margin-top: 0; }
  body.cook .ingredients li:not(.sub) { font-size: 19px; }
}

/* Kookstand: geen receptnaam in de kopbalk (die staat al in beeld); terug-pijltje, schakelknoppen
   en koksmuts op één regel */
body.cook #title { display: none; }

/* Kookstand op iPad liggend en laptop: aantal personen in de kopbalk, links van de koksmuts
   (op de iPhone en iPad staand niet) */
.cook-tabs .cook-stepper { display: none; }
@media (min-width: 900px) { body.cook .cook-tabs .cook-stepper { display: flex; flex: none; margin: 0; height: 36px; } }
.cook-stepper button { width: 28px; height: 100%; }
.cook-stepper span { min-width: 34px; }

/* Kookstand: 'Eet smakelijk!' / 'Proost!' groter en verticaal gecentreerd in de lege ruimte onder de
   laatste stap (die ruimte is er zodat ook de laatste stap in het midden kan staan) */
body.cook.cook-tab-steps .part-steps { display: flex; flex-direction: column; padding-bottom: 0; }
@media (min-width: 900px) {
  body.cook .part-steps, body.cook:not(.cook-tab-steps) .part-steps { display: flex; flex-direction: column; padding-bottom: 0; }
}
body.cook .part-steps > h3 { align-self: flex-start; }
body.cook .part-steps::after { content: ''; flex: none; height: 40vh; }
body.cook .part-steps:has(> .bon-appetit:not([hidden]))::after { display: none; }
body.cook .bon-appetit { flex: 1 0 40vh; align-items: center; margin: 0; padding: 0; }
body.cook .ba-band { font-size: min(44px, 10vw); padding: 13px 34px 10px; outline-offset: -6px; }
body.cook .ba-ribbon::before, body.cook .ba-ribbon::after { top: 13px; width: 44px; }
body.cook .ba-ribbon::before { left: -32px; }
body.cook .ba-ribbon::after { right: -32px; }
@media (min-width: 900px) {
  body.cook .ba-band { font-size: 68px; padding: 18px 50px 13px; outline-width: 2px; outline-offset: -8px; }
  body.cook .ba-ribbon::before, body.cook .ba-ribbon::after { top: 18px; width: 64px; }
  body.cook .ba-ribbon::before { left: -46px; }
  body.cook .ba-ribbon::after { right: -46px; }
}

/* ---------- Account: welkom, inloggen, gebruikers ---------- */
body[data-page=welcome] #title { visibility: hidden; }
.acc-welcome { max-width: 420px; margin: 0 auto; min-height: calc(100vh - var(--topbar-h) - 40px); display: flex; flex-direction: column; justify-content: center; padding: 8px 8px 40px; }
.acc-flag { align-self: center; position: relative; isolation: isolate; margin: 0 30px 26px; }
.acc-flag span { position: relative; z-index: 1; display: block; background: var(--accent); color: #fff8ee; font: 400 46px/1 var(--font-title); letter-spacing: .06em; padding: 14px 30px 10px; outline: 2px solid rgba(255, 248, 238, .85); outline-offset: -7px; }
.acc-flag::before, .acc-flag::after { content: ''; position: absolute; z-index: 0; top: 14px; height: 100%; width: 40px; background: color-mix(in srgb, var(--accent) 70%, #000); }
.acc-flag::before { left: -28px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 32% 50%); }
.acc-flag::after { right: -28px; clip-path: polygon(0 0, 100% 0, 68% 50%, 100% 100%, 0 100%); }
.acc-lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.acc-form { display: grid; gap: 10px; }
.acc-form label { display: grid; gap: 6px; font: 500 12px var(--font-label); text-transform: uppercase; letter-spacing: .12em; color: var(--mustard); }
.acc-form input { font: inherit; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--text); padding: 12px 14px; border: 1.5px solid var(--text); border-radius: 2px; background: var(--surface); outline: none; width: 100%; min-width: 0; }
.acc-form input:focus { border-color: var(--accent); }
.acc-form .btn { margin-top: 8px; }
.acc-form .btn:disabled { opacity: .5; }
.acc-note { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 0 0; line-height: 1.6; }
.acc-note .link { font-size: 14px; }
.acc-who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.acc-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff8ee; display: grid; place-items: center; font: 400 24px/1 var(--font-title); flex: none; }
.acc-who b, .users b { display: block; font-size: 17px; }
.acc-who small, .users small { color: var(--muted); font-size: 13px; }
.acc-role { font: 500 11px var(--font-label); letter-spacing: .1em; text-transform: uppercase; background: var(--text); color: var(--bg); padding: 2px 6px; border-radius: 2px; margin-left: 4px; vertical-align: 2px; }
.acc-actions { display: grid; gap: 10px; margin-bottom: 6px; }
.card-box .acc-actions .btn + .btn { margin-top: 0; }
#syncCard > .link { display: block; margin-top: 12px; }
#syncCard .small-note { margin-top: 10px; }
.users { list-style: none; margin: 0 0 16px; padding: 0; }
.users li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.users-text { flex: 1; min-width: 0; }
.users-more { font-size: 22px; color: var(--accent); }
.acc-sheet .btn { margin-top: 12px; }
.acc-sheet .btn.danger { margin-top: 18px; }
.acc-sheet-text { color: var(--muted); font-size: 15px; margin: 10px 0; }
.acc-sheet .sync-msg { margin: 10px 0 0; }
.pw-box { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 12px 14px; border: 1.5px dashed var(--accent); background: var(--surface); }
.pw-box > div { flex: 1; min-width: 0; }
.pw-box small { display: block; font: 500 11px var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--mustard); }
.pw-box b { font-size: 19px; overflow-wrap: anywhere; }
.pw-box .pw-mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .03em; }

/* ---------- Vegetarisch en vegan: logo met tekst ---------- */
/* Tekst in dezelfde letter als de labels (Hoofdgerecht, Soep…), alleen in het groen */
.diet { display: inline-flex; align-items: center; gap: .4em; vertical-align: middle; white-space: nowrap; line-height: 1; margin-right: .7em; cursor: help; }
.diet svg { width: 1.5em; height: 1.5em; flex: none; fill: initial; overflow: visible; }
.diet svg use, symbol[id^=diet-] { overflow: visible; }
/* Alleen het logo (in de overzichten): iets omhoog, optisch midden van de hoofdletters ernaast */
.diet:not(:has(.diet-text)) svg { transform: translateY(-.12em); }
.diet svg, .diet svg * { stroke: none !important; }   /* geen lichte rand van de andere iconen */
.diet-text { font-family: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: #008C44; }
.diet .diet-text { color: #008C44; }
.meta .diet { margin-right: 0; }
.diet:not(:has(.diet-text)) { margin-right: .5em; }
.diet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 50%; }
/* Op de donkere foto (receptpagina iPad/laptop) */
@media (min-width: 900px) {
  body[data-page=detail]:not(.cook) .photo-cap .meta .diet-vegan .diet-text { color: #FFF200; }
  body[data-page=detail]:not(.cook) .photo-cap .meta .diet-vegetarisch .diet-text { color: #7DDC9F; }
}
/* Filterknoppen */
.chip-diet { display: inline-flex; align-items: center; }
.chip-diet .diet { margin: 0; cursor: pointer; }
.chip-diet .diet-text { padding-top: .08em; }   /* hoofdletters optisch in het midden naast het logo */
.chip-diet.on .diet-text { color: #fff; }
/* Bewerken: vinkjes naast Porties */
.diet-pick { display: grid; gap: 8px; align-content: end; }
.diet-check { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; cursor: pointer; }
.diet-check .diet { margin: 0; cursor: pointer; }
/* Uitleg bij het logo */
.tip { position: fixed; z-index: 50; max-width: min(300px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 14px; line-height: 1.35; box-shadow: 0 4px 14px rgb(0 0 0 / .2);
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.tip.on { opacity: 1; transform: none; }
.form .diet-check input[type=checkbox] {
  -webkit-appearance: auto; appearance: auto; width: 22px; height: 22px; min-width: 0; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; flex: none; accent-color: #008C44;
}

/* Bewerken op iPad/laptop: Vegetarisch en Vegan naast elkaar */
@media (min-width: 700px) {
  .diet-pick { display: flex; align-items: flex-end; gap: 24px; padding-bottom: 10px; }
}

/* Uitgelicht recept: VEGAN/VEGETARISCH en de gang/categorieën op precies dezelfde hoogte */
.mag-hero .mag-kicker:has(.diet) { display: inline-flex; align-items: center; flex-wrap: wrap; row-gap: 4px; }
.mag-hero .mag-kicker .diet-text { letter-spacing: inherit; }

/* ---------- Recepten koppelen ---------- */
.ingredients .ing-link { color: var(--accent); text-decoration: underline dotted 1.5px; text-underline-offset: 3px; }
.ing-go { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 7px 1px; border-radius: 3px; background: var(--accent-soft); color: var(--accent);
  font: 500 11px var(--font-label); letter-spacing: .1em; text-transform: uppercase; vertical-align: 2px; white-space: nowrap; }
.ingredients li.done .ing-link, .ingredients li.done .ing-go { color: inherit; }
.links-box { margin: 34px 0 12px; }
.links-box h3 { margin-bottom: 4px; }
.links-sub { font: 500 12px var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--mustard); margin: 14px 0 8px; }
.link-cards { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; }
.link-cards::-webkit-scrollbar { display: none; }
.link-card { flex: none; width: 140px; display: block; background: var(--surface); outline: 3px double var(--teal); outline-offset: -6px; color: var(--text); }
.link-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.link-nophoto, .pick-nophoto { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.link-nophoto { aspect-ratio: 1; }
.link-nophoto svg { width: 44px; height: 44px; }
.link-card b { display: block; padding: 8px 10px 11px; font: 400 18px/1.05 var(--font-title); letter-spacing: .02em; text-align: center; overflow-wrap: anywhere; }
.link-card:active { transform: scale(.98); }
@media (min-width: 700px) { .link-cards { flex-wrap: wrap; overflow: visible; margin: 0; padding: 4px 0 6px; } .link-card { width: 160px; } }
body.cook .links-box { display: none; }
/* Bewerken */
.field-links { display: grid; gap: 8px; }
.field-label { font-family: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
.field-label small { font-weight: 400; text-transform: none; letter-spacing: 0; font-family: -apple-system, system-ui, sans-serif; color: var(--muted); }
.edit-links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font: 600 15px -apple-system, system-ui, sans-serif; }
.link-chip i { font-style: normal; font-weight: 400; color: var(--muted); }
.link-chip span { color: var(--accent); }
.link-add { border-style: dashed; color: var(--accent); }
.pick { list-style: none; margin: 10px 0 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.pick li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.pick img, .pick-nophoto { width: 44px; height: 44px; object-fit: cover; flex: none; }
.pick-nophoto svg { width: 24px; height: 24px; }
.pick b { flex: 1; min-width: 0; font-weight: 600; }
.pick .seg { display: flex; gap: 4px; flex: none; }
.pick .seg button { font: 500 11px var(--font-label); letter-spacing: .08em; text-transform: uppercase; padding: 6px 7px; border: 1.5px solid var(--text); color: var(--text); border-radius: 2px; }
.pick .seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick-none { color: var(--muted); justify-content: center; }
/* Spiekvenster in de kookstand */
.peek { max-height: 70vh; overflow-y: auto; }
.peek h4 { font: 500 12px var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--mustard); margin: 14px 0 6px; }
.peek ul, .peek ol { margin: 0; padding-left: 22px; font-size: 18px; }
.peek li { margin: 6px 0; }
.peek .peek-sub { list-style: none; margin-left: -22px; font: 500 12px var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--mustard); }
.peek .btn { margin-top: 16px; }
/* Boodschappenlijst: onderdelen kiezen */
.parts-pick { display: grid; gap: 10px; margin: 6px 0 4px; }
.parts-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.parts-check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.sheet .parts-check input[type=checkbox] { width: 22px; height: 22px; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; -webkit-appearance: auto; appearance: auto; }
.link-suggest { display: inline-flex; align-items: center; gap: 6px; border-style: dashed; border-color: #008C44; color: #008C44; text-transform: none; letter-spacing: 0; font: 600 15px -apple-system, system-ui, sans-serif; }
.link-suggest i { font-style: normal; font-weight: 400; color: var(--muted); }
.link-suggest, .link-chip { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: left; flex-wrap: wrap; row-gap: 2px; }
