/* =========================================================================
   Rechtop — huisstijl
   Idee: "dossier op je bureau". Koel papier, inktblauw, één accent: rood lakzegel
   (alleen voor wat echt telt: je cijfer, de hoofdknop bij inleveren).
   Kleuren aanpassen? Alleen de variabelen hieronder wijzigen.
   ========================================================================= */

:root {
    --paper: #eef1f4;          /* achtergrond */
    --sheet: #ffffff;          /* kaarten */
    --ink: #172036;            /* tekst */
    --ink-soft: #55607a;       /* secundaire tekst */
    --line: #d9dee7;           /* randen */
    --navy: #1c2a4a;           /* primair */
    --navy-2: #2c4170;
    --seal: #a8233a;           /* accent: lakzegel */
    --sage: #2f7a5b;           /* goed */
    --amber: #a8670f;          /* nog nakijken / waarschuwing */
    --wash: #e4e9f2;           /* lichte vulling */
    --radius-s: 6px;
    --radius: 10px;
    --radius-l: 16px;
    --shadow: 0 1px 0 rgba(23, 32, 54, .04), 0 8px 24px -14px rgba(23, 32, 54, .25);
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
    --sidebar: 240px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #10151f;
        --sheet: #171e2c;
        --ink: #e8ebf2;
        --ink-soft: #9aa4ba;
        --line: #2a3346;
        --navy: #8fb0f0;
        --navy-2: #b5cbf6;
        --seal: #e2667a;
        --sage: #5cc496;
        --amber: #e0a645;
        --wash: #1f2839;
        --shadow: 0 10px 30px -18px rgba(0, 0, 0, .7);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: var(--navy); }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: .88em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--navy) 55%, transparent); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.warn { color: var(--amber); font-size: .95rem; }
.hint { font-size: .9rem; }
.note { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; font-size: .93rem; color: var(--ink-soft); }
.label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .2rem; }
.icon { flex-shrink: 0; vertical-align: -3px; }

/* ---------- App-schil ---------- */

.app-shell { min-height: 100dvh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    display: flex; flex-direction: column; gap: 1.5rem;
    padding: 1.4rem 1rem;
    background: var(--sheet); border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--navy); color: var(--sheet);
}
.brand-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 650; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav__link {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem;
    border-radius: var(--radius-s); color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.side-nav__link:hover { background: var(--wash); color: var(--ink); }
.side-nav__link.active { background: var(--wash); color: var(--navy); box-shadow: inset 3px 0 0 var(--navy); }

.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sidebar-user form { margin: 0 0 0 auto; }
.sidebar-user__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--wash); color: var(--navy); font-weight: 700; }

.app-main { margin-left: var(--sidebar); }
.app-content { max-width: 1080px; margin: 0 auto; padding: 2.2rem 2rem 4rem; display: flex; flex-direction: column; gap: 1.4rem; }

.bottom-nav { display: none; }

.public-top { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; }
.public-top__actions { display: flex; gap: .5rem; }
.public-top + .app-main, .app-shell:has(.public-top) .app-main { margin-left: 0; }

