/* Eén vaste accentkleur: Bos. Licht is de basis; donker staat eronder (waarden uit #118 en #120). */
:root {
  --bg: #F5F3EE;
  --card: #FFFFFF;
  --text: #1F2328;
  --muted: #5C6166;
  --soft: #8A8F94;
  --grey: #6B7075;
  --ring: #9A9EA3;
  --faint: #B3B6BA;
  --arrow: #3F4448;
  --placeholder: #A3A7AB;
  --chip-border: #E2DED6;
  --grip: #DDD8CF;
  --line: #EEEAE3;
  --border: #E4E0D8;
  --overlay: rgba(31, 35, 40, 0.35);
  --danger: #B3261E;
  --accent: #2E6B5E;
  --accent-line: #2E6B5E;
  --accent-tint: #E6F0EC;
  --fill: #2E6B5E;
  --on-fill: #FFFFFF;
  --fab-shadow: 0 6px 18px rgba(31, 77, 67, .28);
  --check-bg: #2E6B5E;
  --check-fg: #FFFFFF;
  --nav-bg: #FFFFFF;
  --nav-line: #E8E4DC;
  --warm: #F2A65A;
  --cold: #7FA7D9;
  --dc0: #2F9467; --dc1: #2F6FD0; --dc2: #C2672A; --dc3: #8A55C9;
  --dc4: #C9447A; --dc5: #1E9AAE; --dc6: #A88A1E; --dc7: #B5473A;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: calc(60px + max(8px, var(--safe-b)));
}

html[data-theme="dark"] {
  --bg: #141618;
  --card: #1E2124;
  --text: #E9EAEB;
  --muted: #A3A8AD;
  --soft: #7C8187;
  --grey: #8F959B;
  --ring: #6E747A;
  --faint: #4A4F55;
  --arrow: #C4C8CC;
  --placeholder: #6E747A;
  --chip-border: #33383D;
  --grip: #3A3F44;
  --line: #2A2E32;
  --border: #363A40;
  --overlay: rgba(0, 0, 0, 0.6);
  --danger: #F2817A;
  --accent: #8CC2B3;
  --accent-line: #3A7465;
  --accent-tint: #22352F;
  --fill: #2C5C51;
  --on-fill: #E6EFEC;
  --fab-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  --check-bg: #3A7465;
  --check-fg: #E6EFEC;
  --nav-bg: #1A1C1F;
  --nav-line: #2A2E32;
  /* Donker: dezelfde tint als in licht, 15% donkerder en 25% minder verzadigd, zodat geen domeinkleur harder opvalt dan de accentkleur. (#120) */
  --dc0: #337356; --dc1: #3962A0; --dc2: #955B34; --dc3: #754AA9;
  --dc4: #A24369; --dc5: #297885; --dc6: #806D28; --dc7: #8D473E;
}

