/* SamenCheck — strak, licht, iOS-achtig. Licht/donker via prefers-color-scheme.
   Eén gedeelde lijst voor twee, in een frisse checklist-look. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #171a1f;
  --text-soft: #8a909b;
  --line: #e8eaef;
  --accent: #2f6bf0;          /* SamenCheck-blauw */
  --accent-2: #4f86ff;
  --accent-soft: #eaf1fe;
  --done: #23b26d;            /* voltooid = groen */
  --done-soft: #e6f7ee;
  --star: #f5b93b;
  --shadow: 0 1px 2px rgba(23, 35, 60, .04), 0 4px 16px rgba(23, 35, 60, .06);
  --shadow-lift: 0 2px 6px rgba(23, 35, 60, .07), 0 12px 28px rgba(23, 35, 60, .10);
  --p1: #3b82f6;
  --p2: #e07a5f;
  --radius: 18px;
  --radius-sm: 13px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* Donkere waarden — gedeeld door 'auto' (media) en handmatig data-theme=dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116; --surface: #191c22; --surface-2: #232730; --text: #eef0f4;
    --text-soft: #8b929e; --line: #282d37; --accent: #4380ff; --accent-2: #5f92ff;
    --accent-soft: #182236; --done: #2fc079; --done-soft: #13251c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .30);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 28px rgba(0, 0, 0, .38);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1116; --surface: #191c22; --surface-2: #232730; --text: #eef0f4;
  --text-soft: #8b929e; --line: #282d37; --accent: #4380ff; --accent-2: #5f92ff;
  --accent-soft: #182236; --done: #2fc079; --done-soft: #13251c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .30);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 28px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(104px + var(--safe-b));
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px 12px 14px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.logo { color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.logo svg { width: 24px; height: 24px; }
.topbar h1 { font-size: 18.5px; font-weight: 750; margin: 0; letter-spacing: -.02em; color: var(--accent);
  white-space: nowrap; flex: 0 0 auto; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.sync-badge {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  color: var(--done); margin-left: 2px;
}
.sync-text {                                  /* alleen voor screenreaders */
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.sync-badge.syncing { color: var(--accent); }
.sync-badge.offline { color: #e2564f; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync-badge.syncing .sync-dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.icon-btn {
  border: none; background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow);
  width: 34px; height: 34px; border-radius: 11px; font-size: 16px; cursor: pointer;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  text-decoration: none; transition: transform .08s, color .15s;
}
.icon-btn:hover { color: var(--accent); }
.icon-btn[hidden] { display: none; }
.icon-btn:active { transform: scale(.92); }
/* De knop naar MATS Hub is een link, geen button: zelfde vorm, tekst gecentreerd. */
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.me-chip {
  border: none; cursor: pointer; height: 34px; padding: 0 11px;
  border-radius: 17px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13px;
  transition: transform .08s; max-width: 130px;
}
.me-chip.avatar-only { padding: 0; width: 34px; justify-content: center; }
.me-chip.avatar-only .avatar { width: 30px; height: 30px; font-size: 13px; }
.me-chip span:not(.avatar) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip:active { transform: scale(.96); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28);
}
.avatar.has-photo { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }

/* Bewerkbare profielfoto */
.person-edit { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.person-edit input { flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 13px; padding: 13px 15px; font-size: 15px; font-family: inherit; }
.person-edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar-edit { position: relative; flex: 0 0 auto; cursor: pointer; }
.avatar-lg { width: 60px; height: 60px; font-size: 24px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3), 0 2px 8px rgba(0,0,0,.12); }
.cam-badge { position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); border: 2px solid var(--bg); }
.avatar-rm { position: absolute; left: -4px; top: -4px; width: 20px; height: 20px; border: 2px solid var(--bg);
  border-radius: 50%; background: #e2564f; color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }

.scroll { }

/* Overzicht: ledenrij = tegelijk persoons-filter (tik = aan/uit) */
.overview { padding: 12px 16px 0; }
.members { display: flex; gap: 16px; flex-wrap: wrap; row-gap: 8px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: none; background: transparent; padding: 2px; font-family: inherit; cursor: pointer; border-radius: 12px; }
.member .avatar { width: 44px; height: 44px; font-size: 17px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3), 0 2px 8px rgba(0,0,0,.08);
  transition: box-shadow .15s, opacity .15s; }
.member-name { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.member.active .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
.members:has(.active) .member:not(.active) { opacity: .45; }

/* Filters */
.filters { padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.search-row { display: flex; gap: 10px; align-items: center; }
#search {
  flex: 1; min-width: 0; height: 44px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: 0 15px; font-size: 15px;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
#search::placeholder { color: var(--text-soft); }
#search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button {
  flex: 1; border: none; background: transparent; color: var(--text-soft);
  padding: 9px 8px; border-radius: 9px; font-size: 13.5px; font-weight: 650; cursor: pointer;
  font-family: inherit; transition: color .15s;
}
.seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line);
  background: var(--surface);
  color: color-mix(in srgb, var(--chip-color, var(--text-soft)) 85%, var(--text));
  padding: 7px 13px; border-radius: 18px; font-size: 13px; font-weight: 650;
  cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: inherit; transition: transform .08s;
}
.chip:active { transform: scale(.95); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.active {
  color: var(--chip-color, var(--accent)); border-color: transparent;
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 15%, var(--surface));
}