@media (max-width: 860px) {
    .sidebar { display: none; }
    .app-main { margin-left: 0; }
    .app-content { padding: 1.2rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
    .bottom-nav {
        display: flex; position: fixed; inset: auto 0 0 0; z-index: 20;
        background: var(--sheet); border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav__link {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: .55rem 0 .45rem; font-size: .75rem; color: var(--ink-soft); text-decoration: none;
    }
    .bottom-nav__link.active { color: var(--navy); font-weight: 600; }
}

/* ---------- Koppen ---------- */

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-header__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.eyebrow { font-size: .92rem; color: var(--seal); font-weight: 600; margin-bottom: .3rem; }
.lead { color: var(--ink-soft); font-size: 1.08rem; max-width: 62ch; margin-top: .4rem; }
.back-link { display: inline-flex; align-items: center; gap: .25rem; color: var(--ink-soft); text-decoration: none; font-size: .93rem; }
.back-link:hover { color: var(--ink); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.section-title { margin-top: .6rem; }

/* ---------- Kaarten ---------- */

.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.card--accent { border-top: 3px solid var(--navy); }
.card-title { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: 1.15rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .8rem; }
.card-head .card-title { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }

.collapsible > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: .5rem; list-style: none; }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible[open] > summary { margin-bottom: 1rem; }
.collapsible-inline { margin: .8rem 0; }
.collapsible-inline > summary { cursor: pointer; color: var(--navy); font-weight: 500; margin-bottom: .5rem; }

/* ---------- Formulieren ---------- */

.stack { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-row--center { align-items: center; margin-top: .4rem; }
.grow { flex: 1 1 260px; }
.grow-right { margin-left: auto; }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; align-items: center; }
.row-start { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.row-between { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; margin-top: .6rem; }
.field > span { font-weight: 600; font-size: .93rem; display: flex; align-items: center; gap: .35rem; }
.field-error, .validation-message { color: var(--seal); font-size: .88rem; }

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
    font: inherit; color: var(--ink); background: var(--sheet);
    border: 1px solid var(--line); border-radius: var(--radius-s);
    padding: .6rem .75rem; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 18%, transparent); }
.input-lg { font-size: 1.3rem !important; padding: .8rem 1rem !important; }
input[type=range] { width: 100%; accent-color: var(--navy); }
.invalid { border-color: var(--seal) !important; }

.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; margin-top: .6rem; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }

pre.example {
    background: var(--wash); border-radius: var(--radius-s); padding: .8rem 1rem; margin: .6rem 0;
    white-space: pre-wrap; font-size: .85rem; color: var(--ink-soft);
}

/* ---------- Knoppen ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font: inherit; font-weight: 600; font-size: .96rem; line-height: 1;
    padding: .7rem 1.1rem; border-radius: var(--radius-s); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--navy); color: var(--sheet); }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--seal); color: #fff; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--wash); }
.btn-success { background: var(--sage); color: #fff; }
.btn-danger { background: var(--seal); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--seal); border-color: transparent; }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--seal) 10%, transparent); }
.btn-link { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; padding: .3rem .4rem; }
.btn-sm { padding: .45rem .75rem; font-size: .88rem; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-s);
    background: transparent; border: 1px solid transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--wash); color: var(--ink); }
.icon-btn.danger:hover { color: var(--seal); }

/* ---------- Kleine onderdelen ---------- */

.chip {
    display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600;
    padding: .15rem .55rem; border-radius: 999px; background: var(--wash); color: var(--navy);
}
.chip--ai { background: color-mix(in srgb, var(--seal) 12%, transparent); color: var(--seal); }
.chip--num { font-family: ui-monospace, monospace; }
.chip--btn { border: 1px solid var(--line); background: var(--sheet); color: var(--ink); cursor: pointer; font: inherit; font-size: .85rem; padding: .3rem .7rem; }
.chip--btn.is-selected { border-color: var(--navy); background: var(--wash); color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .2rem; }

.badge { font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.score-pill { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.unsaved { font-size: .85rem; color: var(--amber); }

.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-s); font-weight: 500; }
.alert-error { background: color-mix(in srgb, var(--seal) 10%, var(--sheet)); color: var(--seal); border: 1px solid color-mix(in srgb, var(--seal) 30%, transparent); }
.alert-success { background: color-mix(in srgb, var(--sage) 10%, var(--sheet)); color: var(--sage); border: 1px solid color-mix(in srgb, var(--sage) 30%, transparent); }

.info-tip { position: relative; display: inline-flex; color: var(--ink-soft); cursor: help; font-weight: 400; }
.info-tip:hover, .info-tip:focus { color: var(--navy); }
.info-tip__bubble {
    position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: min(300px, 80vw);
    background: var(--ink); color: var(--paper); padding: .6rem .75rem; border-radius: var(--radius-s);
    font-size: .85rem; line-height: 1.45; font-weight: 400; text-align: left;
    opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none;
}
.info-tip:hover .info-tip__bubble, .info-tip:focus .info-tip__bubble, .info-tip:focus-within .info-tip__bubble { opacity: 1; visibility: visible; }

