:root {
  --papier: #FFFFFF; --inkt: #14181F; --grijs: #5D6673; --stil: #8A93A1;
  --lijn: #EBEDF1; --vlak: #EFF0F3; --blauw: #12385E; --accent: #D6451B;
  --boven: env(safe-area-inset-top); --onder: env(safe-area-inset-bottom);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="licht"]) {
    --papier: #14181F; --inkt: #ECEEF2; --grijs: #A2AAB6; --stil: #78818E;
    --lijn: #262C36; --vlak: #1D232C; --blauw: #7FA8D4;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--inkt);
  font-family: -apple-system, "SF Pro Text", system-ui, "Helvetica Neue", sans-serif;
  font-size: 15px; overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
#app { display: flex; flex-direction: column; height: 100%; }

.kop { flex-shrink: 0; padding: calc(var(--boven) + 6px) 22px 12px; }
.merk { display: flex; align-items: center; gap: 10px; }
.merk .vlag {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(170deg, #123A63 0%, #2B2438 62%, #43221C 100%);
  display: flex; align-items: center; justify-content: center;
}
.merk h1 { flex-grow: 1; margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.8px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--stil); }

.tabs { display: flex; gap: 6px; padding: 3px; border-radius: 9px; background: var(--vlak); margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 10px; border-radius: 7px; border: none; background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--grijs); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--papier); box-shadow: 0 1px 2px rgba(20,24,31,.12); font-weight: 600; color: var(--blauw); }
.tabs .telling { padding: 1px 6px; border-radius: 7px; background: var(--accent); color: #FFF;
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; }
.tabs .plus { flex: 0 0 34px; font-size: 17px; line-height: 1; color: var(--stil); }

.lijst { flex-grow: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 22px calc(var(--onder) + 24px); }
.regel { display: flex; flex-direction: column; gap: 5px; padding: 14px 0; border-top: 1px solid var(--lijn);
  width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.regel .meta { display: flex; align-items: center; gap: 7px; }
.bol { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.vink { width: 12px; }
.stip { width: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.regel .titel { font-size: 15px; line-height: 1.32; letter-spacing: -.25px; }
.regel[data-gelezen="1"] .titel { font-weight: 400; color: var(--grijs); }
.regel[data-gelezen="0"] .titel { font-weight: 600; color: var(--inkt); }
.regel .romp { font-size: 13px; line-height: 1.45; color: var(--grijs);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.balk { flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: calc(var(--boven) + 4px) 18px 10px; border-bottom: 1px solid var(--lijn); }
.balk .terug { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px 5px 4px; border: none; background: none; color: var(--blauw); font-size: 15px; cursor: pointer; }
.balk .midden { flex-grow: 1; text-align: center; font-size: 14px; font-weight: 600; color: var(--grijs); margin-left: -12px; }
.balk .rond { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: none; background: none; padding: 0; cursor: pointer; }

.blad { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 18px 22px calc(var(--onder) + 30px); display: flex; flex-direction: column; gap: 11px; }
.blad h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.6px; line-height: 1.22; }
.streep { height: 1px; background: var(--lijn); margin: 3px 0; }
.rubriek { font-size: 9.5px; font-weight: 700; letter-spacing: .8px; color: var(--accent); margin-top: 4px; }
.item { display: flex; flex-direction: column; gap: 4px; }
.item .ikop { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.item p { margin: 0; font-size: 14px; line-height: 1.58; color: var(--inkt); }
.merkje { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--vlak); color: var(--grijs);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: .4px; }
.bronnen { display: flex; flex-wrap: wrap; gap: 6px; }
.bronnen a { font-size: 11.5px; color: var(--blauw); text-decoration: none; border-bottom: 1px solid var(--lijn); }

.leeg { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px 34px calc(var(--onder) + 40px); text-align: center; }
.leeg p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--grijs); }
.knop { padding: 10px 18px; border-radius: 9px; border: 1px solid #0E2D4C; background: var(--blauw); color: #FFF; font-size: 14px; font-weight: 600; cursor: pointer; }
.knop.stil { background: transparent; border-color: var(--lijn); color: var(--grijs); font-weight: 500; }

.veld { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--lijn); background: var(--papier); font-size: 15px; }
.formulier { display: flex; flex-direction: column; gap: 12px; padding: 24px 22px; margin: auto; width: 100%; max-width: 360px; }

.gesprek { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; }
.bubbel { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.bubbel.ik { align-self: flex-end; background: var(--blauw); color: #FFF; border-bottom-right-radius: 5px; }
.bubbel.claude { align-self: flex-start; background: var(--vlak); border-bottom-left-radius: 5px; }
.voorstel { border: 1px solid var(--lijn); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.voorstel dt { font-size: 9.5px; font-weight: 700; letter-spacing: .7px; color: var(--stil); }
.voorstel dd { margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; }
.invoerbalk { flex-shrink: 0; display: flex; gap: 8px; padding: 10px 18px calc(var(--onder) + 12px); border-top: 1px solid var(--lijn); }
.invoerbalk .veld { flex-grow: 1; }

.draaitop { margin: 22px 0 0; text-align: center; font-size: 10.5px; font-weight: 400;
  letter-spacing: .2px; color: var(--stil); opacity: .72; }

.melding { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--onder) + 22px);
  background: var(--inkt); color: var(--papier); padding: 9px 16px; border-radius: 20px; font-size: 13px; z-index: 9; }
.draait { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: tol .7s linear infinite; vertical-align: -2px; }
@keyframes tol { to { transform: rotate(360deg); } }
