/* BrickSort components (T006). Based on docs/design/mockups/mockup.css (D001/D002); values from tokens.css. */

/* ---------- Basis ---------- */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}

img, svg { display: block; }

.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: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

.mono { font-family: var(--font-mono); font-size: 0.95em; letter-spacing: -0.01em; }

/* ---------- Schermopbouw ---------- */
.screen {
  min-height: 100dvh;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.screen__body {
  flex: 1;
  padding: var(--space-4) var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 56px;
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.app-bar__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

.section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.action-bar {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.action-bar__hint {
  margin: var(--space-2) 0 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: var(--space-2) var(--space-4);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  font: inherit;
  font-weight: var(--weight-bold);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}

.btn svg { flex: none; }

.btn--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-edge-primary);
  margin-bottom: var(--edge-height);
}
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--primary:active {
  transform: translateY(calc(var(--edge-height) - 1px));
  box-shadow: var(--shadow-edge-pressed);
}

.btn--block { width: 100%; }

.btn--large {
  min-height: var(--tap-primary);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-edge-neutral);
  margin-bottom: var(--edge-height);
}
.btn--secondary:active { transform: translateY(calc(var(--edge-height) - 1px)); box-shadow: none; }

.btn--quiet {
  background: transparent;
  color: var(--color-primary);
  padding-inline: var(--space-3);
}
.btn--quiet:hover { background: var(--color-primary-soft); color: var(--color-on-primary-soft); }

.btn--icon { padding: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-text); }
.btn--icon:hover { background: var(--color-surface-sunken); }

.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  min-height: 22px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1;
  white-space: nowrap;
}
.badge--focus { background: var(--color-accent-soft); color: var(--color-on-accent-soft); }
.badge--reserve { background: var(--color-surface-sunken); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge--sure { background: var(--color-success-soft); color: var(--color-on-success-soft); }
.badge--maybe { background: var(--color-warning-soft); color: var(--color-on-warning-soft); }
.badge--doubt { background: var(--color-surface-sunken); color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* ---------- Kaart: gekozen element en kandidaat ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.element {
  display: grid;
  grid-template-columns: var(--thumb-size) minmax(0, 1fr) auto; /* T016: the text never pushes under the image */
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
}

.thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  object-fit: contain;
  padding: var(--space-1);
}

.element__name, .candidate__name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  overflow-wrap: anywhere;
}

.element__meta, .candidate__meta {
  margin: var(--space-1) 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Kandidaat (herkenning): de hele kaart is één knop. */
.candidate {
  width: 100%;
  display: grid;
  grid-template-columns: var(--thumb-size) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.candidate:active { transform: translateY(1px); box-shadow: none; }
.candidate__score { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--text-sm); }

/* ---------- Kleurstaal ---------- */
.swatch-chip { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text); font-weight: var(--weight-medium); }
.swatch-chip svg { border-radius: var(--radius-sm); }

/* Het vlak zelf is een <svg> met <rect fill="#rrggbb">: een presentatie-attribuut, toegestaan onder de CSP. */
.swatch__tile rect.tile { stroke: var(--color-swatch-ring); stroke-width: 2; }

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.swatch {
  width: 100%;
  min-height: var(--tap-min);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-1);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  color: var(--color-text);
  text-align: center;
  cursor: pointer;
  position: relative;
}
.swatch__tile { width: var(--swatch-size); height: var(--swatch-size); }
.swatch[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-on-primary-soft);
  font-weight: var(--weight-bold);
}
.swatch__check {
  display: none;
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.swatch[aria-pressed="true"] .swatch__check { display: grid; place-items: center; }
.swatch__count { color: var(--color-text-muted); font-weight: var(--weight-regular); }

/* ---------- Rij voor een exemplaar ---------- */
.copy-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }

.copy {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head  place"
    "need  place"
    "prog  prog";
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.copy:hover { border-color: var(--color-border-strong); }
.copy:active { transform: translateY(2px); box-shadow: none; }

.copy--focus { border: 2px solid var(--color-accent); padding: calc(var(--space-3) - 1px) calc(var(--space-3) - 1px) calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.copy--reserve { background: var(--color-surface-sunken); box-shadow: none; }

.copy__head { grid-area: head; min-width: 0; }
.copy__badges { display: flex; gap: var(--space-2); margin-bottom: var(--space-1); }
.copy__name {
  display: block;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}
.copy__set { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--color-text-muted); }

.copy__need { grid-area: need; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-sm); }
.copy__need strong { font-weight: var(--weight-bold); }
.copy__have { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* Nopjes: gevuld = ligt al in de bak, open = nog nodig. Vorm én tekst, niet alleen kleur. */
.studs { display: inline-flex; gap: 3px; }
.stud {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 2px solid var(--color-primary);
}
.stud--have { background: var(--color-primary); }

.copy__place {
  grid-area: place;
  align-self: center;
  display: grid;
  place-items: center;
  width: var(--tap-primary);
  height: var(--tap-primary);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  color: var(--color-on-primary-soft);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
}
.copy--reserve .copy__place { background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-muted); }

