/* Horstel – "Twee draden" (zie DESIGN.md). Licht is de basis; donker volgt het systeem of de eigen keuze.
   Persoonskleuren betekenen altijd "van wie" en worden nergens als versiering gebruikt. */

:root {
  color-scheme: only light;
  --bg: #eef1f4;
  --surface-low: #ffffff;
  --surface-mid: #d9dee5;      /* surface-muted */
  --surface-high: #d9dee5;
  --line: #b8c1cc;
  --card-border: transparent;  /* geen randen of schaduwen: diepte uit bg tegen surface */
  --text: #1a2230;
  --text-2: #4a5568;
  --accent: #1a2230;           /* knoppen en actieve staat: inkt, geen persoonskleur */
  --accent-hover: #2c3647;
  --accent-text: #1a2230;
  --on-accent: #ffffff;
  --badge-bg: #d9dee5;
  --badge-text: #1a2230;
  --danger: #b3261e;
  --input: #ffffff;
  --placeholder: #6b7686;
  --chip: #d9dee5;
  --chip-text: #4a5568;
  --chip-on-bg: #1a2230;
  --chip-on-text: #ffffff;
  --track: #d9dee5;
  --nav-bg: #ffffff;
  --scrim: rgba(26, 34, 48, 0.4);
  --rim: none;
  --card-shadow: none;
  --float-shadow: none;
  --nest-bg: #faf6f0;
  --switch-knop: #ffffff;
  /* Persoonskleuren */
  --person-E: #1f3a5f;          /* Joeri, inktblauw */
  --person-J: #e8a33d;          /* Angela, goudsbloem */
  --person-J-strong: #b87714;   /* goudsbloem als lijn of icoon op wit */
  --on-person-E: #ffffff;
  --on-person-J: #1a2230;
  --nestie-kleur: #f08a5d;
  /* Horstie-blok per toon */
  --toon-braaf-bg: var(--surface-low); --toon-braaf-tekst: var(--text); --toon-braaf-pijl: var(--text-2);
  --toon-stout-bg: #fbe3d6; --toon-stout-tekst: #712b13; --toon-stout-pijl: #993c1d;
  --toon-noir-bg: #1f3a5f; --toon-noir-tekst: #eef1f4; --toon-noir-pijl: #e8a33d;
}

