/* ── Darmie v3 · "Sunset" ─────────────────────────────────────────────────────
   Warm perzik + lavendel. Licht en donker volgen de telefoon (of de keuze in Meer).
   Eén accentverloop, rustige vlakken, grote tikdoelen (min. 44px). */

@font-face {
  font-family: 'DM Sans';
  src: url(../fonts/dmsans-latin.woff2) format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* licht */
  --bg: #fbf4ef;
  --bg-glow-1: rgba(255, 170, 120, .28);
  --bg-glow-2: rgba(190, 150, 255, .22);
  --surface: #ffffff;
  --surface-2: #f7ede7;
  --surface-3: #efe2da;
  --line: rgba(80, 40, 60, .10);
  --text: #2b1b3a;
  --muted: #6e5a7e;
  --faint: #725f86;
  --accent: #c2410c;          /* tekst/links: AA op wit */
  --accent-soft: rgba(234, 88, 12, .10);
  --lav: #7c3aed;
  --lav-soft: rgba(124, 58, 237, .10);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ea580c 100%);
  --good: #136c34; --good-soft: rgba(21, 128, 61, .10);
  --warn: #b45309; --warn-soft: rgba(217, 119, 6, .12);
  --bad: #c2410c;  --bad-soft: rgba(220, 38, 38, .09);
  --neutral: #6e5a7e; --neutral-soft: rgba(110, 90, 126, .10);
  --shadow: 0 1px 2px rgba(60, 30, 50, .06), 0 8px 24px rgba(60, 30, 50, .07);
  --shadow-lg: 0 20px 60px rgba(40, 10, 40, .22);
  --stool: #8b6914;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1229;
    --bg-glow-1: rgba(255, 138, 88, .16);
    --bg-glow-2: rgba(168, 85, 247, .24);
    --surface: #2a1b3e;
    --surface-2: #34234b;
    --surface-3: #412d5c;
    --line: rgba(255, 200, 180, .10);
    --text: #f6edf6;
    --muted: #c3acd4;
    --faint: #ad98bb;
    --accent: #ff9a6a;
    --accent-soft: rgba(255, 138, 88, .14);
    --lav: #cfb0ff;
    --lav-soft: rgba(192, 132, 252, .16);
    --grad: linear-gradient(135deg, #a46ef8 0%, #ff7a45 100%);
    --good: #6fd39b; --good-soft: rgba(111, 211, 155, .14);
    --warn: #f5b544; --warn-soft: rgba(245, 181, 68, .14);
    --bad: #ff8a7a;  --bad-soft: rgba(255, 122, 107, .15);
    --neutral: #c3acd4; --neutral-soft: rgba(195, 172, 212, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 28px rgba(0, 0, 0, .22);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
    --stool: #c79a3a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1229;
  --bg-glow-1: rgba(255, 138, 88, .16);
  --bg-glow-2: rgba(168, 85, 247, .24);
  --surface: #2a1b3e;
  --surface-2: #34234b;
  --surface-3: #412d5c;
  --line: rgba(255, 200, 180, .10);
  --text: #f6edf6;
  --muted: #c3acd4;
  --faint: #ad98bb;
  --accent: #ff9a6a;
  --accent-soft: rgba(255, 138, 88, .14);
  --lav: #cfb0ff;
  --lav-soft: rgba(192, 132, 252, .16);
  --grad: linear-gradient(135deg, #a46ef8 0%, #ff7a45 100%);
  --good: #6fd39b; --good-soft: rgba(111, 211, 155, .14);
  --warn: #f5b544; --warn-soft: rgba(245, 181, 68, .14);
  --bad: #ff8a7a;  --bad-soft: rgba(255, 122, 107, .15);
  --neutral: #c3acd4; --neutral-soft: rgba(195, 172, 212, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 28px rgba(0, 0, 0, .22);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
  --stool: #c79a3a;
  color-scheme: dark;
}

/* ── Basis ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(120% 50% at 85% -5%, var(--bg-glow-1), transparent 60%),
    radial-gradient(90% 45% at -10% 105%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}
body.has-sheet, body.has-onboarding { overflow: hidden; }
html, body { overflow-x: clip; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--lav); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
b { font-weight: 700; }

.ic { width: 22px; height: 22px; flex: none; }
.ic-sm { width: 16px; height: 16px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

#view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 12px) 16px calc(var(--nav-h) + var(--safe-b) + 96px);
  outline: none;
}
.page { animation: fade .22s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.boot { display: grid; place-items: center; gap: 12px; padding-top: 30vh; color: var(--muted); }
.boot img { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ── Kop ─────────────────────────────────────────────────────────────────── */

.top { padding: 8px 2px 14px; }
.top h1 { font-size: 30px; font-weight: 800; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.eyebrow-link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 700; min-height: 32px; }
.eyebrow-link .ic { width: 18px; height: 18px; }
.day-nav { display: flex; align-items: center; gap: 6px; margin-left: -8px; }
.day-h1 { margin: 0; font-size: inherit; }
.day-title { font-size: 30px; font-weight: 800; padding: 2px 4px; border-radius: 10px; }
.day-title:disabled { cursor: default; }
.day-nav .icon-btn:disabled { opacity: .25; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 4px 10px; }

/* ── Kaarten en knoppen ──────────────────────────────────────────────────── */

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}
.card h2 { font-size: 17px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), opacity .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(234, 88, 12, .25); }
.btn-primary:disabled { background: var(--surface-3); color: var(--faint); box-shadow: none; cursor: default; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn.grow, .grow { flex: 1; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.card .btn { margin-top: 12px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  color: var(--text); flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.danger { color: var(--bad); background: var(--bad-soft); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.tone-bad.pill { background: var(--bad-soft); color: var(--bad); }
.tone-warn.pill { background: var(--warn-soft); color: var(--warn); }
.tone-good.pill { background: var(--good-soft); color: var(--good); }
.tone-neutral.pill, .tone-muted.pill { background: var(--neutral-soft); color: var(--neutral); }

/* ── Vandaag ─────────────────────────────────────────────────────────────── */

.study { display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; }
.study::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 120% at 100% 0%, var(--accent-soft), transparent 60%);
}
.study h2 { font-size: 17px; margin-bottom: 2px; }
.study p { color: var(--muted); font-size: 15px; }
.study .study-meta, .study .study-trial { font-size: 13px; margin-top: 6px; color: var(--faint); }
.study-text { flex: 1; min-width: 0; }
.study > .ic { color: var(--faint); }
.ring {
  --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
  position: relative;
}
.ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 800; font-size: 14px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 4px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
  transition: transform .12s var(--ease);
}
.quick-btn:active { transform: scale(.95); }
.quick-btn .ic { width: 26px; height: 26px; padding: 9px; box-sizing: content-box; border-radius: 14px; }
.q-meal .ic { color: #ea580c; background: rgba(234, 88, 12, .12); }
.q-wind .ic { color: #8b5cf6; background: rgba(139, 92, 246, .14); }
.q-stool .ic { color: var(--stool); background: rgba(160, 120, 30, .14); }
.q-calm .ic { color: var(--good); background: var(--good-soft); }

.nudge {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; margin-bottom: 12px; border-radius: 16px;
  background: var(--lav-soft); color: var(--text); font-size: 15px;
}
.nudge span { flex: 1; }
.nudge .ic { color: var(--lav); }

.exp { display: flex; gap: 12px; align-items: center; }
.exp-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--lav-soft); color: var(--lav); flex: none; }
.exp-text { flex: 1; }
.exp-text p { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

.rating { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.rating button {
  height: 46px; min-width: 0; border-radius: 10px; font-weight: 800; font-size: 15px;
  background: var(--surface-2); color: var(--muted); transition: transform .12s var(--ease);
}
.rating button:active { transform: scale(.9); }
.rating button[aria-checked="true"] { color: #fff; transform: scale(1.06); }
.rating .r-low[aria-checked="true"] { background: #e8533b; }
.rating .r-mid[aria-checked="true"] { background: #e39b1c; }
.rating .r-high[aria-checked="true"] { background: #2f9e62; }
.rating-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 6px; }
.rating-label { font-size: 14px; font-weight: 700; color: var(--accent); }

.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid; grid-template-columns: 46px 36px 1fr; align-items: start; gap: 8px;
  text-align: left; padding: 10px 6px; border-radius: 14px; position: relative;
}
.tl-item:hover { background: var(--surface-2); }
.tl-item + .tl-item::before {
  content: ''; position: absolute; left: 77px; top: -10px; height: 20px; width: 2px; background: var(--line);
}
.tl-time { font-size: 14px; font-weight: 700; color: var(--muted); padding-top: 8px; font-variant-numeric: tabular-nums; }
.tl-dot { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.tl-dot .ic { width: 20px; height: 20px; }
.dot-meal { background: rgba(234, 88, 12, .12); color: #ea580c; }
.dot-sym { background: rgba(139, 92, 246, .14); color: #8b5cf6; }
.dot-calm { background: var(--good-soft); color: var(--good); }
.tl-body { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.tl-title { font-weight: 600; overflow-wrap: anywhere; }
.tl-sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.empty { display: flex; gap: 14px; align-items: center; padding: 8px 4px; color: var(--muted); font-size: 15px; }
.empty b { color: var(--text); }

/* ── FODMAP-labels en chips ──────────────────────────────────────────────── */

.fchip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  background: color-mix(in srgb, var(--g) 16%, transparent); color: var(--text);
}
.fchip.lvl-midden { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g) 55%, transparent); }
.fchip-low { background: var(--good-soft); color: var(--good); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); font-size: 15px; font-weight: 600; border: 1px solid transparent;
}
.chip-on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.chip-static { min-height: 30px; font-size: 13px; padding: 0 10px; cursor: default; }
.chip small { color: var(--faint); font-weight: 600; }

/* ── Sheets ──────────────────────────────────────────────────────────────── */

.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 8, 30, .45); opacity: 0; transition: opacity .22s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - var(--safe-t) - 24px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .26s var(--ease);
  padding-bottom: var(--safe-b);
}
.sheet-tall { height: calc(100dvh - var(--safe-t) - 24px); }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet-root.closing .sheet { transform: translateY(105%); }
.sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 4px 20px; flex: none; }
.sheet-head h2 { font-size: 20px; font-weight: 800; }
.sheet-body { overflow-y: auto; padding: 8px 20px 16px; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.sheet-foot { padding: 10px 16px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; flex: none; background: var(--surface); }
.sheet-dialog .sheet-foot { flex-direction: row; justify-content: flex-end; }
.sheet-dialog .sheet-foot .btn { flex: 1; }
.dialog { padding: 12px 0 4px; }
.dialog h2 { font-size: 20px; margin-bottom: 8px; }
.dialog p { color: var(--muted); }
.foot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.foot-row .btn.grow { min-width: 120px; }
@media (max-width: 370px) {
  .foot-row .foot-day { flex: 1 1 100%; }
  .seg-sm button { font-size: 12px; }
}
.foot-day { font-size: 14px; font-weight: 700; color: var(--muted); flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-box {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 52px; border-radius: 16px;
  background: var(--surface-2); border: 1.5px solid transparent; position: sticky; top: 0; z-index: 2;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box .ic { color: var(--faint); }
.search-box input { flex: 1; border: 0; background: none; outline: none; font-size: 17px; min-width: 0; }
.search-box input::-webkit-search-cancel-button { display: none; }

.tray { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 2px; }
.tray:empty { display: none; }
.exp-warn { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 14px; display: flex; gap: 8px; }
.results { padding-top: 6px; }
.sub { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 16px 0 8px; }
.hint { font-size: 14px; color: var(--faint); margin-top: 14px; }
.empty-line { padding: 14px 4px; color: var(--muted); }

.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 1fr auto 28px; align-items: center; gap: 8px;
  text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); min-height: 56px; width: 100%;
}
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { font-size: 13px; color: var(--faint); }
.row-tags { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 120px; }
.row-check { color: var(--faint); display: grid; place-items: center; }
.row-on .row-check { color: var(--accent); }
.row-on .row-title { color: var(--accent); }
.row-add { grid-template-columns: auto 1fr; color: var(--accent); font-weight: 600; border-bottom: 0; }

.repeat-list { display: flex; flex-direction: column; gap: 6px; }
.repeat {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 14px;
  background: var(--lav-soft); font-size: 14px; font-weight: 600;
}
.repeat .ic { color: var(--lav); }

.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 2px; width: 100%; }
.seg button { flex: 1; min-height: 40px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-sm button { font-size: 13px; padding: 0 2px; }
.seg-label { margin: 14px 2px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

.time-field {
  display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px; border-radius: 14px;
  background: var(--surface-2); color: var(--muted);
}
.time-field input { border: 0; background: none; font-weight: 700; font-size: 16px; color: var(--text); width: 5.6em; min-width: 0; }
.time-field input::-webkit-calendar-picker-indicator { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: 14px; color: var(--muted); }
.field input { min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); padding: 0 14px; font-size: 17px; color: var(--text); }
.field input:focus { outline: none; border-color: var(--accent); }

/* Klachten */
.sym { padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.sym:last-child { border-bottom: 0; }
.sym h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 12px; }
.sym h3 .ic { color: #8b5cf6; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button {
  min-height: 52px; border-radius: 14px; background: var(--surface-2); font-size: 18px;
  transition: transform .12s var(--ease), background .15s;
}
.scale button:active { transform: scale(.94); }
.scale button[aria-checked="true"] { background: var(--grad); color: #fff; }
.scale-caption { text-align: center; color: var(--accent); font-size: 14px; font-weight: 700; margin-top: 6px; min-height: 21px; }
.dur { margin-top: 10px; }
.dur-label { display: block; font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }

.bristol { display: flex; flex-direction: column; gap: 6px; }
.bristol-opt {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; text-align: left;
  padding: 8px 12px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent;
}
.bristol-opt b { display: block; font-size: 15px; }
.bristol-opt small { color: var(--muted); font-size: 13px; }
.bristol-opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.bristol-svg { width: 56px; height: 37px; color: var(--stool); }
.bristol-opt.tone-good b::after { content: ' ✓'; color: var(--good); }

.chooser { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.chooser button {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px; border-radius: 18px; background: var(--surface-2);
}
.chooser .ic { width: 26px; height: 26px; padding: 10px; box-sizing: content-box; border-radius: 14px; }
.chooser b { display: block; font-size: 16px; }
.chooser small { color: var(--muted); font-size: 14px; }

/* ── Rapport ─────────────────────────────────────────────────────────────── */

.prof { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.darmie { display: block; height: auto; }
.darmie-prof { width: 92px; flex: none; filter: drop-shadow(0 8px 14px rgba(60, 20, 60, .25)); }
.darmie-sm { width: 64px; flex: none; }
.bubble {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px;
  padding: 14px 16px; box-shadow: var(--shadow); font-size: 16px; font-weight: 500; position: relative; margin-bottom: 22px;
}
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--lav-soft); margin-bottom: 14px; font-size: 14px; }
.banner .ic { color: var(--lav); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 4px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 4px; text-align: center; }
.stats b { display: block; font-size: 20px; font-weight: 800; }
.stats span { font-size: 12px; color: var(--muted); }

.suspect {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.suspect::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--g); }
.suspect.tone-bad { box-shadow: var(--shadow), 0 0 0 1.5px var(--bad-soft); }
.suspect header { display: flex; align-items: center; gap: 12px; }
.s-emoji { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--g) 15%, transparent); flex: none; }
.s-name { flex: 1; min-width: 0; }
.s-name h3 { font-size: 18px; }
.s-name p { font-size: 13px; color: var(--muted); }
.suspect > .pill { margin-top: 10px; }
.effect { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; font-size: 14px; color: var(--muted); gap: 8px; }
.effect b { font-size: 22px; color: var(--text); font-weight: 800; }
.forest { position: relative; height: 22px; }
.forest-track { position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--surface-3); border-radius: 2px; }
.forest-ref { position: absolute; top: 3px; width: 2px; height: 16px; background: var(--faint); transform: translateX(-1px); }
.forest-ci { position: absolute; top: 7px; height: 8px; border-radius: 8px; background: var(--neutral-soft); }
.forest-dot { position: absolute; top: 4px; width: 14px; height: 14px; border-radius: 50%; transform: translateX(-7px); background: var(--neutral); border: 3px solid var(--surface); box-sizing: content-box; margin-top: -3px; }
.forest.tone-bad .forest-ci { background: var(--bad-soft); } .forest.tone-bad .forest-dot { background: var(--bad); }
.forest.tone-warn .forest-ci { background: var(--warn-soft); } .forest.tone-warn .forest-dot { background: var(--warn); }
.forest.tone-good .forest-ci { background: var(--good-soft); } .forest.tone-good .forest-dot { background: var(--good); }
.forest-axis { position: relative; height: 18px; font-size: 11px; color: var(--faint); display: flex; justify-content: space-between; }
.forest-axis span[style] { position: absolute; transform: translateX(-50%); }
.s-text { margin-top: 10px; font-size: 15px; color: var(--text); }
.s-foods { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.s-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.s-more summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; min-height: 32px; display: flex; align-items: center; }
.s-more summary::-webkit-details-marker { display: none; }
.s-more p { margin: 6px 0 4px; font-size: 15px; }

