/* Familiestamtafel v5, stijl "Fotoalbum" (Geert, 2026-12-02)
   IDEE    helder als een gewone iPhone-app; de foto's van de familie zijn het mooiste op het scherm
   KLEUR   licht: warm gebroken wit met witte kaarten; donker: bijna zwart met donkergrijze kaarten. Eén accent: diepgroen
   LETTER  Inter voor alles (namen, koppen, knoppen), Lora voor levensverhalen en anekdotes. Alles lokaal
   OPBOUW  telefoon: één scherm tegelijk met tabbalk; iPad liggend: boom in het midden, persoon of verhaal rechts
   THEMA   volgt de telefoon; bij Instellingen kies je licht of donker vast (html[data-thema]) */

@font-face { font-family: 'Inter'; src: url('fonts/inter-variabel.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('fonts/lora-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Lora'; src: url('fonts/lora-400-italic.woff2') format('woff2'); font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --kaart: #ffffff;
  --kaart2: #eeece6;
  --inkt: #1a1a18;
  --zacht: #6b6a65;
  --lijn: #e3e1da;
  --acc: #2e6a4f;
  --acc-zacht: #e2eee7;
  --op-acc: #ffffff;
  --fout: #b3261e;
  --schaduw: 0 1px 2px rgb(30 30 20 / .06), 0 4px 14px rgb(30 30 20 / .07);
  --balk: rgb(250 249 246 / .88);
  --tekst: 'Inter', -apple-system, system-ui, sans-serif;
  --verhaal: 'Lora', Georgia, serif;
  --rond: 16px;
}
/* Donker: volgt de telefoon, tenzij bij Instellingen licht is gekozen; of vast donker */
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="licht"]) {
    color-scheme: dark;
    --bg: #0f1110; --kaart: #1b1e1c; --kaart2: #262a27; --inkt: #f1f1ee; --zacht: #9da29d; --lijn: #2e3330;
    --acc: #74c69c; --acc-zacht: #1d3428; --op-acc: #0c1a12; --fout: #ff8a80;
    --schaduw: 0 1px 2px rgb(0 0 0 / .4); --balk: rgb(22 25 23 / .88);
  }
}
:root[data-thema="donker"] {
  color-scheme: dark;
  --bg: #0f1110; --kaart: #1b1e1c; --kaart2: #262a27; --inkt: #f1f1ee; --zacht: #9da29d; --lijn: #2e3330;
  --acc: #74c69c; --acc-zacht: #1d3428; --op-acc: #0c1a12; --fout: #ff8a80;
  --schaduw: 0 1px 2px rgb(0 0 0 / .4); --balk: rgb(22 25 23 / .88);
}
html.groot { font-size: 19px; }

* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; margin: 0; }
html { font-synthesis: none; -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--inkt); font: 400 1rem/1.5 var(--tekst); position: fixed; inset: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--tekst); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

/* App-schil */
.app { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.kop { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg); }
.merk { margin-right: auto; display: grid; overflow: hidden; }
.merk b { font-weight: 750; font-size: 1.65rem; letter-spacing: -0.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merk span { font-size: .85rem; color: var(--zacht); }
.rondknop { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--kaart); box-shadow: var(--schaduw); font-weight: 600; flex: none; }
.rondknop svg { width: 22px; height: 22px; }
.rondknop.aan { background: var(--acc); color: var(--op-acc); }
.hoofd { overflow-y: auto; overflow-x: clip; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scherm { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; align-content: start; max-width: 720px; margin: 0 auto; }

/* Tabbalk, zoals op de iPhone: iconen met een woord eronder, het actieve tabblad in het accent */
.tabbalk { position: relative; z-index: 5; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; background: var(--balk); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: .5px solid var(--lijn); padding: 4px 4px calc(env(safe-area-inset-bottom, 0px) + 2px); }
.tabbalk button { display: grid; justify-items: center; gap: 2px; font-size: .7rem; font-weight: 550; color: var(--zacht); padding: 6px 0; min-height: 52px; }
.tabbalk button svg { width: 25px; height: 25px; }
.tabbalk button.aan, .tabbalk button.aan svg { color: var(--acc); }
.tabbalk .vertelknop { margin-top: -20px; }
.tabbalk .vertelknop .bol { width: 56px; height: 56px; border-radius: 50%; background: var(--acc); color: var(--op-acc); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgb(20 60 40 / .55); }
.tabbalk .vertelknop.aan svg, .tabbalk .vertelknop svg { color: var(--op-acc); width: 26px; height: 26px; }

/* Typen en labels */
.label { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--zacht); }
.klein { font-size: .88rem; color: var(--zacht); }
.groot-kop { font-size: clamp(1.9rem, 8.5vw, 2.4rem); letter-spacing: -0.03em; }
.sectiekop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.sectiekop h2 { font-size: 1.3rem; }
.sectiekop button { color: var(--acc); font-weight: 600; font-size: .95rem; min-height: 44px; }