.copy__progress { grid-area: prog; margin-top: var(--space-1); display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.copy__pct { min-width: 9.5em; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Voortgangsbalk: <progress>, zodat er geen style-attribuut nodig is ---------- */
.progress {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: var(--progress-height);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-progress-track);
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: var(--color-progress-track); border-radius: var(--radius-pill); }
.progress::-webkit-progress-value { background: var(--color-progress-fill); border-radius: var(--radius-pill); }
.progress::-moz-progress-bar { background: var(--color-progress-fill); border-radius: var(--radius-pill); }
.progress--done::-webkit-progress-value { background: var(--color-progress-done); }
.progress--done::-moz-progress-bar { background: var(--color-progress-done); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  max-width: calc(var(--content-max) - 2 * var(--space-3));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-toast-bg);
  color: var(--color-toast-text);
  box-shadow: var(--shadow-raised);
  animation: toast-in var(--duration-slow) var(--ease-snap);
}
.toast--inline { position: static; margin: 0; animation: none; }
.toast__text { flex: 1; font-size: var(--text-sm); line-height: var(--leading-tight); }
.toast__text strong { display: block; font-size: var(--text-md); }
.toast__action {
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-toast-action);
  font: inherit;
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.toast__action:hover { text-decoration: underline; }

@keyframes toast-in {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Lege toestand, laden en fout ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
}
.state__title { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-black); }
.state__text { margin: 0; color: var(--color-text-muted); max-width: 22rem; }
.state--error { background: var(--color-danger-soft); border-radius: var(--radius-lg); color: var(--color-on-danger-soft); }
.state--error .state__text { color: var(--color-on-danger-soft); }
.state--error .state__icon { color: var(--color-danger); }

/* Laden: het beeldmerk "bouwt" zichzelf op. */
.loader { display: flex; align-items: flex-end; gap: 6px; height: 48px; }
.loader span { width: 14px; border-radius: 3px; animation: stack 900ms var(--ease-out) infinite alternate; }
.loader span:nth-child(1) { height: 16px; background: var(--bes-500); }
.loader span:nth-child(2) { height: 28px; background: var(--mango-500); animation-delay: 150ms; }
.loader span:nth-child(3) { height: 40px; background: var(--color-primary); animation-delay: 300ms; }
@keyframes stack { from { transform: scaleY(0.4); transform-origin: bottom; } to { transform: none; transform-origin: bottom; } }
@media (prefers-reduced-motion: reduce) { .loader span { animation: none; } }

.skeleton {
  height: 104px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--color-skeleton) 30%, var(--color-skeleton-shine) 50%, var(--color-skeleton) 70%);
  background-size: 300% 100%;
  animation: shine 1.4s linear infinite;
}
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Voettekst: naamsvermelding ---------- */
.attribution {
  padding: var(--space-4) var(--space-4) var(--space-6);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  text-align: center;
}
.attribution p { margin: 0 0 var(--space-1); }
.attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: var(--space-1) 0; }

/* ---------- Alleen voor de componentenpagina ---------- */
.candidate__name { display: block; }

/* =====================================================================
 * D002: componenten voor de schermen van fase 1.
 * Uitleg en states: design-system.md §5.10 e.v.
 * ===================================================================== */

/* ---------- App-balk: titel met ondertitel, acties rechts ---------- */
.app-bar__titles { flex: 1; min-width: 0; }
.app-bar__titles .app-bar__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar__sub { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-tight); }
.app-bar--root { padding-inline: var(--space-4) var(--space-2); }

/* Wisselknop voor de actieve collectie (in de app-balk) */
.chip-button {
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: var(--tap-min); padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--color-text);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-bold);
  cursor: pointer; white-space: nowrap;
}
.chip-button:hover { background: var(--color-surface-sunken); }