/* Takenlijst */
.list { display: flex; flex-direction: column; gap: 7px; padding: 4px 16px; }
.card {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 9px 12px; box-shadow: var(--shadow); position: relative;
  transition: box-shadow .18s;
}
.card.expanded { box-shadow: var(--shadow-lift); }
.card-head { display: flex; gap: 11px; align-items: center; cursor: pointer; transition: transform .07s; }
.card-head:active { transform: scale(.99); }
.card.done { background: color-mix(in srgb, var(--done-soft) 55%, var(--surface)); }
.card.done .card-title { color: var(--text-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-soft) 60%, transparent); }

.chevron { flex: 0 0 auto; align-self: center; color: var(--text-soft); display: grid; place-items: center;
  transition: transform .2s ease; }
.card.expanded .chevron { transform: rotate(180deg); color: var(--accent); }

/* Uitgeklapte inhoud */
.card-expand { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px; animation: expand .2s ease; }
@keyframes expand { from { opacity: 0; transform: translateY(-4px); } }
.card-notes-full { color: var(--text-soft); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.card-gallery { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.card-gallery::-webkit-scrollbar { display: none; }
.card-gallery img { height: 96px; border-radius: 11px; object-fit: cover; flex: 0 0 auto; }
.card-edit { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; border: none;
  background: var(--surface-2); color: var(--accent); font-weight: 700; font-size: 13.5px; font-family: inherit;
  padding: 9px 15px; border-radius: 11px; cursor: pointer; transition: transform .08s; }
.card-edit:active { transform: scale(.96); }

.check {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 6px;
  border: 2px solid var(--line); background: var(--surface);
  display: grid; place-items: center; margin-top: 3px; cursor: pointer;
  color: transparent; font-size: 11px; font-weight: 800;
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .15s, border-color .15s;
}
.check.on { background: var(--done); border-color: var(--done); color: #fff; }
.check.pop { animation: checkpop .32s cubic-bezier(.34,1.56,.64,1); }
@keyframes checkpop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }

.thumb {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 11px; object-fit: cover;
  background: var(--surface-2);
}
.card-body { flex: 1; min-width: 0; }
.card-title { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; word-break: break-word;
  display: flex; align-items: center; gap: 7px; line-height: 1.3; font-size: 15px; }
.prio-dot { flex: 0 0 auto; display: inline-grid; place-items: center; color: var(--star); font-size: 13px; }
.card-notes { color: var(--text-soft); font-size: 13.5px; margin-top: 2px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Checkpunten op de kaart */
.sub-list { display: flex; flex-direction: column; gap: 6px; }
.sub-item { display: flex; flex-direction: column; gap: 4px; }
.sub-top { display: flex; align-items: center; gap: 9px; }
.sub-check {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px;
  border: 2px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: transparent;
  font-size: 11px; font-weight: 800; transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .15s, border-color .15s;
}
.sub-check:active { transform: scale(.85); }
.sub-check.on { background: var(--done); border-color: var(--done); color: #fff; }
.sub-text { font-size: 13.5px; color: var(--text); line-height: 1.3; word-break: break-word; }
.sub-item.done .sub-text { color: var(--text-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-soft) 55%, transparent); }
.sub-text { flex: 1; min-width: 0; }

/* Notitie/link per checkpunt */
.sub-note-btn { flex: 0 0 auto; width: 26px; height: 26px; padding: 0; border: none; border-radius: 8px;
  background: transparent; color: var(--text-soft); display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s; }
.sub-note-btn:hover { background: var(--accent-soft); color: var(--accent); }
.sub-note-btn.has { color: var(--accent); }
.sub-note { margin-left: 28px; font-size: 12.5px; color: var(--text-soft); line-height: 1.35;
  word-break: break-word; padding: 5px 9px; background: var(--bg-soft, var(--surface));
  border-radius: 8px; border: 1px solid var(--line); }
.sub-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.sub-note-edit { margin-left: 28px; display: flex; align-items: center; gap: 8px; }
.sub-note-edit input { flex: 1; min-width: 0; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.sub-note-edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sub-note-edit input::placeholder { color: var(--text-soft); }
.sub-note-edit-row { margin-left: 34px; margin-top: 2px; }
.sub-progress { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  color: var(--text-soft); }
.sub-progress.complete { color: var(--done); }

.card-meta { display: flex; align-items: center; gap: 9px; margin-top: 4px; flex-wrap: wrap; }
.cat-tag { font-size: 12.5px; font-weight: 700; color: color-mix(in srgb, var(--cat-color, var(--text-soft)) 60%, var(--text)); letter-spacing: -.01em; }
.by { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-soft); font-weight: 600; }
.by .avatar { width: 18px; height: 18px; font-size: 9px; }
.gallery-count { font-size: 12px; color: var(--text-soft); display: flex; align-items: center; gap: 3px; font-weight: 600; margin-left: auto; }

.empty { text-align: center; color: var(--text-soft); padding: 54px 28px; font-size: 15.5px; line-height: 1.7; }

/* FAB */
.fab {
  position: fixed; right: 18px; bottom: calc(20px + var(--safe-b)); z-index: 30;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  color: #fff; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 6px rgba(0,0,0,.12);
  transition: transform .12s cubic-bezier(.34,1.56,.64,1);
}
.fab:active { transform: scale(.9) rotate(90deg); }

/* Overlay + sheet */
.overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 30, .44);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(24px + var(--safe-b));
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
  animation: slideup .26s cubic-bezier(.2, .9, .2, 1);
}
@keyframes slideup { from { transform: translateY(28px); opacity: .6; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 14px; }
.sheet h2 { font-size: 21px; margin: 0 0 16px; letter-spacing: -.02em; font-weight: 750; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; flex: 1; }
.sheet-close { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--text-soft); display: grid; place-items: center; cursor: pointer;
  transition: transform .08s; }
.sheet-close:active { transform: scale(.9); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-soft);
  margin-bottom: 7px; letter-spacing: .01em; }