.busy { display: flex; align-items: center; gap: .7rem; color: var(--ink-soft); padding: .8rem 0; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--navy); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty__title { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs--inline { margin-bottom: .6rem; }
.tab {
    font: inherit; font-weight: 600; font-size: .93rem; background: none; border: 0; cursor: pointer;
    padding: .6rem .8rem; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--navy); border-bottom-color: var(--navy); }
.tab__count { font-size: .78rem; background: var(--wash); border-radius: 999px; padding: 0 .45rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list__row {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .7rem .2rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.list li:last-child .list__row { border-bottom: 0; }
.list__row span:first-child { display: flex; flex-direction: column; min-width: 0; }
.list__row:hover strong { color: var(--navy); }
.list__row.is-active strong { color: var(--navy); }
.list--compact .list__row { padding: .55rem .1rem; }
.link { font-size: .9rem; font-weight: 600; text-decoration: none; }

.disclaimer { display: flex; gap: .4rem; align-items: center; font-size: .85rem; }

/* ---------- Home ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tile {
    display: flex; flex-direction: column; gap: .4rem; padding: 1.3rem; border-radius: var(--radius);
    background: var(--sheet); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.tile::after { content: "§"; position: absolute; right: .6rem; bottom: -1.4rem; font-family: var(--font-display); font-size: 6rem; color: var(--wash); line-height: 1; }
.tile:hover { border-color: var(--navy); }
.tile__icon { color: var(--navy); }
.tile__title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 650; }
.tile__text { color: var(--ink-soft); font-size: .95rem; position: relative; z-index: 1; max-width: 32ch; }

.hero { padding: 4rem 0 2rem; max-width: 720px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: .4rem 0 1rem; }
.hero__actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 2rem; }

/* ---------- Auth ---------- */

.auth-shell { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; gap: 1.2rem; }
.auth-brand { display: flex; align-items: center; gap: .6rem; }
.auth-card { width: min(440px, 100%); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .6rem; }
.auth-title { font-size: 1.7rem; }
.auth-switch { text-align: center; margin-top: .6rem; font-size: .95rem; }
.auth-foot { font-size: .88rem; text-align: center; }

/* ---------- Leersets ---------- */

.set-grid, .doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.set-card {
    display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
    background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
    /* tabblad van een dossiermap */
    border-top-left-radius: 0; position: relative; margin-top: 10px;
}
.set-card::before {
    content: ""; position: absolute; left: -1px; top: -11px; width: 42%; height: 11px;
    background: var(--sheet); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0;
}
.set-card__main { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.set-card__main:hover h3 { color: var(--navy); }
.set-card__actions { display: flex; gap: .5rem; justify-content: flex-end; }

.items { list-style: none; counter-reset: q; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.item {
    counter-increment: q; display: flex; gap: .8rem; align-items: flex-start;
    background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem;
}
.item::before { content: counter(q); font-family: var(--font-display); color: var(--ink-soft); min-width: 1.6rem; font-size: 1.05rem; }
.item.is-editing { flex-direction: column; border-color: var(--navy); }
.item.is-editing::before { display: none; }
.item__body { flex: 1; cursor: pointer; min-width: 0; }
.item__q { font-weight: 600; }
.item__a { color: var(--ink-soft); margin-top: .2rem; display: flex; gap: .4rem; align-items: baseline; white-space: pre-wrap; }
.item__meta { font-size: .82rem; margin-top: .3rem; }
.item-form { width: 100%; }

.distractors { margin-top: .8rem; padding: .8rem; background: var(--wash); border-radius: var(--radius-s); }
.distractors__head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.distractors__head > span { display: flex; align-items: center; gap: .35rem; }
.distractor-row { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }

.import-preview { margin-top: 1rem; padding: .9rem 1rem; background: var(--wash); border-radius: var(--radius-s); }
.preview-list { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .25rem; font-size: .92rem; }
.preview-list li { display: flex; gap: .5rem; flex-wrap: wrap; }
.preview-list .arrow { color: var(--ink-soft); }

/* ---------- Toets starten ---------- */

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.mode-card {
    position: relative; display: flex; flex-direction: column; gap: .35rem; cursor: pointer;
    padding: 1.1rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--sheet);
}
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:hover { border-color: var(--navy-2); }
.mode-card.is-selected { border-color: var(--navy); background: var(--wash); box-shadow: inset 0 0 0 1px var(--navy); }
.mode-card:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--navy) 55%, transparent); }
.mode-card__icon { color: var(--navy); }
.mode-card__title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 650; display: flex; align-items: center; gap: .35rem; }
.mode-card__text { color: var(--ink-soft); font-size: .92rem; }