/* ---------- Dock: actiebalk + tabbalk samen onderaan ---------- */
.dock {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}
.dock .action-bar { position: static; border-top: 0; padding-bottom: var(--space-2); }
.action-bar__row { display: flex; gap: var(--space-3); align-items: flex-start; }
.action-bar__row > .btn--grow { flex: 1; }
.btn--square { width: var(--tap-primary); min-height: var(--tap-primary); padding: 0; border-radius: var(--radius-xl); }

/* ---------- Tabbalk (hoofdnavigatie) ---------- */
.tab-bar {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 0 var(--space-2) env(safe-area-inset-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.tab-bar__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tap-primary);
  color: var(--color-text-muted); text-decoration: none;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
}
.tab-bar__item[aria-current="page"] { color: var(--color-primary); font-weight: var(--weight-black); }
.tab-bar__item[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--color-primary);
}
.tab-bar__item .icon-fill { fill: none; }
.tab-bar__item[aria-current="page"] .icon-fill { fill: currentColor; fill-opacity: 0.2; }

/* ---------- Zoeker van de camera ---------- */
.viewfinder {
  position: relative; overflow: hidden;
  aspect-ratio: 6 / 5;
  border-radius: var(--radius-xl);
  background: #000;
  box-shadow: var(--shadow-card);
}
.viewfinder__feed { width: 100%; height: 100%; object-fit: cover; }
.viewfinder__frame { position: absolute; top: 12%; left: 50%; height: 76%; width: auto; aspect-ratio: 1; transform: translateX(-50%); color: #FFFFFF; }
.viewfinder__hint {
  position: absolute; left: 50%; bottom: var(--space-2); transform: translateX(-50%);
  margin: 0; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgb(12 16 18 / 0.72); color: #FFFFFF;
  font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap;
}

/* ---------- Privacytekst bij de camera (eis 19) ---------- */
.privacy-note {
  display: grid; grid-template-columns: 18px 1fr; gap: var(--space-2);
  margin: 0; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--color-text-muted);
}
.privacy-note svg { margin-top: 1px; }
.privacy-note a { color: var(--color-text); text-decoration: underline; text-underline-offset: 2px; }

/* Toast boven het dock: het dock is de ankerplek, de toast staat er net boven. */
.toast--docked { position: absolute; bottom: calc(100% + var(--space-3)); }

/* ---------- Net geplaatst ---------- */
.recent-card { padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3); }
.recent { margin: 0; padding: 0; list-style: none; }
.recent__row {
  display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: var(--space-1) var(--space-2);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
}
.recent__row:last-child { border-bottom: 0; }
.recent__img { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--color-surface-sunken); padding: 2px; }
.recent__text { min-width: 0; font-size: var(--text-sm); line-height: var(--leading-tight); }
.recent__text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent__text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-muted); }
.recent__row--undone .recent__text strong { color: var(--color-text-muted); text-decoration: line-through; }

/* ---------- Eigen foto (canvas) ---------- */
.photo { width: 48px; height: 48px; border-radius: var(--radius-md); object-fit: cover; border: 1px solid var(--color-border); }
.photo-row { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }
.photo-row p { margin: 0; }

/* ---------- Gesegmenteerde keuze (tabs binnen een scherm) ---------- */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-lg);
  background: var(--color-surface-sunken);
}
.segmented__item {
  min-height: var(--tap-min); padding: 0 var(--space-2);
  border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--color-text-muted);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.segmented__item[aria-selected="true"] {
  background: var(--color-surface); color: var(--color-text); font-weight: var(--weight-bold);
  box-shadow: var(--shadow-card);
}

/* ---------- Onderdelen in een raster (bladeren) ---------- */
.part-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.part {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-2) var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.part:hover { border-color: var(--color-border-strong); }
.part:active { transform: translateY(2px); box-shadow: none; }
.part__img { width: 100%; height: 88px; border-radius: var(--radius-md); background: var(--color-surface-sunken); object-fit: contain; padding: var(--space-2); }
.part__name { font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: var(--leading-tight); }
.part__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.part--current { border: 2px solid var(--color-primary); }

.badge--need { background: var(--color-primary-soft); color: var(--color-on-primary-soft); }