.field input[type=text], .field input[type=date], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 13px; padding: 13px 15px; font-size: 15px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Checkpunten-editor in de sheet */
.sub-edit { display: flex; flex-direction: column; gap: 8px; }
.sub-edit-row { display: flex; align-items: center; gap: 9px; }
.sub-edit-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 11px; padding: 11px 13px; font-size: 14.5px; font-family: inherit;
}
.sub-edit-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sub-edit-row .sub-check { width: 24px; height: 24px; border-radius: 7px; font-size: 13px; }
.sub-rm { flex: 0 0 auto; width: 28px; height: 28px; border: none; border-radius: 8px;
  background: var(--surface-2); color: var(--text-soft); font-size: 17px; cursor: pointer; line-height: 1; }
.sub-add {
  margin-top: 10px; width: 100%; border: 1.5px dashed var(--line); background: transparent; color: var(--accent);
  border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 650; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.sub-add:active { background: var(--accent-soft); border-color: var(--accent); }

.cat-select { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-select::-webkit-scrollbar { display: none; }
.cat-opt {
  flex: 0 0 auto; border: 1px solid var(--line);
  background: var(--surface);
  color: color-mix(in srgb, var(--cat-color, var(--text-soft)) 85%, var(--text));
  padding: 9px 13px; border-radius: 12px; font-size: 13px; font-weight: 650; cursor: pointer;
  display: flex; align-items: center; gap: 6px; white-space: nowrap; font-family: inherit;
  transition: transform .08s;
}
.cat-opt:active { transform: scale(.95); }
.cat-opt.active { color: var(--cat-color, var(--accent)); border-color: transparent;
  background: color-mix(in srgb, var(--cat-color, var(--accent)) 15%, var(--surface)); }
.ai-badge { font-size: 12px; color: var(--text-soft); margin-top: 7px; display: flex; align-items: center; gap: 5px; line-height: 1.4; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; font-weight: 600; }
.switch { position: relative; width: 50px; height: 29px; flex: 0 0 auto; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: var(--surface-2); border-radius: 20px; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 23px; height: 23px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 24px; }

/* Foto's in sheet */
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-tile { position: relative; width: 78px; height: 78px; border-radius: 13px; overflow: hidden; background: var(--surface-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.thumb-mark { outline: 2.5px solid var(--accent); outline-offset: -2.5px; }
.photo-tile.thumb-mark::after { content: '★'; position: absolute; left: 4px; top: 3px; font-size: 12px; color: var(--accent); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.photo-tile .rm { position: absolute; top: 3px; right: 3px; width: 21px; height: 21px; border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; cursor: pointer; line-height: 1; }
.add-photo {
  width: 78px; height: 78px; border-radius: 13px; border: 1.5px dashed var(--line);
  background: var(--surface); color: var(--text-soft); font-size: 26px; cursor: pointer;
  display: grid; place-items: center; transition: border-color .15s, color .15s;
}
.add-photo:active { border-color: var(--accent); color: var(--accent); }
.gallery-view { display: flex; gap: 8px; overflow-x: auto; margin: 4px 0 14px; scrollbar-width: none; }
.gallery-view img { height: 140px; border-radius: 13px; object-fit: cover; }

.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn {
  flex: 1; border: none; border-radius: 14px; padding: 15px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: #e2564f; border: 1px solid color-mix(in srgb, #e2564f 40%, var(--line)); }
.btn:disabled { opacity: .5; }

.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.identity-card {
  border: 2px solid var(--line); background: var(--surface); border-radius: 18px;
  padding: 22px 12px; cursor: pointer; text-align: center; font-weight: 650;
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  transition: transform .08s, border-color .15s, background .15s;
}
.identity-card:active { transform: scale(.97); }
.identity-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.identity-card .avatar { width: 52px; height: 52px; font-size: 22px; }
.add-person-card { border-style: dashed; color: var(--accent); }
.add-person-plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; color: var(--accent); background: var(--accent-soft); }

/* Persoon-kop in instellingen (label + verwijderen) */
.person-head { display: flex; align-items: center; justify-content: space-between; }
.person-del { border: none; background: transparent; color: #e2564f; font-size: 12.5px; font-weight: 700;
  cursor: pointer; padding: 0 0 7px; }

.color-swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2.5px solid transparent;
  transition: transform .08s; }
.swatch:active { transform: scale(.9); }
.swatch.active { border-color: var(--text); transform: scale(1.08); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 22px;
  font-size: 14px; font-weight: 650; z-index: 60; box-shadow: var(--shadow-lift); max-width: 88vw;
  animation: toastin .22s cubic-bezier(.2,.9,.2,1);
}
@keyframes toastin { from { transform: translate(-50%, 10px); opacity: 0; } }

/* ---------- Deadlines ---------- */
.due-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 12px; background: var(--surface-2); color: var(--text-soft); }
.due-tag.late { background: color-mix(in srgb, #e2564f 14%, var(--surface)); color: #e2564f; }
.due-tag.today { background: color-mix(in srgb, #e08a00 16%, var(--surface)); color: #c67a02; }
.due-tag.soon { background: var(--accent-soft); color: var(--accent); }
.due-clear { margin-top: 8px; border: none; background: transparent; color: var(--text-soft);
  font-size: 12.5px; font-weight: 650; font-family: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- Sorteren + tab-tellers ---------- */
#sort {
  flex: 0 0 auto; height: 44px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px;
  font-weight: 650; padding: 0 10px; max-width: 118px;
}
#sort:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg-count { font-weight: 800; opacity: .5; font-size: 11px; margin-left: 5px; }

/* ---------- Suggesties bij toevoegen ---------- */
.suggest { display: flex; gap: 7px; overflow-x: auto; margin-top: 9px; scrollbar-width: none; padding-bottom: 2px; }
.suggest::-webkit-scrollbar { display: none; }
.suggest-chip {
  flex: 0 0 auto; border: 1.5px dashed var(--line); background: var(--surface); color: var(--text-soft);
  border-radius: 16px; padding: 7px 13px; font-size: 12.5px; font-weight: 650; font-family: inherit; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.suggest-chip:active { color: var(--accent); border-color: var(--accent); }

/* ---------- Activiteitenfeed ---------- */
.stat-banner {
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--done-soft) 75%, var(--surface)));
  border-radius: 16px; padding: 16px 18px; margin-bottom: 16px;
}
.stat-big { font-size: 16.5px; font-weight: 750; letter-spacing: -.01em; line-height: 1.35; }
.stat-sub { font-size: 13px; color: var(--text-soft); margin-top: 3px; font-weight: 600; }
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; align-items: center; gap: 11px; padding: 10px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.activity-row:last-child { border-bottom: none; }
.act-icon { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; flex: 0 0 auto; }
.act-icon.check { background: var(--done-soft); color: var(--done); }
.act-icon.plus { background: var(--accent-soft); color: var(--accent); }
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 14px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.act-time { font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.act-empty { color: var(--text-soft); text-align: center; padding: 24px; }

/* ---------- Toast met actieknop (undo) ---------- */
.toast { display: flex; align-items: center; gap: 4px; }
.toast[hidden] { display: none; }
.toast button {
  border: none; background: transparent; color: inherit; font: inherit; font-weight: 800;
  text-decoration: underline; margin-left: 10px; cursor: pointer; padding: 0; white-space: nowrap;
}

/* ---------- Voltooide punten wissen ---------- */
.clear-done {
  margin: 8px auto 0; display: block; border: 1.5px dashed color-mix(in srgb, #e2564f 45%, var(--line));
  background: transparent; color: #e2564f; border-radius: 12px; padding: 12px 20px;
  font-size: 13.5px; font-weight: 700; font-family: inherit; cursor: pointer;
}

/* ---------- Foto-lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgba(8, 10, 14, .93);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fade .15s ease;
}
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 100%; max-height: 92vh; border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lb-count {
  position: fixed; bottom: calc(24px + var(--safe-b)); left: 50%; transform: translateX(-50%);
  color: #fff; font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, .16);
  padding: 6px 14px; border-radius: 16px;
}

/* ================= Nieuwe features (batch) ================= */

/* Quick-add balk */
.quick-row { display: flex; gap: 8px; align-items: center; }
#quick-input {
  flex: 1; min-width: 0; height: 46px; border-radius: 13px; border: 1.5px solid var(--accent);
  background: var(--surface); color: var(--text); padding: 0 15px; font-size: 15px; font-family: inherit;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#quick-input::placeholder { color: var(--text-soft); }
#quick-input:focus { outline: none; }
.quick-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; border: none; cursor: pointer;
  display: grid; place-items: center; }
.quick-plus { background: var(--accent); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 40%, transparent); }
.quick-plus:active { transform: scale(.92); }
#quick-mic.quick-icon { background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow); }
.mic-btn.listening, #quick-mic.listening { color: #e2564f; animation: pulse 1s ease-in-out infinite; }

/* Lijst-schakelaar */
.lists { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.lists::-webkit-scrollbar { display: none; }
.list-tab { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--text-soft);
  border-radius: 18px; padding: 8px 15px; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.list-tab.active { background: var(--accent); color: #fff; border-color: transparent; }

/* Herhaling- en toewijs-badges op de kaart */
.recur-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  color: var(--accent); }
.assign-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.assign-tag .avatar { width: 18px; height: 18px; font-size: 9px; }
.assign-arrow { font-weight: 800; color: var(--text-soft); }

/* Reactie-draadje */
.thread { display: flex; flex-direction: column; gap: 8px; }
.thread-msg { display: flex; gap: 8px; align-items: flex-start; }
.thread-msg .avatar { width: 24px; height: 24px; font-size: 11px; margin-top: 2px; }
.thread-msg.mine { flex-direction: row-reverse; }
.thread-bubble { position: relative; background: var(--surface-2); border-radius: 13px; padding: 7px 12px; max-width: 80%; }
.thread-msg.mine .thread-bubble { background: var(--accent-soft); padding-right: 46px; }
.thread-acts { position: absolute; top: 4px; right: 5px; display: flex; gap: 3px; }
.thread-act { width: 18px; height: 18px; border: none; border-radius: 50%; padding: 0;
  background: color-mix(in srgb, var(--text-soft) 20%, transparent); color: var(--text); font-size: 12px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; }
.thread-act:active { transform: scale(.85); }
.thread-edit-input { width: 100%; border: 1px solid var(--accent); background: var(--surface); color: var(--text);
  border-radius: 9px; padding: 6px 9px; font-size: 14px; font-family: inherit; margin-top: 2px; }
.thread-edit-input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Potlood-icoon rechtsboven in de kaart (i.p.v. de 'Bewerken'-knop onderaan) */
.card-edit-icon { flex: 0 0 auto; align-self: flex-start; width: 30px; height: 30px; border: none; border-radius: 9px;
  background: var(--surface-2); color: var(--text-soft); display: grid; place-items: center; cursor: pointer; margin-top: 1px; }
.card-edit-icon:active { transform: scale(.9); }

/* Snel checkpunt toevoegen in de uitgeklapte kaart */
.sub-add-inline { display: flex; align-items: center; gap: 9px; }
.sub-add-plus { flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px; border: 1.5px dashed var(--line);
  background: transparent; color: var(--accent); display: grid; place-items: center; cursor: pointer; padding: 0; }
.sub-add-plus:active { transform: scale(.85); }
.sub-add-inline input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text);
  font-size: 13.5px; font-family: inherit; padding: 2px 0; }
.sub-add-inline input::placeholder { color: var(--text-soft); }
.sub-add-inline input:focus { outline: none; }
.thread-name { font-size: 11px; color: var(--text-soft); font-weight: 700; margin-bottom: 1px; }
.thread-text { font-size: 14px; line-height: 1.35; word-break: break-word; }
.thread-input { display: flex; gap: 8px; margin-top: 2px; }
.thread-input input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 7px 11px; font-size: 13.5px; font-family: inherit; }
.thread-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thread-send { border: none; background: var(--accent); color: #fff; border-radius: 11px; padding: 0 15px;
  font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* Sleep-greep */
.drag-grip { flex: 0 0 auto; color: var(--text-soft); cursor: grab; touch-action: none; display: grid; place-items: center;
  align-self: center; margin-right: -4px; }
.card.dragging { opacity: .85; box-shadow: var(--shadow-lift); transform: scale(1.02); position: relative; z-index: 5; }

/* Titel-input met mic-knop */
.input-mic { position: relative; display: flex; align-items: center; }
.input-mic input { flex: 1; padding-right: 46px; }
.mic-btn { position: absolute; right: 6px; width: 34px; height: 34px; border: none; background: transparent;
  color: var(--text-soft); cursor: pointer; display: grid; place-items: center; }

/* AI-checkpunten knop */
.sub-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sub-btns .sub-add { margin-top: 0; flex: 1; min-width: 140px; }
.sub-ai { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* Toewijs-picker in editor */
.assign-picker { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.assign-picker::-webkit-scrollbar { display: none; }
.assign-opt { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); border-radius: 20px; padding: 6px 13px 6px 6px; font-size: 13px;
  font-weight: 650; cursor: pointer; font-family: inherit; white-space: nowrap; }
.assign-opt:first-child { padding: 6px 14px; }
.assign-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.assign-opt .avatar { width: 22px; height: 22px; font-size: 10px; }
.recur-seg button { flex: 1; }

/* Thema */
.accent-swatches { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.accent-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid transparent; cursor: pointer; }
.accent-swatch.active { border-color: var(--text); transform: scale(1.08); }

/* Categorie- / lijst-editor */
.cat-edit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.cat-edit-row input.cat-emoji { width: 46px; flex: 0 0 auto; text-align: center; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 11px; padding: 11px 4px; font-size: 16px; font-family: inherit; }
.cat-edit-row > input:not(.cat-emoji):not(.cat-color-in) { flex: 1 1 auto; width: auto; min-width: 0; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); border-radius: 11px; padding: 11px 13px; font-size: 14.5px; font-family: inherit; }
.cat-edit-row .cat-color-in { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); padding: 3px; cursor: pointer; }
.cat-edit-row .sub-rm { flex: 0 0 auto; }

/* Confetti */
.confetti-host { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti-piece { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px;
  animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }

/* Op smalle telefoons: sync-badge als stip zodat "SamenCheck" volledig past. */
@media (max-width: 400px) {
  .sync-badge { padding: 0; width: 30px; justify-content: center; }
  .sync-badge .sync-text { display: none; }
}

/* Rond ✓-knopje om een reactie/checkpunt in te dienen (zelfde als Enter) */
.mini-send { flex: 0 0 auto; width: 30px; height: 30px; border: none; border-radius: 9px;
  background: var(--surface-2); color: var(--text-soft); display: grid; place-items: center;
  cursor: pointer; transition: background .15s, color .15s; }
.mini-send svg { width: 15px; height: 15px; }
/* Pas echt blauw zodra er iets in het veld staat of je erin typt — anders
   trekken twee grote blauwe blokken alle aandacht in een rustige kaart. */
.sub-add-inline:has(input:not(:placeholder-shown)) .mini-send,
.sub-add-inline:has(input:focus) .mini-send,
.thread-input:has(input:not(:placeholder-shown)) .mini-send,
.thread-input:has(input:focus) .mini-send,
.sub-note-edit:has(input:not(:placeholder-shown)) .mini-send,
.sub-note-edit:has(input:focus) .mini-send { background: var(--accent); color: #fff; }
.mini-send:active { transform: scale(.9); }
.act-icon.chat { background: var(--surface-2); }

/* ── Instellingen: inklapbare secties (accordion) ── */
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.acc-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: none; background: transparent; color: var(--text); font-family: inherit; cursor: pointer;
  padding: 14px 15px; text-align: left; }
.acc-titles { min-width: 0; }
.acc-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.acc-sub { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }
.acc-chev { flex: 0 0 auto; color: var(--text-soft); display: grid; place-items: center; transition: transform .2s ease; }
.acc.open .acc-chev { transform: rotate(180deg); color: var(--accent); }
.acc-body { display: none; padding: 0 15px 15px; }
.acc.open .acc-body { display: block; animation: expand .2s ease; }

/* Checkbox is nu een <button> — default-styling neutraliseren */
.check { padding: 0; font-family: inherit; }

/* Grotere tik-doelen (WCAG 2.5.8) zonder het uiterlijk te vergroten */
.check, .sub-check, .thread-act, .sub-note-btn { position: relative; }
.check::after, .sub-check::after, .thread-act::after, .sub-note-btn::after { content: ''; position: absolute; inset: -6px; }

/* Zichtbare toetsenbord-focus (raakt muis niet) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, .card-head:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Respecteer 'verminderde beweging' */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .confetti-host { display: none !important; }
}

/* ── Lijst gegroepeerd per hoofdcategorie ── */
/* Kaarten binnen een categorie hadden alleen schaduw als scheiding; nu echte ruimte. */
.cat-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.cat-group-head { display: flex; align-items: center; gap: 8px; padding: 12px 6px 6px; }
.cat-group-emoji { font-size: 15px; }
.cat-group-title { font-size: 13px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase;
  color: color-mix(in srgb, var(--cat-color, var(--text-soft)) 55%, var(--text)); }
.cat-group-count { font-size: 11.5px; font-weight: 700; color: var(--text-soft);
  background: var(--surface-2); border-radius: 9px; padding: 1px 7px; }

/* ── Breed scherm (desktop/tablet-liggend): app als gecentreerde kolom,
     sheets als gecentreerd venster i.p.v. bottom-sheet ── */
@media (min-width: 700px) {
  .topbar { padding-left: max(14px, calc(50vw - 280px)); padding-right: max(14px, calc(50vw - 280px)); }
  .scroll { max-width: 560px; margin: 0 auto; }
  .fab { right: max(18px, calc(50vw - 280px + 18px)); }
  .overlay { align-items: center; padding: 28px; }
  .sheet { border-radius: 26px; max-height: 86vh; padding-bottom: 24px; animation: fade .18s ease; }
  .sheet-grip { display: none; }
}

/* ── Instellingen: "Ik ben nu" + doorlink-rij ── */
.settings-link {
  width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); font-family: inherit;
  font-size: 15px; font-weight: 650; cursor: pointer; text-align: left;
  transition: border-color .15s, color .15s;
}
.settings-link:hover { border-color: var(--accent); color: var(--accent); }
.settings-link > span:first-of-type { flex: 1; }
.settings-link-arrow { color: var(--text-soft); font-weight: 700; }

/* ── Checkpunten ordenen (sleepgreep + pijltjes) ── */
.sub-grip { flex: 0 0 auto; color: var(--text-soft); opacity: .5; cursor: grab;
  touch-action: none; display: grid; place-items: center; margin-left: -3px; }
.sub-grip:active { cursor: grabbing; opacity: 1; }
.sub-item.sub-dragging { opacity: .9; }
.sub-item.sub-dragging .sub-top { background: var(--surface-2); border-radius: 9px; }
.sub-move { flex: 0 0 auto; display: flex; gap: 1px; }
.sub-move-btn { width: 24px; height: 24px; padding: 0; border: none; border-radius: 7px;
  background: transparent; color: var(--text-soft); display: grid; place-items: center;
  cursor: pointer; transition: background .15s, color .15s; }
.sub-move-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.sub-move-btn:disabled { opacity: .25; cursor: default; }
.sub-edit-row .sub-move { margin-right: 2px; }

/* Afgevinkte checkpunten zakken naar onderen — met een subtiele scheiding. */
.sub-item.sub-first-done { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* ── Aantal per product ── */
.sub-qty { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 1px; }
.sub-qty-btn { width: 24px; height: 24px; padding: 0; border: none; border-radius: 7px;
  background: transparent; color: var(--text-soft); font-family: inherit; font-size: 16px;
  font-weight: 700; line-height: 1; display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s; }
.sub-qty-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.sub-qty-btn:disabled { opacity: .25; cursor: default; }
.sub-qty-n { min-width: 15px; text-align: center; font-size: 12.5px; font-weight: 700;
  color: var(--text-soft); font-variant-numeric: tabular-nums; }
.sub-qty.has .sub-qty-n { color: var(--accent); }
.sub-qty-done { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--text-soft); }

/* Checkpunt-tekst is aantikbaar om een tikfout te herstellen */
button.sub-text { border: none; background: transparent; font-family: inherit; text-align: left;
  padding: 2px 4px; margin-left: -4px; border-radius: 7px; cursor: text; transition: background .15s; }
button.sub-text:hover { background: var(--surface-2); }
.sub-text-input { flex: 1; min-width: 0; font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; padding: 5px 8px;
  box-shadow: 0 0 0 3px var(--accent-soft); }
.sub-text-input:focus { outline: none; }

/* ── Groepen (gangpaden) binnen een checklist ── */
.sub-group { display: flex; flex-direction: column; }
.sub-group-head { display: flex; align-items: center; gap: 4px; padding: 6px 0 2px; }
.sub-group-toggle { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: none; border-radius: 7px;
  background: transparent; color: var(--text-soft); display: grid; place-items: center; cursor: pointer; }
.sub-group-chev { transition: transform .2s ease; }
.sub-group.dicht .sub-group-chev { transform: rotate(-90deg); }
.sub-group-name { border: none; background: transparent; font-family: inherit; cursor: pointer;
  font-size: 11.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-soft); padding: 3px 5px; margin-left: -2px; border-radius: 6px; text-align: left;
  transition: background .15s, color .15s; }
.sub-group-name:hover { background: var(--surface-2); color: var(--text); }
.sub-group-name.vast { cursor: default; }
.sub-group-name.vast:hover { background: transparent; color: var(--text-soft); }
.sub-group-input { flex: 1; min-width: 0; font-family: inherit; font-size: 13px; font-weight: 650;
  color: var(--text); background: var(--surface); border: 1px solid var(--accent); border-radius: 8px;
  padding: 4px 8px; box-shadow: 0 0 0 3px var(--accent-soft); }
.sub-group-input:focus { outline: none; }
.sub-group-count { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--text-soft);
  background: var(--surface-2); border-radius: 9px; padding: 1px 7px; margin-left: auto; }
