/* First Things – stijlen */

:root {
  /* Forest Dream – diep bosgroen met een blauwe zweem */
  --bg: #f4f5f1;
  --surface: #fdfdfb;
  --surface-2: #eef0eb;
  --surface-3: #e3e7e1;
  --border: #e2e5df;
  --border-strong: #c9cfcb;
  --text: #22292a;
  --text-2: #5c6664;
  --text-3: #87918e;
  --accent: #2f4d48;
  --accent-hover: #263f3b;
  --accent-soft: #e2ebe8;
  --accent-text: #ffffff;
  --ok: #4f7396;          /* afgerond: grijsblauw, zodat groen niet dubbel voorkomt */
  --violet: #6f5a99;      /* openstaand: zacht paars */
  --prio-high: #b55d38;   /* hoge prioriteit: terracotta */
  --prio-low: #6b7a77;
  --ok-soft: #e3eaf2;
  --on-ok: #ffffff;
  --warn: #a5601d;
  --warn-soft: #f8ecdc;
  --danger: #b4412f;
  --danger-soft: #f8e6e2;
  --shadow-sm: 0 1px 2px rgba(25, 35, 33, .06);
  --shadow: 0 1px 2px rgba(25, 35, 33, .05), 0 4px 14px rgba(25, 35, 33, .06);
  --shadow-lg: 0 10px 40px rgba(25, 35, 33, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --sidebar-w: 248px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a19;
    --surface: #1d2422;
    --surface-2: #26302d;
    --surface-3: #303a37;
    --border: #2c3532;
    --border-strong: #435049;
    --text: #e6ece9;
    --text-2: #a3aeab;
    --text-3: #75817e;
    --accent: #8fb8ad;
    --accent-hover: #a5c8be;
    --accent-soft: #26403a;
    --accent-text: #10201c;
    --ok: #8aa8c9;
    --violet: #b7a3d6;
    --prio-high: #e3a283;
    --prio-low: #9aa7a4;
    --ok-soft: #1f2d3b;
    --on-ok: #10201c;
    --warn: #e0a55e;
    --warn-soft: #3a2c19;
    --danger: #ec8a78;
    --danger-soft: #3c221d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  }
}

/* Plus Jakarta Sans, op de eigen server (zie INSTALLATIE.md). Ontbreekt het
   bestand, dan valt de app terug op het systeemlettertype. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans-VariableFont_wght.woff2") format("woff2"),
       url("../fonts/PlusJakartaSans-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 16px; height: 16px; }
svg.i-lg { width: 24px; height: 24px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main {
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--nav-h) + var(--safe-bottom) + 96px);
  max-width: 780px;
  margin: 0 auto;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .01em;
}
.tab svg.i { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
    padding: 28px 16px; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto;
  }
  .main { margin-left: calc(var(--sidebar-w) + max(0px, (100vw - var(--sidebar-w) - 780px) / 2)); padding: 40px 32px 120px; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; margin-bottom: 22px; }
  .brand img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
  .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .brand-name { font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
  .brand-motto { color: var(--text-3); font-size: 12.5px; font-style: italic; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--text-2); text-decoration: none; font-weight: 600;
  }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .side-link .side-count { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 600; }
  .side-link[aria-current="page"] .side-count { color: var(--accent); }
  .side-spacer { flex: 1; }
}

/* ---------- Typografie & kop ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 16px; }
.page-head > div { min-width: 0; flex: 1 1 auto; }
/* Met boardwisselaar: actieknop op hoogte van de titel, wisselaar houdt zijn ruimte. */
.page-head:has(.board-switch) > .btn { align-self: flex-end; margin-bottom: 2px; }
.page-head .btn { flex: none; }
.page-head .btn .short { display: none; }
@media (max-width: 520px) { .page-head .btn .long { display: none; } .page-head .btn .short { display: inline; } }
.page-title { font-size: 28px; line-height: 1.15; font-weight: 780; letter-spacing: -.025em; margin: 0; }
.page-sub { color: var(--text-2); margin: 4px 0 0; font-size: 14.5px; }
@media (min-width: 900px) { .page-title { font-size: 32px; } }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none;
  font-weight: 600; font-size: 14px; margin: 0 0 10px; padding: 4px 2px;
}
.back-link svg.i { width: 18px; height: 18px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 26px 4px 8px; }