/* Plaatsvervanger voor een plaatje dat nog ontbreekt (eis 17a) */
.thumb--placeholder, .part__img--placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px dashed var(--color-border-strong);
  color: var(--color-text-muted);
  text-align: center;
}
.placeholder__num { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--color-text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Kandidaat met familieknop ---------- */
.candidate-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.candidate-item { display: flex; flex-direction: column; }
.candidate-item .candidate { border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.candidate-item__more {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 var(--space-3);
  border: 1px solid var(--color-border); border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--color-surface-sunken);
  color: var(--color-primary); font-size: var(--text-sm); font-weight: var(--weight-bold); text-decoration: none;
  box-shadow: var(--shadow-card);
}
.candidate-item__more span:last-child { color: var(--color-text-muted); font-weight: var(--weight-regular); }

/* ---------- Kleurstaal met plaatje van het element (eis 11) ---------- */
.swatch__img { width: 56px; height: 56px; object-fit: contain; }
.swatch__label { display: inline-flex; align-items: center; gap: var(--space-1); }
.swatch__label svg { border-radius: 3px; }
.swatch-grid--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Invoervelden ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label { font-weight: var(--weight-bold); }
.field__hint { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.field__error { margin: 0; display: flex; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-danger); }
.input {
  width: 100%; min-height: 48px; padding: 0 var(--space-3);
  border: 2px solid var(--color-border-strong); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text);
  font: inherit; font-size: var(--text-md);
}
.input--multi { min-height: 48px; padding: 10px var(--space-3); resize: vertical; line-height: 1.4; }
.input::placeholder { color: var(--color-text-muted); }
.input[aria-invalid="true"] { border-color: var(--color-danger); }
.search { position: relative; }
.search .input { padding-left: 44px; padding-right: 48px; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.search__clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }

/* ---------- Banner ---------- */
.banner {
  display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2);
  margin: 0; padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.banner--info { background: var(--color-primary-soft); color: var(--color-on-primary-soft); }
.banner--warning { background: var(--color-warning-soft); color: var(--color-on-warning-soft); }
.banner--danger { background: var(--color-danger-soft); color: var(--color-on-danger-soft); }

/* ---------- Toast bij een fout ---------- */
.toast--error { background: var(--color-danger-soft); color: var(--color-on-danger-soft); border: 1px solid var(--color-danger); }
.toast--error .toast__action { color: var(--color-on-danger-soft); text-decoration: underline; }

/* ---------- Gevaarlijke actie ---------- */
.btn--danger { background: var(--color-danger); color: var(--color-on-danger); box-shadow: 0 var(--edge-height) 0 var(--color-danger-edge); margin-bottom: var(--edge-height); }
.btn--danger:active { transform: translateY(calc(var(--edge-height) - 1px)); box-shadow: 0 1px 0 var(--color-danger-edge); }
.btn--danger-quiet { background: transparent; color: var(--color-danger); padding-inline: var(--space-3); }
.btn--danger-quiet:hover { background: var(--color-danger-soft); }

/* ---------- Lijsten (account, beheer, auditlog) ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.list-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-3);
  min-height: 56px; padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.list-row:last-child { border-bottom: 0; }
.list-row__title { margin: 0; font-weight: var(--weight-bold); }
.list-row__meta { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
a.list-row { color: inherit; text-decoration: none; }

/* ---------- Dialoog (bevestigen, step-up) als blad onderaan ---------- */
.dialog {
  width: 100%; max-width: var(--content-max);
  margin: auto auto 0; padding: var(--space-6) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  border: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--color-surface); color: var(--color-text);
  box-shadow: var(--shadow-raised);
}
.dialog::backdrop { background: var(--color-scrim); }
.dialog__title { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-black); }
.dialog__text { margin: 0 0 var(--space-5); color: var(--color-text-muted); }
.dialog__actions { display: flex; flex-direction: column; gap: var(--space-2); }

/* ---------- Kaart van een exemplaar in de collectie ---------- */
.copy-card {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); align-items: center;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: inherit; text-decoration: none;
}
.copy-card { grid-template-areas: "head chev" "prog prog"; }
.copy-card__chev { grid-area: chev; color: var(--color-text-muted); }

/* ---------- Ontbreek-lijst ---------- */
.group-title {
  position: sticky; top: 56px; z-index: 1;
  margin: 0; padding: var(--space-2) 0;
  background: var(--color-bg);
  font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-text-muted);
}
.missing { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.missing .thumb { width: 48px; height: 48px; }
.missing__name { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: var(--leading-tight); overflow-wrap: anywhere; }
.missing__meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); align-items: center; font-size: var(--text-sm); color: var(--color-text-muted); }
.missing__count { text-align: right; font-variant-numeric: tabular-nums; }
.missing__count strong { display: block; }
.missing__count span { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Groot getal ---------- */
.stat { display: flex; align-items: baseline; gap: var(--space-2); }
.stat__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-black); line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---------- Hulpklassen voor de mockups ---------- */
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--text-sm); }
.m0 { margin: 0; }