/* Donker (verplicht) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14202f; --surface-low: #1d2b3d; --surface-mid: #2a3a50; --surface-high: #2a3a50;
    --line: #3d4f68; --text: #eef1f4; --text-2: #a9b6c7;
    --accent: #eef1f4; --accent-hover: #ffffff; --accent-text: #eef1f4; --on-accent: #14202f;
    --badge-bg: #2a3a50; --badge-text: #eef1f4; --danger: #ffb4ab;
    --input: #1d2b3d; --placeholder: #8593a6; --chip: #2a3a50; --chip-text: #a9b6c7; --chip-on-bg: #eef1f4; --chip-on-text: #14202f;
    --track: #2a3a50; --nav-bg: #1d2b3d; --scrim: rgba(0, 0, 0, 0.55); --switch-knop: #a9b6c7;
    --person-E: #7fa6d6; --person-J: #e8a33d; --person-J-strong: #e8a33d; --on-person-E: #14202f; --on-person-J: #14202f;
    --toon-stout-bg: #4a2416; --toon-stout-tekst: #fbe3d6; --toon-stout-pijl: #f08a5d;
    --toon-noir-bg: #0e1b2c; --toon-noir-tekst: #eef1f4; --toon-noir-pijl: #e8a33d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14202f; --surface-low: #1d2b3d; --surface-mid: #2a3a50; --surface-high: #2a3a50;
  --line: #3d4f68; --text: #eef1f4; --text-2: #a9b6c7;
  --accent: #eef1f4; --accent-hover: #ffffff; --accent-text: #eef1f4; --on-accent: #14202f;
  --badge-bg: #2a3a50; --badge-text: #eef1f4; --danger: #ffb4ab;
  --input: #1d2b3d; --placeholder: #8593a6; --chip: #2a3a50; --chip-text: #a9b6c7; --chip-on-bg: #eef1f4; --chip-on-text: #14202f;
  --track: #2a3a50; --nav-bg: #1d2b3d; --scrim: rgba(0, 0, 0, 0.55); --switch-knop: #a9b6c7;
  --person-E: #7fa6d6; --person-J: #e8a33d; --person-J-strong: #e8a33d; --on-person-E: #14202f; --on-person-J: #14202f;
  --toon-stout-bg: #4a2416; --toon-stout-tekst: #fbe3d6; --toon-stout-pijl: #f08a5d;
  --toon-noir-bg: #0e1b2c; --toon-noir-tekst: #eef1f4; --toon-noir-pijl: #e8a33d;
}

/* ---------- Basis ---------- */

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; }
h1, h2, h3 { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  display: inline-block; width: 1em; overflow: hidden;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased; flex: none;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.ms.sm { font-size: 20px; }

:focus-visible { outline: 2px solid var(--person-J); outline-offset: 2px; }

/* Typografie (DESIGN.md) */
.headline-xl { font-size: 30px; line-height: 38px; font-weight: 500; letter-spacing: -0.025em; }
.headline-lg { font-size: 20px; line-height: 26px; font-weight: 500; letter-spacing: 0; }
.headline-md { font-size: 20px; line-height: 26px; font-weight: 500; letter-spacing: -0.015em; }
.headline-sm { font-size: 16px; line-height: 22px; font-weight: 500; letter-spacing: -0.01em; }
.body-lg { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: -0.005em; }
.body-sm { font-size: 12px; line-height: 16px; letter-spacing: 0.01em; }
.label-sm { font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: 0; }
.muted { color: var(--text-2); }

/* ---------- Shell ---------- */

.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.topbar .logo { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.topbar .titles { flex: 1; min-width: 0; }
.topbar .overline { color: var(--text-2); }
.me-pill {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 4px;
  border-radius: 9999px; background: var(--surface-mid); font-weight: 500;
}

main { flex: 1; padding: 4px 16px calc(120px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 400px) { main, .topbar { padding-left: 20px; padding-right: 20px; } }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Kaarten ---------- */

.card {
  background: var(--surface-low); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 16px; box-shadow: var(--card-shadow), var(--rim);
  display: flex; flex-direction: column; gap: 12px;
}
.card.tight { gap: 8px; }
main > .card, main > .section { scroll-margin-top: 96px; }
.card-title { font-size: 16px; line-height: 22px; font-weight: 500; letter-spacing: -0.01em; }

/* Hero met Horstie */
.hero { flex-direction: row; align-items: center; gap: 12px; padding: 18px 16px 18px 18px; overflow: hidden; position: relative; }
.hero .grow { display: flex; flex-direction: column; gap: 8px; }
.nestie { width: 96px; height: 96px; flex: none; }
.nestie.lg { width: 168px; height: 168px; }
.nestie.md { width: 120px; height: 120px; }
.hero .nestie { margin: -8px -6px -10px 0; }
.nestie-wave { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

.progress { height: 6px; border-radius: 9999px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 9999px; background: var(--accent); transition: width .4s cubic-bezier(.2,.8,.2,1); }

/* ---------- Knoppen ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: 9999px;
  font-size: 14px; line-height: 18px; font-weight: 500; letter-spacing: 0.01em;
  transition: transform .12s ease, background-color .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { filter: brightness(1.08); }
.btn-secondary { background: var(--surface-mid); color: var(--text); border: 1px solid var(--line); }
.btn-ghost { color: var(--text-2); padding: 0 12px; }
.btn-danger { color: var(--danger); padding: 0 12px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 9999px; display: grid; place-items: center;
  background: var(--surface-mid); color: var(--text); flex: none;
}

.fab {
  position: fixed; z-index: 6; right: max(16px, calc(50% - 244px));
  bottom: calc(96px + env(safe-area-inset-bottom));
  height: 56px; padding: 0 22px 0 18px; border-radius: 9999px;
  background: var(--accent); color: var(--on-accent); font-weight: 500;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--float-shadow);
}
.fab:active { transform: scale(0.97); }

/* ---------- Chips ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; padding: 0 16px; border-radius: 9999px; background: var(--chip); color: var(--chip-text);
  font-weight: 500; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--chip-on-bg); color: var(--chip-on-text); font-weight: 500; }
.chip.day { min-width: 44px; padding: 0 12px; justify-content: center; }

.badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 9999px; background: var(--badge-bg); color: var(--badge-text);
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.01em;
}
.badge.neutral { background: var(--surface-mid); color: var(--text-2); }
.badge .ms { font-size: 16px; }

/* ---------- Avatars ---------- */

.avatar {
  width: 32px; height: 32px; border-radius: 9999px; display: grid; place-items: center; flex: none;
  font-weight: 500; font-size: 13px; border: 2px solid var(--surface-low);
}
.av-E { background: var(--person-E); color: var(--on-person-E); }
.av-J { background: var(--person-J); color: var(--on-person-J); }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.xl { width: 72px; height: 72px; font-size: 28px; }
.avatar.foto { overflow: hidden; background: var(--surface-mid); }
.avatar.foto img { width: 100%; height: 100%; object-fit: cover; }
.profiel { align-items: center; gap: 16px; }
label.btn { position: relative; cursor: pointer; }

/* ---------- Taakkaart ---------- */

.task { gap: 12px; }
.task-row { display: flex; align-items: center; gap: 12px; }
.task-body { flex: 1; min-width: 0; text-align: left; }
.task-title { font-size: 16px; line-height: 22px; font-weight: 500; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.task-meta { font-size: 12px; line-height: 16px; color: var(--text-2); margin-top: 2px; }
.task.done .task-title { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--line); }
.task-actions { display: flex; gap: 8px; padding-left: 36px; flex-wrap: wrap; }
.task-badges { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 36px; }
.task-nestie { width: 44px; height: 44px; margin: -8px -4px -8px 0; flex: none; }

.check {
  width: 24px; height: 24px; border-radius: 9999px; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; color: transparent; position: relative;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.check::after { content: ''; position: absolute; inset: -10px; } /* groter tikvlak */
.check .ms { font-size: 18px; font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 20; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check.pop { animation: pop .32s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }

/* Compacte rij (week, later, taken) */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface-low); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 12px 16px; min-height: 60px; box-shadow: var(--card-shadow);
}
button.item:active, .item.tap:active { background: var(--surface-mid); }
.item .grow { display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 500; font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.item-meta { font-size: 12px; line-height: 16px; color: var(--text-2); }
.item.done .item-title { color: var(--text-2); text-decoration: line-through; }
.item .chev { color: var(--text-2); }

/* ---------- Verzoek ---------- */

.request { border: 1px solid var(--accent); box-shadow: var(--rim); }
.request .who { display: flex; align-items: center; gap: 8px; }
.request .text { font-size: 15px; line-height: 22px; font-weight: 500; }
.request .actions { display: flex; gap: 8px; }
.request .actions .btn { flex: 1; }
.request.out { border-color: var(--card-border); }

/* ---------- Week ---------- */

.weeknav { display: flex; align-items: center; gap: 8px; margin-bottom: -8px; }
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px;
  border-radius: 9999px; position: relative;
}
.day .dl { font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.day .dn { font-size: 16px; line-height: 22px; font-weight: 500; }
.day .dots { display: flex; gap: 3px; height: 4px; }
.day .dot { width: 4px; height: 4px; border-radius: 9999px; background: var(--accent); }
.day .dot.done { background: var(--line); }
.day.today { background: var(--accent); }
.day.today .dl, .day.today .dn { color: var(--on-accent); }
.day.today .dn { font-weight: 500; }
.day.today .dot { background: var(--on-accent); }
.day.today .dot.done { background: rgba(0,0,0,.35); }
.day.vak .dn { color: var(--text-2); }

.daygroup { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 90px; }
.daygroup-head { display: flex; align-items: baseline; gap: 8px; }
.daygroup-head .headline-sm { flex: none; }
details.daygroup > summary { list-style: none; cursor: pointer; }
details.daygroup > summary::-webkit-details-marker { display: none; }
details.daygroup > summary .ms { transition: transform .2s; color: var(--text-2); }
details.daygroup[open] > summary .ms { transform: rotate(180deg); }

/* ---------- Banner ---------- */

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px;
  background: var(--badge-bg); color: var(--badge-text); font-weight: 500;
}

/* ---------- Formulieren ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-label { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.03em; color: var(--text-2); }
.input {
  width: 100%; background: var(--input); border: 1px solid transparent; border-radius: 12px;
  padding: 14px 16px; font-size: 16px; line-height: 20px; color: var(--text); outline: none;
  -webkit-appearance: none; appearance: none; min-height: 50px;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--accent); box-shadow: none; }
select.input { background-image: none; }
.hint { font-size: 12px; line-height: 16px; color: var(--text-2); }

.setting { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.setting .grow { display: flex; flex-direction: column; gap: 2px; }
.setting-title { font-weight: 500; font-size: 15px; }
.divider { height: 1px; background: var(--card-border); margin: 0 -16px; }

.switch { width: 52px; height: 32px; border-radius: 9999px; background: var(--line); position: relative; flex: none; transition: background-color .2s; }
.switch::after {
  content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 9999px;
  background: var(--switch-knop); transition: transform .2s cubic-bezier(.2,.8,.2,1);
}
.switch[aria-pressed="true"] { background: var(--accent); }
.switch[aria-pressed="true"]::after { transform: translateX(20px); background: var(--on-accent); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--chip); padding: 4px; border-radius: 9999px; }
.seg button { height: 36px; border-radius: 9999px; font-weight: 500; font-size: 13px; color: var(--chip-text); }
.seg button.on { background: var(--chip-on-bg); color: var(--chip-on-text); font-weight: 500; }

/* ---------- Bottom-navigatie ---------- */

.navwrap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; pointer-events: none;
  padding: 24px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 55%);
}
.nav {
  pointer-events: auto; max-width: 488px; margin: 0 auto; height: 68px; border-radius: 9999px;
  background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px;
}
.nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 9999px; color: var(--text-2); font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: 0.02em;
}
.nav button.on { color: var(--accent); }
.nav button.on .ms { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* ---------- Bottom sheet ---------- */

.scrim { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  background: var(--surface-low); border-radius: 24px 24px 0 0; box-shadow: var(--rim);
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px;
  animation: up .28s cubic-bezier(.2,.8,.2,1);
}
.sheet .grabber { width: 36px; height: 4px; border-radius: 9999px; background: var(--line); margin: 4px auto 4px; }
.sheet .item { background: var(--surface-mid); border-color: transparent; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

/* ---------- Toast ---------- */

.toast {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom));
  max-width: 488px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  background: var(--surface-high); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 10px 10px 14px;
  animation: up .25s cubic-bezier(.2,.8,.2,1);
}
.toast img { width: 52px; height: 52px; margin: -10px 0 -10px -6px; }
.toast .grow { font-weight: 500; }

/* ---------- Vergrendel- en koppelscherm ---------- */

.lock {
  min-height: 100dvh; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: clamp(8px, 2dvh, 20px);
  padding: calc(clamp(12px, 3dvh, 24px) + env(safe-area-inset-top)) 24px calc(clamp(12px, 3dvh, 24px) + env(safe-area-inset-bottom));
  text-align: center;
}
/* Op lagere schermen (of met grotere tekst) krimpen Horstie en het toetsenblok mee, zodat er niets te scrollen is. */
.lock .nestie.lg { width: clamp(84px, 17dvh, 168px); height: clamp(84px, 17dvh, 168px); }
.lock .nestie.md { width: clamp(72px, 13dvh, 120px); height: clamp(72px, 13dvh, 120px); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand span { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.lock .actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; height: 16px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 9999px; border: 2px solid var(--line); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { --toets: clamp(52px, 8.4dvh, 72px); display: grid; grid-template-columns: repeat(3, var(--toets)); gap: clamp(8px, 1.6dvh, 14px) 18px; justify-content: center; }
.keypad button {
  width: var(--toets); height: var(--toets); border-radius: 9999px; background: var(--surface-mid);
  font-size: 24px; font-weight: 500; display: grid; place-items: center;
}
.keypad button:active { background: var(--surface-high); transform: scale(.96); }
.keypad .blank { visibility: hidden; }
.keypad .key-alt { background: none; color: var(--text-2); }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.who-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 12px;
  border-radius: 10px; background: var(--surface-low); border: 1px solid var(--card-border); font-weight: 500; font-size: 16px;
}
.who-btn .avatar { width: 56px; height: 56px; font-size: 22px; }
.who-btn:active { background: var(--surface-mid); }
.who-btn[disabled] { opacity: .5; }
.topbar .offline { width: 40px; height: 40px; border-radius: 9999px; display: grid; place-items: center; flex: none; background: var(--badge-bg); color: var(--badge-text); }

/* Lege staat met Horstie */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 8px 16px 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Vandaag: "Twee draden" (DESIGN.md §4–5) ---------- */

/* Compacter op Vandaag: marge 12 px, 12 px tussen blokken. */
[data-tab="vandaag"] main { padding-left: 12px; padding-right: 12px; gap: 12px; }
[data-tab="vandaag"] .topbar { padding-left: 12px; padding-right: 12px; padding-bottom: 8px; }
.topbar .datum { font-size: 14px; line-height: 20px; color: var(--text-2); white-space: nowrap; }
.topbar .avatar { width: 28px; height: 28px; font-size: 12px; }

/* Horstie-blok: het ene gewaagde element per scherm. */
.nestie-blok {
  --nb-bg: var(--toon-braaf-bg); --nb-tekst: var(--toon-braaf-tekst); --nb-pijl: var(--toon-braaf-pijl);
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; text-align: left;
  padding: 8px 8px 8px 8px; border-radius: 14px; background: var(--nb-bg); color: var(--nb-tekst);
}
.nestie-blok.toon-stout { --nb-bg: var(--toon-stout-bg); --nb-tekst: var(--toon-stout-tekst); --nb-pijl: var(--toon-stout-pijl); }
.nestie-blok.toon-noir { --nb-bg: var(--toon-noir-bg); --nb-tekst: var(--toon-noir-tekst); --nb-pijl: var(--toon-noir-pijl); }
.nestie-av { width: 26px; height: 26px; border-radius: 9999px; background: var(--nestie-kleur); flex: none; overflow: hidden; display: grid; place-items: center; }
.nestie-av img { width: 30px; height: 30px; margin-top: 4px; }
.nestie-tekst {
  flex: 1; min-width: 0; font-size: 14px; line-height: 20px; padding-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nestie-blok[aria-expanded="true"] .nestie-tekst {
  white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4;
}
.nestie-blok .pijl { color: var(--nb-pijl); padding-top: 1px; transition: transform .2s ease; }
.nestie-blok[aria-expanded="true"] .pijl { transform: rotate(180deg); }


/* Weekbalk: per dag de verdeling in persoonskleuren. */
.weekbalk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wb-dag { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 44px; padding: 0; }
.wb-label { font-size: 11px; line-height: 14px; color: var(--text-2); text-align: center; }
.wb-dag.gekozen .wb-label { color: var(--text); font-weight: 500; }
.wb-staaf {
  height: 22px; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface-mid);
}
.wb-staaf > span { display: block; min-height: 3px; }
.wb-staaf .p-E { background: var(--person-E); }
.wb-staaf .p-J { background: var(--person-J); }
.wb-dag.vandaag .wb-staaf { outline: 2px solid var(--text); outline-offset: 1px; }
.wb-dag.gekozen:not(.vandaag) .wb-staaf { outline: 2px solid var(--text-2); outline-offset: 1px; }
.legenda { display: flex; gap: 16px; font-size: 11px; line-height: 14px; color: var(--text-2); margin-top: -4px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legenda .p-E { background: var(--person-E); }
.legenda .p-J { background: var(--person-J); }

/* Taakrij: balkje in de kleur van de eigenaar, titel en meta, afvinkcirkel. */
.taken { display: flex; flex-direction: column; gap: 6px; }
.taakrij {
  --eigen: var(--person-E); --eigen-lijn: var(--person-E);
  display: flex; align-items: center; min-height: 52px; background: var(--surface-low); border-radius: 10px;
  border-left: 4px solid var(--eigen-lijn); touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transition: transform .15s ease;
}
.taakrij.p-J { --eigen: var(--person-J); --eigen-lijn: var(--person-J-strong); } /* goudsbloem als lijn op wit: de sterke variant (3:1) */
.taakrij-body { flex: 1; min-width: 0; text-align: left; padding: 8px 4px 8px 10px; display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.taakrij-titel { font-size: 15px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.taakrij-meta { font-size: 12px; line-height: 16px; color: var(--text-2); }
.taakrij.klaar .taakrij-titel { color: var(--text-2); text-decoration: line-through; }
.afvink { width: 44px; height: 44px; flex: none; display: grid; place-items: center; margin-right: 4px; }
.afvink .rondje {
  width: 22px; height: 22px; border-radius: 9999px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent;
}
.afvink .rondje .ms { font-size: 18px; font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 20; }
.taakrij.klaar .afvink .rondje { border-color: transparent; color: var(--eigen); }
.taakrij.p-J.klaar .afvink .rondje { color: var(--person-J-strong); }
.afvink.ander { cursor: default; }
.afvink.ander .rondje { border-style: dashed; }
.afvink.pop .rondje { animation: pop .32s cubic-bezier(.2,1.6,.4,1); }
.taakrij.veeg { transform: translateX(-24px); }
.taken-kop { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; line-height: 16px; color: var(--text-2); margin-top: 4px; }
.leeg-uitnodiging { background: var(--surface-low); border-radius: 10px; padding: 12px; color: var(--text-2); }

/* Eigen persoonskleuren van deze installatie */
:root { --person-E: #b3261e; --person-J: #2e7d46; --person-J-strong: #2e7d46; --on-person-E: #ffffff; --on-person-J: #ffffff; --nestie-kleur: #f0e6c9; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --person-E: #f2928b; --person-J: #82cf9a; --person-J-strong: #82cf9a; --on-person-E: #14202f; --on-person-J: #14202f; }
}
:root[data-theme="dark"] { --person-E: #f2928b; --person-J: #82cf9a; --person-J-strong: #82cf9a; --on-person-E: #14202f; --on-person-J: #14202f; }
