:root {
  --primary: #1f3a5f;
  --accent: #3fa38a;
  --accent-soft: #eef7f4;
  --accent-tint: #f4faf7;
  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #22303f;
  --muted: #5b6875;   /* 5,3:1 op wit — #7a8794 haalde de norm van 4,5:1 niet */
  --line: #e5e9e7;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(31, 58, 95, 0.08), 0 4px 14px rgba(31, 58, 95, 0.05);
  --font: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar h1 { flex: 1; font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
}
.icon-btn:active { background: rgba(255,255,255,0.15); }
.user-chip {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.app[data-view="home"] #btn-back { display: none; }

/* ---------- Startscherm ---------- */
.btn-book, .btn-add-big {
  width: 100%; height: 58px; border-radius: 18px;
  font-weight: 800; font-size: 17px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-book { background: var(--primary); color: #fff; margin-bottom: 10px; }
.btn-add-big { background: var(--accent); color: #fff; }
.btn-book:active, .btn-add-big:active { transform: scale(0.98); }
.sugg-head { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 10px; }
.sugg-head h2 {
  flex: 1; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 800;
}
.btn-link { color: var(--accent); font-weight: 800; font-size: 13.5px; }

.view { max-width: 1080px; margin: 0 auto; padding: 14px 14px 60px; }

/* ---------- Filters ---------- */
.filters { margin-bottom: 14px; }
.filters input[type="search"], .filters input[type="text"] {
  width: 100%; height: 48px; padding: 0 16px; margin-bottom: 10px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); outline: none;
}
.filters input:focus { border-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line);
  font-weight: 700; font-size: 14px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Drie filters naast elkaar in plaats van onder elkaar — scheelt ruimte en
   voorkomt dat ze op receptkaarten lijken. */
.filterbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.fb {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-height: 52px; justify-content: center;
}
.fb.active { border-color: var(--accent); background: var(--accent-tint); }
.fb-lab { font-weight: 800; font-size: 14px; color: var(--primary); }
.fb-sum { font-weight: 700; font-size: 12px; color: var(--muted); }
.filter-panel {
  background: var(--card); border: 1.5px solid var(--accent); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 8px;
}
.filter-panel input[type="text"] { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; }
.filter-panel input[type="text"]:focus { border-color: var(--accent); }
.filter-panel .chips { padding-bottom: 0; }

.fold { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 8px; }
.fold summary {
  font-weight: 700; cursor: pointer; color: var(--primary);
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before {
  content: '▸'; font-size: 12px; color: var(--muted); transition: transform 0.15s; flex: none;
}
.fold[open] > summary::before { transform: rotate(90deg); }
.fold-sum { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.fold > *:not(summary) { margin-top: 10px; }
.fold input[type="text"] { margin-top: 10px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 6px; }

/* schuifregelaar voor de tijd */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] {
  flex: 1; accent-color: var(--accent); height: 32px; margin: 0;
}
.slider-row output {
  flex: none; min-width: 84px; text-align: right;
  font-weight: 800; color: var(--primary); font-size: 15px;
}

/* ---------- Receptkaarten ---------- */
.card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px; border: 2px solid transparent;
}
.card:hover { background: var(--accent-tint); }
.card-title { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px;
  font-size: 12px; font-weight: 800; background: var(--accent-soft); color: var(--primary);
}
.tag-vlees { background: #fbe6e3; color: #9e2b1c; }
.tag-vis { background: #e2eefb; color: #1c4f8f; }
.tag-vegetarisch { background: #e4f5ec; color: #1d7048; }
.tag-veganistisch { background: #dcf2e2; color: #14663a; }
.tag-vlees_en_vis { background: #f6e8d8; color: #8a5a1c; }
.tag-onbekend { background: #ecedef; color: #62707c; }
.tag-tijd { background: #eef1f4; color: #44515e; }
.tag-mist { background: #fdf1dc; color: #8a5a1c; }
.card-mist { font-size: 13.5px; color: #8a5a1c; font-weight: 700; margin-top: 6px; }
.stars { color: #e0a92b; letter-spacing: 1px; font-size: 13px; }

.empty { text-align: center; color: var(--muted); font-weight: 600; padding: 46px 20px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* ---------- Receptpagina ---------- */
.recipe-head { margin-bottom: 14px; }
.recipe-head h2 { font-size: 24px; font-weight: 800; color: var(--primary); }
.recipe-desc { color: var(--muted); font-weight: 600; margin-top: 6px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.panel h3 { font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.ing-list { list-style: none; }
.ing-list li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.ing-list li:last-child { border-bottom: none; }
.ing-amount { font-weight: 800; color: var(--primary); min-width: 76px; flex: none; }
.ing-note { color: var(--muted); font-size: 13.5px; }
.steps { list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 0 0 14px 40px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.steps .group { font-weight: 800; color: var(--primary); margin: 6px 0 8px; padding-left: 0; }
.nutri { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.nutri div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.nutri .n-val { font-weight: 800; font-size: 17px; color: var(--primary); }
.nutri .n-lab { font-size: 12px; color: var(--muted); font-weight: 700; }
.warn { background: #fdf6e6; border: 1.5px solid #f0dca8; color: #7a5a12; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.btn-primary, .btn-plain, .btn-danger {
  height: 46px; padding: 0 16px; border-radius: 12px; font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-plain { background: var(--accent-soft); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.notes-area { width: 100%; min-height: 90px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; outline: none; resize: vertical; }
.notes-area:focus { border-color: var(--accent); }
.rate { display: flex; gap: 4px; }
.rate button { font-size: 26px; color: #b9c1c6; line-height: 1; min-width: 44px; min-height: 44px; }
.rate button.on { color: #e0a92b; }
.source-link { color: var(--accent); font-weight: 700; text-decoration: none; word-break: break-all; }

/* ---------- Inbox ---------- */
.inbox-form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.inbox-form label { display: block; font-weight: 800; margin-bottom: 8px; color: var(--primary); }
.inbox-form input { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; margin-bottom: 10px; }
.inbox-form input:focus { border-color: var(--accent); }
.section-head { font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 10px; }
.inbox-row { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.inbox-row .grow { flex: 1; min-width: 0; }
.inbox-row .payload { font-weight: 700; word-break: break-all; font-size: 14.5px; }
.status { font-size: 12.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.status-klaar { background: #e4f5ec; color: #1d7048; }
.status-wacht_op_claude { background: #fdf1dc; color: #8a5a1c; }
.status-wacht { background: #eef1f4; color: #44515e; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(31,58,95,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto; }
.overlay-card h1, .overlay-card h2 { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.overlay-card p { color: var(--muted); font-weight: 600; font-size: 14.5px; }
.userpick-buttons { display: flex; gap: 12px; margin-top: 18px; }
.btn-user { flex: 1; height: 58px; border-radius: var(--radius); background: var(--accent-soft); color: var(--primary); font-weight: 800; font-size: 18px; border: 2px solid transparent; }
.btn-user:active, .btn-user:hover { border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
#input-pin { width: 100%; height: 54px; padding: 0 14px; margin-top: 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; font-size: 26px; letter-spacing: 0.4em; text-align: center; }
#input-pin:focus { border-color: var(--accent); }
.pin-error { color: var(--danger) !important; font-weight: 700 !important; margin-top: 10px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.pick-row:last-of-type { border-bottom: none; }
.pick-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.pick-row .pick-text { flex: 1; min-width: 0; }
.pick-row .pick-note { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.list-select { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; margin: 10px 0 4px; background: var(--card); }

/* Keuzelijst in een modal. Deze stond alleen in het boodschappenlijstje en
   is bij het overzetten van het weekbord vergeten — de receptenlijst plakte
   daardoor als kale tekst aan elkaar. */
.menu-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.menu-list button {
  min-height: 48px; text-align: left; padding: 10px 12px; border-radius: 10px;
  font-weight: 700; font-size: 15.5px; color: var(--primary); line-height: 1.3;
}
.menu-list button:hover, .menu-list button:active { background: var(--accent-tint); }

/* ---------- Porties ---------- */
.portions {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 14px; margin-bottom: 12px; font-weight: 700; color: var(--primary);
}
.pbtn {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft);
  color: var(--primary); font-size: 22px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.pbtn:active { background: var(--accent); color: #fff; }
.portions strong { min-width: 26px; text-align: center; font-size: 18px; }
.ing-group { font-weight: 800; color: var(--primary); }

/* ---------- Waardering per persoon ---------- */
.rate-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.rate-name { flex: 1; font-weight: 700; }

/* ---------- Berekening ---------- */
.calc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.calc-table td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.calc-table td.num { text-align: right; color: var(--muted); font-weight: 700; white-space: nowrap; padding-left: 10px; }

/* ---------- Gast ---------- */
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-weight: 700; font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#form-gast label { display: block; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
#form-gast input { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; }
#form-gast input:focus { border-color: var(--accent); }
.user-chip.guest { background: #8a5a1c; }
.icon-btn.mini { width: 44px; height: 44px; font-size: 18px; color: var(--muted); }

/* ---------- Foto's ---------- */
.card { padding: 0; overflow: hidden; }
.card-body { padding: 14px 16px; }
.card-foto { width: 100%; height: 150px; object-fit: cover; display: block; }
.recipe-photo { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow); }
.recipe-photo img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.photo-del {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(31,58,95,0.65); color: #fff; font-size: 20px; line-height: 1;
}
.photo-add { display: inline-block; margin-bottom: 10px; }
.photo-add .btn-plain { display: inline-flex; }
.h3-link {
  float: right; color: var(--accent); font-weight: 800; font-size: 14px;
  text-transform: none; letter-spacing: 0;
  padding: 8px 4px; margin: -8px 0;   /* raakvlak, niet alleen de letters */
}

/* ---------- Ingrediënten bijwerken ---------- */
.ing-edit { display: grid; grid-template-columns: 58px 66px 1fr 44px; gap: 6px; margin-bottom: 6px; align-items: center; }
.ing-edit input {
  height: 40px; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 10px;
  outline: none; min-width: 0; font-size: 14px;
}
.ing-edit input:focus { border-color: var(--accent); }
.ie-del { color: var(--muted); font-size: 20px; min-height: 44px; min-width: 44px; }

/* ---------- Kookmodus ---------- */
.cook { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.cook-bar {
  display: flex; align-items: center; gap: 8px; background: var(--primary); color: #fff;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); flex: none;
}
.cook-bar h2 { flex: 1; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-wake { font-size: 18px; flex: none; }
.cook-body {
  flex: 1; overflow-y: auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
  max-width: 760px; margin: 0 auto; width: 100%;
}
.cook-body h3 {
  font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  margin: 18px 0 10px;
}
.cook-row {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 10px; font-size: 19px; line-height: 1.45; cursor: pointer;
}
.cook-row input[type="checkbox"] { width: 28px; height: 28px; flex: none; accent-color: var(--accent); margin-top: 2px; }
.cook-row.done { opacity: 0.45; }
.cook-row.done span { text-decoration: line-through; }
.cook-step { font-size: 18px; }
.cook-step b { color: var(--accent); margin-right: 4px; }

/* ---------- Doorstap naar het weekbord ---------- */
.btn-week {
  width: 100%; height: 58px; border-radius: 18px; margin-bottom: 10px;
  background: var(--accent-soft); color: var(--primary); font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-week:active { transform: scale(0.98); }

/* ---------- Timers ---------- */
.cook-blok { margin-bottom: 10px; }
.cook-blok .cook-row { margin-bottom: 4px; }
.timerknoppen { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 6px 52px; }
.timerknop {
  background: var(--accent-soft); color: var(--primary); font-weight: 800; font-size: 14px;
  border-radius: 999px; padding: 7px 14px;
  min-height: 44px;   /* met natte handen mik je niet op 34 px */
}
.timerknop:active { background: var(--accent); color: #fff; }
body:has(.timerbalk) .cook-body { padding-bottom: 110px; }
.timerbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--primary); color: #fff; display: flex; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); justify-content: center;
}
.timer { font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.timer.klaar { color: #ffd76e; animation: knipper 1s steps(2, start) infinite; }
.timer button { color: #cfe0f0; font-size: 18px; min-width: 44px; min-height: 44px; }
@keyframes knipper { 50% { opacity: 0.35; } }

/* ---------- Snackbar ---------- */
.snackbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--primary); color: #fff; border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 6px 20px rgba(31,58,95,0.35); max-width: calc(100vw - 28px);
}
.snackbar a { color: #7fd8bd; font-weight: 800; }

@media (min-width: 760px) {
  #recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
  .card { margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Vanavond & offline ---------- */
.vanavond {
  background: var(--primary); color: #fff; border-radius: 18px;
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.vanavond-label { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.vanavond-titel { font-size: 21px; font-weight: 800; margin-top: 2px; }
.vanavond .btn-plain { background: rgba(255,255,255,0.16); color: #fff; }
.offline-melding {
  background: var(--accent-soft); color: var(--primary); border-radius: 10px;
  padding: 9px 12px; font-weight: 700; font-size: 13.5px; margin-bottom: 10px;
}