/* =====================================================================
   T010: copied from docs/design/mockups/mockup.css (section D005).
   D005 (voorstel): collecties door gebruikers en deellinks.
   Uitleg: design-system.md §5.37–5.42. Schermen: screens/001-collecties.md,
   001-collectie-leden.md, 001-uitnodigen.md, 001-doe-mee.md, 001-beheer.md.
   ===================================================================== */

/* ---------- 5.37 Losse pagina zonder app-balk (deellink; ook inloggen en enroll) ---------- */
.solo {
  flex: 1;
  display: flex; flex-direction: column; gap: var(--space-5);
  padding: var(--space-8) var(--space-4) var(--space-6);
}
.solo__logo { width: 120px; height: auto; }
.solo__title {
  margin: 0;
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-black);
  line-height: var(--leading-tight); letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.solo__lead { margin: 0; color: var(--color-text-muted); }

/* ---------- 5.38 Uitnodigingskaart: welke collectie, van wie ---------- */
.invite {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--space-3); align-items: center;
  padding: var(--space-4);
}
.invite__icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--color-primary-soft); color: var(--color-on-primary-soft);
}
.invite__name {
  margin: 0;
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-black);
  line-height: var(--leading-tight); overflow-wrap: anywhere;
}
.invite__from { margin: 2px 0 0; font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }

/* "Je doet mee als Robin", met "Niet Robin?" ernaast */
.as-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.as-line p { margin: 0; }
.as-line strong { color: var(--color-text); }

/* Scheiding "of" tussen twee wegen */
.or { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--color-border); }

/* <details> "Wat is een passkey?" */
.details { font-size: var(--text-sm); color: var(--color-text-muted); }
.details summary {
  display: inline-flex; align-items: center; min-height: var(--tap-min);
  color: var(--color-primary); font-weight: var(--weight-bold); cursor: pointer;
}
.details p { margin: 0; }

/* ---------- 5.39 Lijstrij als knop, rij met gevaarlijke actie, kaart met binnenruimte ---------- */
button.list-row {
  width: 100%;
  background: transparent; border: 0; border-bottom: 1px solid var(--color-border);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.list > li > a.list-row, .list > li > button.list-row { border-bottom: 0; }
.list > li:not(.list-row) + li { border-top: 1px solid var(--color-border); }
.switch-row + .list { border-top: 1px solid var(--color-border); }
.subhead { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: var(--leading-tight); }
.section-note { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
a.list-row:hover, button.list-row:hover { background: var(--color-surface-sunken); }
.list-row__chev { color: var(--color-text-muted); }
.list-row--danger .list-row__title { color: var(--color-danger); }
.list-row__title .badge { margin-left: var(--space-1); vertical-align: 2px; }
.list-row__title bdi { overflow-wrap: anywhere; }
.card--pad { padding: var(--space-4); }

/* ---------- 5.40 Keuzelijst in een dialoog (eigenaar kiezen) ---------- */
.choices { margin: 0 0 var(--space-5); padding: 0; border: 0; min-width: 0; }
.choice {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 56px; padding: var(--space-2) var(--space-1);
  border-bottom: 1px solid var(--color-border);
  font-weight: var(--weight-bold); cursor: pointer;
}
.choice:last-child { border-bottom: 0; }
.choice input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--color-primary); }
.choice__meta { display: block; font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--color-text-muted); }

/* ---------- 5.41 Schakelaar (aanmeldingen open of dicht) ---------- */
.switch-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: start;
  padding: var(--space-4);
}
.switch-row__title { margin: 0; font-weight: var(--weight-bold); }
.switch-row__text { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.switch {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 var(--space-1);
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-text);
  font: inherit; font-weight: var(--weight-bold); cursor: pointer;
}
.switch__track {
  position: relative; flex: none;
  width: 52px; height: 32px; border-radius: var(--radius-pill);
  background: var(--color-surface-sunken); border: 2px solid var(--color-border-strong);
  transition: background-color var(--duration-fast) var(--ease-out);
}
.switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform var(--duration-fast) var(--ease-snap);
}
.switch[aria-checked="true"] .switch__track { background: var(--color-primary); border-color: var(--color-primary); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(20px); background: var(--color-on-primary); }
.switch__label { min-width: 2.8em; text-align: left; }

/* ---------- 5.42 Teller bij een grens ---------- */
.limit { font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