.others { display: flex; flex-direction: column; gap: 8px; }
.other { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 14px; }
.other summary { display: flex; align-items: center; gap: 10px; min-height: 56px; cursor: pointer; list-style: none; }
.other summary::-webkit-details-marker { display: none; }
.other .s-emoji { width: 36px; height: 36px; font-size: 20px; background: var(--surface-2); }
.o-name { flex: 1; font-weight: 700; }
.other .chev { color: var(--faint); transition: transform .2s; }
.other[open] .chev { transform: rotate(180deg); }
.other p { padding: 0 0 12px; font-size: 15px; color: var(--muted); }
.other .btn { margin-bottom: 12px; }
.calm-card { display: flex; gap: 12px; align-items: flex-start; }
.calm-card .ic { color: var(--good); width: 28px; height: 28px; }

.foodsig { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.foodsig li { display: flex; flex-direction: column; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.foodsig span { font-size: 13px; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; }
.bar-sym { fill: #8b5cf6; }
.bar-ok { fill: var(--good); opacity: .6; }
.chart-lbl { font-size: 10px; fill: var(--faint); font-family: var(--font); }

.method summary { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; list-style: none; min-height: 28px; }
.method summary::-webkit-details-marker { display: none; }
.method p { margin-top: 10px; font-size: 15px; color: var(--muted); }
.nerd { margin-top: 14px; overflow-x: auto; }
.nerd table { border-collapse: collapse; font-size: 12px; width: 100%; font-variant-numeric: tabular-nums; }
.nerd th, .nerd td { padding: 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.nerd th:first-child, .nerd td:first-child { text-align: left; }
.nerd p { font-size: 12px; }

.steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.steps li.done { color: var(--text); }
.steps li.done .ic { color: var(--good); }
.tips ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

.exp-card .bar { margin: 4px 0 14px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare div { background: var(--surface-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.compare span { font-size: 13px; color: var(--muted); }
.compare b { font-size: 26px; font-weight: 800; }
.compare small { font-size: 12px; color: var(--faint); }
.verdict { margin: 12px 0 0; padding: 12px; border-radius: 14px; font-weight: 600; }
.verdict.tone-good { background: var(--good-soft); color: var(--good); }
.verdict.tone-warn { background: var(--warn-soft); color: var(--warn); }
.verdict.tone-neutral { background: var(--neutral-soft); }
.exp-card > p.muted { margin-top: 10px; }

.locked { filter: blur(7px); pointer-events: none; user-select: none; max-height: 520px; overflow: hidden; }
.paywall { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: -260px; position: relative; }
.paywall p { color: var(--muted); }

.disclaimer { margin-top: 24px; padding: 14px; border-radius: 16px; background: var(--warn-soft); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.disclaimer .ic { color: var(--warn); vertical-align: -3px; }

/* ── Meer ────────────────────────────────────────────────────────────────── */

.list { padding: 6px; }
.list-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 10px;
  border-radius: 14px; color: inherit; text-decoration: none; min-height: 60px;
}
.list-item:hover { background: var(--surface-2); }
.list-item > .ic:first-child { color: var(--accent); }
.list-item > span { flex: 1; display: flex; flex-direction: column; }
.list-item small { color: var(--muted); font-size: 13px; }
.list-item > .ic:last-child { color: var(--faint); }
.list-item.danger > .ic:first-child, .list-item.danger b { color: var(--bad); }
.list-note { display: flex; gap: 10px; padding: 10px; font-size: 14px; color: var(--muted); }
.list-note .ic { color: var(--good); }
.card.list-item { padding: 14px 16px; }
.footnote { font-size: 13px; color: var(--faint); text-align: center; margin: 24px 12px; }
.group-info { border-left: 4px solid var(--g); padding: 4px 0 4px 12px; margin: 18px 0; }
.group-info h3 { font-size: 17px; margin-bottom: 4px; }
.group-info p { margin-top: 4px; }
.error pre { white-space: pre-wrap; font-size: 12px; color: var(--muted); }

/* ── Navigatie ───────────────────────────────────────────────────────────── */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.nav-item {
  flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 700; position: relative;
}
.nav-item[aria-current="page"] { color: var(--text); }
.nav-item[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad);
}
.fab {
  position: fixed; z-index: 21; right: max(16px, calc(50% - 264px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  display: inline-flex; align-items: center; gap: 6px; height: 58px; padding: 0 22px 0 18px; border-radius: 20px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 10px 28px rgba(234, 88, 12, .35);
  transition: transform .15s var(--ease);
}
.fab:active { transform: scale(.94); }
.fab .ic { width: 24px; height: 24px; }
body.has-onboarding .fab, body.has-onboarding .bottom-nav { visibility: hidden; }

/* ── Toast ───────────────────────────────────────────────────────────────── */

#toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 88px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 14px; border-radius: 18px; background: #2b1b3a; color: #fff;
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: 15px;
  transition: opacity .2s, transform .25s var(--ease);
}
:root[data-theme="dark"] #toast { background: #f6edf6; color: #2b1b3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #toast { background: #f6edf6; color: #2b1b3a; } }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-darmie { width: 34px; height: 34px; object-fit: contain; }
.toast-act { color: #ffb38a; font-weight: 800; padding: 6px 8px; border-radius: 10px; white-space: nowrap; }
:root[data-theme="dark"] .toast-act { color: #c2410c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast-act { color: #c2410c; } }
body.has-sheet #toast { bottom: auto; top: calc(var(--safe-t) + 16px); transform: translate(-50%, -20px); }
body.has-sheet #toast.show { transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i {
  position: absolute; top: 40%; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
  animation: pop 1.3s var(--ease) forwards;
}
@keyframes pop {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), 260px) rotate(var(--rot)); }
}

/* ── Onboarding ──────────────────────────────────────────────────────────── */

.onboarding {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg);
  background-image: radial-gradient(120% 50% at 85% -5%, var(--bg-glow-1), transparent 60%), radial-gradient(90% 45% at -10% 105%, var(--bg-glow-2), transparent 60%);
  padding: var(--safe-t) 0 var(--safe-b);
  animation: fade .3s var(--ease);
}
.onboarding.closing { opacity: 0; transition: opacity .25s; }
.ob-skip { position: absolute; right: 12px; top: calc(var(--safe-t) + 10px); padding: 10px 12px; color: var(--muted); font-weight: 700; z-index: 2; }
.ob-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ob-track::-webkit-scrollbar { display: none; }
.ob-slide {
  flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 28px 12px; gap: 14px; min-width: 0;
  overflow-y: auto; justify-content: safe center;
}
@media (max-height: 720px) { .ob-img { width: 104px; } .ob-slide { padding-top: 40px; gap: 10px; } }
.ob-slide > * { max-width: 460px; }
.ob-img { width: 150px; filter: drop-shadow(0 12px 20px rgba(60, 20, 60, .25)); }
.ob-slide h1 { font-size: 30px; font-weight: 800; }
.ob-slide p { color: var(--muted); font-size: 17px; max-width: 420px; }
.ob-foot { font-size: 14px !important; color: var(--faint) !important; }
.ob-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; max-width: 380px; }
.ob-list li { display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 12px 14px; border-radius: 16px; font-weight: 600; box-shadow: var(--shadow); }
.ob-list span { font-size: 22px; }
.ob-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 20px; max-width: 560px; width: 100%; margin: 0 auto; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 9px; background: var(--surface-3); transition: width .2s; }
.ob-dots i.on { width: 24px; background: var(--accent); }

/* ── Laden ───────────────────────────────────────────────────────────────── */

.skeleton .sk-line { height: 14px; border-radius: 8px; background: var(--surface-2); margin: 6px 0; animation: shimmer 1.2s ease-in-out infinite; }
.skeleton .sk-line.short { width: 60%; }
@keyframes shimmer { 50% { opacity: .5; } }

@media (min-width: 600px) {
  .top h1, .day-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Rapport voor huisarts/diëtist (scherm + papier) ─────────────────────── */
.print-bar { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 14px; }
.print-doc { background: #fff; color: #1a1020; border-radius: 16px; padding: 22px 18px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
.print-doc h1 { font-size: 22px; }
.print-doc h2 { font-size: 15px; margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 2px solid #ea580c; }
.pd-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.pd-head p, .pd-meta, .pd-small { color: #4a3d55; font-size: 12px; }
.pd-meta { text-align: right; }
.pd-note { margin-top: 12px; padding: 10px 12px; background: #f6efe9; border-radius: 10px; font-size: 12.5px; }
.pd-table, .pd-kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pd-table th, .pd-table td, .pd-kv th, .pd-kv td { text-align: left; vertical-align: top; padding: 5px 6px; border-bottom: 1px solid #e5dcd6; }
.pd-table thead th { font-size: 11px; color: #4a3d55; }
.pd-kv th { width: 38%; font-weight: 600; color: #4a3d55; }
.print-doc section { overflow-x: auto; }
.pd-chart { width: 100%; height: auto; }
.pd-cols { columns: 2; column-gap: 20px; font-size: 12.5px; }
.pd-foot { margin-top: 20px; padding-top: 10px; border-top: 1px solid #e5dcd6; font-size: 11px; color: #4a3d55; }
.share-doc { margin-top: 16px; }
body.printing .fab, body.route-vandaag .fab { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; background-image: none !important; }
  .bottom-nav, .fab, .no-print, #toast, .skip { display: none !important; }
  #view { padding: 0 !important; max-width: none; }
  .print-doc { box-shadow: none; border-radius: 0; padding: 0; }
  .print-doc section { overflow: visible; break-inside: avoid; }
  .pd-break { break-before: auto; }
  .pd-table { font-size: 10.5pt; }
}

.reintro { list-style: none; padding: 0; margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.reintro li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.reintro li span { display: flex; flex-direction: column; }
.reintro li small { color: var(--muted); font-size: 13px; }
.reintro li .ic { color: var(--faint); }
.reintro .st-vandaag { background: var(--accent-soft); }
.reintro .st-vandaag .ic { color: var(--accent); }
.reintro .st-klaar .ic { color: var(--good); }
.reintro .react .ic { color: var(--bad); }
.reintro .st-overgeslagen { opacity: .6; }
.exp .btn-row { margin-top: 4px; }
.exp .btn-row .btn { min-height: 40px; padding: 0 14px; font-size: 15px; margin-top: 0; }

.rel { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 14px; }
.rel-name { color: var(--muted); }
.rel-stars { color: #e39b1c; letter-spacing: 1px; font-size: 16px; }
.rel-low .rel-stars { color: var(--faint); }
.rel-label { color: var(--muted); font-weight: 600; }
.info-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--muted); margin-left: -4px; }
.info-btn:hover { background: var(--surface-2); }
.other .rel { margin: 0 0 6px; }
