/* Opbouw en stijl naar prototype v2 (Ontwerp/prototype-v2-leespagina.html), mobile-first op
   volle breedte; op desktop een leesbreedte van max. 680 px. Kleuren in tokens.css. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.45;
}

.shell {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* App-balk: definitief logo (beeldmerk + woordmerk in Outfit 800) en rechts de taalkeuze */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/outfit-800.woff2") format("woff2");
}
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 16px;
  min-height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  text-decoration: none;
}
.mark { display: block; height: 34px; width: auto; }
.mark-dark { display: none; }
html[data-theme="dark"] .mark-light { display: none; }
html[data-theme="dark"] .mark-dark { display: block; }
.wordmark {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.wm-page { color: var(--primary); }
html[data-theme="dark"] .wm-page { color: var(--text); }
.wm-wend { color: var(--accent); }

/* Kaart: op een telefoon volle breedte, op grotere schermen met rand en ronding */
.card {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex: 1 0 auto;
}
.card:not(.reader) { padding: 16px 16px 24px; }

@media (min-width: 700px) {
  .shell { padding: 0 0 24px; }
  .card {
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
  }
}

/* Toast (sluitbaar, bovenin) */
.toast {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 8px 6px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.toast.show { display: flex; }
.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

/* Kop van het boek */
.book-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.book-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

/* Bovenbalk: terug, bladeren, lettergrootte en thema */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "back tools" "stepper stepper";
  align-items: center;
  gap: 4px 8px;
  padding: 6px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.topbar .ghost-nav { grid-area: back; }
.topbar .stepper { grid-area: stepper; justify-self: center; }
.topbar .icon-tools { grid-area: tools; justify-self: end; }
@media (min-width: 480px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "back stepper tools";
  }
}

.ghost-nav {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.ghost-nav:hover { background: var(--border); color: var(--text); }

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.stepper #page-counter { min-width: 84px; text-align: center; }

.step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.step-btn:hover:not(:disabled):not(.is-disabled) { border-color: var(--primary); color: var(--primary); }
.step-btn:disabled, .step-btn.is-disabled { opacity: 0.35; cursor: not-allowed; }

.icon-tools { display: flex; gap: 4px; }
.tool-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* De bladzijde */
.page {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
}
.chapter-row { margin-bottom: 14px; }
.chapter-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.3;
}
.prose {
  font-family: var(--font-story);
  font-size: var(--story-size);
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
}
.prose p { margin: 0 0 15px; white-space: pre-line; }
.prose p:last-child { margin-bottom: 0; }
.prose:empty { min-height: 1.75em; }

.writing {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}
.writing::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}
@media (prefers-reduced-motion: reduce) { .writing::after { animation: none; } }

.empty-page { margin: 0; }

.versions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Stuurblok */
.steer {
  padding: 16px 18px 20px;
  background: var(--surface-alt);
}
.group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 16px 0 8px;
}

.btn {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-btn);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  transition: transform 0.06s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-inline { width: auto; display: inline-flex; }

.btn-next { background: var(--primary); color: var(--on-primary); border: none; }
.btn-next:hover:not(:disabled) { background: var(--primary-hover); }

