:root {
  --bg: #fbf3f1;
  --surface: #ffffff;
  --ink: #3b2a2a;
  --soft: #7a6262;
  --primary: #c4566f;
  --primary-ink: #ffffff;
  --tint: #f6dfe2;
  --line: #ead6d6;
  --danger: #b3261e;
  --ok: #2e7d4f;
  --radius: 18px;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: 34px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }

p { margin: 0 0 1em; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px 120px;
}

/* ---------- knoppen ---------- */
button, .btn {
  font: inherit;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--line); }
.btn-tint { background: var(--tint); color: var(--ink); }
.btn-small { min-height: 48px; font-size: 18px; padding: 10px 16px; width: auto; }
.btn-danger { background: transparent; color: var(--danger); border: 2px solid currentColor; }
.btn + .btn, .btn-row + .btn { margin-top: 12px; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { margin-top: 0; }

.link-btn {
  background: none;
  color: var(--primary);
  font-weight: 700;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- kop en voortgang ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-bottom: 8px;
}
.back {
  background: none;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  padding: 10px 12px 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.progress { flex: 1; margin-left: 16px; }
.progress-label { font-size: 15px; color: var(--soft); text-align: right; margin-bottom: 4px; }
.progress-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s ease; }

.who-tag {
  display: inline-block;
  background: var(--tint);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.lead { font-size: 21px; color: var(--soft); }
.hint { font-size: 17px; color: var(--soft); }

/* ---------- welkom ---------- */
.cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 24px;
  display: block;
  margin: 8px 0 24px;
  background: var(--tint);
}
.cover-placeholder {
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 96px;
  color: var(--primary);
}

/* ---------- wensenlijstje ---------- */
.wish {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.wish-icon { font-size: 32px; line-height: 1; }
.wish strong { display: block; font-size: 19px; line-height: 1.3; }
.wish small { display: block; font-size: 15px; color: var(--soft); margin-top: 2px; }

/* ---------- kaarten en lijsten ---------- */
.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.name-list { display: grid; gap: 10px; margin: 16px 0; }
.name-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  text-align: left;
}
.name-btn.done { color: var(--soft); font-weight: 400; }
.name-btn .badge { font-size: 15px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.name-btn.selected { border-color: var(--primary); background: var(--tint); }

.section-label {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--soft);
  margin: 24px 0 8px;
}

/* ---------- formulieren ---------- */
label.field { display: block; margin-bottom: 22px; }
label.field > span, div.field > span { display: block; font-weight: 700; margin-bottom: 8px; }
input[type=text], input[type=email], input[type=date], input[type=search], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 21px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
.counter { font-size: 15px; color: var(--soft); text-align: right; margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  background: var(--tint);
  color: var(--ink);
  border-radius: 99px;
  padding: 10px 18px;
  font-size: 18px;
  font-weight: 700;
}

.choice-grid { display: grid; gap: 12px; margin: 20px 0; }
.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  color: var(--ink);
}
.choice .icon { font-size: 36px; line-height: 1; }
.choice strong { display: block; font-size: 22px; }
.choice small { display: block; color: var(--soft); font-size: 17px; }

/* ---------- foto ---------- */
.photo-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--tint);
  border: 2px dashed var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin: 12px 0 20px;
  color: var(--soft);
  text-align: center;
  padding: 0;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame .ph { font-size: 64px; }

.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- opnemen ---------- */
.rec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 20px;
}
.rec-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 0 0 var(--primary);
}
.rec-btn .dot { width: 34px; height: 34px; border-radius: 50%; background: currentColor; }
.rec-btn.recording { animation: pulse 1.4s ease infinite; }
.rec-btn.recording .dot { border-radius: 6px; width: 30px; height: 30px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent); }
  100% { box-shadow: 0 0 0 26px transparent; }
}
.rec-time { font-size: 28px; font-variant-numeric: tabular-nums; font-weight: 700; }
audio { width: 100%; }

.read-along {
  background: var(--tint);
  border-radius: 14px;
  padding: 16px;
  font-size: 19px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  margin-bottom: 8px;
}

/* ---------- controle ---------- */
.preview-page {
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  padding: 18px;
  margin: 16px 0 10px;
}
.preview-page img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; display: block; background: #eee; }
.preview-page .pp-nick { font-family: var(--font-head); font-size: 30px; margin: 14px 0 0; }
.preview-page .pp-name { font-size: 17px; color: #666; }
.preview-page .pp-msg { font-size: 17px; margin-top: 10px; white-space: pre-wrap; }
.preview-page .pp-audio { font-size: 15px; color: #666; margin-top: 10px; }
.edit-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 18px; }

/* ---------- meldingen ---------- */
.notice {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 18px;
}
.notice.error { background: #fbe9e7; color: var(--danger); }
.notice.info { background: var(--tint); }

.overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  display: grid;
  place-items: center;
  z-index: 50;
  text-align: center;
  padding: 24px;
}
.spinner {
  width: 54px;
  height: 54px;
  border: 6px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sticky-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.sticky-actions > div { max-width: 560px; margin: 0 auto; }

.big-check {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid;
  place-items: center;
  font-size: 54px;
  margin: 40px auto 24px;
}
.center { text-align: center; }

/* Altijd de lichte kleuren tonen: telefoons mogen de site niet automatisch donker maken */
:root { color-scheme: only light; }

/* Donkere modus van de telefoon (o.a. Samsung Internet): de site regelt dit zelf en blijft licht.
   Doordat deze regel bestaat, maakt de browser de pagina niet zelf donker. */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: only light; }
  html, body { background: var(--bg); color: var(--ink); }
}

.deadline-note { background: var(--tint); border-radius: 12px; padding: 10px 14px; margin: 14px 0; font-size: 16px; }
.sticky-hint { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 0 0 8px; text-align: center; font-size: 14px; font-weight: 700; color: var(--soft); }

.ask-box { margin-top: 22px; padding: 14px 16px; border: 2px dashed var(--line); border-radius: 14px; }
.ask-box p { margin: 0 0 10px; font-size: 15px; }
.ask-books { grid-template-columns: 1fr 1fr; }
.choice.on { border-color: var(--primary); background: var(--tint); }
.wait-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.wait-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); opacity: .3; animation: wd 1.2s infinite; }
.wait-dots span:nth-child(2) { animation-delay: .2s; } .wait-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes wd { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wait-dots span { animation: none; opacity: .6; } }
