:root {
  --bg: #f6f4f1; --panel: #ffffff; --text: #23211f; --muted: #7a746d; --line: #e4dfd8;
  --accent: #b0563a; --soft: #f1e6df; --me: #2f5d8a; --me-text: #ffffff; --me-soft: #e6eef6; --her: #efeae4;
  --goed: #3c9a5f; --weg: #b8b1a8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161514; --panel: #1f1d1b; --text: #ece8e3; --muted: #958e86; --line: #2f2c29;
    --accent: #d9805f; --soft: #2b221e; --me: #3d6f9f; --me-soft: #1d2732; --her: #2a2724;
    --goed: #58b97c; --weg: #5a544d; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.app { max-width: 720px; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0); }
header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 12px; }
h1 { font-size: 20px; margin: 0; letter-spacing: 0.01em; }
.stand { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.stand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stip { width: 8px; height: 8px; border-radius: 50%; background: var(--weg); flex: none; }
.stip.er { background: var(--goed); }
.blad { flex: 1; overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; }
.blad[hidden] { display: none; }

/* gesprek */
#chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 84%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.jij { align-self: flex-end; background: var(--me); color: var(--me-text); border-bottom-right-radius: 5px; }
.msg.zij { align-self: flex-start; background: var(--her); border-bottom-left-radius: 5px; }
.msg.wacht { opacity: 0.6; }
.msg small { display: block; margin-top: 3px; font-size: 11px; opacity: 0.8; }
.dag { align-self: center; font-size: 12px; color: var(--muted); margin: 8px 0 2px; }
.leeg { color: var(--muted); font-size: 14px; margin: auto; text-align: center; max-width: 30ch; }

/* tijdlijn */
.dagkop { margin: 22px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dagkop:first-child { margin-top: 4px; }
.moment { position: relative; margin-left: 7px; padding: 4px 0 20px 22px; border-left: 2px solid var(--line); }
.moment::before { content: ""; position: absolute; left: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); }
.moment.eigen::before { background: var(--accent); }
.meta { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--muted); }
.soort { letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.feit { margin: 3px 0 0; overflow-wrap: anywhere; }
.woorden { margin: 10px 0 0; padding: 10px 14px; background: var(--soft); border-radius: 4px 14px 14px 14px;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: 17px; overflow-wrap: anywhere; }
.wie { display: block; font: 600 11px/1 system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px; }
.reactie { margin: 8px 0 0 auto; max-width: 88%; width: fit-content; padding: 8px 13px; background: var(--me-soft);
  border-radius: 14px 14px 4px 14px; font-size: 15px; overflow-wrap: anywhere; }
.reactie .wie { color: var(--me); margin-bottom: 3px; }
.erbij { margin-top: 8px; background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; }
.moment form { display: flex; gap: 8px; margin-top: 10px; }

/* uitleg */
.uitleg h2 { font-size: 18px; margin: 18px 0 8px; }
.uitleg p { max-width: 42ch; }
.klein { color: var(--muted); font-size: 14px; }

/* invoer en onderdelen */
#invoer { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
#invoer[hidden] { display: none; }
input[type=text] { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 16px; }
form button { padding: 0 18px; min-height: 44px; border-radius: 22px; border: 0; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; }
form button:disabled { opacity: 0.5; }
nav { display: flex; border-top: 1px solid var(--line); }
nav button { flex: 1; min-height: 48px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px;
  border-top: 2px solid transparent; margin-top: -1px; }
nav button.aan { color: var(--text); font-weight: 600; border-top-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
