/* ==========================================================================
   Ons geld — basisstijl, ontwerp-tokens, schil en beweging.
   Bron: dashboard-ontwerp/DESIGN_TOKENS.md (goedgekeurd 1 dec 2026) en ontwerp.css.
   Pas tokens hier aan, niet per pagina. Oude variabelenamen (--text, --border,
   --positive, ...) blijven bestaan als alias naar de nieuwe tokens.
   ========================================================================== */

/* ---------- 1. Tokens: licht (standaard) ---------- */
:root {
  color-scheme: light dark;

  /* Basis */
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --surface-2: #F0EEE9;
  --surface-3: #E7E4DD;
  --line: #DCD8CF;
  --line-strong: #B9B3A7;
  --ink: #1B1A17;
  --ink-2: #4A4740;
  --ink-3: #66625A;
  --accent: #1D4E9E;
  --accent-hover: #173F82;
  --accent-ink: #FFFFFF;
  --accent-soft: #E7EEF9;
  --accent-line: #A9C0E8;

  /* Betekeniskleuren: tekst · vlak · rand */
  --ok: #0F5C45;      --ok-soft: #E2F2EC;     --ok-line: #93CDB8;
  --warn: #8A4B00;    --warn-soft: #FFF2DC;   --warn-line: #E2A54E;
  --danger: #A3261B;  --danger-soft: #FCEBE8; --danger-line: #E5A097;
  --scen: #5B33B0;    --scen-soft: #F1ECFB;   --scen-line: #A68BE0;
  --demo: #5E4500;    --demo-soft: #FFF3C4;   --demo-line: #E3C25A;
  --unk: #5A5650;     --unk-soft: #EFEDE8;    --unk-line: #9C968B;

  /* Grafiek */
  --c-actual: #1D4E9E;
  --c-careful: #B35C00;
  --c-scen: #6B3FC7;
  --c-grid: #E4E0D8;
  --c-area: rgba(29, 78, 158, 0.08);

  /* Overig */
  --paper: #FBFAF6;
  --paper-ink: #3B3833;
  --scrim: rgba(27, 26, 23, 0.45);
  --shadow-overlay: 0 16px 40px rgba(27, 26, 23, 0.2), 0 2px 6px rgba(27, 26, 23, 0.08);
  --shadow-hover: 0 6px 18px rgba(27, 26, 23, 0.08), 0 1px 3px rgba(27, 26, 23, 0.06);

  /* Typografie: systeemletter, niets te hosten */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
  --fs-xs: 12px;   /* mini, badges */
  --fs-sm: 13px;   /* klein: bronnen, uitleg */
  --fs-md: 15px;   /* lopende tekst */
  --fs-lg: 18px;   /* tegelnaam */
  --fs-xl: 21px;   /* sectiekop, uitspraak */
  --fs-2xl: 28px;  /* paginatitel */
  --fs-3xl: 34px;  /* hoofdbedrag */
  --lh: 1.4667;    /* 22 / 15 */

  /* Ruimte (basis 4) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --gap-section: 36px;
  --gap-grid: 16px;
  --pad-card: 20px;
  --pad-page-y: 28px;
  --pad-page-x: 32px;

  /* Vormen */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Tikdoelen */
  --tap: 40px;

  /* Beweging (§7) */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 600ms;
  --dur-5: 900ms;
  --dur-draw: 1100ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --stagger: 60ms;

  --sidebar-w: 240px;
  --topbar-h: 56px;

  /* ---------- Aliassen voor bestaande schermen (niet weghalen) ---------- */
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --positive: var(--ok);
  --positive-soft: var(--ok-soft);
  --negative: var(--danger);
  --negative-soft: var(--danger-soft);
  --warning: var(--warn);
  --warning-soft: var(--warn-soft);
  --info: var(--accent);
  --info-soft: var(--accent-soft);
  --unknown: var(--unk);
  --unknown-soft: var(--unk-soft);
  --forecast: var(--c-actual);
  --scenario: var(--scen);
  --scenario-soft: var(--scen-soft);
  --accent-2: var(--accent);
  --surface-glass: var(--surface);
  --bg-grad-1: var(--bg);
  --bg-grad-2: var(--bg);
  --font-display: var(--font);
  --shadow-1: none;
  --shadow-2: var(--shadow-hover);
  --shadow-3: var(--shadow-overlay);
  --focus: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
  --dur-fast: var(--dur-1);
  --dur: var(--dur-2);
  --dur-slow: var(--dur-3);
  --dur-countup: var(--dur-5);
}