/* Knoppen */
.knop { min-height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--kaart); box-shadow: var(--schaduw); text-align: center; }
.knop svg { width: 20px; height: 20px; flex: none; }
.knop.vol, .knop.roest { background: var(--acc); color: var(--op-acc); }
.knop.breed { width: 100%; }
.vel .knop:not(.vol):not(.roest), .kaartje .knop:not(.vol):not(.roest) { background: var(--kaart2); box-shadow: none; }
.knop:disabled { opacity: .5; }
.tekstknop { color: var(--acc); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; justify-self: start; }
.tekstknop svg { width: 20px; height: 20px; }
.knoppenrij { display: flex; flex-wrap: wrap; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px 0 5px; border-radius: 99px; background: var(--kaart); box-shadow: var(--schaduw); font-weight: 550; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }
.chip.tekst { padding: 0 14px; }
.chip.aan { background: var(--acc); color: var(--op-acc); }
.terug { display: inline-flex; align-items: center; gap: 2px; color: var(--acc); font-weight: 600; min-height: 44px; justify-self: start; }
.terug svg { width: 22px; height: 22px; }

/* Gesegmenteerde keuze (Over, Verhalen, ...; Boom of Lijst; licht of donker) */
.segment { display: flex; background: var(--kaart2); border-radius: 11px; padding: 3px; gap: 2px; }
.segment > * { flex: 1; text-align: center; font-weight: 600; font-size: .86rem; padding: 7px 4px; border-radius: 9px; color: var(--zacht); min-height: 36px; display: grid; place-items: center; white-space: nowrap; }
.segment .aan { background: var(--kaart); color: var(--inkt); box-shadow: var(--schaduw); }

/* Portret: een ronde foto, of de initialen op een rustige kleur */
.afdruk { display: block; position: relative; border-radius: 50%; overflow: hidden; background: var(--kaart2); }
.afdruk .beeld { aspect-ratio: 1; display: grid; place-items: center; }
.afdruk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.afdruk .initialen { font-weight: 650; font-size: 1.9em; color: var(--zacht); line-height: 1; letter-spacing: -0.02em; }
.afdruk.mini { width: 44px; flex: none; font-size: 9px; }

/* Boom: kaartjes met een ronde foto, rustige lijnen, partners met een lijn in het accent */
.boomscherm { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.boombalk { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.verversknop { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--kaart2); color: var(--zacht); }
.verversknop svg { width: 19px; height: 19px; }
.verversknop.bezig svg { animation: draai .8s linear infinite; }
@keyframes draai { to { transform: rotate(360deg); } }
.boomvlak { position: relative; overflow: hidden; touch-action: none; }
.boomvlak > svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
/* Zachte randen: wie aan de zijkant half wegvalt, ziet eruit als 'hier gaat de boom verder' */
.boomvlak > svg { -webkit-mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 28px), transparent), linear-gradient(to bottom, transparent 2px, #000 26px); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 28px), transparent), linear-gradient(to bottom, transparent 2px, #000 26px); mask-composite: intersect; }
.boomvlak text { fill: var(--inkt); font-family: var(--tekst); }
.boomvlak .naam { font-size: 14px; font-weight: 650; }
.boomvlak .naam.twee, .boompagina .naam.twee { font-size: 12.5px; }
.boomvlak .jaren { font-size: 12px; fill: var(--zacht); font-variant-numeric: tabular-nums; }
.boomvlak .tak { fill: none; stroke: var(--zacht); stroke-opacity: .5; stroke-width: 1.5; }
.boomvlak .huwelijk { stroke: var(--acc); stroke-opacity: 1; stroke-width: 2.5; stroke-linecap: round; }
/* Getrouwd: twee ringetjes op de lijn tussen het stel; uit elkaar: gestippeld; overleden: een kruisje op het kaartje */
.huwelijk.uit-elkaar { stroke: var(--zacht); stroke-opacity: .7; stroke-dasharray: 2 5; }
.ringen circle { fill: none; stroke: var(--acc); stroke-width: 2; }
.ringen .onder { fill: var(--bg); }
.boomvlak .kruisje { fill: var(--zacht); font-size: 21px; font-weight: 500; }
.boomvlak .knoop { cursor: pointer; transition: opacity .35s; }
.boomvlak .knoop.nogniet { opacity: .12; }
.boomvlak .knoop.toenoverleden { opacity: .45; }
.boomvlak .kader { fill: var(--kaart); filter: drop-shadow(0 3px 8px rgb(30 30 20 / .12)); }
.boomvlak .knoop.ik .kader { stroke: var(--acc); stroke-width: 2.5; }
.boomvlak .knoop.ik .naam { fill: var(--acc); }
.boomvlak .knoop.gekozen .kader { stroke: var(--acc); stroke-width: 3.5; }
.boomvlak .leeg { fill: var(--kaart2); }
.boomvlak .initialen { font-size: 19px; font-weight: 650; fill: var(--zacht); }
.boomvlak .leeftijd rect { fill: var(--acc); }
.boomvlak .leeftijd text { fill: var(--op-acc); font-weight: 700; font-size: 13px; }
.boomhulp { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.boomvlak .zwevend { position: absolute; left: 12px; right: 12px; top: 8px; }
.tijdschuif { background: var(--balk); border-top: .5px solid var(--lijn); padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 0; }
.tijdschuif .rij { display: flex; align-items: center; gap: 14px; }
.tijdschuif .jaar { flex: none; min-width: 3.2ch; font-weight: 750; font-size: 1.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tijdschuif .uitleg { margin: 0 0 2px; font-size: .82rem; color: var(--zacht); line-height: 1.3; }
.tijdschuif input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; width: 100%; height: 36px; background: transparent; touch-action: pan-x; }
.tijdschuif input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--kaart2); }
.tijdschuif input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--kaart2); }
.tijdschuif input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .3), 0 0 0 1px rgb(0 0 0 / .04); }
.tijdschuif input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }

/* Lijst en zoeken */
.zoekveld { display: flex; align-items: center; gap: 8px; background: var(--kaart2); border-radius: 11px; padding: 0 12px; min-height: 40px; color: var(--zacht); }
.zoekveld svg { width: 18px; height: 18px; flex: none; }
.zoekveld input { flex: 1; font: inherit; font-size: 16px; border: 0; background: transparent; color: var(--inkt); min-height: 40px; outline: none; }
.lijstgroep { display: grid; gap: 6px; margin-top: 14px; }
.lijstgroep:first-child { margin-top: 0; }
.lijstgroep .label { padding-left: 4px; }

/* Kaarten en groepen (zoals de lijsten in Instellingen van de iPhone) */
.vel { background: var(--kaart); border-radius: var(--rond); padding: 16px; display: grid; gap: 10px; box-shadow: var(--schaduw); }
.kaartje { background: var(--kaart); border-radius: var(--rond); padding: 14px 16px; display: grid; gap: 8px; box-shadow: var(--schaduw); }
.melding-vel { border-left: 4px solid var(--acc); }
.groep { background: var(--kaart); border-radius: var(--rond); box-shadow: var(--schaduw); overflow: hidden; display: grid; }
.groep > .regel, .groep > .segment, .groep > .schakelregel { border-top: .5px solid var(--lijn); }
.groep > :first-child { border-top: 0; }
.groep > .segment { margin: 0 14px 12px; border-top: 0; }
.regel { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 52px; text-align: left; width: 100%; }
.regel > span { display: grid; gap: 1px; }
.regelicoon + span { flex: 1; }
.regelicoon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--acc-zacht); color: var(--acc); place-items: center; }
.regelicoon svg { width: 20px; height: 20px; }
.regel b { font-weight: 600; }
.regel > svg { width: 18px; height: 18px; color: var(--zacht); flex: none; }
.persoonregel { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 16px; min-height: 60px; text-align: left; width: 100%; border-top: .5px solid var(--lijn); }
.persoonregel:first-child { border-top: 0; }
.persoonregel .afdruk { font-size: 8px; }
.persoonregel b { display: block; font-weight: 600; }
.persoonregel svg { width: 18px; height: 18px; color: var(--zacht); }