.sub-options { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1.1rem; }
.sub-options__label { font-weight: 600; font-size: .93rem; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--sheet); }
.segmented label { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .85rem; cursor: pointer; font-weight: 500; font-size: .92rem; border-right: 1px solid var(--line); }
.segmented label:last-child { border-right: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label.is-selected { background: var(--navy); color: var(--sheet); }
.segmented label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--navy) 55%, transparent); outline-offset: -3px; }

.sticky-actions { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 860px) { .sticky-actions { bottom: calc(4.6rem + env(safe-area-inset-bottom)); } }

/* ---------- Toets maken ---------- */

.quiz { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.quiz__top, .quiz__meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.progress { height: 6px; background: var(--wash); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--navy); transition: width .25s ease; }

.question-card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.8rem; box-shadow: var(--shadow); }
.question-card__q { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-bottom: 1.3rem; white-space: pre-wrap; }

.options { display: flex; flex-direction: column; gap: .6rem; }
.option {
    display: flex; align-items: center; gap: .9rem; text-align: left; width: 100%;
    font: inherit; color: var(--ink); background: var(--sheet);
    border: 1.5px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; cursor: pointer;
}
.option:hover { border-color: var(--navy-2); }
.option.is-selected { border-color: var(--navy); background: var(--wash); }
.option__letter {
    display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
    border: 1.5px solid var(--line); font-weight: 700; font-size: .88rem; color: var(--ink-soft);
}
.option.is-selected .option__letter { background: var(--navy); border-color: var(--navy); color: var(--sheet); }

.quiz__nav { display: flex; justify-content: space-between; gap: .5rem; }
.dots { display: flex; flex-wrap: wrap; gap: .35rem; }
.dot {
    width: 34px; height: 34px; border-radius: var(--radius-s); border: 1px solid var(--line);
    background: var(--sheet); color: var(--ink-soft); font: inherit; font-size: .82rem; cursor: pointer;
}
.dot.is-done { background: var(--wash); color: var(--navy); border-color: transparent; font-weight: 600; }
.dot.is-current { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); color: var(--navy); }

/* ---------- Resultaat: het lakzegel ---------- */