/* ---------- Tellingen ---------- */
:root { --stat-col: 200px; --row-pad: 8px; --check-w: 36px; }
/* Desktop (met zijbalk): statistieken en zoekregel vullen de volle breedte */
@media (min-width: 900px) {
  :root { --stat-col: 1fr; }
  .filter-panel, .filter-summary { max-width: none; }
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, var(--stat-col))); gap: 8px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.stat-n { font-size: 22px; font-weight: 760; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12px; color: var(--text-2); font-weight: 600; }
.stat { --sc: var(--accent); background: color-mix(in srgb, var(--sc) 13%, var(--surface)); border-color: color-mix(in srgb, var(--sc) 26%, var(--border)); }
.stat.is-ready { --sc: var(--accent); }
@media (prefers-color-scheme: light) { .stat.is-ready .stat-n { color: #3f6a62; } }
.stat .stat-n { color: var(--sc); }
.stat.is-open { --sc: var(--violet); }
.stat.is-ready { --sc: var(--accent); }
.stat.is-done { --sc: var(--ok); }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, var(--stat-col))); gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar .search { grid-column: span 2; }
.toolbar .filter-btn { width: 100%; padding: 0 10px; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 40px; padding-right: 36px; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--text-3); padding: 6px; border-radius: 8px; display: grid;
}
.filter-btn { position: relative; }
.filter-btn[aria-expanded="true"] { background: var(--surface-3); border-color: var(--border-strong); }
.filter-btn .badge-dot {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 11.5px; font-weight: 750;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.label-bar {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 0 -16px 12px; padding: 2px 16px 4px;
}
.label-bar::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .label-bar { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 0; } }
.label-bar .chip { flex: none; }
.chip-clear { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid transparent; background: var(--surface-3); color: var(--text); font-size: 14px; font-weight: 650; }
.chip-clear svg.i { width: 15px; height: 15px; }
.filter-panel {
  max-width: calc(3 * var(--stat-col) + 16px);
  display: block;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.filter-panel[hidden] { display: none; }
.filter-summary { max-width: calc(3 * var(--stat-col) + 16px); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; font-size: 13.5px; color: var(--text-2); }
.filter-summary[hidden] { display: none; }
.reorder-note { font-size: 12.5px; color: var(--text-3); margin: -2px 4px 10px; }

/* ---------- Formulieren ---------- */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 650; color: var(--text-2); margin: 0 2px 6px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
details.field > summary.field-label { display: list-item; }
.field-hint { font-size: 12px; color: var(--text-3); margin: 6px 2px 0; }
.input, .select, .textarea {
  width: 100%; display: block;
  font-size: 16px; /* voorkomt automatisch inzoomen op iOS */
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-lg { font-size: 18px; padding: 14px 15px; border-radius: 12px; }
.textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8c94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.check { display: flex; align-items: center; gap: 10px; margin: 4px 2px 18px; font-size: 14.5px; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.counter { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.is-warn { color: var(--warn); }
.counter.is-over { color: var(--danger); font-weight: 700; }

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 650; font-size: 15px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-link { border: 0; background: none; color: var(--accent); font-weight: 650; padding: 4px 2px; min-height: 0; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-3); flex: none;
}

/* ---------- Kaarten ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px;
}
.alert { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }

/* ---------- Groepen & taken ---------- */
.groups { display: flex; flex-direction: column; gap: 12px; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.group-head {
  display: flex; align-items: center; gap: 0; padding: 4px 8px 4px var(--row-pad); min-height: 50px;
}
.group-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none;
  padding: 8px 8px 8px calc((var(--check-w) - 20px) / 2); border-radius: 10px; text-align: left; font-weight: 700; font-size: 15.5px;
}
.group-toggle .chev { color: var(--text-3); transition: transform .18s; }
.group.is-collapsed .group-toggle .chev { transform: rotate(-90deg); }
.group-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.group-icon svg.i { width: 18px; height: 18px; }
.group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-body { border-top: 1px solid var(--border); }
.group.is-collapsed .group-body { display: none; }
.group-empty { padding: 14px 18px; color: var(--text-3); font-size: 14px; }

.task {
  display: flex; align-items: flex-start; gap: 0; padding: 6px 12px 6px var(--row-pad);
  border-bottom: 1px solid var(--border); background: var(--surface); position: relative;
}
.task:last-child { border-bottom: 0; }
.task-check {
  width: var(--check-w); height: 40px; flex: none; display: grid; place-items: center;
  border: 0; background: none; padding: 0; border-radius: 50%;
}
.task-check .circle {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong);
  display: grid; place-items: center; transition: all .15s; color: transparent;
}
.task-check .circle svg.i { width: 14px; height: 14px; stroke-width: 3; }
.task.is-done .task-check .circle { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.task.is-blocked .task-check .circle { border-style: dashed; color: var(--text-3); border-color: var(--text-3); }
.task.is-blocked .task-check .circle svg.i { stroke-width: 2.2; width: 12px; height: 12px; }
.task-main {
  flex: 1; min-width: 0; padding: 9px 0 6px 6px; cursor: pointer; border: 0; background: none; text-align: left;
}
.task-name { font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; font-weight: 520; }
.task.is-done .task-name { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.task.is-blocked .task-name { color: var(--text-2); }
.task-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center; }
.task-meta:empty { display: none; }
.task.is-enter { animation: enter .35s ease-out; }
@keyframes enter { from { background: var(--accent-soft); } to { background: var(--surface); } }

.pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; line-height: 1;
  padding: 4px 8px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.pill svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.pill-blocks { background: var(--accent-soft); color: var(--accent); }
.pill-requires { background: var(--warn-soft); color: var(--warn); }
.pill-requires { max-width: 100%; min-width: 0; }
.pill-requires svg.i { flex: none; }
.pill-requires .pill-txt { overflow: hidden; text-overflow: ellipsis; }
.pill-done { background: var(--ok-soft); color: var(--ok); }
.pill-note { background: transparent; padding-left: 2px; padding-right: 2px; color: var(--text-3); }

/* Labelkleuren */
.lbl { --c: #6b7280; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; line-height: 1; padding: 4px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 78%, var(--text)); }
.lbl .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.c-slate { --c: #64748b; } .c-red { --c: #e03131; } .c-orange { --c: #e8590c; } .c-amber { --c: #d4a20a; }
.c-lime { --c: #66a80f; } .c-green { --c: #2f9e44; } .c-teal { --c: #0c8599; } .c-sky { --c: #1c9ad6; }
.c-blue { --c: #1c64f2; } .c-indigo { --c: #4c51d6; } .c-violet { --c: #8a3ffc; } .c-pink { --c: #d6336c; }

/* Labelkeuze (chips) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px;
  border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-2);
}
.chip[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.chip[aria-pressed="true"]::after { content: "✓"; font-weight: 800; font-size: 12px; }

/* Segmentkeuze */
.segmented { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.segmented .seg-ind { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); pointer-events: none;
  transition: transform 250ms cubic-bezier(.25, .8, .3, 1), width 250ms cubic-bezier(.25, .8, .3, 1), background-color .25s, box-shadow .25s; }
.segmented.no-anim .seg-ind { transition: none; }
.segmented[data-value="1"] .seg-ind { background: color-mix(in srgb, var(--prio-high) 12%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--prio-high) 40%, transparent); }
.segmented[data-value="1"] input:checked + span { color: var(--prio-high); }
.segmented[data-value="3"] input:checked + span { color: var(--prio-low); }
.segmented label { position: relative; z-index: 1; display: flex; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 42px; padding: 6px 4px; white-space: nowrap;
  border-radius: 9px; font-size: 14px; font-weight: 650; color: var(--text-2); cursor: pointer; line-height: 1.2;
}
.segmented input:checked + span { color: var(--text); }
.segmented span svg.i { width: 15px; height: 15px; margin-right: 4px; stroke-width: 2.2; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.segmented input:disabled + span { opacity: .45; cursor: not-allowed; }
.dep-info { font-size: 13px; color: var(--text-2); margin: 8px 4px 0; overflow-wrap: anywhere; }

/* ---------- Afhankelijkhedenkiezer ---------- */
/* Geen geneste scrollcontainer: de lijst groeit mee en de pagina of het
   bewerkscherm scrolt. Zo kan niets samengedrukt worden of overlappen. */
.dep-picker { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.dep-picker-top { padding: 8px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.dep-picker-top .search .input { padding-top: 9px; padding-bottom: 9px; }
.dep-selected { font-size: 12.5px; color: var(--text-2); padding: 0 4px; font-weight: 600; }
.dep-group { border-bottom: 1px solid var(--border); }
.dep-group:last-child { border-bottom: 0; }
.dep-group-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 10px; border: 0; background: var(--surface-2);
  font-weight: 700; font-size: 14px; text-align: left; min-height: 44px;
}
.dep-group-head .chev { color: var(--text-3); transition: transform .18s; }
.dep-group.is-collapsed .dep-group-head .chev { transform: rotate(-90deg); }
.dep-group-head .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 650; }
.dep-group-head .count.has-sel { color: var(--accent); }
.dep-group.is-collapsed .dep-list { display: none; }
.dep-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.dep-item:first-child { border-top: 0; }
.dep-item input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.dep-item .dep-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
.dep-item.is-done .dep-name { color: var(--text-3); text-decoration: line-through; }
.dep-item.is-disabled { cursor: not-allowed; opacity: .55; }
.dep-empty { padding: 14px; color: var(--text-3); font-size: 14px; }

/* ---------- Toevoegen ---------- */
.add-card { padding: 18px; }
.add-row { display: flex; gap: 8px; }
.add-row .input { flex: 1; min-width: 0; }
.add-grid { display: grid; gap: 4px; margin-top: 16px; }
.recent { margin-top: 8px; }
.recent .task { border-radius: 0; }

/* ---------- Instellingen ---------- */
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px;
  border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; background: var(--surface); width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0;
}
.row:last-child { border-bottom: 0; }
.row-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.row-icon.is-accent { background: var(--accent-soft); color: var(--accent); }
.row-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--text-2); }
.row .chev-r { color: var(--text-3); }
.row-actions { display: flex; gap: 2px; }
.app-footer { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin-top: 32px; text-align: left; line-height: 1.35; }
.app-footer img { width: 44px; height: 44px; border-radius: 12px; box-shadow: var(--shadow-sm); flex: none; }
.app-footer strong { display: block; color: var(--text-2); font-size: 14px; }
.app-footer em { display: block; }

/* Iconenkiezer */
.icon-group-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.icon-opt {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); padding: 0; font-size: 11px; font-weight: 650;
}
.icon-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.icon-opt.is-none { font-size: 10.5px; line-height: 1.1; text-align: center; padding: 2px; }

/* Kleurenkiezer */
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 360px; }
.swatch {
  aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--c); position: relative; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.swatch[aria-pressed="true"]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }

/* ---------- Slepen ---------- */
.is-dragging { box-shadow: var(--shadow-lg) !important; opacity: .97; cursor: grabbing; border-radius: 12px; pointer-events: none; }
.sort-placeholder { background: var(--accent-soft) !important; border: 2px dashed var(--accent) !important; border-radius: 12px; box-shadow: none !important; }
body.is-sorting { user-select: none; -webkit-user-select: none; cursor: grabbing; }

/* ---------- Leeg ---------- */
.empty {
  text-align: center; padding: 40px 20px; color: var(--text-2); background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty > svg.i { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 8px; }
.empty p { margin: 0 0 12px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Modals ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 16, 22, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.modal {
  width: 100%; max-height: calc(100dvh - var(--safe-top) - 16px); max-height: calc(100vh - var(--safe-top) - 16px);
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: rise .2s ease-out;
}
@supports (height: 100dvh) { .modal { max-height: calc(100dvh - var(--safe-top) - 16px); } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--border); flex: none; }
.modal-title { font-size: 18px; font-weight: 750; margin: 0; flex: 1; letter-spacing: -.01em; }
.modal-body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.modal-foot {
  display: flex; gap: 8px; align-items: center; padding: 12px 18px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border); background: var(--surface); flex: none; border-radius: 0;
}
.modal-foot .spacer { flex: 1; }
@media (max-width: 440px) {
  .modal-foot { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .modal-foot .btn { padding: 0 12px; }
  #editDelete span, #editDuplicate span, #editMove span { display: none; }
}
.modal-sm .modal-body p { margin: 0 0 10px; color: var(--text-2); }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
}
.choice strong { font-size: 15px; }
.choice span { font-size: 13px; color: var(--text-2); }
.choice.is-danger strong { color: var(--danger); }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .modal { max-width: 600px; border-radius: 18px; max-height: min(860px, calc(100vh - 48px)); }
  .modal-foot { border-radius: 0 0 18px 18px; padding-bottom: 12px; }
  .modal-sm { max-width: 440px; }
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 200; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 24px; left: calc(var(--sidebar-w) + 24px); } }
.toast {
  pointer-events: auto; position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; max-width: 520px; width: 100%;
  background: #22292a; color: #f1f4f2; border-radius: 12px; padding: 12px 12px 12px 16px;
  box-shadow: var(--shadow-lg); font-size: 14.5px; animation: rise .2s ease-out;
}
@media (prefers-color-scheme: dark) { .toast { background: #e6ece9; color: #151a19; } }
.toast.is-error { background: var(--danger); color: #fff; }
.toast-msg { flex: 1; min-width: 0; }
.toast-action { border: 0; background: rgba(255,255,255,.14); color: inherit; font-weight: 750; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .toast-action { background: rgba(0,0,0,.08); color: #2f4d48; } }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: #8fb8ad; animation: bar linear forwards; }
@keyframes bar { from { width: 100%; } to { width: 0; } }

/* ---------- Inloggen ---------- */
.login-body { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-bottom)); }
.login { width: 100%; max-width: 380px; }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 68px; height: 68px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center;
  background: #2f4d48; color: #fff; box-shadow: var(--shadow); /* zelfde als het app-icoon, ook in donker */
}
.login-logo svg { width: 46px; height: 46px; overflow: visible; }
.login-logo .lg-check { stroke: #2f4d48; }
.login-brand h1 { font-size: 28px; letter-spacing: -.025em; margin: 14px 0 2px; }
.login-brand .motto { color: var(--text-2); font-style: italic; margin: 0; }
.login-card { padding: 22px; }

/* ---------- Installatie ---------- */
.install { max-width: 560px; margin: 40px auto; padding: 0 16px 60px; }
.install h1 { letter-spacing: -.02em; }
.install fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.install legend { font-weight: 750; font-size: 16px; margin-bottom: 10px; }
.install pre { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 10px; font-size: 13px; overflow-x: auto; }
.ok-box { background: var(--ok-soft); color: var(--ok); padding: 12px 14px; border-radius: 10px; font-weight: 650; margin-bottom: 14px; }

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

/* Hover-effecten alleen op apparaten met een muis: op touchscreens
   blijft een getikte knop anders grijs "hangen". */
@media (hover: hover) {
  .btn:hover { background: var(--surface-2); }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn-danger:hover { background: var(--danger-soft); }
  .btn-danger-solid:hover { filter: brightness(.95); background: var(--danger); }
  .btn-ghost:hover { background: var(--surface-2); color: var(--text); }
  .btn-link:hover { background: none; text-decoration: underline; }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
  .icon-btn.is-danger:hover { color: var(--danger); background: var(--danger-soft); }
  .group-toggle:hover { background: var(--surface-2); }
  .task-check:hover .circle { border-color: var(--accent); color: var(--accent); }
  .task.is-blocked .task-check:hover .circle { color: var(--warn); border-color: var(--warn); }
  a.row:hover, button.row:hover { background: var(--surface-2); }
  .icon-opt:hover { background: var(--surface-2); color: var(--text); }
  .choice:hover { background: var(--surface-2); }
}
@media (max-width: 370px) { .segmented span { white-space: normal; font-size: 13px; } }

/* ---------- Animaties: afronden (speels) en vrijgekomen taken ---------- */
.task.is-completing .task-check .circle { background: var(--ok); border-color: var(--ok); color: var(--on-ok); animation: ft-pop .35s ease; }
.task.is-completing .task-check .circle path { stroke-dasharray: 20; animation: ft-draw .3s ease .1s both; }
.task.is-completing { animation: ft-nudge .45s ease .15s; }
.task.is-completing .task-name { color: var(--text-3); transition: color .3s .2s; }
.task.is-completing .task-name::after { width: 100%; }
.task-name { position: relative; }
.task-name::after { content: ""; position: absolute; left: 0; top: .68em; height: 1.5px; width: 0; background: var(--text-3); transition: width .3s ease .15s; }
.task.is-done .task-name::after { display: none; }
.task.is-leaving { overflow: hidden; animation: ft-leave .42s ease forwards; }
.task.is-unlocked { animation: ft-unlock-in .55s cubic-bezier(.2, .8, .3, 1.2), ft-glow 1.8s ease; }
.task.is-unlocked .task-check .circle { animation: ft-wiggle .6s ease; border-color: var(--accent); }
.pill-new { background: var(--accent-soft); color: var(--accent); transition: opacity .6s; }
.pill-new.is-fading { opacity: 0; }
@keyframes ft-pop { 45% { transform: scale(1.3); } }
@keyframes ft-draw { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
@keyframes ft-nudge { 30% { transform: translateX(6px); } 60% { transform: translateX(-2px); } }
@keyframes ft-leave { to { opacity: 0; transform: translateX(28px); max-height: 0; padding-top: 0; padding-bottom: 0; border-bottom-width: 0; } }
@keyframes ft-unlock-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes ft-glow { from { background: var(--accent-soft); } to { background: var(--surface); } }
@keyframes ft-wiggle { 25% { transform: rotate(-14deg) scale(1.2); } 55% { transform: rotate(10deg) scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  .task.is-completing, .task.is-completing .task-check .circle, .task.is-unlocked, .task.is-unlocked .task-check .circle { animation: none !important; }
}

/* ---------- Installatie-uitleg ---------- */
.install-intro { margin: 0 0 12px; color: var(--text-2); }
.install-steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.install-step { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.install-n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 750; font-size: 13px; flex: none; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-text strong { font-weight: 650; }
.install-text span { font-size: 13px; color: var(--text-2); }
.install-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; flex: none; }

/* ---------- Prioriteit ---------- */
.task.prio-high { background: color-mix(in srgb, var(--prio-high) 3.5%, var(--surface)); }
.task.prio-low .task-name { color: var(--text-2); }
.pill-prio-high { background: color-mix(in srgb, var(--prio-high) 13%, var(--surface)); color: var(--prio-high); }
.pill-prio-low { background: color-mix(in srgb, var(--prio-low) 13%, var(--surface)); color: var(--prio-low); }
.chip-prio svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.chip-prio.p-1 { --c: var(--prio-high); color: var(--prio-high); }
.chip-prio.p-3 { --c: var(--prio-low); color: var(--prio-low); }
.bar-div { flex: none; width: 1px; align-self: stretch; margin: 6px 2px; background: var(--border-strong); }

/* Afgeronde rij zonder sleepgreep houdt dezelfde inspringing */

/* ---------- Schuifjes (Weergave-opties) ---------- */
.switch-row { cursor: pointer; }
.switch {
  position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px; border: 0; padding: 0;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color .25s ease, box-shadow .25s ease; -webkit-tap-highlight-color: transparent;
}
.switch[aria-checked="true"] { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.switch-knob {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 3px 8px rgba(0, 0, 0, .12);
  transition: transform 280ms cubic-bezier(.3, 1.35, .5, 1), width 160ms ease;
}
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
/* Bij indrukken rekt het knopje even uit, zoals op iOS */
.switch-row:active .switch-knob { width: 33px; }
.switch-row:active .switch[aria-checked="true"] .switch-knob { transform: translateX(14px); }

/* ---------- Slepen door vasthouden ---------- */
.is-sortable > .task, .is-sortable > .group > .group-head, .is-sortable > .row {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.task.is-pressing, .group > .group-head.is-pressing, .row.is-pressing, .group.is-pressing > .group-head { background: var(--surface-2); transition: background-color .3s ease; }
.is-dragging {
  transform: scale(1.03); box-shadow: 0 10px 28px rgba(20, 20, 30, .18) !important; border-radius: 12px;
  transition: transform .16s ease, box-shadow .16s ease; pointer-events: none;
}
.is-dragging.is-settling { transform: none; transition: top .2s cubic-bezier(.25, .8, .3, 1), left .2s ease, transform .2s ease, box-shadow .2s ease; }
.sort-placeholder { background: color-mix(in srgb, var(--accent) 7%, transparent) !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0; box-shadow: none !important; }
.sort-placeholder.group { border-radius: var(--radius); border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent) !important; }

/* ---------- Plusje per categorie ---------- */
.group-add {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--text-2);
}
.group-add svg.i { width: 18px; height: 18px; stroke-width: 2.2; }
@media (hover: hover) { .group-add:hover { background: var(--accent-soft); color: var(--accent); } }
.group-add:active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Toevoegen: bevestiging en zwevende knop ---------- */
.add-input-wrap { position: relative; }
.add-input-wrap .input { padding-right: 46px; transition: border-color .3s, box-shadow .3s; }
.add-input-wrap .input.is-ok { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.add-tick {
  position: absolute; right: 12px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); display: grid; place-items: center; pointer-events: none;
  opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s cubic-bezier(.3, 1.5, .5, 1);
}
.add-tick svg.i { width: 14px; height: 14px; stroke-width: 3; }
.add-tick.is-on { opacity: 1; transform: none; }
.add-confirm {
  display: flex; align-items: center; gap: 6px; min-height: 22px; margin: 6px 2px 0; font-size: 13.5px; font-weight: 600; color: var(--accent);
  opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; overflow-wrap: anywhere;
}
.add-confirm svg.i { width: 16px; height: 16px; stroke-width: 2.6; flex: none; }
.add-confirm.is-on { opacity: 1; transform: none; }

.add-bar {
  position: fixed; z-index: 45; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bottom));
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
}
.add-bar-btns { display: flex; gap: 10px; max-width: 748px; margin: 0 auto; }
.add-bar .btn { flex: 1 1 0; min-width: 0; min-height: 48px; font-size: 16px; }
.add-bar .btn.is-empty { opacity: .55; }
.add-bar.above-kb { padding-bottom: 8px; }
body.has-add-bar .main { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 96px); }
body.has-add-bar .toasts { bottom: calc(var(--nav-h) + var(--safe-bottom) + 80px); }
@media (min-width: 900px) {
  .add-bar { bottom: 0; left: var(--sidebar-w); padding: 12px 32px 16px; }
  body.has-add-bar .main { padding-bottom: 120px; }
  body.has-add-bar .toasts { bottom: 90px; }
}

/* ---------- Notities: leesweergave ---------- */
.notes-view {
  position: relative; padding: 11px 52px 11px 13px; min-height: 48px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5;
}
.notes-view a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.notes-edit {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.notes-edit svg.i { width: 18px; height: 18px; display: block; }
@media (hover: hover) { .notes-edit:hover { background: var(--accent-soft); color: var(--accent); } }
.notes-empty {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong); background: transparent; color: var(--text-2); font-weight: 600;
}
.notes-empty svg.i { width: 16px; height: 16px; }

/* ---------- Filterpaneel met knoppen ---------- */
.filter-group { margin-bottom: 12px; }
.filter-group .field-label { margin-bottom: 7px; }
.filter-panel .chip { min-height: 34px; padding: 0 11px; font-size: 13.5px; }
.filter-panel .chip svg.i { width: 15px; height: 15px; }
.chip.c-accent { --c: var(--accent); }
.chip-cat svg.i { color: currentColor; }
.filter-sep { height: 1px; background: var(--border); margin: 2px 0 12px; }
.chip-plusdone { --c: var(--ok); border-style: dashed; color: var(--ok); }
.chip-plusdone[aria-pressed="true"] { border-style: solid; }
.chip-plusdone svg.i { stroke-width: 2.6; }

/* ---------- Bevestiging in de regel van Taaknaam ---------- */
.add-name-row { align-items: center; min-width: 0; }
.add-name-row .field-label { flex: none; margin-bottom: 0; }
.add-name-row { margin-bottom: 6px; }
.add-name-row .add-confirm { margin: 0 2px 0 auto; min-height: 0; flex: 0 1 auto; min-width: 0; font-size: 13px; }
.add-name-row .add-confirm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.add-name-row .add-confirm.is-on ~ .counter { display: none; }
.chip-prio.p-2 { --c: var(--accent); }

/* ---------- Dupliceren ---------- */
.dup-note {
  display: flex; align-items: flex-start; gap: 8px; margin: -4px 2px 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600;
}
.dup-note svg.i { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---------- Boards ---------- */
.board-switch {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  margin: 0 0 6px -2px; padding: 3px 9px 3px 3px; min-height: 30px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .15s, border-color .15s;
}
.board-switch:active { background: var(--surface-2); }
.board-switch-icon {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 11.5px !important;
}
.board-switch-icon svg.i { width: 15px; height: 15px; }
.board-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text); }
.board-switch-chev { color: var(--text-3); flex: none; }
.page-head .board-switch { display: flex; width: max-content; }
.section-board { text-transform: none; letter-spacing: 0; margin-bottom: 8px; }
.section-board .board-switch { margin: 0; }

.board-list { display: flex; flex-direction: column; margin: -16px -18px; }
.board-opt { cursor: pointer; font: inherit; }
.board-opt[aria-current] .row-title { color: var(--accent); }
.board-check { color: var(--accent); flex: none; display: grid; place-items: center; }
.board-new .row-title { color: var(--accent); }
.modal-sheet .modal-body { padding-bottom: calc(16px + var(--safe-bottom)); }
@media (min-width: 640px) { .modal-sheet .modal-body { padding-bottom: 16px; } }

.board-copy { margin: 0 0 18px; }
.board-copy .row { min-height: 0; }
.pill-current { background: var(--accent-soft); color: var(--accent); vertical-align: 2px; margin-left: 4px; }
.hint-text { color: var(--text-3); font-size: 13px; margin: 10px 4px 0; }
.move-block { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--text-2); }
.move-block svg.i { color: var(--warn); flex: none; margin-top: 2px; }
.move-info { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); }
.move-info.is-warn { color: var(--warn); }