/* ---------- 1b. Tokens: donker (apparaat volgt, of expliciet gekozen) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='licht']):not([data-theme='light']) {
    --bg: #121315; --surface: #1B1D20; --surface-2: #23262A; --surface-3: #2C3035;
    --line: #33373D; --line-strong: #4B5058;
    --ink: #EEECE7; --ink-2: #C4C0B8; --ink-3: #A29E95;
    --accent: #8AB0F2; --accent-hover: #A6C3F5; --accent-ink: #0E1A33; --accent-soft: #1E2B44; --accent-line: #3D5786;
    --ok: #7FD3B4; --ok-soft: #15322A; --ok-line: #2F6B57;
    --warn: #F2B266; --warn-soft: #3A2A12; --warn-line: #7A5520;
    --danger: #F59A8F; --danger-soft: #3D1D1A; --danger-line: #7E3A33;
    --scen: #C4AEF7; --scen-soft: #2A2240; --scen-line: #6A55A8;
    --demo: #F2D27A; --demo-soft: #352C10; --demo-line: #6F5B1E;
    --unk: #BDB8AE; --unk-soft: #26282C; --unk-line: #6B6E74;
    --c-actual: #6A94DE; --c-careful: #D27A33; --c-scen: #977BDA; --c-grid: #2E3237; --c-area: rgba(106, 148, 222, 0.12);
    --paper: #E9E5DC; --paper-ink: #2E2B27;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow-overlay: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme='donker'],
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121315; --surface: #1B1D20; --surface-2: #23262A; --surface-3: #2C3035;
  --line: #33373D; --line-strong: #4B5058;
  --ink: #EEECE7; --ink-2: #C4C0B8; --ink-3: #A29E95;
  --accent: #8AB0F2; --accent-hover: #A6C3F5; --accent-ink: #0E1A33; --accent-soft: #1E2B44; --accent-line: #3D5786;
  --ok: #7FD3B4; --ok-soft: #15322A; --ok-line: #2F6B57;
  --warn: #F2B266; --warn-soft: #3A2A12; --warn-line: #7A5520;
  --danger: #F59A8F; --danger-soft: #3D1D1A; --danger-line: #7E3A33;
  --scen: #C4AEF7; --scen-soft: #2A2240; --scen-line: #6A55A8;
  --demo: #F2D27A; --demo-soft: #352C10; --demo-line: #6F5B1E;
  --unk: #BDB8AE; --unk-soft: #26282C; --unk-line: #6B6E74;
  --c-actual: #6A94DE; --c-careful: #D27A33; --c-scen: #977BDA; --c-grid: #2E3237; --c-area: rgba(106, 148, 222, 0.12);
  --paper: #E9E5DC; --paper-ink: #2E2B27;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-overlay: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
}
:root[data-theme='licht'],
:root[data-theme='light'] {
  color-scheme: light;
}

/* Telefoon: grotere tikdoelen en kleinere marges */
@media (max-width: 720px) {
  :root {
    --tap: 44px;
    --gap-section: 28px;
    --pad-card: 16px;
    --pad-page-y: 18px;
    --pad-page-x: 16px;
    --fs-2xl: 24px;
    --fs-xl: 19px;
    --fs-3xl: 30px;
  }
}

/* ---------- 2. Basis ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font);
  color: var(--ink);
  margin: 0 0 var(--space-3);
}
h1 {
  font-size: var(--fs-2xl);
  line-height: 1.2143;
  font-weight: 750;
  letter-spacing: -0.01em;
}
h2 {
  font-size: var(--fs-xl);
  line-height: 1.3333;
  font-weight: 750;
}
h3 {
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}
h4 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}
p {
  margin: 0 0 var(--space-3);
}
small,
.small {
  font-size: var(--fs-sm);
  line-height: 18px;
}
.xs {
  font-size: var(--fs-xs);
  line-height: 16px;
}
.num,
.amount {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.muted {
  color: var(--ink-2);
}
.subtle {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 18px;
}
.eyebrow {
  font-size: var(--fs-xs);
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.b {
  font-weight: 650;
}
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.sr-only,
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
::selection {
  background: var(--accent-soft);
}
[hidden] {
  display: none !important;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-4) 0;
}

/* Iconen: lijntekening in de kleur van de tekst */
.ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: middle;
}
.ic-sm {
  width: 14px;
  height: 14px;
}
.ic-lg {
  width: 24px;
  height: 24px;
}

/* ---------- 3. Opstart- en inlogscherm ---------- */
.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: var(--space-4);
  justify-items: center;
  color: var(--ink-2);
  padding: var(--space-4);
}
.boot-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  animation: boot-breathe 1400ms linear infinite;
}
.boot .card {
  width: min(420px, calc(100vw - 32px));
}
.auth-card {
  animation: rise var(--dur-3) var(--ease-out) backwards;
}