/* Persoon: grote foto bovenaan met de naam erover, daaronder tabbladen */
.persoon-held { position: relative; margin: -10px calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 0; height: min(58vw, 340px); background: var(--kaart2); overflow: hidden; display: grid; place-items: center; }
.persoon-held img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Zonder foto: de initialen in een rondje, zoals bij Contacten op de iPhone */
/* Zonder foto staat de naam onder de initialen in plaats van eroverheen, zodat een lange naam over twee regels past */
.persoon-held:not(.met-foto) { height: auto; padding: 58px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); gap: 18px; }
.persoon-held:not(.met-foto) .tekst { position: static; justify-self: stretch; }
.persoon-held .initialen { width: 104px; height: 104px; border-radius: 50%; background: var(--kaart); box-shadow: var(--schaduw); display: grid; place-items: center; font-size: 2.6rem; font-weight: 650; color: var(--zacht); letter-spacing: -0.03em; }
.persoon-held.met-foto::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgb(0 0 0 / .72)); }
.persoon-held .tekst { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); right: 16px; bottom: 16px; z-index: 1; display: grid; gap: 2px; }
.persoon-held.met-foto .tekst { color: #fff; }
.persoon-held h1 { font-size: clamp(1.8rem, 8vw, 2.3rem); letter-spacing: -0.03em; }
.persoon-held .onder { font-size: .95rem; opacity: .9; }
.persoon-held .terug-boom { position: absolute; top: 10px; left: max(12px, env(safe-area-inset-left, 0px)); z-index: 2; width: 38px; height: 38px; border-radius: 50%; background: rgb(0 0 0 / .35); color: #fff; justify-content: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.persoon-held .fotoknop { position: absolute; top: 10px; right: 12px; z-index: 2; min-height: 38px; padding: 0 12px; border-radius: 99px; background: rgb(0 0 0 / .35); color: #fff; font-weight: 600; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.persoon-held:not(.met-foto) .fotoknop, .persoon-held:not(.met-foto) .terug-boom { background: var(--kaart); color: var(--acc); box-shadow: var(--schaduw); }
.persoon-held .fotoknop svg { width: 18px; height: 18px; }
.verwant { font-size: 1rem; color: var(--zacht); }
.feitenkaart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; padding: 4px 16px; margin: 0; }
.feitenkaart dt { color: var(--zacht); padding: 12px 16px 12px 0; }
.feitenkaart dd { margin: 0; padding: 12px 0; text-align: right; }
.feitenkaart dt + dd ~ dt, .feitenkaart dt + dd ~ dt + dd { border-top: .5px solid var(--lijn); }
.levensverhaal { font-family: var(--verhaal); font-size: 1.1rem; line-height: 1.65; white-space: pre-line; }
.door { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--zacht); }

/* Anekdotes als kaarten met een groen label */
.briefjes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.briefje { background: var(--kaart); border-radius: var(--rond); padding: 14px 16px 8px; box-shadow: var(--schaduw); display: grid; gap: 8px; }
.briefje q { font-family: var(--verhaal); font-size: 1.08rem; line-height: 1.5; display: block; quotes: none; white-space: pre-line; }
.briefje-kop { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; text-align: left; min-height: 40px; }
.briefje-kop .afdruk.mini { width: 32px; font-size: 6px; }
.briefje-kop .wie { display: grid; min-width: 0; }
.briefje-kop b { font-weight: 650; font-size: 1rem; overflow-wrap: anywhere; }
.briefje-kop .wie span { font-size: .8rem; color: var(--zacht); overflow-wrap: anywhere; }
.briefje-kop .jaar { align-self: flex-start; padding-top: 3px; }
/* Vertel: wie er nog meer bij waren, als vinkjes die netjes doorlopen op een volgende regel */
.metwie summary { font-weight: 600; cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vinkchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vinkchips label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 99px; background: var(--kaart2); font-size: .9rem; font-weight: 550; cursor: pointer; }
.vinkchips input { width: 18px; height: 18px; accent-color: var(--acc); margin: 0; }
.vinkchips label:has(input:checked) { background: var(--acc-zacht); }
.vertel-extra { display: grid; gap: 14px; }
.briefje-kop .jaar { margin-left: auto; font-size: .8rem; color: var(--zacht); font-variant-numeric: tabular-nums; }
/* Uitleg bij de rollen: wie mag wat */
.uitleg-rollen summary { font-weight: 600; color: var(--acc); cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.rollen { display: grid; gap: 2px; margin: 4px 0 0; font-size: .85rem; }
.rollen dt { font-weight: 650; margin-top: 6px; }
.rollen dd { margin: 0; color: var(--zacht); }
.briefje .voet { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--zacht); }
.briefje .voet .knopjes { display: flex; gap: 4px; flex: none; }
.briefje .voet button { color: var(--zacht); min-height: 40px; min-width: 40px; display: grid; place-items: center; }
.briefje .voet svg { width: 16px; height: 16px; }

/* Foto's in een raster, zoals de Foto's-app */
.fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-radius: 12px; overflow: hidden; }
.fotos .afdruk { border-radius: 0; position: relative; font-size: 12px; }
.fotos .afdruk .beeld { aspect-ratio: 1; }
.fotos .afdruk span:not(.beeld) { position: absolute; left: 6px; bottom: 4px; font-size: .72rem; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }

/* Foto's bij een persoon: elke foto in zijn eigen verhouding, netjes in kolommen (staand en liggend door elkaar) */
.fotos.album { display: block; columns: 2 150px; column-gap: 6px; border-radius: 0; overflow: visible; }
.fotos.album .afdruk { display: block; width: 100%; break-inside: avoid; margin-bottom: 6px; border-radius: 12px; overflow: hidden; }
.fotos.album .afdruk .beeld { aspect-ratio: auto; display: block; }
.fotos.album .afdruk img { height: auto; }

/* Familierij */
.familierij { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px 10px; }
.familierij button { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: .84rem; line-height: 1.2; }
.familierij .afdruk { width: 64px; font-size: 11px; }
.familierij b { font-weight: 600; font-size: .95rem; }
.familierij span { color: var(--zacht); font-size: .78rem; }