.side-boards { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; }
.side-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 6px; }
.side-board { border: 0; background: none; font: inherit; width: 100%; text-align: left; cursor: pointer; padding-top: 8px; padding-bottom: 8px; }
.side-board-icon {
  width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); font-size: 12px !important;
}
.side-board-icon svg.i { width: 16px; height: 16px; }
.side-board[aria-current] { color: var(--text); }
.side-board[aria-current] .side-board-icon { background: var(--accent-soft); color: var(--accent); }
.side-board-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.side-board-new { color: var(--text-3); }
.side-board-new svg.i { width: 18px; height: 18px; margin: 0 4px; }

@media (hover: hover) {
  .board-switch:hover { background: var(--surface-2); border-color: var(--border-strong); }
  .side-board:hover { background: var(--surface-2); color: var(--text); }
}

.board-enter { animation: boardEnter .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes boardEnter { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .board-enter { animation: none; } }
.has-move #editDuplicate span, .has-move #editMove span { display: none; }
.has-move #editDuplicate, .has-move #editMove { padding: 0 12px; }
.board-copy .row-title { font-weight: 600; font-size: 15px; }

/* ---------- Toevoegen: Klaar en Volgende, even zwaar ---------- */
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-soft:active { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); }
@media (hover: hover) { .btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 88%, var(--accent)); } }
.task.is-flash { animation: ft-flash 1.8s ease-out; }
@keyframes ft-flash { 0%, 35% { background: var(--accent-soft); } 100% { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .task.is-flash { animation: none; background: var(--accent-soft); } }

/* ---------- Instellingen: dit board / algemeen ---------- */
.board-panel { background: var(--accent-soft); border-radius: calc(var(--radius) + 6px); padding: 12px; margin: 0 0 6px; }
.board-panel .list-card { border-color: transparent; }
.board-panel-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 12px; }
.board-panel-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-size: 16px !important;
}
.board-panel-icon svg.i { width: 21px; height: 21px; }
.board-panel-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.board-panel-label { font-size: 12.5px; color: var(--text-2); }
.board-panel-name { font-size: 17px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-panel-switch {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); background: var(--surface);
  color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer;
}
.board-panel-switch svg.i { width: 16px; height: 16px; }
@media (hover: hover) { .board-panel-switch:hover { background: var(--surface-2); } }
.install-section { display: contents; }
.install-section .row { border-bottom: 1px solid var(--border); }