/* ---------- 4. Schil: zijmenu, topbalk, snelmenu ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
  view-transition-name: zijmenu;
  scrollbar-width: thin;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 10px 20px;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  color: var(--ink);
}
.brand small {
  display: block;
  font-weight: 500;
  font-size: var(--fs-xs);
  line-height: 16px;
  color: var(--ink-3);
}
.brand img,
.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: none;
}
.mark {
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav a,
.nav-i {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.nav a.active,
.nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}
.nav a.sub {
  padding-left: 38px;
  font-size: 14px;
  min-height: 36px;
}
.nav .nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.nav .count {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: transform var(--dur-2) var(--ease-spring);
}
.nav a:hover .count {
  transform: scale(1.1);
}
.nav-section {
  margin: var(--space-4) 10px var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.sidebar-foot {
  margin-top: auto;
  padding: 16px 4px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  min-width: 0;
}
.who .avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
  flex: none;
}
.who .name {
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who .meta {
  font-size: var(--fs-xs);
  line-height: 16px;
  color: var(--ink-3);
}
.foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.foot-actions .btn {
  flex: 1 1 auto;
}

/* Weergave-instellingen (thema en animaties) in de zijbalkvoet */
.prefs {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.prefs > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-1) var(--ease-out);
}
.prefs > summary::-webkit-details-marker {
  display: none;
}
.prefs > summary:hover {
  background: var(--surface-2);
}
.prefs > summary .chev {
  margin-left: auto;
  transition: transform var(--dur-2) var(--ease-out);
}
.prefs[open] > summary .chev {
  transform: rotate(180deg);
}
.prefs-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 10px 12px;
  animation: fade var(--dur-2) var(--ease-out) backwards;
}
.prefs-body .flabel {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.prefs-body .seg {
  width: 100%;
}
.prefs-body .seg button {
  flex: 1 1 0;
  padding: 4px 6px;
  font-size: 13px;
}

.main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--pad-page-y) var(--pad-page-x) 72px;
  min-width: 0;
  outline: none;
}
.topbar,
.mnav {
  display: none;
}
/* Het donkere vlak achter het telefoonmenu bestaat alleen op smalle schermen. */
.shell > .scrim {
  display: none;
}

/* Voorbeeldbalk (demonstratiemodus) */
.demo-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--demo-soft);
  color: var(--demo);
  border-bottom: 1px solid var(--demo-line);
  padding: 8px var(--pad-page-x);
  font-size: var(--fs-sm);
  line-height: 18px;
  animation: rise var(--dur-3) var(--ease-out) backwards;
}
.demo-bar b {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--fs-xs);
  border: 1px solid var(--demo-line);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}
.demo-bar .btn {
  margin-left: auto;
  min-height: 32px;
  color: var(--demo);
  border-color: var(--demo-line);
  background: transparent;
}
/* Oude naam blijft werken */
.demo-banner {
  background: var(--demo-soft);
  color: var(--demo);
  border-bottom: 1px solid var(--demo-line);
  padding: 8px var(--pad-page-x);
  font-size: var(--fs-sm);
}

/* ---------- 5. Pagina, koppen, rasters ---------- */
.route-view {
  position: relative;
  min-width: 0;
}
.page {
  min-width: 0;
}
.page[hidden] {
  display: none;
}
.route-loader {
  display: none;
}
.route-loader.show {
  display: block;
  animation: fade var(--dur-2) var(--ease-out) backwards;
}
.route-loader .status {
  margin-top: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.page-header,
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: var(--space-5);
}
.page-header h1,
.page-head h1 {
  margin: 0;
}
.page-header .page-sub,
.page-head .sub {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
  margin-top: var(--space-1);
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.grid,
.g {
  display: grid;
  gap: var(--gap-grid);
}
.grid-2,
.g-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3,
.g-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4,
.g-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.g-12 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.g-21 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  flex-wrap: wrap;
}
.row.between,
.between {
  justify-content: space-between;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.section {
  margin-top: var(--gap-section);
}
.section > h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: var(--space-4);
}
.section-head h2 {
  margin: 0;
}
.section-head .meta {
  color: var(--ink-3);
  font-size: var(--fs-sm);
}

