:root {
	--bg: #faf8f5;
	--surface: #ffffff;
	--surface-2: #f3efe9;
	--text: #1f1d1a;
	--muted: #6b655d;
	--border: #e6e0d7;
	--accent: #e8590c;
	--accent-strong: #c2410c;
	--accent-soft: #fff1e6;
	--blue: #1d4ed8;
	--blue-soft: #e8efff;
	--good: #15803d;
	--good-soft: #e7f6ec;
	--bad: #b91c1c;
	--bad-soft: #fdecec;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.05);
	--radius: 14px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #151412;
		--surface: #1e1c1a;
		--surface-2: #282522;
		--text: #f2eee8;
		--muted: #a59d92;
		--border: #36322d;
		--accent: #fb8a3c;
		--accent-strong: #fdba74;
		--accent-soft: #3a2415;
		--blue: #93b4ff;
		--blue-soft: #1c2640;
		--good: #4ade80;
		--good-soft: #15291c;
		--bad: #f87171;
		--bad-soft: #351919;
		--shadow: none;
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; }

button, input { font: inherit; color: inherit; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* Header */
.topbar {
	position: sticky; top: 0; z-index: 5;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { white-space: nowrap; }
.topbar-stats { white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.brand-mark {
	width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
	background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 800; letter-spacing: -0.02em;
}
.topbar-stats { margin-left: auto; display: flex; gap: 14px; font-size: 0.9rem; color: var(--muted); }
.topbar-stats b { color: var(--text); }
.nav-auth { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-auth .btn { min-height: 34px; padding: 5px 11px; font-size: 0.85rem; margin-top: 0; }
.nav-auth + .topbar-stats { margin-left: 10px; }
.nav-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 560px) {
	.nav-auth { gap: 4px; }
	.nav-auth .btn { min-height: 32px; padding: 4px 8px; font-size: 0.78rem; }
	.nav-auth .nav-auth-signup, .nav-user { display: none; }
}

main.wrap { padding-top: 28px; padding-bottom: 64px; }

h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 20px;
}
.stack > * + * { margin-top: 16px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 18px; border-radius: 12px;
	border: 1px solid var(--border); background: var(--surface);
	font-weight: 600; cursor: pointer; text-decoration: none;
	transition: transform 0.06s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .option:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, input:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #1a0f07; } }
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.icon-btn {
	width: 36px; height: 36px; border-radius: 50%; flex: none;
	display: inline-grid; place-items: center; cursor: pointer;
	border: 1px solid var(--border); background: var(--surface-2);
}
.icon-btn svg { width: 18px; height: 18px; }

/* Home */
.hero { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.next-up { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.next-up .grow { flex: 1 1 220px; }
.eyebrow { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-strong); }

.level { margin-top: 32px; }
.level-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.level-badge { font-weight: 800; color: var(--accent-strong); }
.unit { margin-top: 18px; }
.unit-title { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
@media (max-width: 560px) { .lessons { grid-template-columns: 1fr; } }
.lesson-card {
	display: flex; gap: 12px; align-items: flex-start; text-decoration: none;
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
	transition: border-color 0.15s ease;
}
.lesson-card:hover { border-color: var(--accent); }
.lesson-card.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lesson-status {
	flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
	background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 700;
}
.lesson-card.is-done .lesson-status { background: var(--good-soft); color: var(--good); }
.lesson-card h3 { margin: 0; font-size: 0.98rem; }
.lesson-card p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }

/* Lesson: learn */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.grammar ul { margin: 0; padding-left: 20px; }
.grammar li + li { margin-top: 6px; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.words { list-style: none; margin: 0; padding: 0; }
.word { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.word:last-child { border-bottom: 0; }
.word-main { flex: 1; min-width: 0; }
.word-nl { font-weight: 600; }
.article { font-weight: 500; }
.article-de { color: var(--blue); }
.article-het { color: var(--accent-strong); }
.word-en { color: var(--muted); font-size: 0.9rem; }
.word-ex { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 2px; }
.sticky-cta { position: sticky; bottom: 12px; margin-top: 20px; }

/* Practice */
.practice-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.progress { flex: 1; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s ease; }
.close-btn { text-decoration: none; color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 4px 8px; }

.prompt-kind { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.prompt { font-size: 1.35rem; font-weight: 600; line-height: 1.35; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prompt-sub { color: var(--muted); margin-top: 4px; }
.blank { display: inline-block; min-width: 3.5em; border-bottom: 2px solid var(--accent); text-align: center; }

.options { display: grid; gap: 10px; margin-top: 18px; }
.option {
	display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
	min-height: 52px; padding: 12px 14px; border-radius: 12px; cursor: pointer;
	border: 2px solid var(--border); background: var(--surface);
}
.option:hover:not([disabled]) { border-color: var(--accent); }
.option .key { flex: none; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); display: grid; place-items: center; font-size: 0.75rem; color: var(--muted); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }

.answer-input {
	width: 100%; margin-top: 18px; min-height: 52px; padding: 12px 14px;
	border: 2px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 1.1rem;
}
.answer-input:focus { border-color: var(--accent); outline: none; }

/* Account forms */
.auth-card { max-width: 460px; margin: 32px auto; }
.auth-form { display: grid; gap: 14px; margin-top: 16px; }
.form-field { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.form-field .answer-input { margin-top: 0; min-height: 46px; font-size: 1rem; }
.form-error { margin: 0; color: var(--bad); font-size: 0.9rem; }
.form-error:empty { display: none; }
.special-chars { display: flex; gap: 6px; margin-top: 8px; }
.chip {
	min-width: 38px; min-height: 36px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
	border: 1px solid var(--border); background: var(--surface-2); font-weight: 600;
}

.order-answer {
	min-height: 60px; margin-top: 18px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
	border-bottom: 2px solid var(--border);
}
.order-bank { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.token {
	padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 500;
	border: 1px solid var(--border); border-bottom-width: 3px; background: var(--surface);
}
.token.used { visibility: hidden; }

.feedback {
	margin-top: 20px; padding: 16px; border-radius: 12px;
	display: grid; gap: 4px; animation: rise 0.18s ease;
}
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.feedback .fb-title { font-weight: 700; }
.feedback .fb-body { color: var(--text); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .feedback { animation: none; } .progress > div { transition: none; } }

.practice-actions { margin-top: 20px; }

/* Results */
.result { text-align: center; padding: 32px 20px; }
.result-score { font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1; margin: 10px 0; }
.result .btn-row { justify-content: center; margin-top: 20px; }

/* Flashcards */
.flashcard { min-height: 220px; display: grid; place-items: center; text-align: center; padding: 28px 20px; }
.flashcard .front { font-size: 1.5rem; font-weight: 600; }
.flashcard .back-side { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); width: 100%; }
.flashcard .back-side .nl { font-size: 1.6rem; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.grades .btn { flex-direction: column; gap: 0; padding: 8px 4px; font-size: 0.9rem; }
.grades .btn small { font-weight: 400; color: var(--muted); font-size: 0.75rem; }

.toast {
	position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
	background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 0.9rem;
	max-width: calc(100% - 32px); z-index: 20;
}

.footer { margin-top: 48px; font-size: 0.85rem; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--muted); font-size: inherit; }

.loading { padding: 64px 0; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Navigation: inline in the header on wide screens, a bottom tab bar on phones */
.nav { display: flex; gap: 2px; margin-left: 12px; }
.nav a {
	position: relative; display: inline-flex; align-items: center; gap: 6px;
	text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem;
	padding: 7px 11px; border-radius: 10px;
}
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.nav-badge {
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: inline-grid; place-items: center;
	background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 1;
}
@media (prefers-color-scheme: dark) { .nav-badge { color: #1a0f07; } }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

@media (max-width: 1040px) and (min-width: 761px) {
	.nav a span:not(.nav-badge) { display: none; }
	.nav a { padding: 8px 10px; }
}
@media (max-width: 760px) {
	/* backdrop-filter would make the header the containing block of the fixed tab bar */
	.topbar { backdrop-filter: none; background: var(--bg); }
	.nav {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0;
		display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
		background: color-mix(in srgb, var(--surface) 94%, transparent);
		backdrop-filter: blur(10px);
		border-top: 1px solid var(--border);
	}
	.nav a { flex-direction: column; gap: 2px; padding: 6px 0; font-size: 0.66rem; border-radius: 10px; justify-content: center; letter-spacing: -0.01em; }
	.nav a svg { width: 22px; height: 22px; }
	.nav a[aria-current="page"] { background: transparent; }
	.nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); }
	body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
	.sticky-cta { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
/* Focus mode: no navigation while practising */
body.focus-mode .nav { display: none; }
body.focus-mode { padding-bottom: 0; }
body.focus-mode .sticky-cta { bottom: 12px; }

/* Blog */
.page-intro { margin-bottom: 8px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }
.post-card {
	display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border);
	border-radius: 12px; padding: 14px 16px; transition: border-color 0.15s ease;
}
.post-card:hover { border-color: var(--accent); }
.post-card h3 { margin: 6px 0 4px; font-size: 1rem; line-height: 1.35; }
.post-card p { margin: 0; font-size: 0.87rem; color: var(--muted); }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--muted); }
.pill { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); }
.pill-a2 { background: var(--blue-soft); color: var(--blue); }
.pill-b1 { background: var(--good-soft); color: var(--good); }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }

.prose { font-size: 1.05rem; line-height: 1.7; }
.prose .post-header { margin-bottom: 24px; }
.prose h1 { font-size: 2rem; margin: 10px 0 8px; }
.prose .lede { font-size: 1.15rem; color: var(--muted); margin: 0; }
.prose h2 { font-size: 1.35rem; margin: 36px 0 10px; }
.prose h3 { font-size: 1.1rem; margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--accent-strong); text-underline-offset: 2px; }
.prose em { font-style: italic; }
.prose blockquote {
	margin: 18px 0; padding: 12px 16px; border-left: 4px solid var(--accent);
	background: var(--accent-soft); border-radius: 0 10px 10px 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { display: block; overflow-x: auto; margin: 14px 0 20px; font-size: 0.95rem; }
.prose th, .prose td { white-space: normal; min-width: 90px; }
.prose em.speakable { cursor: pointer; text-decoration: underline dotted color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
.cta-card { margin-top: 36px; }
.cta-card .lessons { margin-top: 12px; }
.site-footer { border-top: 1px solid var(--border); padding-top: 20px; padding-bottom: 32px; }

/* De/het trainer */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.active { color: #1a0f07; } }
details.rule { border-top: 1px solid var(--border); padding: 10px 0; }
details.rule summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
details.rule p { margin: 8px 0 0; }
.noun-list { list-style: none; padding: 0; margin: 12px 0 0; columns: 2 220px; column-gap: 24px; }
.noun-list li { break-inside: avoid; padding: 3px 0; }
.noun { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; }
.noun:hover { text-decoration: underline; }
.article-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.article-btn {
	min-height: 64px; border-radius: 14px; font-size: 1.4rem; font-weight: 800; cursor: pointer;
	border: 2px solid var(--border); background: var(--surface);
}
.article-btn-de { color: var(--blue); }
.article-btn-het { color: var(--accent-strong); }
.article-btn:hover:not([disabled]) { border-color: currentColor; }
.article-btn.correct { border-color: var(--good); background: var(--good-soft); }
.article-btn.wrong { border-color: var(--bad); background: var(--bad-soft); }
.flashcard .feedback { text-align: left; }

/* ---- Home ---- */
.welcome { display: grid; gap: 14px; }
.welcome h1 { font-size: 2rem; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; list-style: none; padding: 0; margin: 4px 0 0; counter-reset: step; }
.how-steps li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; counter-increment: step; }
.how-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.75rem; font-weight: 800; margin-bottom: 6px; }
.how-steps b { display: block; }
.how-steps span { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 560px) { .how-steps { grid-template-columns: 1fr; } .how-steps li { display: grid; grid-template-columns: 30px 1fr; align-items: start; } .how-steps li::before { margin: 0; } }

.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-link {
	display: flex; align-items: center; gap: 10px; text-decoration: none;
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.quick-link:hover { border-color: var(--accent); }
.quick-link svg { width: 22px; height: 22px; color: var(--accent-strong); flex: none; }
.quick-link b { display: block; font-size: 0.95rem; }
.quick-link span { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 560px) { .quick-links { grid-template-columns: 1fr; } }

.stats-compact { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.92rem; color: var(--muted); }
.stats-compact b { color: var(--text); font-size: 1.05rem; }

.level-tabs { display: flex; gap: 6px; margin-top: 32px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.level-tab {
	background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer;
	font-weight: 700; color: var(--muted); white-space: nowrap; display: flex; align-items: baseline; gap: 6px;
}
.level-tab small { font-weight: 500; font-size: 0.78rem; }
.level-tab[aria-selected="true"], .level-tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
a.level-tab { text-decoration: none; }
.level-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 0.85rem; color: var(--muted); }
.bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; max-width: 260px; }
.bar > div { height: 100%; background: var(--good); border-radius: 99px; }
.unit-card { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.unit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.unit-head h3 { margin: 0; font-size: 1rem; flex: 1; }
.unit-head .count { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.unit-card .lessons { gap: 8px; }
.unit-card .lesson-card { background: var(--bg); }
.unit-card.is-complete .unit-head h3::after { content: " ✓"; color: var(--good); }

/* ---- Lesson ---- */
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.stepper li { display: flex; align-items: center; gap: 6px; }
.stepper li + li::before { content: ""; width: 18px; height: 2px; background: var(--border); }
.stepper li[aria-current="step"] { color: var(--accent-strong); }
.stepper li.done { color: var(--good); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--good-soft); color: var(--good); }
.jump-links { display: flex; gap: 8px; flex-wrap: wrap; }
.jump-links a { font-size: 0.85rem; text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); }
.jump-links a:hover { border-color: var(--accent); }
.lesson-pager, .post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.pager-link { display: grid; gap: 2px; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.pager-link:hover { border-color: var(--accent); }
.pager-next { text-align: right; }
@media (max-width: 560px) { .lesson-pager, .post-pager { grid-template-columns: 1fr; } .pager-next { text-align: left; } }
.btn-text { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 10px; font-size: 0.9rem; }
.practice-actions .btn-text { display: block; margin: 6px auto 0; }
.kbd-hint { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
@media (hover: none) { .kbd-hint { display: none; } }

/* ---- Blog ---- */
.post-filter { margin: 8px 0 4px; }
.post-filter .answer-input { margin-top: 8px; }
.post-filter .filter-chips { margin-top: 10px; }
.empty-state { text-align: center; color: var(--muted); padding: 32px 0; }
.toc { margin: 0 0 28px; padding: 16px 20px; }
.toc ol { margin: 6px 0 0; padding-left: 20px; font-size: 0.95rem; }
.toc li + li { margin-top: 3px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent-strong); text-decoration: underline; }
.prose h2 { scroll-margin-top: 72px; }

/* ---- Footer ---- */
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; width: 100%; }
.footer-cols div { display: grid; gap: 6px; align-content: start; font-size: 0.9rem; }
.footer-cols a { color: var(--muted); text-decoration: none; }
.footer-cols a:hover { color: var(--text); text-decoration: underline; }
.footer-cols p { margin: 0; }
@media (max-width: 560px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-cols div:first-child { grid-column: 1 / -1; } }
[hidden] { display: none !important; }

/* ---- Navigation dropdowns (desktop) ---- */
.nav-item { position: relative; }
.nav .caret { width: 12px !important; height: 12px !important; margin-left: -2px; opacity: 0.6; }
.nav-menu {
	display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 240px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px;
	box-shadow: 0 12px 32px rgb(0 0 0 / 0.12);
}
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* hover bridge */
.nav-menu a { display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 0.9rem; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--surface-2); }
.nav-menu a b { display: block; font-size: 0.92rem; }
.nav-menu a span { display: block; font-size: 0.8rem; color: var(--muted); }
.nav-menu-wide { display: none; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 4px 12px; min-width: 420px; }
.nav-menu-guides { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(170px, 1fr)); min-width: 620px; left: -200px; }
.menu-col { display: grid; align-content: start; }
.menu-levels { display: flex; flex-wrap: wrap; }
.menu-levels a { font-weight: 700; padding: 7px 9px; }
.menu-title { font-size: 0.72rem !important; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-strong) !important; padding: 8px 10px 4px !important; }
a.menu-title:hover { text-decoration: underline; background: none !important; }
.menu-foot { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
@media (min-width: 761px) and (hover: hover) {
	.nav-item:hover > .nav-menu, .nav-item:focus-within > .nav-menu { display: block; }
	.nav-item:hover > .nav-menu-wide, .nav-item:focus-within > .nav-menu-wide { display: grid; }
}
@media (min-width: 761px) and (hover: none) {
	.nav .caret { display: none; }
}
@media (max-width: 760px) {
	.nav-menu, .nav .caret { display: none !important; }
	.nav-item { display: contents; }
}

/* ---- Category / topic navigation ---- */
.cat-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; margin: 6px 0 4px; scrollbar-width: thin; }
.cat-nav a {
	white-space: nowrap; text-decoration: none; padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 0.9rem;
	border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.cat-nav a:hover { border-color: var(--accent); }
.cat-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .cat-nav a[aria-current="page"] { color: #1a0f07; } }
.count { font-size: 0.75rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.cat-nav a[aria-current="page"] .count { background: rgb(255 255 255 / 0.25); color: inherit; }
.guide-cat { margin-top: 36px; scroll-margin-top: 72px; }
.guide-cat-head h2 { margin: 0; }
.guide-cat-head h2 a { text-decoration: none; }
.guide-cat-head h2 a:hover { color: var(--accent-strong); }
.guide-cat-head p { margin: 4px 0 0; }
.guide-subcat { margin-top: 18px; scroll-margin-top: 72px; }
.subcat-title { font-size: 0.95rem; margin: 0 0 4px; color: var(--muted); }
.topic-grid, .cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.topic-card {
	display: grid; gap: 4px; text-decoration: none; background: var(--surface); border: 1px solid var(--border);
	border-radius: 14px; padding: 14px 16px; transition: border-color 0.15s ease;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card h3 { margin: 0; font-size: 1rem; }
.topic-card p { margin: 0; font-size: 0.87rem; color: var(--muted); }
.topic-card .meta { font-size: 0.78rem; font-weight: 700; color: var(--accent-strong); margin-top: 4px; }
.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.cat-card h3 { margin: 0 0 4px; font-size: 1rem; }
.cat-card h3 a { text-decoration: none; }
.cat-card ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 0.9rem; }
.course-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.view-switch { display: flex; gap: 6px; }
.unit-head h3 a { text-decoration: none; }
.unit-head h3 a:hover { text-decoration: underline; }

/* ---- De/het rules ---- */
.chip-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: start; margin-top: 8px; }
.chip-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); padding-top: 9px; }
.chip-row .filter-chips { margin: 0; }
@media (max-width: 560px) { .chip-row { grid-template-columns: 1fr; gap: 2px; } .chip-label { padding-top: 0; } }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.rule-card {
	display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px;
	background: var(--bg); border: 1px solid var(--border); border-top: 4px solid var(--blue);
}
.rule-card.rule-het { border-top-color: var(--accent); }
.rule-top { display: flex; gap: 12px; align-items: flex-start; }
.art-badge { flex: none; font-weight: 800; font-size: 0.85rem; padding: 4px 10px; border-radius: 8px; }
.art-de { background: var(--blue-soft); color: var(--blue); }
.art-het { background: var(--accent-soft); color: var(--accent-strong); }
.rule-title h4 { margin: 0 0 4px; font-size: 1rem; line-height: 1.3; }
.rule-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pattern { font: 600 0.78rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }
.reliability { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.rel-good { background: var(--good-soft); color: var(--good); }
.rel-blue { background: var(--blue-soft); color: var(--blue); }
.rel-amber { background: #fdf3dc; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .rel-amber { background: #3a2d10; color: #f4c46b; } }
.rule-text { margin: 0; font-size: 0.93rem; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-chip { font-size: 0.85rem; padding: 3px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.rule-except { margin: 0; font-size: 0.85rem; color: var(--muted); }
.rule-except b { color: var(--text); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; align-self: flex-start; margin-top: auto; }

/* ---- Idioms ---- */
.idiom-group { margin-top: 32px; scroll-margin-top: 72px; }
.idiom-group h2 { margin: 0; }
.idiom-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.idiom { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; scroll-margin-top: 80px; }
.idiom:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.idiom-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.idiom-nl { font-weight: 700; font-size: 1.02rem; }
.idiom p { margin: 6px 0 0; font-size: 0.9rem; }
.idiom .speakable { cursor: pointer; text-decoration: underline dotted color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
.quiz-card { margin: 12px 0 8px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.quiz-card .result { padding: 12px 0; }
@media (max-width: 560px) {
	/* Long filter rows scroll sideways on phones instead of wrapping into a tall block */
	.chip-row .filter-chips, .scroll-chips {
		flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; padding-bottom: 4px; scrollbar-width: none;
	}
	.chip-row .filter-chips .chip, .scroll-chips .chip { flex: none; }
}

/* ---- Verb conjugation ---- */
.verb-en { font-size: 1.1rem; font-weight: 500; }
.verb-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.verb-summary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.verb-summary dt { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.verb-summary dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 600; }
.verb-summary p { margin: 12px 0 0; }
.conj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 16px 0; }
.conj-table { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.conj-table h3 { margin: 0 0 6px; font-size: 1rem; }
.conj-table p { margin: 0 0 6px; }
.conj-table th { width: 42%; color: var(--muted); font-weight: 500; font-size: 0.85rem; white-space: nowrap; }
.conj-table td { white-space: normal; font-weight: 600; }
.conj-table i { font-style: normal; }
.verb-examples { margin: 0; padding-left: 20px; }
.verb-examples li + li { margin-top: 6px; }
.verb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.verb-chips a { text-decoration: none; }
.verb-chips a:hover { border-color: var(--accent); }
.verb-index { padding: 6px 12px; }
.verb-index td a { text-decoration: none; }
.verb-index td a:hover { text-decoration: underline; }

/* ---- Wide screens ---- */
/* Keep running text at a comfortable line length even in the wide container. */
.page-intro p, .welcome p, .hero p.muted, .level-head + p, .guide-cat-head p { max-width: 72ch; }
.narrow { max-width: 760px; margin-inline: auto; }
/* Exercises, flashcards and drills stay a focused single column. */
body.focus-mode main.wrap { max-width: 808px; }

/* Home: unit cards side by side */
@media (min-width: 1100px) {
	#level-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
	#level-panel > .level-progress, #level-panel > .plan-link { grid-column: 1 / -1; }
	#level-panel .unit-card .lessons { grid-template-columns: 1fr; }
	.welcome { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 40px; }
	.welcome > :first-child { grid-column: 1; }
	.welcome > .how-steps { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr; }
	.welcome > .btn-row { grid-column: 1; }
	.welcome h1 { font-size: 2.4rem; }
}

/* Lesson: grammar and vocabulary side by side */
.lesson-cols { display: grid; gap: 16px; }
@media (min-width: 1100px) {
	.lesson-cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; }
	.lesson-cols > .card:last-child { position: sticky; top: 72px; max-height: calc(100vh - 160px); overflow: auto; }
}
.sticky-cta { max-width: 760px; margin-inline: auto; }

/* Guide pages: article + sticky table of contents */
.post-layout { display: grid; gap: 24px; }
.post-layout .prose { max-width: 760px; min-width: 0; }
@media (min-width: 1100px) {
	.post-layout { grid-template-columns: minmax(0, 760px) 280px; justify-content: space-between; align-items: start; }
	.post-aside { grid-column: 2; grid-row: 1; position: sticky; top: 76px; }
	.post-aside .toc { margin: 0; max-height: calc(100vh - 110px); overflow: auto; }
	.post-header-wide { grid-column: 1 / -1; }
}
.toc a.active { color: var(--accent-strong); font-weight: 700; }

/* Vocabulary page: words in columns */
@media (min-width: 900px) {
	.words-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); column-gap: 24px; }
	.words-grid .word:last-child { border-bottom: 1px solid var(--border); }
}
main > .card.result { max-width: 760px; margin-inline: auto; }
.post-aside { display: none; }
@media (min-width: 1100px) {
	.post-aside { display: block; }
	.toc-inline { display: none; }
}
.post-filter .answer-input, #main > div > .answer-input[type="search"] { max-width: 680px; }
.pill-b2 { background: #ede9fe; color: #6d28d9; }
.pill-c1 { background: #fce7f3; color: #be185d; }
.pill-c2 { background: #e0f2fe; color: #0369a1; }
@media (prefers-color-scheme: dark) {
	.pill-b2 { background: #2e2350; color: #c4b5fd; }
	.pill-c1 { background: #3d1d30; color: #f9a8d4; }
	.pill-c2 { background: #12324a; color: #7dd3fc; }
}

/* ---- Exercises ---- */
.ex-group { margin-top: 28px; }
.ex-group .level-head { align-items: baseline; flex-wrap: wrap; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.ex-card {
	display: grid; gap: 4px; align-content: start; text-decoration: none; background: var(--surface); border: 1px solid var(--border);
	border-radius: 14px; padding: 14px 16px; transition: border-color 0.15s ease;
}
.ex-card:hover { border-color: var(--accent); }
.ex-card.is-done { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.ex-card h3 { margin: 4px 0 0; font-size: 1rem; }
.ex-card p { margin: 0; font-size: 0.87rem; color: var(--muted); }
.ex-score { color: var(--good); font-weight: 700; }
.ex-card.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Study plan */
.plan-link {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 12px; padding: 12px 14px; text-decoration: none;
	background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius);
}
.plan-link span { font-size: 0.87rem; color: var(--muted); }
.plan-following { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; }
.plan-following .btn { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
.plan-practice { margin: 14px 0 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.unit-card .ex-grid { margin-top: 8px; gap: 8px; }
.unit-card .ex-card { background: var(--bg); }

.reading-layout { display: grid; gap: 16px; }
@media (min-width: 1000px) {
	.reading-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
	.reading-text { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; }
}
.reading-text p { font-size: 1.06rem; line-height: 1.75; margin: 0 0 12px; }
.reading-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.reading-tools .btn svg { width: 16px; height: 16px; }
.glossary { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.glossary summary { cursor: pointer; font-weight: 600; }
.glossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 10px 0 0; font-size: 0.92rem; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; color: var(--muted); }
.reading-questions { display: grid; gap: 12px; }
.question-text { font-weight: 600; font-size: 1.05rem; margin-top: 2px; }
.question .options { margin-top: 12px; }
.gap-base { color: var(--accent-strong); font-weight: 700; }
.drill-head { margin-bottom: 10px; }
.drill-tip { margin-bottom: 14px; padding: 12px 16px; }
.drill-tip summary { cursor: pointer; font-weight: 600; }
.drill-tip p { margin: 8px 0 0; }

/* ---- Resume & progress ---- */
.resume-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; border-color: var(--accent); background: var(--accent-soft); }
.resume-banner .grow { flex: 1 1 220px; }
.resume-banner .btn-row { margin: 0; }
.progress-panel summary { cursor: pointer; }
.progress-panel p { margin: 10px 0 0; }
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.progress-code { font: 600 0.85rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; word-break: break-all; }