.btn-subtle { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-subtle:hover:not(:disabled) { background: var(--bg); }

.btn-accent { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }

.plots { display: flex; flex-direction: column; gap: 8px; }
.plot-option {
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-btn);
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}
.plot-option:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.plot-option[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}
.plot-option[aria-pressed="true"]::before { content: "✓ "; color: var(--accent); }
.plot-option:disabled { opacity: 0.38; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip:disabled { opacity: 0.38; cursor: not-allowed; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.hint { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }

/* Startpagina */
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.page-title { margin: 8px 0; font-size: 22px; font-weight: 700; }
.book-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.book-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.book-link:hover { background: var(--primary-soft); }
.book-item-title { font-family: var(--font-story); font-size: 17px; }
.book-item-meta { font-size: 13px; color: var(--text-muted); }
.book-item-action { font-size: 14px; font-weight: 700; color: var(--primary); }
.empty { color: var(--text-muted); }

/* Startformulier */
.new-book { display: flex; flex-direction: column; gap: 18px; }
.field { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 700; padding: 0; }
select, textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 48px;
  width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
.segmented { display: flex; gap: 8px; }
.segment { flex: 1; position: relative; }
.segment input { position: absolute; opacity: 0; inset: 0; }
.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}
.segment input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.segment input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

/* Voet: taal en instellingen */
.footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.lang-switch { display: flex; align-items: center; gap: 2px; }

/* Licht/donker rechtsboven: maan in het lichte thema, zon in het donkere. Standaard volgt het
   thema het systeem van het apparaat; de knop overschrijft dat (prefs.js). */
.appbar-tools { display: flex; align-items: center; gap: 2px; }
.theme-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-btn:hover { color: var(--text); background: var(--surface-alt); }
.theme-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-btn .icon-sun { display: none; }
html[data-theme="dark"] .theme-btn .icon-sun { display: block; }
html[data-theme="dark"] .theme-btn .icon-moon { display: none; }
.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); background: var(--surface-alt); }
.link-btn[aria-current="true"] { color: var(--primary); text-decoration: underline; }

/* Tijdens het schrijven: niets aanklikbaar in het lees- en stuurblok */
#lezer[data-busy] a { pointer-events: none; opacity: 0.5; }

/* --- BR-003: titels, profielkaart, schuifjes, Einde boek, bewerkmodus -------------------- */
.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;
}
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.title-btn {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 8px 0;
  background: none; border: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.title-btn:hover .edit-mark, .title-btn[aria-expanded="true"] .edit-mark { color: var(--accent); }
.edit-mark { font-size: 0.85em; color: var(--text-muted); font-weight: 400; }
.chapter-heading .title-btn { color: var(--text-muted); }
.small-action-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.small-action-btn:hover { border-color: var(--primary); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.picker {
  margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-btn);
  background: var(--surface-alt); display: flex; flex-direction: column; gap: 10px;
}
.page .picker { margin: 0 0 14px; }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.more-row { display: flex; }
.more-btn {
  min-height: 44px; padding: 0 4px; background: none; border: none; color: var(--primary);
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: underline; cursor: pointer;
}
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; }
input[type="text"] {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 48px; width: 100%;
}
.counter-wrap { display: inline-flex; flex-direction: column; align-items: center; min-width: 84px; }
.progress { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.near-end {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: var(--primary-soft); color: var(--text);
}
.end-book { margin-top: 8px; }
.end-book[data-armed], .end-book[data-armed]:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.end-block { display: flex; flex-direction: column; gap: 12px; }
.end-title { margin: 0; font-family: var(--font-story); font-size: 20px; text-align: center; }
.edit-strip { margin-top: 16px; display: flex; justify-content: flex-end; }
.edit-btn {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--accent);
  background: var(--surface); color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.edit-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); border-style: solid; }
.page.editing { box-shadow: inset 4px 0 0 var(--accent); }
.edit-panel {
  margin-top: 12px; padding: 12px; border-radius: var(--radius-btn);
  border: 1px solid var(--accent); background: var(--accent-soft);
}
.edit-panel-title { font-weight: 700; font-size: 14px; }
.edit-panel .chips { margin-top: 10px; }
.toast-link { color: inherit; font-weight: 700; text-decoration: underline; }
.refine { border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); }
.refine summary { min-height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 14px; font-weight: 700; cursor: pointer; }
.refine-body { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 12px; }
.style-profile { gap: 2px; }
/* Eén regel per schuifje, ook op 360 px: label · licht · schuif · donker */
.slider {
  display: grid;
  grid-template-columns: 76px 66px minmax(60px, 1fr) 48px;
  align-items: center;
  column-gap: 6px;
}
.slider-label { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.slider-end { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; line-height: 1.2; }
.slider-end:first-of-type { text-align: right; }
.slider input[type="range"] { width: 100%; min-width: 0; min-height: 44px; margin: 0; accent-color: var(--primary); }
.meta-line { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); }
.meta-line strong { color: var(--text); }
.person-row { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 10px; }
@media (min-width: 480px) { .person-row { grid-template-columns: 2fr 3fr; } }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); cursor: pointer;
}
.radio-option input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.radio-option:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.radio-option span { font-family: var(--font-story); font-size: 16px; }
.own-option span { font-family: var(--font-ui); font-size: 14px; font-weight: 600; }
.book-link.is-finished { border-left-color: var(--accent); }

