/* Eén kolom: kop, drie tabs, daarna groepen per periode (dag, week, maand). Systeemlettertypes, dus alles werkt ook offline. */
:root {
  color-scheme: light dark;
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #E9EEF6;
  --ink: #17202F;
  --muted: #566277;
  --line: #D5DCE8;
  --line-strong: #A9B5C8;
  --accent: #1F4E9C;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCE6F6;
  --ok: #1E7F4F;
  --on-ok: #FFFFFF;
  --ok-soft: #D9F0E3;
  --warn: #A85A08;
  --warn-soft: #FBE8CF;
  --danger: #B3261E;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1520; --surface: #18202D; --surface-2: #212B3B; --ink: #E7ECF4; --muted: #9AA7BB;
    --line: #2B3647; --line-strong: #4A586E; --accent: #8DB3F0; --accent-ink: #0F1520; --accent-soft: #22314A;
    --ok: #5FCB92; --on-ok: #0F1520; --ok-soft: #173828; --warn: #F0A855; --warn-soft: #3F2C12; --danger: #FF8A80;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: max(56px, calc(env(safe-area-inset-bottom, 0px) + 24px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 640px; margin: 0 auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 800 32px/1.1 var(--font-body); letter-spacing: -0.03em; }
h2 { font: 500 12px/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
h3 { font: 600 17px/1.3 var(--font-body); }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; }
.eyebrow { font: 500 12px/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  min-height: 46px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  font: 600 15px var(--font-body); color: var(--muted); cursor: pointer;
}
.tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px 7px; font: 400 12px/1.3 var(--font-mono);
}
.pill b { font-weight: 500; }
.pill::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: var(--ok); }

.group { margin-bottom: 26px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.goals.spaced { margin-bottom: 24px; }
.goal {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.goal-main { min-width: 0; padding-top: 2px; }
.goal-title { font-weight: 600; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.goal-meta { color: var(--muted); margin-top: 2px; }
.take { margin-top: 8px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.take .mono { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }

.check {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0;
}
.check:hover { background: var(--accent-soft); border-color: var(--accent); }
.check svg { width: 22px; height: 22px; }
.check.done { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.check.skipped { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
@media (prefers-reduced-motion: no-preference) { .check { transition: background .15s, border-color .15s; } }

.sheet {
  grid-column: 1 / -1; margin-top: 10px; background: var(--surface-2); border-radius: 8px; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.sheet .exp { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line-strong); padding-left: 10px; overflow-wrap: anywhere; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
label, .label { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="time"], select, textarea {
  width: 100%; font: 400 16px/1.4 var(--font-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 64px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: 600 15px var(--font-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; text-align: center;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); width: fit-content; max-width: 100%; flex-wrap: wrap; }
.seg label { position: relative; font-weight: 500; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span { display: flex; align-items: center; min-height: 42px; padding: 0 14px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.seg input[value="skipped"]:checked + span { background: var(--warn-soft); color: var(--warn); }

.empty { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.empty h2 { font: 700 21px/1.2 var(--font-body); text-transform: none; letter-spacing: -0.01em; }
.chips { display: flex; flex-direction: column; gap: 8px; }
.chip-btn { text-align: left; justify-content: flex-start; flex-wrap: wrap; gap: 4px 10px; padding-block: 8px; }
.chip-btn .mono { color: var(--muted); font-weight: 400; }

.note { font-size: 14px; color: var(--muted); }
.note.flush { margin: 0; }
.note.top-gap { margin-top: 8px; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.status { font-size: 14px; background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.status:empty { display: none; }

.filter { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter select { flex: 1; min-width: 0; }
.month { margin: 22px 0 10px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.entry-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.chip { font: 500 12px/1 var(--font-mono); padding: 5px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); }
.chip.skipped { background: var(--warn-soft); color: var(--warn); }
.entry dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.entry dt { font: 500 12px/1.3 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.entry dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.goal-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.goal-item > div:first-child { min-width: 0; flex: 1 1 200px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.card.flush { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sub { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 36px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 8px; }
.copybox { font: 400 12px/1.4 var(--font-mono); min-height: 140px; }
.file-label:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.file-label label { cursor: pointer; }

.cats { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); width: fit-content; max-width: 100%; margin-bottom: 16px; }
.cats button { min-height: 40px; padding: 0 16px; background: none; border: 0; font: 500 14px var(--font-body); color: var(--ink); cursor: pointer; }
.cats button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tag { display: inline-block; font: 500 11px/1.5 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 6px; border-radius: 4px; margin-right: 4px; }
.tag.werk { background: var(--accent-soft); color: var(--accent); }
.tag.prive { background: var(--surface-2); color: var(--muted); }