.sub-group-del { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border: none; border-radius: 6px;
  background: transparent; color: var(--text-soft); font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .15s, color .15s; }
.sub-group-del:hover { background: color-mix(in srgb, #e2564f 12%, transparent); color: #e2564f; }
.sub-group-body { display: flex; flex-direction: column; gap: 7px; padding-left: 2px; min-height: 8px; }
.sub-group.dicht .sub-group-body { display: none; }
.sub-group-add-row { display: flex; padding: 2px 0 0; }
.sub-group-add { border: 1px dashed var(--line); background: transparent; color: var(--text-soft);
  font-family: inherit; font-size: 12px; font-weight: 650; border-radius: 8px; padding: 4px 10px;
  cursor: pointer; transition: border-color .15s, color .15s; }
.sub-group-add:hover { border-color: var(--accent); color: var(--accent); }

/* Actieve knop in de kaartkop (bijv. het slot) */
.card-edit-icon.aan { background: var(--accent-soft); color: var(--accent); }

/* ── Winkelmodus: alleen deze lijst, schermvullend ── */
body.shop-open { overflow: hidden; }
.shop {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top, 0px)) 16px calc(28px + var(--safe-b));
  animation: shopin .22s cubic-bezier(.2,.9,.2,1);
}
@keyframes shopin { from { opacity: 0; transform: translateY(12px); } }
.shop-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.shop-titles { flex: 1; min-width: 0; }
.shop-title { font-size: 22px; font-weight: 780; letter-spacing: -.02em; line-height: 1.2; }
.shop-sub { font-size: 13.5px; color: var(--text-soft); font-weight: 600; margin-top: 2px; }
.shop-close { flex: 0 0 auto; width: 40px; height: 40px; border: none; border-radius: 12px;
  background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer; }