.result-hero { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; padding: 1rem 0 .5rem; }
.result-hero__score {
    --c: var(--seal);
    width: 132px; height: 132px; flex-shrink: 0; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 75%, #fff), var(--c) 60%);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent), 0 14px 30px -14px var(--c);
    transform: rotate(-6deg);
    animation: seal .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.result-hero__score.is-pass { --c: var(--sage); }
.result-hero__score.is-pending { --c: var(--amber); }
.result-hero__grade { font-family: var(--font-display); font-size: 2.6rem; font-weight: 650; line-height: 1; }
.result-hero__label { font-size: .72rem; opacity: .9; margin-top: .2rem; }
@keyframes seal { from { transform: scale(1.4) rotate(-14deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .result-hero__score { animation: none; } * { transition: none !important; } }

.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.review { background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.review.is-correct { border-left-color: var(--sage); }
.review.is-wrong { border-left-color: var(--seal); }
.review.is-pending { border-left-color: var(--amber); }
.review__head { display: flex; gap: .7rem; align-items: flex-start; }
.review__head h3 { flex: 1; font-size: 1.05rem; white-space: pre-wrap; }
.review__num { font-family: var(--font-display); color: var(--ink-soft); }
.review.is-correct .review__state { color: var(--sage); }
.review.is-wrong .review__state { color: var(--seal); }
.review.is-pending .review__state { color: var(--amber); }
.review__answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: .8rem; }
.review__answers p { white-space: pre-wrap; }
.review__feedback { margin-top: .8rem; padding: .6rem .8rem; background: var(--wash); border-radius: var(--radius-s); font-size: .95rem; display: flex; gap: .5rem; align-items: baseline; }
.review__actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: .6rem; flex-wrap: wrap; }

/* ---------- Documenten ---------- */

.doc-card {
    display: flex; flex-direction: column; gap: .45rem; align-items: flex-start;
    background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
    text-decoration: none; color: var(--ink);
}
.doc-card:hover { border-color: var(--navy); }
.doc-card__preview { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.doc-card__meta { font-size: .8rem; margin-top: auto; }

.editor-toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.editor-toolbar .title-input { flex: 1 1 280px; font-family: var(--font-display); font-size: 1.4rem !important; font-weight: 650; border-color: transparent !important; background: transparent !important; padding-left: 0 !important; }
.editor-toolbar .title-input:focus { border-color: var(--line) !important; padding-left: .75rem !important; }
.editor-toolbar select { width: auto; }
.editor-toolbar__actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: 1fr; } }
.editor {
    min-height: 65vh; font-family: var(--font-body); font-size: 1rem; line-height: 1.7;
    padding: 1.4rem 1.6rem !important; border-radius: var(--radius) !important;
}
.paper { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 2.4rem; min-height: 65vh; box-shadow: var(--shadow); }
.editor-side { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .6rem; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.changes, .feedback { margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .93rem; }
.rubric { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .6rem .75rem; background: var(--paper); }
.rubric > summary { cursor: pointer; font-weight: 600; font-size: .93rem; display: flex; align-items: center; gap: .4rem; list-style: none; }
.rubric > summary::-webkit-details-marker { display: none; }
.rubric[open] > summary { margin-bottom: .7rem; }
.rubric .file-drop { padding: .8rem; }
.feedback .prose table, .editor-side .prose table { display: block; overflow-x: auto; white-space: normal; }
.changes ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.versions small { margin-left: .4rem; }

/* ---------- Uitleg ---------- */

.explain-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
@media (max-width: 1000px) { .explain-layout { grid-template-columns: 1fr; } }
.explain-main { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.explain-history { position: sticky; top: 1rem; }
.asked { background: var(--wash); padding: .6rem .8rem; border-radius: var(--radius-s); margin-bottom: 1rem; font-size: .95rem; }

.file-drop {
    position: relative; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--paper);
}
.file-drop:hover, .file-drop:focus-within { border-color: var(--navy); }
.file-drop.has-file { border-style: solid; border-color: var(--navy); background: var(--wash); }
.file-drop__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop__body { display: flex; flex-direction: column; gap: .1rem; color: var(--navy); }
.file-drop__body strong { color: var(--ink); word-break: break-all; }
.file-drop__body span { font-size: .88rem; }
.file-drop__clear { position: relative; z-index: 2; margin-left: auto; }

/* ---------- Opgemaakte AI-tekst ---------- */

.prose { line-height: 1.7; max-width: 75ch; }
.prose > * + * { margin-top: .8em; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.2rem; }
.prose h3 { font-size: 1.05rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .25em; }
.prose blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--ink-soft); }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; }
.paper .prose { font-family: var(--font-body); }

/* ---------- Blazor ---------- */

#blazor-error-ui {
    display: none; position: fixed; inset: auto 0 0 0; z-index: 1000;
    background: var(--seal); color: #fff; padding: .8rem 1.2rem;
}
#blazor-error-ui a { color: #fff; font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; }

/* ---------- Beheer ---------- */

.side-nav__link--admin { margin-top: .6rem; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-s) var(--radius-s); padding-top: .8rem; }
.admin-stats { display: flex; flex-wrap: wrap; gap: .8rem; }
.admin-stats > div { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; display: flex; flex-direction: column; min-width: 110px; }
.admin-stats strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.admin-stats span { color: var(--ink-soft); font-size: .85rem; }
.admin-search { max-width: 360px; }
.admin-table-wrap { padding: 0; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.admin-table th { text-align: left; font-size: .82rem; color: var(--ink-soft); font-weight: 600; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-blocked td { opacity: .6; }
.admin-actions { white-space: nowrap; text-align: right; }
.admin-actions .btn + .btn { margin-left: .3rem; }

@media (max-width: 760px) {
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
    .admin-table td { border: 0; padding: .25rem 1rem; }
    .admin-table td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--ink-soft); }
    .admin-actions { text-align: left; }
}