/* ---------- 6. Breekpunten (zelfde grenzen als het ontwerp) ---------- */
@media (max-width: 1180px) {
  .grid-4,
  .g-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    height: 100%;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
    box-shadow: var(--shadow-overlay);
    z-index: 40;
    view-transition-name: none;
  }
  .shell.menu-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-3) var(--ease-out), visibility 0s;
  }
  .shell > .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-3) var(--ease-out);
    z-index: 35;
  }
  .shell.menu-open > .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .mhead {
    position: sticky;
    top: 0;
    z-index: 30;
    view-transition-name: topbalk;
  }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--topbar-h);
    padding: 6px 12px 6px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .topbar .mark {
    width: 28px;
    height: 28px;
    font-size: 13px;
    border-radius: 7px;
  }
  .topbar .t {
    font-weight: 700;
    font-size: 17px;
    line-height: 22px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mnav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 6px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .mnav::-webkit-scrollbar {
    display: none;
  }
  .mnav a {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
  }
  .mnav a[aria-current='page'] {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .mnav .nav-icon {
    width: 16px;
    height: 16px;
  }
  /* Voorbeeldbalk compact; terug naar echt staat ook in het menu */
  .demo-bar {
    padding: 6px var(--pad-page-x);
    font-size: var(--fs-xs);
    line-height: 16px;
  }
  .demo-bar .btn {
    display: none;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .g-2,
  .g-3,
  .g-4,
  .g-12,
  .g-21 {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-header .page-actions,
  .page-head .actions {
    width: 100%;
  }
  .page-header .page-actions > .btn,
  .page-head .actions > .btn {
    flex: 1 1 auto;
  }
}

/* ---------- 7. Beweging (§7) ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes grow-y {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes wipe {
  from {
    clip-path: inset(-12px 100% -12px -12px);
  }
  to {
    clip-path: inset(-12px -12px -12px -12px);
  }
}
@keyframes drawer-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: none;
  }
}
@keyframes drawer-out {
  from {
    transform: none;
  }
  to {
    transform: translateX(100%);
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
@keyframes sheet-out {
  from {
    transform: none;
  }
  to {
    transform: translateY(100%);
  }
}
@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: none;
  }
}
@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes draw-stroke {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}
@keyframes sk-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes boot-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 1. Pagina komt binnen: kop schuift 8 px omhoog, secties volgen na elkaar */
.page > * {
  animation: rise var(--dur-3) var(--ease-out) backwards;
}
.page > :nth-child(2) {
  animation-delay: calc(var(--stagger) * 1);
}
.page > :nth-child(3) {
  animation-delay: calc(var(--stagger) * 2);
}
.page > :nth-child(4) {
  animation-delay: calc(var(--stagger) * 3);
}
.page > :nth-child(n + 5) {
  animation-delay: calc(var(--stagger) * 4);
}
/* Paginawissel zonder View Transitions: de nieuwe pagina komt 8 px omhoog */
.page.enter {
  animation: page-in 280ms var(--ease-out) backwards;
}

/* 2. Kaarten in een raster komen na elkaar */
.grid > *,
.g > * {
  animation: rise var(--dur-3) var(--ease-out) backwards;
}
.grid > :nth-child(1),
.g > :nth-child(1) {
  animation-delay: 80ms;
}
.grid > :nth-child(2),
.g > :nth-child(2) {
  animation-delay: 140ms;
}
.grid > :nth-child(3),
.g > :nth-child(3) {
  animation-delay: 200ms;
}
.grid > :nth-child(n + 4),
.g > :nth-child(n + 4) {
  animation-delay: 260ms;
}

/* Gestaffeld binnenkomen: zet style="--i: n" op kinderen van .stagger (anders volgorde) */
.stagger > * {
  animation: rise var(--dur-3) var(--ease-out) backwards;
  animation-delay: calc(var(--i, var(--i-auto, 0)) * var(--stagger));
}
.stagger > :nth-child(2) { --i-auto: 1; }
.stagger > :nth-child(3) { --i-auto: 2; }
.stagger > :nth-child(4) { --i-auto: 3; }
.stagger > :nth-child(5) { --i-auto: 4; }
.stagger > :nth-child(6) { --i-auto: 5; }
.stagger > :nth-child(n + 7) { --i-auto: 6; }

/* 12. Paginaovergang met View Transitions (zijmenu blijft staan) */
::view-transition-old(root) {
  animation: fade-out var(--dur-2) var(--ease-in) both;
}
::view-transition-new(root) {
  animation: page-in 280ms var(--ease-out) both;
}

/* Minder beweging: alles stil, eindtoestand blijft gewone CSS (§7.4) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(*) {
    animation: none !important;
  }
  /* Skelet: geen glans, alleen pas na 300 ms zichtbaar (geen flits) */
  .skeleton,
  .sk {
    animation: sk-reveal 1ms linear 300ms backwards !important;
  }
}
:root[data-motion='uit'] *,
:root[data-motion='uit'] *::before,
:root[data-motion='uit'] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
:root[data-motion='uit']::view-transition-old(root),
:root[data-motion='uit']::view-transition-new(root) {
  animation: none !important;
}
:root[data-motion='uit'] .skeleton,
:root[data-motion='uit'] .sk {
  animation: sk-reveal 1ms linear 300ms backwards !important;
}