.shop-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; }
.shop-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s cubic-bezier(.2,.8,.2,1); }
.shop-list { display: flex; flex-direction: column; gap: 14px; }
.shop-group-head { width: 100%; display: flex; align-items: center; gap: 6px; padding: 4px 2px 8px;
  border: none; background: transparent; font-family: inherit; cursor: pointer; color: var(--text-soft); }
.shop-chev { flex: 0 0 auto; transition: transform .2s ease; }
.shop-group.dicht .shop-chev { transform: rotate(-90deg); }
.shop-group-name { flex: 1; text-align: left; font-size: 12.5px; font-weight: 750;
  letter-spacing: .05em; text-transform: uppercase; }
.shop-group-count { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; background: var(--surface-2);
  border-radius: 9px; padding: 1px 8px; }
.shop-group-body { display: flex; flex-direction: column; gap: 8px; }
.shop-group.dicht .shop-group-body { display: none; }
.shop-row { display: flex; flex-direction: column; gap: 4px; }
.shop-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 16px; font-family: inherit; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .1s, opacity .15s, background .15s; }
.shop-item:active { transform: scale(.985); }
.shop-item.done { opacity: .5; background: var(--surface-2); box-shadow: none; }
.shop-check { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line);
  display: grid; place-items: center; color: transparent; font-size: 15px; font-weight: 800; }