/* Formulieren */
.veld { display: grid; gap: 6px; }
.veld > label, .veld > .label-tekst { font-weight: 600; font-size: .92rem; }
.veld input, .veld select, .veld textarea { font: inherit; font-size: max(16px, 1.05rem); min-height: 50px; border-radius: 12px; border: 1px solid var(--lijn); background: var(--kaart); color: var(--inkt); padding: 0 14px; width: 100%; }
.veld select { -webkit-appearance: none; appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a85' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
/* Datum: dag, maand en jaar op één rij, even hoog en netjes uitgelijnd */
.datumkiezer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.datumkiezer select, .datumkiezer input { padding-left: 10px; }
.datumkiezer select { padding-right: 26px; background-position: right 6px center; }
.veld textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.veld textarea.hand { font-family: var(--verhaal); font-size: max(16px, 1.1rem); }
.veld input:focus, .veld select:focus, .veld textarea:focus { outline: 2px solid var(--acc); outline-offset: 0; border-color: transparent; }
.naast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.keuzes { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.keuzes button { min-height: 48px; border-radius: 12px; border: 1px solid var(--lijn); background: var(--kaart); font-weight: 600; }
.keuzes button.aan { border: 2px solid var(--acc); color: var(--acc); background: var(--acc-zacht); }
.vinkje { display: flex; gap: 10px; align-items: center; font-weight: 550; min-height: 44px; }
.vinkje input { width: 24px; height: 24px; accent-color: var(--acc); }
.tegels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tegel { background: var(--kaart); border-radius: var(--rond); box-shadow: var(--schaduw); padding: 18px 12px; display: grid; justify-items: center; gap: 6px; text-align: center; min-height: 120px; align-content: center; }
.tegel b { font-weight: 650; font-size: 1.15rem; }
.tegel span { font-size: .82rem; color: var(--zacht); line-height: 1.25; }
.praattip { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.praattip svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--acc); color: var(--op-acc); }

/* Tijdlijn */
.tijdlijn { position: relative; display: grid; }
.tijdlijn::before { content: ''; position: absolute; left: 66px; top: 10px; bottom: 10px; width: 2px; background: var(--lijn); }
.moment { display: grid; grid-template-columns: 54px 24px minmax(0, 1fr); gap: 0 8px; padding: 10px 0; align-items: start; }
.moment .jr { font-weight: 750; font-size: 1rem; text-align: right; padding-top: 1px; font-variant-numeric: tabular-nums; }
.moment .stip { width: 12px; height: 12px; border-radius: 50%; background: var(--acc); margin: 6px 0 0 6px; position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.moment.wereld .stip { background: var(--bg); border: 2px solid var(--zacht); }
.moment .inhoud { display: grid; gap: 6px; }
.moment .inhoud b { font-weight: 600; }
.moment.wereld .inhoud b { color: var(--zacht); font-weight: 550; }
.leeftijden { display: flex; flex-wrap: wrap; gap: 6px; }
/* Alleen het pilletje zelf: de rondjes erin zijn ook spans */
.leeftijden > span { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 550; background: var(--kaart); box-shadow: var(--schaduw); border-radius: 99px; padding: 2px 10px 2px 2px; }
.leeftijden .afdruk.mini { width: 24px; font-size: 5px; }

/* Aan tafel */
.lid { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: .5px solid var(--lijn); }
.lid:last-child { border-bottom: 0; }
.lid b { display: block; font-weight: 600; }
.lid .acties { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.lid .acties button { color: var(--acc); font-weight: 600; font-size: .85rem; min-height: 40px; padding: 0 6px; }
.lid .acties select { font: inherit; font-size: 16px; min-height: 40px; max-width: 9.5rem; border: 1px solid var(--lijn); border-radius: 10px; background: var(--kaart); color: var(--inkt); padding: 0 6px; }
.lid.met-acties .acties { grid-column: 2 / -1; justify-content: flex-start; }
.wijziging { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .92rem; padding: 6px 0; border-bottom: .5px solid var(--lijn); }
.wijziging:last-child { border-bottom: 0; }
.wijziging button { color: var(--acc); font-weight: 600; min-height: 44px; }
.wijziging.teruggezet span { text-decoration: line-through; color: var(--zacht); }
.verlopen { color: var(--fout); font-weight: 600; }

/* Welkom en inloggen */
.welkomtegels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.welkomtegel { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; background: var(--kaart); border-radius: var(--rond); box-shadow: var(--schaduw); padding: 12px; min-height: 64px; }
.welkomtegel .regelicoon { grid-row: 1 / 3; display: grid; }
.welkomtegel b { font-weight: 650; font-size: .95rem; line-height: 1.2; }
.onderdeeltegels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.onderdeeltegel { display: grid; justify-items: center; gap: 6px; background: var(--kaart); border-radius: var(--rond); box-shadow: var(--schaduw); padding: 12px 4px 10px; }
.onderdeeltegel .regelicoon { display: grid; }
.onderdeeltegel b { font-weight: 600; font-size: .85rem; }
.welkomtegel .klein { font-size: .75rem; line-height: 1.25; }
.welkom { min-height: 100%; display: grid; place-content: center; gap: 20px; padding: 32px max(20px, env(safe-area-inset-right, 0px)) 40px max(20px, env(safe-area-inset-left, 0px)); max-width: 520px; margin: 0 auto; text-align: center; }
.welkom h1 { font-size: clamp(2.4rem, 12vw, 3.4rem); letter-spacing: -0.035em; }
.welkom h1.woordmerk { font-size: clamp(2rem, 10vw, 3rem); line-height: 1.05; }
.welkom .stapel { display: flex; justify-content: center; }
.welkom .stapel .afdruk { width: 72px; font-size: 13px; box-shadow: 0 0 0 4px var(--bg); }
.welkom .stapel .afdruk + .afdruk { margin-left: -16px; }
.welkom .stapel .afdruk:nth-child(1) { background: var(--acc-zacht); }
.welkom .stapel .afdruk:nth-child(2) { z-index: 1; width: 84px; margin-top: -6px; }
.welkom .inloglink { text-align: left; }
.welkom a, .scherm a { color: var(--acc); }
body > .welkom { height: 100%; overflow-y: auto; align-content: safe center; }

/* Pincode: slot over alles heen, met een eigen cijferblok */
.slotlaag { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; }
.pinscherm { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 18px; padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 20px); text-align: center; }
.pinkop { display: grid; gap: 6px; max-width: 320px; }
.pinkop h1 { font-size: 1.5rem; }
.pinbolletjes { display: flex; gap: 16px; padding: 6px 0; }
.pinbolletjes span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--inkt); transition: background .12s; }
.pinbolletjes span.vol { background: var(--inkt); }
.pinbolletjes.schud { animation: schud .4s; }
@keyframes schud { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinfout { color: var(--fout); font-size: .9rem; min-height: 1.4em; max-width: 300px; }
.cijferblok { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; }
.cijferblok button { width: 76px; height: 76px; border-radius: 50%; background: var(--kaart2); font-size: 1.9rem; font-weight: 450; display: grid; place-items: center; transition: background .1s; }
.cijferblok button:active { background: var(--lijn); }
.cijferblok button.tekst, .cijferblok button[data-toets="wis"] { background: transparent; font-size: .95rem; font-weight: 600; color: var(--acc); }
.cijferblok button svg { width: 28px; height: 28px; color: var(--inkt); }
.pinscherm .tekstknop { justify-self: center; }
@media (max-height: 640px) { .cijferblok { grid-template-columns: repeat(3, 64px); gap: 10px 20px; } .cijferblok button { width: 64px; height: 64px; font-size: 1.6rem; } }

/* Groot bekijken van een foto */
.laag { position: fixed; inset: 0; background: rgb(0 0 0 / .94); z-index: 20; display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 56px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.laag img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.laag .onder { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); color: #eee; text-align: center; display: grid; gap: 8px; justify-items: center; }
.laag .sluit { position: absolute; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 10px); color: #fff; background: rgb(255 255 255 / .14); box-shadow: none; }
.laag .onder .knoppenrij { justify-content: center; }
.laag .onder .knop { background: rgb(255 255 255 / .14); color: #fff; box-shadow: none; min-height: 44px; }

/* Melding onderin */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); transform: translateX(-50%); background: var(--inkt); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: .92rem; max-width: calc(100% - 32px); text-align: center; z-index: 60; }
.laden { padding: 40px 16px; text-align: center; color: var(--zacht); }

/* iPad en groter: boom in het midden, paneel rechts */
.paneel { display: none; }
@media (min-width: 900px) {
  .app { grid-template-columns: 92px minmax(0, 1fr) minmax(380px, 460px); grid-template-rows: auto minmax(0, 1fr); }
  .kop { grid-column: 1 / -1; }
  .tabbalk { grid-row: 2; grid-column: 1; grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; border-top: 0; border-right: .5px solid var(--lijn); gap: 6px; padding-top: 14px; }
  .tabbalk .vertelknop { margin: 0 0 6px; order: -1; }
  .hoofd { grid-row: 2; grid-column: 2; }
  .paneel { display: block; grid-row: 2; grid-column: 3; overflow-y: auto; border-left: .5px solid var(--lijn); background: var(--bg); }
  .paneel .persoon-held .terug-boom { display: none; }
}

/* Welkom en boekje (jaren-typ) */
.jaren-typ { font-weight: 600; color: var(--zacht); margin-top: 4px; font-variant-numeric: tabular-nums; }
.speelkaart { text-align: left; gap: 4px; }
.speelkaart b { font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1.15; }
.speelkaart .label { color: var(--acc); }


/* Familieboekje: op het scherm als vellen papier, bij printen één vel per bladzijde (A5). Altijd licht, want het wordt geprint. */
.boekje { display: grid; gap: 22px; padding-bottom: 40px; }
.boekpagina { --inkt: #1a1a18; --zacht: #6b6a65; --kaart2: #eeece6; color: #1a1a18; background: #fff; width: min(100% - 32px, 560px); margin: 0 auto; aspect-ratio: 148 / 210; padding: 9% 8%; box-shadow: 0 14px 30px -18px rgb(0 0 0 / .5); display: grid; gap: 14px; align-content: start; overflow: hidden; }
.boekpagina h2 { font-size: 1.7rem; }
.omslag { align-content: center; justify-items: center; text-align: center; background: #f5f4f0; }
.omslag h1 { font-size: clamp(2.2rem, 10vw, 3.2rem); letter-spacing: -0.035em; }
.omslag .stapel { display: flex; justify-content: center; margin-bottom: 10px; }
.omslag .stapel .afdruk { width: 28%; max-width: 120px; font-size: 14px; box-shadow: 0 0 0 4px #f5f4f0; }
.omslag .stapel .afdruk + .afdruk { margin-left: -6%; }
.boompagina svg { width: 100%; height: auto; }
.boompagina .tak { fill: none; stroke: #6b6a65; stroke-opacity: .5; stroke-width: 1.5; }
.boompagina .huwelijk { stroke: #2e6a4f; stroke-width: 2.5; stroke-linecap: round; }
.boompagina .huwelijk.uit-elkaar { stroke: #6b6a65; stroke-dasharray: 2 5; }
.boompagina .ringen circle { stroke: #2e6a4f; }
.boompagina .ringen .onder { fill: #fff; }
.boompagina .kruisje { fill: #6b6a65; font-size: 21px; }
.boompagina .kader { fill: #fff; stroke: #e3e1da; }
.boompagina .leeg { fill: #eeece6; }
.boompagina text { fill: #1a1a18; font-family: var(--tekst); }
.boompagina .naam { font-size: 14px; font-weight: 650; }
.boompagina .jaren { font-size: 12px; fill: #6b6a65; }
.boompagina .initialen { font-size: 19px; font-weight: 650; fill: #6b6a65; }
.persoonpagina:not(.vol) { aspect-ratio: auto; }
.boek-kop { display: grid; grid-template-columns: 30% minmax(0, 1fr); gap: 16px; align-items: center; }
.boek-kop .roep { color: #2e6a4f; font-weight: 600; }
.boek-portret { font-size: 20px; }
.boekpagina .levensverhaal { font-size: 1rem; line-height: 1.6; }
.boekpagina .briefjes { grid-template-columns: 1fr; gap: 12px; }
.boekpagina .briefje { background: #f5f4f0; box-shadow: none; }
.boekpagina .briefje q { font-size: 1rem; }
.boek-fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.boek-fotos .afdruk { border-radius: 8px; }
.boekpagina figure { margin: 0; }
.boekpagina figcaption { font-size: .7rem; color: #6b6a65; margin-top: 4px; }
.slot { align-content: center; text-align: center; aspect-ratio: auto; min-height: 200px; }
.app.boekmodus .paneel { display: none; }
@media (min-width: 900px) { .app.boekmodus .hoofd { grid-column: 2 / -1; } }

@media print {
  @page { size: A5; margin: 0; }
  html, body { position: static; height: auto; background: #fff; }
  .kop, .tabbalk, .paneel, .boekje-balk, .toast { display: none !important; }
  .app { display: block; height: auto; }
  .hoofd { overflow: visible; }
  .boekje { display: block; padding: 0; }
  .boekpagina { width: 148mm; height: 210mm; aspect-ratio: auto; margin: 0; box-shadow: none; page-break-after: always; break-after: page; padding: 14mm 13mm; }
  .persoonpagina { height: auto; min-height: 0; break-after: auto; page-break-after: auto; break-inside: avoid; padding-bottom: 6mm; }
  .persoonpagina.vol { break-before: page; page-break-before: always; }
  .slot { height: auto; break-after: auto; }
}

/* Losse pagina (privacy): gewoon scrollen */
body.los { position: static; height: auto; }
body.los .scherm { padding-top: 32px; padding-bottom: 48px; }
body.los h2 { font-size: 1.3rem; margin: 10px 0 0; }
body.los p, body.los li { line-height: 1.6; }
.vel select { font: inherit; }

/* Schakelaar, zoals op de iPhone */
.schakelregel { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.groep > .schakelregel { padding: 10px 16px; }
.schakelregel > span { display: grid; gap: 1px; }
.schakelregel input { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--kaart2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.schakelregel input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3, .7, .4, 1.3); }
.schakelregel input:checked { background: #34c759; }
.schakelregel input:checked::after { transform: translateX(20px); }
.schakelregel input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Afwerking: een nieuw scherm schuift rustig binnen, de kaarten één voor één, en alles wat je aantikt geeft mee */
@keyframes binnen { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.komt-binnen > * { animation: binnen .4s cubic-bezier(.2, .75, .25, 1) backwards; }
.komt-binnen > :nth-child(2) { animation-delay: .04s; }
.komt-binnen > :nth-child(3) { animation-delay: .08s; }
.komt-binnen > :nth-child(4) { animation-delay: .12s; }
.komt-binnen > :nth-child(5) { animation-delay: .16s; }
.komt-binnen > :nth-child(n+6) { animation-delay: .2s; }
.knop, .rondknop, .tekstknop, .speelkaart, .tabbalk button, .lid[data-ga], [data-ga].vel, .regel, .persoonregel, .chip { transition: transform .16s cubic-bezier(.3, .7, .4, 1.4), background-color .2s, color .2s; }
.knop:active, .rondknop:active, .speelkaart:active, .lid[data-ga]:active, [data-ga].vel:active, .chip:active { transform: scale(.96); transition-duration: .06s; }
.regel:active, .persoonregel:active { background: var(--kaart2); }
.tekstknop:active { opacity: .6; }
.tabbalk button:active svg, .tabbalk .vertelknop:active .bol { transform: scale(.88); }
.tabbalk button svg, .tabbalk .vertelknop .bol { transition: transform .18s cubic-bezier(.3, .7, .4, 1.5); }
@keyframes tik { 40% { transform: translateY(-3px) scale(1.12); } }
.tabbalk button.aan svg { animation: tik .35s ease-out; }
@keyframes opkomen { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } }
.toast { animation: opkomen .3s cubic-bezier(.2, .8, .3, 1.2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Rondleiding de eerste keer: schermafbeelding van de voorbeeldfamilie, korte tekst, stappen */
.rondleiding { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(20px, env(safe-area-inset-left, 0px)); }
.rondleiding-kop { display: flex; justify-content: space-between; align-items: center; }
.rondleiding-beeld { min-height: 0; position: relative; }
/* Absoluut in het vak, zodat de schermafbeelding meekrimpt op een lage telefoon en nooit over de tekst valt */
.rondleiding-beeld img { position: absolute; inset: 0; margin: auto; max-height: 100%; max-width: 100%; width: auto; height: auto; border-radius: 22px; box-shadow: var(--schaduw), 0 0 0 1px var(--lijn); }
.rondleiding-tekst { display: grid; gap: 6px; text-align: center; max-width: 440px; justify-self: center; }
.rondleiding-tekst h1 { font-size: 1.6rem; letter-spacing: -0.02em; }
.rondleiding-voet { display: grid; gap: 14px; max-width: 440px; width: 100%; justify-self: center; }
.puntjes { display: flex; justify-content: center; gap: 8px; }
.puntjes i { width: 8px; height: 8px; border-radius: 50%; background: var(--lijn); }
.puntjes i.aan { background: var(--acc); width: 22px; border-radius: 4px; }
/* Nieuw na een update */
.nieuwslaag { background: rgb(0 0 0 / .45); }
.nieuwsvel { max-width: 440px; width: 100%; max-height: 100%; overflow-y: auto; gap: 10px; }
.nieuwslijst { display: grid; gap: 8px; padding-left: 20px; margin: 0; }

/* Eerste stappen om af te vinken op Welkom */
.welkomkaart { gap: 6px; }
.stappen, .beginpad, .uitlegstappen { list-style: none; margin: 0; padding: 0; display: grid; }
.stappen li { border-top: .5px solid var(--lijn); }
.stappen li:first-child { border-top: 0; }
.stappen li > button, .stappen li.klaar { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px 0; min-height: 52px; }
.stappen li > button > span:nth-child(2) { display: grid; gap: 1px; }
.stappen li > button svg { width: 18px; height: 18px; color: var(--zacht); }
.stappen li.klaar { color: var(--zacht); text-decoration: line-through; text-decoration-color: var(--lijn); }
.vinkbol { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--zacht); display: grid; place-items: center; }
.klaar .vinkbol { background: var(--acc); border-color: var(--acc); color: var(--op-acc); }
.vinkbol svg { width: 15px; height: 15px; }
.beginpad { gap: 12px; text-align: left; }
.beginpad li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.beginpad li > span:last-child { display: grid; }
.beginpad b { font-weight: 650; font-size: 1.1rem; }
.vel-kop { font-size: 1.2rem; }
.uitlegstappen { counter-reset: stap; gap: 10px; }
.uitlegstappen li { counter-increment: stap; display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.uitlegstappen li::before { content: counter(stap); font-weight: 750; color: var(--acc); }