/* Leeftijd (wijziging BR-003): 6 keuzes in 3 kolommen, en het boekprofiel als leestekst */
.age-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.age-grid .segment span { flex-direction: column; gap: 0; padding: 4px 2px; line-height: 1.2; text-align: center; }
.age-grid .segment small { font-size: 11px; font-weight: 500; opacity: 0.85; }
.profile-view dl { margin: 6px 0 0; display: grid; gap: 4px; }
.profile-view dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 6px; }
.profile-view dd { margin: 0; font-family: var(--font-story); font-size: 16px; line-height: 1.5; }
.profile-view ul { margin: 0; padding-left: 18px; }

/* --- BR-004: accounts, kast, publiceren, boekpagina (compact op mobiel) ------------------- */
input[type="email"], input[type="password"], input[type="search"], .admin input.code-input {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 48px; width: 100%;
}
.code-input { font-size: 22px; letter-spacing: 0.3em; text-align: center; }
.account { position: relative; }
.account-btn { text-decoration: none; }
.account-menu {
  position: absolute; right: 0; top: 46px; z-index: 20; min-width: 180px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 24px rgba(16, 19, 23, 0.16);
}
.account-menu a, .account-menu button, .shelf-menu a, .shelf-menu button {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: none; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; text-decoration: none;
  cursor: pointer; width: 100%;
}
.account-menu a:hover, .account-menu button:hover, .shelf-menu a:hover, .shelf-menu button:hover { background: var(--surface-alt); }
.auth { display: flex; flex-direction: column; gap: 12px; }
.auth .page-title { margin-bottom: 0; }
.auth p { margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-or { text-align: center; color: var(--text-muted); font-size: 13px; }
.auth-foot { font-size: 14px; text-align: center; }
.auth a:not(.btn):not(.ghost-nav), .meta-line a, .shelf a.inline { color: var(--primary); }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.check-option { align-items: flex-start; font-size: 14px; line-height: 1.4; }
.check-option input { margin-top: 1px; }
.link-btn.inline { text-decoration: underline; }
.shelf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.shelf-row {
  display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: start;
  padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.cover.cover-small { width: 54px; padding: 6px 5px; border-radius: 3px 8px 8px 3px; }
.cover-small .cover-genre { font-size: 6px; }
.cover-small .cover-title { font-size: 9px; }
.cover-small .cover-mark { width: 12px; height: 12px; }
.cover-maker { font-size: 12px; opacity: 0.9; }
.cover-misdaad { background: #4A3B33; }
.cover-horror { background: #3B1F24; }
.cover-sciencefiction { background: #2F4858; }
.shelf-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shelf-title { font-family: var(--font-story); font-size: 17px; overflow-wrap: anywhere; }
.shelf-meta { font-size: 13px; color: var(--text-muted); }
.status { font-weight: 700; }
.status-voltooid { color: var(--primary); }
.status-gepubliceerd { color: var(--accent); }
.shelf-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.shelf-actions .btn { width: auto; flex: 1; min-height: 44px; }
.btn-small { min-height: 40px; font-size: 14px; }
.more-menu-btn {
  width: 44px; height: 44px; flex: none; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer;
}
.more-menu-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.shelf-menu { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 4px; }
.shelf-menu .danger, .shelf-menu .danger[data-armed] { color: var(--accent); font-weight: 700; }
.publish-preview, .book-page-head { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.publish-preview .meta-line { margin: 0; }
.book-page { display: flex; flex-direction: column; gap: 12px; }
.book-page .page-title { margin: 0 0 4px; }
.book-page .profile-view p { margin: 0 0 10px; }
.book-maker { margin: 0 0 6px; color: var(--text-muted); font-size: 14px; }
.badge { display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
/* Bovenbalk op een smalle telefoon (360 px): logo, thema, taal en account passen naast elkaar. */
@media (max-width: 400px) {
  .appbar { padding-left: 10px; gap: 4px; }
  .wordmark { font-size: 22px; }
  .mark { height: 28px; }
  .appbar-tools .theme-btn { width: 36px; }
  .lang-switch .link-btn { min-width: 34px; padding: 0 4px; }
}
/* Andere opties direct onder de keuzes, links uitgelijnd (Peter, 29 nov 2026), in elke
   keuzegroep hetzelfde: boektitel, makernaam en de titelkiezer in de lezer. */
.field > .more-btn, .field .more-btn { align-self: flex-start; text-align: left; margin-top: -2px; }

/* --- BR-003b: boekkeuzes als chips (radio + label), Meer keuzes, eigen naam, Einde boek ---- */
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; display: inline-flex; }
.choice-chip[hidden] { display: none; }
.choice-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-chip); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.choice-chip input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.choice-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-chip input:disabled + span { cursor: default; }
.choice-chip input:disabled:not(:checked) + span { opacity: 0.6; }
.chip-row[hidden] { display: none; }
.ai-tag { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.more-summary { font-weight: 600; color: var(--text-muted); overflow-wrap: anywhere; }
.more-choices summary { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.other-names { align-self: flex-start; color: var(--primary); text-decoration: underline; padding: 0 4px; }
/* Eigen naam: het veld klapt alleen open als de chip Eigen naam aan staat (stap 3). */
.own-name { display: none; flex-direction: column; gap: 4px; }
.chip-row:has(input[data-eigen-naam-chip]:checked) .own-name { display: flex; }
.small-label { font-size: 13px; }
.form-notice {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--primary-soft); border: 1px solid var(--primary);
}
.choices-line { margin: 0; font-size: 14px; color: var(--text); }
.remake-row { display: flex; flex-direction: column; gap: 6px; }
/* Einde boek: de eerste tik klapt de einde-chips open, de tweede schrijft de slotbladzijde. */
.end-book-confirm { margin-top: 8px; }
.end-book-confirm > summary { list-style: none; display: flex; align-items: center; justify-content: center; }
.end-book-confirm > summary::-webkit-details-marker { display: none; }
.end-book-confirm[open] > summary.btn, .end-book-confirm[open] > summary.btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.end-book-body { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.profile-choices { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.choices-summary { list-style: none; cursor: pointer; min-height: 44px; display: block; padding: 10px 0; font-size: 14px; line-height: 1.5; }
.choices-summary::-webkit-details-marker { display: none; }
.choices-edit { color: var(--primary); font-weight: 700; text-decoration: underline; white-space: nowrap; }
.profile-choices-toggle[open] .choices-edit { display: none; }

/* Testknop (tijdelijk, tot livegang; alleen met DEV_TESTKNOP=true) */
.testknop { display: inline-flex; }
.testknop-btn {
  min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1px dashed var(--accent);
  background: var(--surface); color: var(--accent); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.testknop-btn:hover { background: var(--accent-soft); }

/* Rond dit hoofdstuk af (30 nov 2026): een vinkje; sinds 4 dec onder Probeer opnieuw. */
.end-chapter { padding: 10px 12px; gap: 12px; align-items: center; margin-top: 12px; }
.end-chapter span { font-family: var(--font-ui); font-size: 15px; }
.end-chapter .hint { display: block; margin-top: 2px; font-size: 13px; }

/* --- Bibliotheek, beoordelen en melden (BR-004 deel 2) ---------------------------------------- */
.cover-dieren { background: #4F6B3A; }
.cover-grappig { background: #8A5A12; }
.cover-echte_leven { background: #5A5F73; }
.cover-link { display: block; color: inherit; text-decoration: none; border-radius: 6px 14px 14px 6px; }
.cover-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.cover-count { color: var(--text-muted); font-weight: 600; }
.cover-meta { flex-wrap: wrap; row-gap: 4px; }
.cover-meta > span { white-space: nowrap; }
.library { display: flex; flex-direction: column; gap: 12px; }
.library .page-title { margin: 0; }
.filters { display: flex; flex-direction: column; gap: 8px; }
.library-grid .cover-genre { overflow-wrap: anywhere; font-size: 9px; }
.filter-line { display: block; }
a.chip { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
a.chip.holiday-chip { border-color: var(--accent); color: var(--accent); }
a.chip[aria-current="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.covers.library-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px 12px;
  margin: 4px 0 0; padding: 0; overflow: visible;
}
.library-grid .cover-item { flex: none; min-width: 0; }
@media (min-width: 560px) {
  /* Op een breder scherm een vaste boekmaat, zodat een paar boeken niet uitrekken. */
  .covers.library-grid { grid-template-columns: repeat(auto-fill, 140px); }
}
.library-grid .cover { padding: 10px 9px; }
.library-grid .cover-title { font-size: 15px; }
.library-grid .cover-maker { font-size: 10px; }
.library-grid .cover-meta { flex-wrap: wrap; gap: 4px 6px; }
.more-item { grid-column: 1 / -1; }
.library-empty { margin: 4px 0; color: var(--text-muted); font-size: 15px; }
.eyebrow-small { margin: 0; font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.book-maker a { color: var(--primary); }
.rating-line { margin: 0; font-size: 14px; color: var(--text-muted); }
.rating-tags { font-size: 13px; }
.rate { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.end-block .rate { border-top: none; padding-top: 0; align-items: center; text-align: center; }
.rate form { display: flex; flex-direction: column; gap: 10px; }
.end-block .rate form { align-items: center; }
.stars { display: flex; gap: 2px; }
.star {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: none; border-radius: 10px; background: none;
  color: var(--border); font-size: 30px; line-height: 1; cursor: pointer; text-decoration: none;
}
.star.is-on { color: var(--accent); }
.star:hover { background: var(--surface-alt); }
.end-block .rate-tags { justify-content: center; }
.rate .hint a, .hint a { color: var(--primary); }
.book-page { position: relative; }
.book-page > .book-more { position: absolute; top: 12px; right: 12px; z-index: 5; }
.book-page .book-page-head { padding-right: 40px; }
.book-more { position: relative; }
.book-menu {
  position: absolute; right: 0; top: 50px; z-index: 20; min-width: 240px; margin: 0;
  padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  box-shadow: 0 10px 24px rgba(16, 19, 23, 0.16);
}
.book-menu[hidden] { display: none; }
.report-panel { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.report-panel[hidden] { display: none; }
.report-panel .hint { margin: 4px 12px 2px; }
.report-done { padding: 10px 12px; margin: 0; font-size: 14px; }
.book-header-menu { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

/* Beheerpagina (Peter, 5 dec 2026) */
.admin { display: flex; flex-direction: column; gap: 12px; }
.admin .page-title { margin-bottom: 0; }
.admin p { margin: 0; }
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.admin-tabs a {
  flex: 1 0 auto; text-align: center; padding: 12px 6px; min-height: 44px; color: var(--text-muted); white-space: nowrap; font-size: 15px;
  font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent;
}
.admin-tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.admin-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.admin-stats p { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.admin-stats strong { font-size: 20px; }
.admin-stats span { font-size: 13px; color: var(--text-muted); }
.admin-h2 { margin: 6px 0 0; font-size: 17px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.admin-compact li { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
.admin-item {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface);
}
.admin-item .shelf-actions form { flex: 1; display: flex; }
.admin-item .shelf-actions .btn { width: 100%; }
.admin-link { flex-direction: row; align-items: center; color: var(--text); text-decoration: none; }
.admin-link .shelf-body { flex: 1; }
.admin-email { overflow-wrap: anywhere; }
.admin-big { font-size: 17px; }
.admin-chevron { color: var(--text-muted); font-size: 22px; }
.admin-search-row { display: flex; gap: 8px; }
.admin-search-row input { flex: 1; }
.admin-back { color: var(--primary); font-size: 14px; }
.admin-danger { color: var(--accent); border-color: var(--accent); }
.admin-events { list-style: none; margin: 0; padding: 0; }
.admin-events li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.admin-events a { color: var(--primary); overflow-wrap: anywhere; }
.admin-when { width: 84px; flex: none; color: var(--text-muted); }
.admin-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.admin-key { display: inline-block; margin: 4px 0; font-size: 17px; letter-spacing: 0.05em; overflow-wrap: anywhere; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.admin-table th, .admin-table td { padding: 7px 4px; border-top: 1px solid var(--border); text-align: right; }
.admin-table thead th { border-top: 0; color: var(--text-muted); font-weight: 600; font-size: 13px; }
.admin-table tbody th { text-align: left; font-weight: 400; }
.admin-table td:nth-child(3), .admin-table td:nth-child(4) { color: var(--primary); }
/* Feedback (Peter, 5 dec 2026) */
.feedback-kinds { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chip-radio { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.chip-radio input { margin: 0; accent-color: var(--accent); }
.chip-radio:has(input:checked) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.admin-feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.admin-book { display: flex; flex-direction: column; gap: 10px; }

/* Voorwaarden en privacyverklaring (livegang 5 dec 2026) */
.legal h2 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.legal li + li { margin-top: 0.35rem; }

/* Botcheck (Turnstile): meestal onzichtbaar; bij twijfel een vinkje boven de knop */
.botcheck:not(:empty) { margin: 0.5rem 0; }

/* Kop van de leespagina in twee dunne regels (testronde 1 dec 2026, punt 11). */
.reader-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.reader-head .book-title { flex: 1; min-width: 0; }
.reader-head .title-btn { min-height: 44px; padding: 4px 0; overflow-wrap: anywhere; }
.back-btn { flex: none; font-size: 18px; }
.reader-head .book-menu { min-width: 220px; }
.menu-tools { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 14px; }
.menu-tools span { flex: 1; color: var(--text-muted); font-weight: 600; }
.topbar-compact { display: flex; justify-content: center; padding: 4px 10px; }

/* Bibliotheek: taal en volgorde achter één knop Filter (testronde 1 dec 2026, punt 14). */
.filter-more > summary {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--primary); font-size: 14px; font-weight: 700; list-style: none;
}
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary::after { content: "▾"; margin-left: 6px; font-size: 12px; }
.filter-more[open] > summary::after { content: "▴"; }
.filter-label { margin: 10px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.reader-head .book-title { display: flex; align-items: center; min-height: 44px; }
.shelf-menu .menu-tools .tool-btn {
  flex: none; width: 48px; min-height: 40px; padding: 0; text-align: center;
  border: 1px solid var(--border); border-radius: 10px; font-weight: 700;
}
.end-block > form { display: contents; }
/* Mijn account en Account verwijderen (5 dec 2026). */
.btn-danger { background: var(--accent); color: #fff; border: none; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.93); }
.auth h2.label { margin: 8px 0 0; }
.account-delete-link { margin-top: 12px; }
.auth .account-delete-link a { color: var(--text-muted); }
.account-delete-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