.shop-check.on { background: var(--done); border-color: var(--done); color: #fff; }
.shop-text { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; color: var(--text); word-break: break-word; }
.shop-item.done .shop-text { text-decoration: line-through; color: var(--text-soft); }
.shop-qty { flex: 0 0 auto; font-size: 15px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border-radius: 9px; padding: 3px 9px; }
.shop-note { margin-left: 56px; font-size: 13px; color: var(--text-soft); word-break: break-word; }
.shop-done { text-align: center; padding: 28px 0; font-size: 17px; font-weight: 700; color: var(--done); }

/* Hele afdeling verplaatsen */
.sub-group-move { flex: 0 0 auto; display: flex; gap: 1px; }
.sub-group-move-btn { width: 22px; height: 22px; padding: 0; border: none; border-radius: 6px;
  background: transparent; color: var(--text-soft); display: grid; place-items: center;
  cursor: pointer; transition: background .15s, color .15s; }
.sub-group-move-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.sub-group-move-btn:disabled { opacity: .25; cursor: default; }

/* Kiezer: naar welke afdeling gaat dit product? */
.pick-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 16px; font-family: inherit; font-size: 15px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.pick-row:hover { border-color: var(--accent); }
.pick-row.actief { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pick-name { flex: 1; min-width: 0; }
.pick-check { flex: 0 0 auto; font-weight: 800; }
.sub-grip { cursor: pointer; }

/* Afdelingskopjes binnen "Klaar" / "In de wagen" */
.sub-subhead { font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-soft); opacity: .75; padding: 6px 0 1px; }
.sub-subhead:first-child { padding-top: 0; }
.shop-subhead { font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-soft); opacity: .8; padding: 8px 2px 2px; }
.shop-subhead:first-child { padding-top: 0; }