/* Dag en nacht op de tab Nestar (#224, varianten B en C): een tint in de schemering, en bij C een nachtblauwe lucht. */
html[data-dagdeel="ochtend"] { --bg: #F7EADB; --nav-bg: #FCF4EA; --nav-line: #EEDDC8; --line: #EEDDC8; }
html[data-dagdeel="avond"] { --bg: #1F1A27; --card: #282231; --nav-bg: #221D2A; --nav-line: #322B3C; --line: #322B3C; --border: #3A3346; }
html[data-dagdeel="nacht"] { --bg: #0E1422; --card: #172033; --nav-bg: #111829; --nav-line: #1F2A40; --line: #1F2A40; --border: #27324A; }

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Figtree, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
/* Geen dubbeltik-zoom en geen vertraging bij tikken (#129) */
html, body, button, a, label, select, summary, [role="tab"], [role="button"] { touch-action: manipulation; }
[hidden] { display: none !important; }

/* Indeling: mobiel eerst */
.app {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.main {
  flex: 1;
  min-height: 0;
  order: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  padding: 0 16px 96px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.main-content {
  min-height: calc(100% + 1px);
  display: flex;
  flex-direction: column;
}
.buddy { display: none; }

.nav {
  flex: 0 0 auto;
  order: 2;
  z-index: 5;
  display: flex; background: var(--nav-bg); border-top: 1px solid var(--nav-line);
  height: var(--nav-h); padding: 0 8px max(8px, var(--safe-b));
}
.nav-i {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 0; min-height: 44px; border: none; background: none;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
  position: relative;
}
.nav-i.on { color: var(--accent); }
html[data-theme="dark"] .nav-i { color: var(--grey); }
html[data-theme="dark"] .nav-i.on { color: var(--accent); }
.nav-i { min-width: 0; padding-left: 2px; padding-right: 2px; }
.nav-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Week | Maand (#300), onder de kop van Planning. */
.seg { display: flex; gap: 2px; padding: 3px; margin: 0 0 16px; border-radius: 12px; background: var(--line); }
.seg-i {
  flex: 1; height: 34px; border: none; border-radius: 9px; background: none; font: inherit; font-size: 15px; font-weight: 600;
  color: var(--grey); cursor: pointer;
}
.seg-i.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.main .set-card { background: var(--card); }
.main .stack > .version-note { padding-top: 4px; }
.nav-i .badge {
  position: absolute; top: 4px; right: calc(50% - 18px); background: var(--warm); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.nav-brand { display: none; }

.fab {
  position: fixed; right: 20px; bottom: calc(var(--nav-h) + 18px); z-index: 6;
  height: 56px; padding: 0 22px; border: none; border-radius: 28px;
  background: var(--fill); color: var(--on-fill); font-size: 17px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  box-shadow: var(--fab-shadow);
  transition: opacity .15s ease;
}
/* Onder een onderscherm of de uitleg over meldingen is "+ Taak" verborgen, zodat niemand erop tikt om iets op te slaan. (#92) */
body.sheet-open .fab, body:has(#meldBg) .fab { opacity: 0; pointer-events: none; }

/* Touch dragging feedback op telefoon */
.drag-avatar {
  position: fixed; z-index: 1000; pointer-events: none;
  background: var(--fill); color: var(--on-fill); padding: 12px 18px;
  border-radius: 14px; font-size: 16px; font-weight: 600;
  width: max-content; max-width: min(320px, calc(100vw - 16px));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3); transform: translate(-50%, -50%) scale(1.04);
  opacity: 0.95;
}

/* Computer: diertje hoort bij de indeling, niet als los venster */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 300px;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .nav {
    order: initial;
    position: relative;
    height: 100%;
    flex-direction: column;
    gap: 4px;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 28px 12px;
    overflow-y: auto;
  }
  .nav-brand { display: block; font-size: 20px; font-weight: 700; padding: 0 12px 20px; color: var(--accent); }
  .nav-i { flex: none; flex-direction: row; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
  .nav-i.on { background: var(--accent-tint); }
  .nav-i.only-mobile { display: none; }
  /* Voorstel (#300): op de computer staat Instellingen onderaan in de zijbalk. Weghalen = Instellingen staat gewoon onder de andere. */
  .nav-i.nav-onder { margin-top: auto; }
  .main {
    order: initial;
    height: 100%;
    padding: 0 32px 120px;
    max-width: 760px;
    width: 100%;
  }
  .buddy-head { display: flex; justify-content: flex-end; gap: 4px; margin: -16px -8px -8px 0; }
  .buddy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    height: 100%;
    border-left: 1px solid var(--border);
    background: var(--bg);
    padding: 32px 20px;
    overflow-y: auto;
  }
  .fab { bottom: 32px; right: 332px; }
  /* Computer (Melroy 18-11): de tab Nestar toont de wereld, zonder zijpaneel; de wereld is 448 px breed, in het midden. */
  body.op-nestar .app { grid-template-columns: 210px minmax(0, 1fr); }
  body.op-nestar .buddy { display: none; }
  .main.in-wereld { max-width: none; }
  .main.in-wereld .wereld { width: 100%; max-width: 448px; margin: 0 auto; align-self: center; box-sizing: border-box; }
  /* Het zijpaneel toont het diertje in zijn wereld: het midden van de wereld, onderaan vast. */
  .buddy .wereld { height: 560px; min-height: 0; margin: 0 -20px; flex: none; }
  .buddy .pet-name { text-align: center; }
}

/* Kop (#118): 56 px boven, 24 links, 16 rechts, 12 onder. Kleine regel, daaronder een rij van 44 px met titel en pijlen. */
.head { padding: calc(12px + var(--safe-t)) 0 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.kicker { font-size: 14px; font-weight: 500; line-height: 18px; color: var(--grey); min-height: 18px; }
.head-back {
  border: none; background: none; padding: 0; margin: 0; min-height: 18px;
  font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center;
}
.head-row { display: flex; align-items: center; gap: 12px; height: 44px; }
h1 { flex: 1; min-width: 0; margin: 0; font-size: clamp(24px, 7.7vw, 30px); font-weight: 700; line-height: 1; white-space: nowrap; }
.head-title {
  display: flex; align-items: center; max-width: 100%; height: 44px; padding: 0; margin: 0; border: none; background: none;
  font: inherit; color: inherit; text-align: left; cursor: default;
}
.head-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.head-title.away { color: var(--accent); cursor: pointer; }
.head-dot { width: 14px; height: 14px; border-radius: 50%; margin-right: 12px; flex-shrink: 0; }
.title-back { display: inline-flex; margin-left: 6px; flex-shrink: 0; }
.head-nav { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.head-nav-btn {
  width: 44px; height: 44px; border: none; background: none; color: var(--arrow);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.head-nav-btn:active { opacity: .5; }

/* Groepen en taken */
.stack { display: flex; flex-direction: column; gap: 20px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.card { background: var(--card); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.task {
  position: relative;
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 14px 18px 14px 16px; border-top: 1px solid var(--line);
  cursor: pointer;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.stack-dag .task { min-height: 60px; }
.task:first-child { border-top: none; }
.task.highlight {
  animation: task-highlight 1s ease-out;
}
@keyframes task-highlight {
  0% { background-color: var(--accent-tint); }
  100% { background-color: transparent; }
}
/* Rondje 26 px. Het tikvlak is de linker helft van de regel, over de volle hoogte (#158): de knop zelf is 44 × 44 px met negatieve marges
   (#117), en ::after rekt het vlak uit tot de helft van .task. De rechter helft is .task-open. Niets verspringt. */
.chk-hit {
  flex: none; width: 44px; height: 44px; margin: -9px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
}
/* z-index 1: de herhaling onder de titel ("↻ Elke dag") is zacht gemaakt met opacity, en daardoor tekende de browser
   hem boven dit tikvlak. Een tik op "Elke dag" opende dan het taakscherm in plaats van af te vinken (Alicia, 23-11). */
.chk-hit::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 50%; z-index: 1; }
.chk {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ring); background: var(--card);
  color: var(--check-fg);
  display: flex; align-items: center; justify-content: center;
}
.chk.on { background: var(--check-bg); border-color: var(--check-bg); }
/* Afvink-moment (#244): de animatie staat in afvinken.js. Hier alleen de vormen: de ring die uitgolft,
   het grote rondje van "Alles gedaan voor vandaag", de druppel en het stof. */
.chk { position: relative; }
.chk-golf { position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--check-bg); pointer-events: none; }
.chk.groot { width: 34px; height: 34px; flex: none; }
.chk.groot svg { width: 20px; height: 20px; }
.stack-dag { position: relative; }
.card.dag-af { pointer-events: none; }
.dag-alles .task-title { color: var(--text); }
.dag-druppel { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; }
.dag-stof { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 40; }
.task-open {
  flex: 1; min-width: 0; padding: 0; margin: 0; border: none; background: none; font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
/* Een lange taak loopt door op de volgende regel, zoals in Herinneringen: je leest altijd de hele taak (Melroy 19-11).
   Afkappen met "..." werkte niet op de iPhone (Safari kort tekst in een knop niet af; de tekst liep over de rand). */
.task-title { font-size: 17px; line-height: 22px; font-weight: 500; color: var(--text); white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.task-sub { font-size: 13px; line-height: 17px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-sub { display: flex; align-items: baseline; max-width: 100%; }
.task-when, .task-sep { flex: none; white-space: pre; }
.task-rep { display: flex; align-items: baseline; gap: 3px; min-width: 0; opacity: .72; }
.task-rep-icoon { flex: none; align-self: center; position: relative; top: 0.5px; }
.task-rep-tekst { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .task-title, .task.done .task-sub { color: var(--ring); }
.task.done .task-rep { opacity: 1; }
.empty { padding: 16px; color: var(--muted); font-size: 15px; }
.section-h { margin: 0; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--grey); }

/* Recent verwijderd */
.deleted-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--line); font-size: 15px;
}
.deleted-item:first-child { border-top: none; }
.deleted-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.deleted-type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.deleted-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }

/* Week & Maand */
.day-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 8px; }
.day-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.day-h h2 .now { color: var(--accent); }
.day-h > span { font-size: 14px; color: var(--grey); }
.drop.over { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Lege dagen in de week: één tekstregel zonder kaart */
.compact-day { padding: 0 8px; font-size: 15px; line-height: 22px; color: var(--grey); }
.compact-day.today { color: var(--accent); font-weight: 600; }
.compact-day[data-act] { cursor: pointer; }

/* Voorbije dagen zonder open taak: één dunne, grijze regel, niet tikbaar */
.past-day { padding: 0 8px; font-size: 15px; line-height: 22px; color: var(--grey); pointer-events: none; }
/* Voorbije dag met afgevinkte taken (23-11, A2): even hoog in beeld als .past-day (22 px), maar 44 px om op te tikken
   (negatieve marge). Het pijltje heeft een vaste breedte: › en ⌄ zijn niet even breed, zo verspringt niets. */
.past-done { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; margin: -11px 0; padding: 0 8px; border: none; background: none; color: var(--grey); font: inherit; font-size: 15px; line-height: 22px; cursor: pointer; text-align: left; }
.past-done.open { margin-bottom: 0; }
.past-done-n { display: flex; align-items: center; gap: 6px; }
.past-done .pijl { display: inline-block; width: 12px; text-align: center; color: var(--ring); }

/* Tijdens slepen klappen lege dagen open tot losse, brede regels (minstens 48 px) */
.day-rows { display: none; flex-direction: column; gap: 8px; }
body.is-dragging .compact-group > .compact-day { display: none; }
body.is-dragging .compact-group > .day-rows { display: flex; }
.day-row {
  box-sizing: border-box; min-height: 48px; width: 100%;
  display: flex; align-items: center; padding: 0 16px;
  background: var(--card); border: 2px solid transparent; border-radius: 12px;
  font-size: 15px; font-weight: 600; color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.day-row.today { color: var(--accent); }
.day-row.drop.over { outline: none; background: var(--accent-tint); border-color: var(--accent); }

/* Maand */
.month { background: var(--card); border-radius: 18px; padding: 12px; }
.m-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; }
.m-wd { text-align: center; font-size: 13px; font-weight: 600; color: var(--grey); padding: 4px 0; }
.m-day {
  height: 44px; border: none; background: none; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 15px; color: var(--text); padding: 0;
}
.m-day.past { color: var(--soft); }
.m-day.out { color: var(--faint); }
.m-day.today { background: var(--accent-tint); font-weight: 700; color: var(--accent); }
.m-day.sel { box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.m-day.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
/* Tijdens slepen blijft de kalender bovenaan in beeld */
body.is-dragging .month { position: sticky; top: 0; z-index: 3; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.m-dots { display: flex; height: 5px; }
.m-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; background: var(--ring); }
.m-day.today .m-dots i { background: var(--accent); }

/* Domeinen */
.dom-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 18px 0 16px; border: none; background: none; border-top: 1px solid var(--line); width: 100%; text-align: left; font: inherit; cursor: pointer; color: var(--text); }
.dom-row:first-child { border-top: none; }
.dom-row .dot { width: 12px; height: 12px; }
.dom-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dom-row .n { color: var(--grey); font-size: 15px; }
.dom-row .chev { color: var(--ring); font-size: 20px; line-height: 1; }
.add-dom { align-self: flex-start; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; border: none; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--arrow); cursor: pointer; }
.del-dom { align-self: center; margin-top: 8px; font-size: 14px; color: var(--danger); }
.note { width: 100%; min-height: 90px; border: none; border-radius: 18px; padding: 14px 16px; font: inherit; font-size: 16px; color: var(--text); background: var(--card); resize: vertical; }
.note::placeholder { color: var(--placeholder); }
.note:focus, .field:focus { outline: 2px solid var(--accent); }

/* Diertje */
.pet { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 4px; }
.pet-stage { position: relative; display: block; line-height: 0; }
/* Pixelscherp: de tekenmachine kiest een hele factor, de browser schaalt niet zelf. */
.pet-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pet-sub { font-size: 15px; color: var(--muted); }
.pet-name { font-size: 22px; font-weight: 700; }
/* Ritme (#149, ontwerp 27-10): vol = verzorgd, licht (33 %) = rustdag, lege rand = gemist, vol met ✦ = hersteld. */
.rhythm { display: flex; gap: 8px; justify-content: center; border: none; background: none; padding: 4px 0; margin: 0 auto; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.r-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.r-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; line-height: 1; }
.r-dot.on { background: var(--warm); border-color: var(--warm); }
.r-dot.rust { background: color-mix(in srgb, var(--warm) 33%, var(--card)); border-color: transparent; }
.r-dot.now { border-color: var(--accent); }
.r-dot.fut { opacity: .45; }
.r-dot.voor { visibility: hidden; }
.r-dot.kan { border: 2px dashed var(--warm); }
.r-herstel { display: block; margin: 0 auto; height: 32px; padding: 0 14px; border-radius: 16px; border: 1.5px solid var(--chip-border);
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sheet .rg-regel { margin: 2px 0; line-height: 1.4; text-align: center; font-size: 15px; color: var(--muted); }
.rg-blok { margin: 0 auto 8px; width: 100%; max-width: 320px; }
.rg-rij { display: grid; grid-template-columns: repeat(7, 1fr); justify-items: center; gap: 6px; margin-bottom: 8px; }
.rg-kop span { font-size: 12px; font-weight: 600; color: var(--muted); }
/* Ritme per maand (Melroy 25-11): één maand als kalender, de vorige maanden als balkje. */
.rg-maand-kop { margin: 14px 0 0; text-align: center; font-size: 17px; font-weight: 700; }
.sheet .rg-telling { margin: 2px 0 10px; text-align: center; font-size: 14px; color: var(--muted); }
.rg-maanden { margin: 16px auto 8px; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }
.rg-maandknop { display: block; width: 100%; min-height: 44px; padding: 8px 10px; border: none; border-radius: 10px; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rg-maandknop:active { background: var(--chip-bg, rgba(127,127,127,.12)); }
.rg-mk-tekst { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; }
.rg-mk-tal { font-weight: 400; color: var(--muted); font-size: 14px; }
.rg-balk { display: block; height: 8px; margin-top: 6px; border-radius: 4px; background: color-mix(in srgb, var(--warm) 18%, var(--card)); overflow: hidden; }
.rg-balk i { display: block; height: 100%; background: var(--warm); border-radius: 4px; }
.r-count { font-size: 15px; color: var(--muted); text-align: center; }
.name-form { display: flex; gap: 8px; width: 100%; max-width: 320px; }
.field { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; background: var(--card); color: var(--text); }
.btn { height: 48px; padding: 0 18px; border: none; border-radius: 12px; background: var(--fill); color: var(--on-fill); font-size: 16px; font-weight: 600; cursor: pointer; }
.btn.danger { background: var(--card); color: var(--danger); border: 1px solid var(--border); margin-right: auto; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.demo-note { font-size: 13px; color: var(--muted); text-align: center; padding: 24px 8px 0; }
.link { border: none; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }

/* Verrassingen rond het ei */
.fxp { position: absolute; left: 50%; top: 50%; font-style: normal; font-size: 16px; line-height: 1; color: var(--c); pointer-events: none; opacity: 0; animation: burst 1.5s ease-out var(--dl) both; }
.fxp.conf { width: 7px; height: 11px; border-radius: 2px; background: var(--c); animation-duration: 2.2s; }
.lv3 .fxp { animation-duration: 2.4s; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(200deg); opacity: 0; } }
.fx-hop, .fx-sparkle { animation: hop .7s ease; }
/* Ei en kuiken draaien om hun eigen midden, niet om het midden van het tekenvlak (dat ligt erboven; Melroy 19-11).
   Het ei staat in het vlak van 64 x 50 op rij 18 t/m 44: midden op 31 van 50 = 62 %. */
.pet-stage.fx { transform-origin: 50% 62%; }
.fx-wiggle { animation: wiggle2 1s ease; }
.fx-stars { animation: spin 1.1s ease; }
.fx-hearts { animation: hop .7s ease 2; }
.fx-confetti { animation: shake 1.2s ease 2; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-16px) scale(1.04); } 55% { transform: translateY(0) scale(1.06, .94); } 75% { transform: translateY(-5px); } }
@keyframes wiggle2 { 10% { transform: rotate(-9deg); } 30% { transform: rotate(9deg); } 50% { transform: rotate(-7deg); } 70% { transform: rotate(7deg); } 90% { transform: rotate(-3deg); } }
@keyframes spin { 60% { transform: rotate(360deg) scale(1.12); } 100% { transform: rotate(360deg); } }
@keyframes shake { 10% { transform: translateX(-6px) rotate(-6deg); } 30% { transform: translateX(6px) rotate(6deg); } 50% { transform: translateX(-5px) rotate(-5deg); } 70% { transform: translateX(5px) rotate(5deg); } 90% { transform: translateX(-2px); } }

/* Eigen herhaling */
.custom-rep { display: flex; align-items: center; gap: 8px; flex: 0 0 100%; height: 40px; margin: 0; font-size: 15px; }
.custom-rep[hidden] { display: none; }
.sheet .custom-rep select { flex: 0 0 120px; width: 120px; height: 40px; border-radius: 20px; border: 1px solid var(--border); padding: 0 12px; background: var(--card); color: var(--text); font-size: 16px; }

.counter {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  overflow: hidden;
  height: 40px;
}
.counter-btn {
  width: 36px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.counter-btn:active {
  background: var(--line);
}
.counter-val {
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* Taakscherm en dialoogvensters */
body.sheet-open { overflow: hidden !important; touch-action: none !important; }
body.sheet-open .main { overflow: hidden !important; }
.sheet-bg {
  position: fixed; inset: 0; background: var(--overlay); z-index: 20;
  overscroll-behavior: none;
  touch-action: none;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--card);
  display: flex; flex-direction: column; gap: 22px; max-width: 520px; margin: 0 auto;
  touch-action: pan-y; overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  /* Onderscherm (#119): begint 150 px van boven, hoeken 24, binnenruimte 10 / 20 / 32. */
  min-height: calc(100dvh - 150px);
  max-height: calc(100dvh - var(--safe-t) - 16px);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(32px + var(--safe-b));
}
.sheet.enter { animation: up .2s ease; }
/* Toetsenbord open: de kaart staat vast boven het toetsenbord en scrolt niet. De inhoud wordt compacter, zodat alles past. */
.sheet.kb-open { min-height: 0; border-radius: 24px; overflow: hidden; touch-action: none; gap: 12px; padding-bottom: 12px; }
.sheet.kb-open .task-form { gap: 12px; }
/* Tijd en herhalen blijven in beeld als ze passen (compacter); passen ze niet, dan gaat de klasse kb-tight ze weg. */
.sheet.kb-open .task-form > .row, .sheet.kb-tight .quiet-rows { display: none; }
.sheet.kb-open .quiet-row { min-height: 44px; }
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--grip); margin: 0 auto; flex-shrink: 0; }
@media (min-width: 900px) {
  .sheet {
    bottom: auto;
    top: 12vh;
    border-radius: 24px;
    min-height: 0;
    max-height: 80vh;
  }
}
@keyframes down { from { transform: translateY(-20px); opacity: 0; } }
@keyframes up { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sheet-head .sheet-title {
  margin: 0; font-size: 18px; font-weight: 700; text-align: center; flex: 1;
}
.sheet-btn-cancel {
  border: none; background: none; color: var(--accent); font: inherit; font-size: 16px;
  font-weight: 500; padding: 6px 0; cursor: pointer; min-width: 80px; text-align: left;
}
.sheet-btn-done {
  /* Vaste breedte voor beide standen, zodat de kop niet verschuift. (#106, #119) */
  flex-shrink: 0; width: 76px; height: 40px; padding: 0; border: none; border-radius: 20px; background: none;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.sheet-btn-done.has-title { background: var(--fill); color: var(--on-fill); }
.sheet-head:has(.sheet-btn-done) .sheet-title { text-align: left; font-size: 15px; font-weight: 600; color: var(--grey); }
.sheet-btn-action {
  border: none; background: var(--fill); color: var(--on-fill); font: inherit; font-size: 15px;
  font-weight: 600; padding: 8px 16px; border-radius: 20px; cursor: pointer;
  min-width: 80px; text-align: center;
}
.sheet-head-spacer { min-width: 80px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--chip-border); background: var(--card); font-size: 15px; cursor: pointer; color: var(--text); display: flex; align-items: center; gap: 8px; }
.chip.on { background: var(--accent-tint); border-color: var(--accent-line); }

/* Datumrij */
.date-row { display: flex; gap: 6px; width: 100%; }
.date-row .chip {
  flex: 1 1 0%; min-width: 0; justify-content: center; padding: 0 4px;
  font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.date-row .chip-cal {
  width: 100%; height: 100%; padding: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.chip-cal-wrap {
  position: relative; flex: 0 0 44px; display: flex;
}
.chip-time-wrap {
  position: relative; display: inline-flex;
}
.chip-time-wrap .chip {
  pointer-events: none;
}
.native-date-input,
.native-time-input {
  font-size: 16px;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  margin: 0;
  padding: 0;
}

/* Rustige regels in het taakscherm */
.quiet-rows {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: 0;
}
.quiet-rows > :not([hidden]) ~ :not([hidden]) {
  border-top: 1px solid var(--line);
}
.quiet-row {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  min-height: 52px; padding: 0 4px; background: none; border: none;
  font-family: inherit; font-size: 16px; color: var(--text); cursor: pointer; text-align: left;
}
.quiet-label { color: var(--text); font-weight: 500; }
.quiet-val { color: var(--grey); font-size: 15px; font-weight: 500; }
.time-note { padding: 0 4px 12px; }
.time-hint { font-size: 13px; line-height: 1.4; color: var(--grey); }
.sub-picker {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 12px;
}
/* Gekozen keuze in een lijstje: vinkje (plek is altijd vrij, zodat niets verschuift) */
.chip-choice::before { content: "✓"; display: inline-block; width: 14px; text-align: center; font-weight: 700; visibility: hidden; }
.chip-choice.on::before { visibility: visible; }
.meld-check { display: block; }
.meld-check[hidden] { display: none; }
.meld-lines p { margin: 0 0 6px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.meld-lines .btn { margin-top: 6px; }
.meld-hint { color: var(--muted); }
.sub-picker.enter { animation: down .15s ease; }

.sheet .field { flex: none; width: 100%; }
.task-form { display: flex; flex-direction: column; gap: 22px; }
.block { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 13px; font-weight: 600; color: var(--grey); }
.title-field {
  width: 100%; height: 44px; padding: 0 0 6px; border: none; border-bottom: 1.5px solid var(--line); border-radius: 0; outline: none;
  background: none; color: var(--text); font: inherit; font-size: 24px; font-weight: 600;
}
.title-field::placeholder { color: var(--placeholder); }
.row { display: flex; gap: 8px; justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .task.highlight {
    animation: none !important;
    background-color: var(--accent-tint);
    transition: none !important;
  }
}

.set-reset { padding-top: 12px; padding-bottom: 12px; }
.set-reset .set-label { color: var(--danger); }
.version-note { font-size: 13px; color: var(--grey); text-align: center; }
/* Instellingen: één kaart met regels (#120) */
.set-card { background: var(--bg); border-radius: 18px; overflow: hidden; }
/* In een onderscherm dat scrolt, krimpen kaarten en tekeningen niet (anders vallen rijen half weg of schuift het kistje over de rijen; gezien bij het kistje, #405). */
.sheet > .set-card, .sheet > .kist-scene, .sheet > .kraam-scene { flex-shrink: 0; }
.set-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 18px 0 16px;
  border: none; border-top: 1px solid var(--line); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.set-row:first-child { border-top: none; }
.set-label { flex: 1; font-size: 17px; font-weight: 500; }
.set-val { font-size: 15px; color: var(--grey); }
.set-row .chev { color: var(--ring); font-size: 20px; line-height: 1; }
.set-card .meld-check { padding: 0 16px 14px; }
.set-card .meld-check + .set-row { border-top: 1px solid var(--line); }

/* Teruggezet in Recent verwijderd */
.deleted-item { transition: opacity .3s ease; }
.deleted-item.leaving { opacity: 0; }
.restored-note { color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; }
.restored-extra { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 400; white-space: normal; text-align: right; }

/* Keuzeknoppen: alleen tint en rand veranderen, niets beweegt */
.chip { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }

/* Afgevinkte taken inklappen (#79) */
.done-row { align-self: flex-start; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; border: none; background: none; color: var(--grey); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.done-row .n { color: var(--ring); }

/* Herinneringen: uitlegscherm bij het aanzetten van meldingen en de rustige regel eronder (#67) */
/* Korte regel onderin, boven de tabs (bijv. "Geen internet", herinnering.js). Verdwijnt na 4 seconden. */
.kort-bericht { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h, 64px) + 16px); z-index: 95; max-width: 420px; margin: 0 auto;
  padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 15px; line-height: 20px; text-align: center; pointer-events: none; }
.modal-bg { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .4); }
.modal { width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto; background: var(--card); color: var(--text); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0; font-size: 20px; }
.modal p { margin: 0; font-size: 16px; line-height: 1.4; }
.modal-ios { color: var(--muted); }
.modal-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.remind-note { display: block; margin: 4px 0 0; padding: 0 2px; font-size: 14px; line-height: 1.35; color: var(--muted); text-align: left; background: none; border: none; font-family: inherit; }
.remind-note-btn { cursor: pointer; min-height: 36px; color: var(--accent); }
.sheet .card { background: var(--bg); }

/* ---------- Intro voor een nieuwe gebruiker (#145) ---------- */
/* Elk scherm één ding en één knop. De brief is een crème vel met een schreefletter (besluit 27-10). */
.intro { position: fixed; inset: 0; z-index: 80; background: var(--bg); color: var(--text); display: flex;
  padding: calc(24px + var(--safe-t)) 20px calc(20px + max(8px, var(--safe-b))); overflow: hidden; }
.intro.intro-weg { opacity: 0; transition: opacity .25s ease; }
body.intro-open { overflow: hidden; }
.intro-step { flex: 1; display: flex; flex-direction: column; max-width: 440px; width: 100%; margin: 0 auto; min-height: 0; }
.intro-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.intro-lead { margin: 0; font-size: 19px; font-weight: 600; }
.intro-hint { margin: 0; min-height: 20px; font-size: 14px; color: var(--muted); }
.intro-kist { border: none; background: none; padding: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.intro-kist canvas, .intro-ei canvas { display: block; image-rendering: pixelated; }
.intro-ei { position: relative; width: 256px; height: 248px; }
.intro-ei canvas { position: absolute; }
.intro-ei .pet-canvas { left: 0; top: 0; }
.intro-ei .intro-kist-achter, .intro-ei .intro-kist-voor { left: 48px; top: 120px; }
.intro-ei .intro-kist-achter { z-index: 0; }
.intro-ei .pet-canvas { z-index: 1; }
.intro-ei .intro-kist-voor { z-index: 2; }
.brief { flex: 0 1 auto; margin: auto 0; min-height: 0; overflow-y: auto; background: #FBF6EA; color: #3B3328; border-radius: 6px;
  padding: 26px 22px; font-family: Georgia, 'Times New Roman', serif; font-size: 17px; line-height: 1.55;
  box-shadow: 0 2px 12px rgba(60, 45, 25, .10); }
html[data-theme="dark"] .brief { background: #EDE5D3; box-shadow: none; }
.brief p { margin: 0 0 14px; }
.brief p:last-child { margin-bottom: 0; }
.brief .brief-van { font-style: italic; margin-top: 18px; }
.intro-knop { display: grid; gap: 10px; padding-top: 16px; }
.intro-knop .btn { width: 100%; }
.intro-vraag { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.intro-vraag h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; text-align: center; }
.intro-sub, .intro-tekst { margin: 0 0 14px; font-size: 16px; line-height: 1.45; color: var(--muted); text-align: center; }
.intro-tekst { color: var(--text); }
.intro-lijst { margin-top: 12px; background: var(--card); border-radius: 14px; padding: 0 16px; }
.intro-keuze { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 0; border: none; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font-size: 17px; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.intro-keuze:last-child { border-bottom: none; }
.intro-rond { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ring); box-sizing: border-box; position: relative; }
.intro-keuze.on .intro-rond { border-color: var(--accent); }
.intro-keuze.on .intro-rond::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.intro-fout { margin: 10px 0 0; min-height: 20px; font-size: 14px; color: var(--danger); text-align: center; }
@media (max-height: 640px) {
  .brief { font-size: 16px; line-height: 1.5; padding: 20px 18px; }
  .brief p { margin-bottom: 10px; }
}

/* ---------- Wat is nieuw (#147): onderscherm, één keer na een update ---------- */
.sheet:has(.nieuw) { min-height: 0; }
.nieuw { display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 8px; }
.nieuw-titel { margin: 0; font-size: 20px; font-weight: 600; }
.nieuw-punten { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.5; }
.nieuw-punten li { margin-bottom: 4px; }
.nieuw-bewaard { margin: 4px 0 6px; font-size: 15px; color: var(--accent); font-weight: 500; }
.nieuw-opnieuw { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.nieuw .btn { width: 100%; }
/* Wat is nieuw, terugkijken in Instellingen (#226) */
.nieuw-lijst { display: flex; flex-direction: column; gap: 16px; }
.nieuw-dag { background: var(--bg); border-radius: 18px; padding: 14px 16px 10px; }
.nieuw-datum { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Brieven bij het diertje (#146) ---------- */
.pet-wrap { position: relative; line-height: 0; }
.pet-wrap.met-bol { transform: translateX(-12.5%); }
/* De sterrenpot staat rechts naast het diertje, op dezelfde pixelmaat en grondlijn (#148, #179). */
.pet-bol { position: absolute; left: 78.125%; bottom: 6.5%; border: none; background: none; padding: 0; line-height: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bol-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pet-envelop { position: absolute; border: none; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sheet:has(.brief-sheet) { min-height: 0; }
.brief-sheet { flex: 0 1 auto; margin: 0; }
.brief-beeld { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0 0 14px; }

/* Het kistje (#191): je spullen en brieven van Ome Bob. Het open kistje bovenin, zoals in de intro. */
.kist-scene { position: relative; width: 200px; height: 160px; margin: 8px auto 4px; line-height: 0; }
.kist-scene canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.kist-achter, .kist-voor { position: absolute; left: 0; top: 0; }
.kist-voor { pointer-events: none; }
/* De pot staat half in het stro: de romp van het kistje ervoor verbergt de onderkant. */
.kist-pot { position: absolute; left: 55px; top: -32px; border: none; background: none; padding: 0; line-height: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.kist-hint { margin: 0 0 8px; text-align: center; font-size: 14px; color: var(--muted); min-height: 20px; }
.kist-kop { margin: 16px 0 8px; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--grey); }
.kist-spul .kist-icoon { margin-right: 12px; flex-shrink: 0; image-rendering: pixelated; }
/* Zolang de pot in het kistje klaarligt, wiebelt de knop af en toe (de hint uit brief 2). */
.head-kist.kist-wacht svg { animation: kist-wiebel 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes kist-wiebel { 0%, 72%, 100% { transform: rotate(0); } 76% { transform: rotate(-12deg); } 82% { transform: rotate(10deg); } 88% { transform: rotate(-6deg); } 94% { transform: rotate(3deg); } }
/* Wat het kistje in gaat: een klein briefje of de kaart vliegt naar de knop. */
.naar-kist { position: fixed; z-index: 60; pointer-events: none; color: var(--accent); line-height: 0; }
.naar-kist canvas { image-rendering: pixelated; }
@media (prefers-reduced-motion: reduce) { .head-kist.kist-wacht svg, .head-kraam.kraam-wacht svg { animation: none; } }
/* Het kraampje (#251) */
.head-kraam.kraam-wacht svg { animation: kist-wiebel 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.kraam-scene { display: flex; justify-content: center; margin: 12px auto 4px; line-height: 0; }
.kraam-saldo { text-align: center; margin: 12px 0 4px; font-size: 17px; font-weight: 600; color: var(--text); }
.kraam-ster { color: #E0A93A; }
.kraam-rij { gap: 12px; }
.kraam-rij .kist-icoon { flex-shrink: 0; image-rendering: pixelated; }
.kraam-sub { display: block; font-size: 13px; font-weight: 400; color: var(--grey); margin-top: 2px; }
.kraam-geef { flex: none; padding: 8px 18px; }
.kraam-leeg { color: var(--grey); }

/* Naar bed (#150): morgen bekijken, welterusten */
.morgen-datum { margin: 0 4px 12px; font-size: 15px; color: var(--grey); }
.morgen-taak { cursor: default; }
.morgen-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.morgen-meer { margin: 8px 4px 0; font-size: 15px; color: var(--grey); }
.morgen-leeg { margin: 4px 4px 0; font-size: 17px; color: var(--text); }
.morgen-btn { width: 100%; margin-top: 20px; }

/* Welkom en kistje (#248) */
.intro-maker { text-align: left; }
.intro-maker a { color: var(--accent, inherit); text-decoration: underline; }
.buddy.kist-dicht .pet, .buddy.kist-dicht .buddy-head, .buddy.kist-dicht .rhythm { display: none; }
.pak-start { margin: 16px auto; display: block; }

/* Over de maker (#247) */
.maker-portret { display: block; width: 120px; height: 120px; margin: 12px auto 4px; image-rendering: pixelated; }
.maker-tekst { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--text); }
.maker-tekst a { color: var(--accent); text-decoration: underline; }

/* "Geef feedback" (#27): een rij die WhatsApp opent, zelfde uiterlijk als de andere rijen. */
.set-link { color: var(--text); text-decoration: none; box-sizing: border-box; }
.set-icoon { flex: none; color: var(--accent); }

/* Backup (#259) */
.backup-keuze[hidden] { display: none; }
.set-row.set-sub { border-top: 1px solid var(--line); padding-left: 32px; }
.set-row.set-sub .set-label { font-size: 16px; font-weight: 400; }
.backup-melding { margin: 0; padding: 10px 16px 14px; font-size: 15px; line-height: 1.4; border-top: 1px solid var(--line); }
.backup-vraag { display: flex; flex-direction: column; gap: 16px; }
.backup-vraag p { margin: 0; font-size: 17px; line-height: 1.45; }

/* ---------- De wereld (#339; landschap uit Pixelorama, #376) ----------
   Op de telefoon vult de wereld het scherm boven de tabs, onderaan vast (besluit 15-11): 112 x 216 tekenpixels op maat 4.
   Een smalle telefoon toont het midden; een langere telefoon meer lucht. Onder de grond: het ritme. */
/* De tab van het diertje scrolt niet (Melroy 22-11): de wereld vult de ruimte tussen de bovenrand en de grond,
   de grond (kistje, kraampje, ritme) staat eronder op zijn eigen hoogte. */
.main.in-wereld { padding: 0; max-width: none; }
.main.in-wereld .main-content { min-height: 100%; height: 100%; }
.main.in-wereld .wereld { flex: 1 1 auto; height: auto; min-height: 320px; }
/* De wereld is een venster met ronde hoeken bovenaan: hij begint zichtbaar onder de balk van de app (Melroy 22-11, B). */
.wereld { position: relative; overflow: hidden; border-radius: 16px 16px 0 0; height: calc(100vh - var(--nav-h) - 64px); height: calc(100dvh - var(--nav-h) - 64px); min-height: 480px; }
/* Uitsnede (Melroy 22-11): zoveel mogelijk lucht en boom, met onderin sneeuw tot rij 198 (792px = 198 x maat 4,
   NestarWereld.ONDER). Nooit lager dan rij 84 bovenaan (336px, NestarWereld.BOVEN): zon en maan blijven in beeld.
   Nooit hoger dan de bovenrand of de onderkant van het werkvlak. Het diertje gaat voor: rij 182 (728px, NestarWereld.VOETEN,
   net onder de voeten) blijft altijd in beeld, ook als de maan dan op een heel laag scherm wegvalt. */
.wereld-vlak { position: absolute; left: 50%; top: min(max(calc(100% - 864px), -336px, min(0px, calc(100% - 792px))), calc(100% - 728px)); width: 448px; height: 864px; transform: translateX(-50%); }
.wereld-bg { position: absolute; left: 0; top: 0; width: 448px; height: 864px; image-rendering: pixelated; image-rendering: crisp-edges; }
.wereld-hemel { position: absolute; line-height: 0; pointer-events: none; }
.wereld-hemel-cv { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.wereld-spin { position: absolute; left: 0; top: 0; width: 448px; height: 864px; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
/* In het sneeuwmandje is het slapende kuiken het hele beeld: geen woordje eronder (#403). */
.wereld[data-plek="sneeuwmandje"] .pet-sub { display: none; }
.wereld-muis { position: absolute; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
/* Naar binnen of buiten: kort donker worden (Melroy 25-11). De duur staat ook in app-dier.js (OVERGANG_MS). */
.wereld-dek { position: absolute; inset: 0; z-index: 5; background: #141318; opacity: 0; transition: opacity 250ms ease; }
.wereld-dek.dicht { opacity: 1; }
/* Het kraampje in de verte (#400): twee beelden van het hele werkvlak, het kraampje en het lampje (dat altijd brandt). */
.wereld-kraam { position: absolute; left: 0; top: 0; width: 448px; height: 864px; pointer-events: none; }
.wereld-kraam img { position: absolute; left: 0; top: 0; width: 448px; height: 864px; image-rendering: pixelated; image-rendering: crisp-edges; }
.wereld-voor { position: absolute; left: 0; top: 0; width: 448px; height: 864px; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.wereld-gloed { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.wereld .pet { position: absolute; left: 96px; top: 516px; width: 256px; padding: 0; gap: 8px; }
/* In de wereld: het diertje in het midden (kolom 56), de pot op de wortel (onderkant rij 162, midden kolom 84). */
.wereld .pet-wrap.met-bol { transform: none; }
.wereld .pet-bol { left: 240px; bottom: 68px; transform: translateX(-50%); }
/* Pips kamertje (ontwerp Codex, goedgekeurd Melroy 24-11; NestarWereld.KAMERTJE). Eigen uitsnede: de bovenste rij in beeld
   is min(90, max(0, 198 - hoogte van het venster / 4)), dus het vlak staat op max(-360px, min(0px, 100% - 792px)):
   rij 90 op 320 x 568, rij 41,5 op 390 x 844. Pip met de linkerbovenhoek van zijn tekenvlak op kolom 26, rij 120. */
/* Het sneeuwmandje (#403, Melroy 25-11): het midden van het ei (rij 130 = 520 px) op 60 % van de hoogte van de wereld,
   begrensd zodat het beeld altijd het hele vak vult (niet onder rij 0, niet boven rij 216). Plek van het diertje: x 24, y 100. */
.wereld[data-plek="sneeuwmandje"] .wereld-vlak { top: max(calc(100% - 864px), min(0px, calc(60% - 520px))); }
.wereld[data-plek="sneeuwmandje"] .pet { left: 96px; top: 400px; }
.wereld[data-plek="kamertje"] .wereld-vlak { top: max(-360px, min(0px, calc(100% - 792px))); }
.wereld[data-plek="kamertje"] .pet { left: 104px; top: 480px; }
/* Slaapt Pip, dan ligt hij op het bedje (keuze B, Melroy 24-11; NestarWereld.KAMERTJE.DIER_SLAAPT: kolom 0, rij 126). */
.wereld[data-plek="kamertje"][data-stand$="-slaapt"] .pet { left: 0px; top: 504px; }
/* Slaapt Pip, dan ligt hij binnen op zijn bedje (Melroy 25-11): buiten is hij er dan niet. */
.wereld[data-plek="landschap"][data-stand$="-slaapt"] .pet { visibility: hidden; }
/* Tikvlakken in de wereld (NestarWereld.ZONES): ingang van het hol, raampje, schakelaar, bedje. Onzichtbaar, onder het diertje. */
.wereld-zone { position: absolute; border: 0; padding: 0; margin: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wereld-zone:focus-visible { outline: 2px solid #F3E9E2; outline-offset: 2px; border-radius: 6px; }
.wereld-zone-stil { cursor: default; }

/* ---------- Demo op een computer: de app in een telefoon (kader.js, Melroy 18-11) ---------- */
/* De hele pagina (ook html) in de kleur van de achtergrond, en scrollen mag (smal venster: de uitleg staat onder de telefoon). */
html.kader, html.kader body { margin: 0; height: auto; min-height: 100%; overflow: auto; background: #E9E5DC; }
.kader-pagina { min-height: 100vh; min-height: 100dvh; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 32px 56px; padding: 24px; box-sizing: border-box; }
.kader-telefoon { position: relative; box-sizing: content-box; width: 390px; height: max(667px, min(844px, calc(100dvh - 72px))); padding: 12px; border-radius: 52px; overflow: hidden; background: #1F1F1F; flex: none; }
/* De rand ligt óver de app heen, zodat de ronde binnenhoek zelf de app afdekt: geen lichte rand in de hoeken. */
.kader-telefoon::after { content: ''; position: absolute; inset: 0; border: 12px solid #1F1F1F; border-radius: 52px; pointer-events: none; }
/* De app heeft zelf ook ronde hoeken: anders steekt zijn vierkante hoek net buiten de buitenrand en schemert hij daar door. */
.kader-scherm { display: block; width: 390px; height: 100%; border: 0; background: transparent; border-radius: 40px; clip-path: inset(0 round 40px); }
.kader-uitleg { width: 310px; color: #3A3A3A; font-size: 17px; line-height: 1.5; }
.kader-uitleg p { margin: 0 0 14px; }
.kader-naam { font-size: 28px; font-weight: 700; color: #2C5C51; margin-bottom: 12px; }
.kader-adres { word-break: break-all; }
.kader-scan { display: flex; gap: 14px; align-items: center; margin: 18px 0 20px; }
.kader-qr { width: 96px; height: 96px; flex: none; background: #FFFFFF; border-radius: 10px; padding: 4px; box-sizing: border-box; }
.kader-qr svg { display: block; width: 100%; height: 100%; }
.kader-scan-kop { font-weight: 600; }
.kader-scan .kader-adres { font-weight: 400; font-size: 14px; color: #6B675F; margin: 2px 0 6px; }
.kader-hoe { font-size: 14px; }
.kader-link { color: #2C5C51; font-weight: 600; text-decoration: none; }
.kader-link:hover { text-decoration: underline; }
.kader-thema { display: inline-flex; background: #DDD7CB; border-radius: 999px; padding: 3px; margin: 0 0 20px; }
.kader-thema-knop { border: none; background: none; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600; color: #6B675F; cursor: pointer; }
.kader-thema-knop[aria-pressed="true"] { background: #FFFFFF; color: #2C5C51; }
.kader-knoppen { display: flex; gap: 8px; margin: 0 0 12px; }
.kader-knop { border: 1px solid #D9D3C7; background: #FFFFFF; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; color: inherit; cursor: pointer; }
.kader-knop:hover { background: #F5F3EE; }
.kader-iconen { display: flex; gap: 14px; margin: 0 0 12px; }
.kader-icoon { color: #6B675F; display: inline-flex; }
.kader-icoon:hover { color: #2C5C51; }
.kader-voet { font-size: 14px; color: #6B675F; }
/* In de telefoon zelf: geen scrollbalken, zoals op een telefoon. */
html.in-kader, html.in-kader * { scrollbar-width: none; }
html.in-kader ::-webkit-scrollbar { display: none; }
@media (prefers-color-scheme: dark) {
  html.kader, html.kader body { background: #141618; }
  .kader-telefoon { background: #3A3D40; }
  .kader-telefoon::after { border-color: #3A3D40; }
  .kader-uitleg { color: #D9D6CF; }
  .kader-naam { color: #8FC2B3; }
  .kader-knop { background: #1E2124; border-color: #2C3034; }
  .kader-thema { background: #24282B; }
  .kader-thema-knop { color: #A8A49C; }
  .kader-thema-knop[aria-pressed="true"] { background: #3A3D40; color: #8FC2B3; }
  .kader-knop:hover { background: #262A2E; }
  .kader-link, .kader-icoon:hover { color: #8FC2B3; }
  .kader-icoon, .kader-voet, .kader-scan .kader-adres { color: #A8A49C; }
}

/* Liggend op een telefoon (Melroy 19-11): Nestar is staand. Een iPhone-webapp kan het draaien niet zelf tegenhouden,
   dus dan een rustig scherm met de vraag de telefoon terug te draaien. De app eronder blijft gewoon staan. */
.draai { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .draai { display: flex; position: fixed; inset: 0; z-index: 200; background: var(--bg); color: var(--muted);
    flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 16px; text-align: center; padding: 24px; }
  .draai svg { color: var(--text); }
  html:not(.kader) body { overflow: hidden; }
}