/* ---------- Inlog- en aanmeldschermen ---------- */
.login-alt { text-align: center; margin: 14px 0 0; font-size: 14px; }
.login-alt a, .login-foot a, .auth-back { color: var(--accent); font-weight: 650; text-decoration: none; }
.login-foot { text-align: center; margin: 18px 0 0; font-size: 14.5px; color: var(--text-2); }
.auth-back { display: inline-block; font-size: 14px; margin: -4px 0 12px; }
.auth-title { font-size: 21px; letter-spacing: -.015em; margin: 0 0 4px; }
.auth-sub { color: var(--text-2); font-size: 14.5px; margin: 0 0 18px; line-height: 1.5; }
.auth-msg { text-align: center; }
.auth-msg h2 { font-size: 21px; margin: 0 0 8px; letter-spacing: -.015em; }
.auth-msg p { color: var(--text-2); line-height: 1.55; margin: 0 0 16px; }
.auth-msg p strong { color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.auth-msg .btn + .login-alt, .auth-msg form + .login-alt { margin-top: 14px; }
.auth-hint { font-size: 13px; color: var(--text-3) !important; }
.auth-icon { width: 60px; height: 60px; border-radius: 50%; margin: 2px auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; margin: 6px 2px 0; }
.field .field-hint { display: block; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Logo-animatie: het vinkje plopt, het lijntje loopt naar de volgende taak. */
@media (prefers-reduced-motion: no-preference) {
  .is-anim .login-logo { animation: lg-tile .4s cubic-bezier(.2, .8, .3, 1.2) both; }
  .is-anim .login-logo .lg-top { transform-origin: 12px 7.5px; animation: lg-pop .42s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
  .is-anim .login-logo .lg-check { stroke-dasharray: 9; animation: lg-draw .24s ease-out .55s both; }
  .is-anim .login-logo .lg-line { stroke-dasharray: 3; animation: lg-draw .18s linear .8s both; }
  .is-anim .login-logo .lg-next { transform-origin: 12px 19px; animation: lg-pop .42s cubic-bezier(.3, 1.6, .5, 1) .95s both; }
  .is-anim h1, .is-anim .motto { animation: lg-fade .45s ease-out .2s both; }
}
@keyframes lg-tile { from { transform: scale(.85); opacity: 0; } }
@keyframes lg-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes lg-draw { from { stroke-dashoffset: 9; } to { stroke-dashoffset: 0; } }
@keyframes lg-fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- First things-icoon: gevuld als actief ---------- */
.tab[aria-current="page"] .ft-top { fill: currentColor; }
.tab[aria-current="page"] .ft-check { stroke: var(--surface); }
@media (min-width: 900px) {
  .side-link[aria-current="page"] .ft-top { fill: currentColor; }
  .side-link[aria-current="page"] .ft-check { stroke: var(--accent-soft); }
}
.input-static { display: flex; align-items: center; background: var(--surface-2); color: var(--text-2); cursor: default; user-select: all; }

/* ---------- Delen ---------- */
.ro-pill {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 0 6px 8px; vertical-align: top;
  font-size: 12.5px; font-weight: 650; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; min-height: 30px; box-sizing: border-box;
}
.ro-pill svg.i { width: 14px; height: 14px; }
.page-head .board-switch + .ro-pill { display: inline-flex; }
.page-head > div:has(.ro-pill) .board-switch { display: inline-flex; vertical-align: top; }
.shared-ico { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--text-3); }
.shared-ico svg.i { width: 15px; height: 15px; }
.side-board .shared-ico { margin-left: 0; }
.side-invites { color: var(--accent); font-weight: 650; }
.side-invites svg.i { width: 18px; height: 18px; margin: 0 4px; }

.invites { display: flex; flex-direction: column; gap: 8px; margin: -4px 0 14px; }
.invite { background: var(--accent-soft); border-radius: calc(var(--radius) + 2px); padding: 12px 14px; }
.invite p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.45; color: var(--text); }
.invite-actions { display: flex; gap: 8px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; background: var(--surface-2); color: var(--text-2);
}
.avatar.r-owner { background: var(--accent); color: var(--accent-text); }
.avatar.r-editor { background: var(--accent-soft); color: var(--accent); }
.avatar.r-viewer { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.avatar svg.i { width: 17px; height: 17px; }
.select-sm { width: auto; min-height: 36px; padding: 0 30px 0 10px; font-size: 14px; flex: none; max-width: 46%; }
.pill-role { background: var(--surface-2); color: var(--text-2); flex: none; }
.danger-text { color: var(--danger); }
.invite-form { display: flex; flex-direction: column; gap: 10px; }
.invite-row { display: flex; gap: 8px; }
.invite-row .input { flex: 1; min-width: 0; }
.invite-row .select { width: auto; flex: none; }
.invite-form .btn-primary { align-self: flex-start; }
.invite-form .field-hint { margin: 0; }
@media (max-width: 420px) { .invite-row { flex-direction: column; } .invite-row .select { width: 100%; } }

/* Alleen lezen */
.is-readonly .group-add, .is-readonly .empty .btn-primary { display: none; }
.is-readonly .task-check { cursor: default; }
.is-readonly .task-check .circle { opacity: .55; }

/* Taak bekijken en geschiedenis */
.view-name { font-size: 19px; margin: 0 0 14px; letter-spacing: -.01em; }
.view-row { margin: 0 0 12px; }
.view-row .field-label { display: block; margin-bottom: 4px; }
.view-row .lbl { margin-right: 4px; }
.history-btn {
  display: inline-flex; align-items: center; gap: 7px; margin: 6px 0 2px; padding: 8px 12px 8px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.history-btn svg.i { width: 17px; height: 17px; }
@media (hover: hover) { .history-btn:hover { background: var(--surface-2); color: var(--text); } }
.history-task { margin: -4px 0 14px; color: var(--text-2); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 24px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); border-radius: 1px; }
.timeline .ev { position: relative; padding: 0 0 16px; font-size: 14.5px; line-height: 1.45; }
.timeline .ev:last-child { padding-bottom: 2px; }
.timeline .ev::before {
  content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong); box-sizing: border-box;
}
.timeline .ev.is-done::before { background: var(--ok); border-color: var(--ok); }
.timeline .ev.is-new::before { background: var(--accent); border-color: var(--accent); }
.timeline .ev.is-del::before { background: var(--danger); border-color: var(--danger); }
.timeline .ev small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.timeline .ev small.ev-note { font-style: italic; }

.empty p.empty-sub { font-size: 14px; color: var(--text-3); max-width: 420px; margin: -4px auto 12px; line-height: 1.5; }

/* Desktop met zijmenu: boards staan links, dus geen boardknop boven de titel. */
@media (min-width: 900px) {
  .page-head .board-switch { display: none !important; }
  .page-head .ro-pill { margin-left: 0; }
}

/* Accountoverzicht (beheerder) */
.account-row { align-items: center; }
.account-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-name .pill-role { font-size: 11px; padding: 3px 7px; }
.account-row .row-sub { display: block; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row .row-main { min-width: 0; }
.account-count { flex: none; text-align: right; display: grid; justify-items: end; line-height: 1.15; }
.account-count strong { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.account-count span { font-size: 12px; color: var(--text-3); }

/* Privacyverklaring */
.auth-privacy { text-align: center; margin: 22px 0 0; font-size: 13px; display: flex; justify-content: center; gap: 18px; }
.auth-privacy a, .app-footer a { color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.auth-note { margin: 14px 2px 0; font-size: 13px; line-height: 1.5; color: var(--text-3); text-align: center; }
.auth-note a { color: var(--accent); font-weight: 650; text-decoration: none; }
.app-footer a { display: inline-block; margin-top: 2px; }

/* Account verwijderen */
.del-card { padding: 14px 16px; }
.del-head { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 6px; }
.del-head + .del-list { margin-bottom: 10px; }
.del-list { list-style: none; margin: 0; padding: 0; }
.del-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; line-height: 1.45; color: var(--text); }
.del-list li svg.i { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.del-list li.is-del svg.i { color: var(--danger); }
.del-list li.is-keep svg.i { color: var(--ok); }
.del-list strong { font-weight: 650; }
.del-admin { display: flex; gap: 10px; align-items: flex-start; margin: 0; line-height: 1.5; color: var(--text-2); }
.del-admin svg.i { width: 20px; height: 20px; flex: none; color: var(--accent); }
.del-privacy { text-align: center; font-size: 13px; margin: 18px 0 0; }
.del-privacy a { color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.app-footer a + a { margin-left: 14px; }
.del-export { font-size: 14px; color: var(--text-2); line-height: 1.5; margin: 14px 2px 0; }
.del-export a { color: var(--accent); font-weight: 650; text-decoration: none; }
.del-privacy a + a { margin-left: 16px; }
.account-warned { font-size: 11px; padding: 3px 7px; }