/* ── Wat is er nieuw ── */
.update-blok { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px; }
.update-blok.nieuwste { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.update-kop { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.update-titel { flex: 1; min-width: 0; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.update-datum { flex: 0 0 auto; font-size: 12px; font-weight: 650; color: var(--text-soft); }
.update-punten { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.update-punten li { font-size: 13.5px; line-height: 1.4; color: var(--text-soft); }
.update-blok.nieuwste .update-punten li { color: var(--text); }

/* Stipje: er is iets nieuws */
.nieuws-stip { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-left: 7px; vertical-align: middle; }
#btn-settings { position: relative; }
#btn-settings.heeft-nieuws::after { content: ''; position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg); }

/* Camera-knop naast "uit galerij" bij foto's */
.add-photo { display: grid; place-items: center; }
.add-photo.add-cam { border-style: solid; border-color: var(--accent);
  color: var(--accent); background: var(--accent-soft); }
.add-photo.add-cam:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

/* ---------- Inlogscherm (v2) ----------
   Staat als eigen laag over de app heen tot er iemand is ingelogd. */
body.auth-open { overflow: hidden; }
.auth {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto;
  background: var(--bg); display: grid; place-items: center;
  /* display: grid verslaat het hidden-attribuut; zonder deze regel blijft het
     scherm onzichtbaar over de app liggen en kun je niets meer aantikken. */
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}
.auth[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 12px;
}
.auth-merk { display: flex; align-items: center; gap: 9px; color: var(--accent);
  font-weight: 750; font-size: 19px; letter-spacing: -.02em; margin-bottom: 2px; }
.auth-card h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.auth-hint { margin: 0; color: var(--text-soft); font-size: 13.5px; line-height: 1.5; }
.auth-veld { display: flex; flex-direction: column; gap: 5px; }
.auth-veld > span { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.auth-veld input {
  width: 100%; padding: 12px 13px; font-size: 16px;         /* 16px: anders zoomt iOS in */
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2); color: var(--text);
}
.auth-veld input:focus { outline: none; border-color: var(--accent); }
.auth-card .btn { width: 100%; justify-content: center; padding: 13px; font-size: 15.5px; }
.btn-stil { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.auth-melding {
  margin: 0; font-size: 13.5px; line-height: 1.45; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, #ef4a63 12%, var(--surface)); color: #c62c44;
}
.auth-melding.goed { background: var(--done-soft); color: var(--done); }
.auth-link {
  background: none; border: none; padding: 4px 0; font: inherit; font-size: 13.5px;
  color: var(--accent); text-align: left; cursor: pointer;
}
.auth-scheiding { height: 1px; background: var(--line); margin: 4px 0 2px; }
.auth-keuzes { display: flex; flex-direction: column; gap: 9px; }
.auth-keuze {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit;
}
.auth-keuze:hover { border-color: var(--accent); }
.auth-keuze strong { font-size: 15.5px; font-weight: 650; }
.auth-keuze span { font-size: 12.5px; color: var(--text-soft); }

/* Ingelogd-als-regel en ledenlijst in de instellingen (v2) */
.me-line { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.me-line:hover { border-color: var(--accent); }
.me-sub { display: block; font-size: 12px; color: var(--text-soft); }
.lid-rij { display: flex; align-items: center; gap: 10px; padding: 9px 2px; }
.lid-rij > div { flex: 1 1 auto; min-width: 0; }
.lid-rij strong { display: block; font-size: 14.5px; font-weight: 620; }

/* Uitnodigingslink: lang, dus hij moet afbreken in plaats van het venster
   uitduwen. word-break op de code-tekst voorkomt de horizontale schuifbalk. */
.uitnodiging-uitslag { margin-bottom: 15px; }
.link-vak {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin: 8px 0 10px;
}
.link-tekst {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  line-height: 1.5; color: var(--text);
  display: block; overflow-wrap: anywhere; word-break: break-all; user-select: all;
}
.uitnodiging-uitslag .btn { width: 100%; justify-content: center; }
/* Geen enkel sheet mag horizontaal schuiven; dat is altijd een fout, geen keuze. */
.sheet { overflow-x: hidden; }

/* Oude namen uit een migratie koppelen aan een account */
.oude-namen { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.oude-namen select { max-width: 45%; }

/* Het logo is een knop naar het overzicht: laat dat merken, maar houd het rustig. */
.brand[role="button"] { cursor: pointer; border-radius: 12px; }
.brand[role="button"]:hover .logo,
.brand[role="button"]:hover h1 { opacity: .78; }
.brand[role="button"]:active { transform: scale(.98); }
.brand[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* De sync-badge zit ín de balk maar hoort niet bij de knop. */
.brand[role="button"] .sync-badge { cursor: default; }
