/* ============================================================
   CLAUDE AI MEESTERHANDLEIDING — Schone stabiele CSS v2.0
   Desktop-first aanpak, geen conflicterende overrides
   ============================================================ */

/* ── Variabelen ── */
:root {
  --bg:           #080d18;
  --surface:      #0f1624;
  --surface2:     #161e30;
  --border:       #1e2d45;
  --accent:       #00c8ff;
  --accent2:      #7c3aed;
  --accent3:      #10b981;
  --danger:       #ef4444;
  --text:         #e2e8f0;
  --text-muted:   #a7b6cc;   /* was #8899b0 — nu 8.1:1 op --bg */
  --text-dim:     #7d8fa8;   /* was #4a5a72 — nu 5.2:1 i.p.v. 2.6:1 */
  --font-ui:      'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-code:    'JetBrains Mono', monospace;
  --nav-h:        63px;
  --sidebar-w:    290px;
  --content-max:  860px;
  --radius:       10px;

  /* Leesbaarheid (v3.0) */
  --read-size:    17px;   /* body-tekst in hoofdstukken */
  --read-lh:      1.75;
  --measure:      54ch;   /* ≈ 70 tekens per regel — optimale leesmaat */

  /* Safe areas — SMSAK mobile spec v2.1 */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

[data-theme="light"] {
  --bg:         #f3f6fb;
  --surface:    #ffffff;
  --surface2:   #eaeff8;
  --border:     #c5d2e8;
  --accent:     #0072a3;   /* donkerder cyaan → AA-contrast op wit */
  --text:       #0e1624;
  --text-muted: #2f3d56;   /* was #374560 — nu 9.6:1 */
  --text-dim:   #55657f;   /* was #7a8ca8 — nu 5.4:1 i.p.v. 3.1:1 */
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; }

/* iOS zoomt nooit in op een focus-veld met 16px+ */
input, textarea, select { font-size: max(16px, 1rem); font-family: inherit; }

/* Zichtbare focus voor toetsenbord- en screenreadergebruikers */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

a, button, [role="button"] { -webkit-tap-highlight-color: rgba(0,200,255,0.15); }

/* Skiplink */
#skip-link {
  position: absolute; left: 12px; top: -200px; z-index: 3000;
  background: var(--accent); color: #00131c; font-weight: 700;
  padding: 12px 18px; border-radius: 0 0 8px 8px; text-decoration: none;
  transition: top 0.2s;
}
#skip-link:focus { top: 0; }

/* ── Progress bar ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 2000;
  width: 0;
  transition: width 0.1s linear;
}

/* ── Topnav ── */
#topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-t));
  padding-top: var(--safe-t);
  background: rgba(8,13,24,0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: max(20px, var(--safe-l));
  padding-right: max(20px, var(--safe-r));
  z-index: 1000;
  gap: 12px;
}

[data-theme="light"] #topnav { background: rgba(243,246,251,0.96); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}

#search-box:hover { border-color: var(--accent); }

#search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  width: 160px;
  cursor: pointer;
}

#search-box input::placeholder { color: var(--text-dim); }

#search-box kbd {
  font-family: var(--font-code);
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.nav-btn:hover { border-color: var(--accent); color: var(--accent); }

#btn-theme { width: 34px; height: 34px; }
#btn-menu  { width: 34px; height: 34px; display: none; }

.badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-display);
  white-space: normal;
}

/* ── Sidebar backdrop (mobile) ── */
#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
}

/* ── Sidebar ── */
#sidebar {
  position: fixed;
  top: calc(var(--nav-h) + var(--safe-t));
  left: 0;
  bottom: 0;
  width: calc(var(--sidebar-w) + var(--safe-l));
  padding-left: var(--safe-l);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 800;
  padding-top: 8px;
  padding-bottom: max(40px, calc(40px + var(--safe-b)));
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

[data-theme="light"] #sidebar { background: var(--surface); }

/* Sidebar progress */
.sb-progress-wrap {
  padding: 10px 16px 6px;
}

.sb-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.sb-progress-label span { color: var(--accent); }

.sb-progress-track {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.sb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 2px;
}

.sb-section {
  padding: 14px 16px 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-display);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  line-height: 1.3;
}

.sb-item:hover {
  color: var(--text);
  background: rgba(0,200,255,0.05);
  border-left-color: rgba(0,200,255,0.4);
}

.sb-item.active {
  color: var(--accent);
  background: rgba(0,200,255,0.08);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sb-item .n {
  font-size: 9px;
  font-family: var(--font-code);
  color: var(--text-dim);
  min-width: 20px;
  flex-shrink: 0;
}

.sb-item .read-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent3);
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
}

.sb-item.read .read-dot { opacity: 1; }

/* ── Main content ── */
#main {
  margin-left: calc(var(--sidebar-w) + var(--safe-l));
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-t);
}

/* ── Hero ── */
#hero {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 80px max(40px, var(--safe-r)) 64px max(40px, var(--safe-l));
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(0,200,255,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,200,255,0.08);
  border: 1px solid rgba(0,200,255,0.2);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

#hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] #hero h1 { color: #0e1624; }

#hero p.lead {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 28px;
  line-height: 1.75;
}

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Chapters ── */
.chapter {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 72px max(40px, var(--safe-r)) 56px max(40px, var(--safe-l));
  border-bottom: 1px solid var(--border);
  font-size: var(--read-size);
  line-height: var(--read-lh);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.chapter:last-child { border-bottom: none; }

.chapter-num {
  font-family: var(--font-code);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.chapter h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.7vw, 2.05rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.4px;
  line-height: 1.22;
  text-wrap: balance;
}

/* Duidelijke visuele hiërarchie: h3 krijgt een accentstreep, h4 blijft subtiel */
.chapter h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  margin: 42px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  line-height: 1.35;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.chapter h4 {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text);
  margin: 26px 0 8px;
  line-height: 1.4;
}

.chapter p {
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: var(--measure);
}

/* Intro-alinea onder de titel leest als een lead */
.chapter h2 + p {
  font-size: 1.08em;
  color: var(--text);
  line-height: 1.68;
}

.chapter ul, .chapter ol {
  padding-left: 26px;
  margin-bottom: 20px;
  color: var(--text-muted);
  max-width: var(--measure);
}

.chapter li { margin-bottom: 10px; line-height: 1.7; }
.chapter li::marker { color: var(--accent); }
.chapter li > strong { color: var(--text); }

/* Tabellen en codeblokken mogen breder zijn dan de leesmaat */
.chapter .table-wrap, .chapter .code-block, .chapter .feature-grid,
.chapter .comparison, .chapter .benchmark-grid, .chapter .figure { max-width: none; }
.chapter strong { color: var(--text); font-weight: 600; }
code.inline {
  font-family: var(--font-code);
  font-size: 0.82em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}

/* Reading time badge */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--font-code);
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Highlight box ── */
.highlight-box {
  background: linear-gradient(135deg, rgba(0,200,255,0.05), rgba(124,58,237,0.05));
  border: 1px solid rgba(0,200,255,0.15);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}

.highlight-box h3 { margin-top: 0; color: var(--accent); font-size: 1rem; }

/* ── Callouts ── */
.callout {
  display: flex;
  gap: 12px;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
  border: 1px solid transparent;
}

.callout-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.callout-body { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.callout-body strong { display: block; margin-bottom: 3px; font-size: 13px; font-family: var(--font-display); letter-spacing: 0.2px; }

.callout.tip     { background: rgba(16,185,129,0.07);  border-color: rgba(16,185,129,0.2); }
.callout.info    { background: rgba(0,200,255,0.06);   border-color: rgba(0,200,255,0.18); }
.callout.warning { background: rgba(245,158,11,0.07);  border-color: rgba(245,158,11,0.2); }
.callout.danger  { background: rgba(239,68,68,0.07);   border-color: rgba(239,68,68,0.2); }
.callout.pro     { background: rgba(124,58,237,0.07);  border-color: rgba(124,58,237,0.2); }

.callout.tip     .callout-body strong { color: #10b981; }
.callout.info    .callout-body strong { color: var(--accent); }
.callout.warning .callout-body strong { color: #f59e0b; }
.callout.danger  .callout-body strong { color: #ef4444; }
.callout.pro     .callout-body strong { color: #a78bfa; }

/* ── Feature grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.feature-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.15s;
}

.feature-card:hover { border-color: rgba(0,200,255,0.3); }
.feature-icon { font-size: 22px; margin-bottom: 8px; }
.feature-card h4 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 5px; font-family: var(--font-display); }
.feature-card p  { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }

.step-card {
  display: flex;
  gap: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  align-items: flex-start;
}

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.step-content h4 { font-size: 14px; color: var(--text); font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.step-content p  { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* ── Code blocks ── */
.code-block {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #0d1526;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--text-dim);
}

.lang-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text-dim);
}

.code-block pre {
  padding: 16px;
  font-family: var(--font-code);
  font-size: 12.5px;
  line-height: 1.65;
  color: #c9d8f0;
  overflow-x: auto;
  white-space: pre;
}

/* Copy button */
.copy-btn {
  background: none;
  border: 1px solid rgba(0,200,255,0.2);
  color: var(--text-dim);
  font-family: var(--font-code);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--accent3); color: var(--accent3); }

/* Syntax */
.kw { color: #c084fc; }
.str { color: #86efac; }
.cm { color: #4a6480; font-style: italic; }
.fn { color: #60a5fa; }
.num { color: #fb923c; }
.tag-html { color: #f87171; }
.attr { color: #fbbf24; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 9px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(30,45,69,0.5);
  vertical-align: top;
  line-height: 1.55;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,200,255,0.02); }

/* ── Prompt example ── */
.prompt-example {
  background: linear-gradient(135deg, rgba(0,200,255,0.04), rgba(124,58,237,0.04));
  border: 1px solid rgba(0,200,255,0.18);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 14px 0;
  position: relative;
}

.prompt-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.prompt-text {
  font-family: var(--font-code);
  font-size: 12.5px;
  color: #c9d8f0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Prompt copy btn */
.pe-copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-code);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.pe-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.pe-copy-btn.copied { border-color: var(--accent3); color: var(--accent3); }

/* ── Comparison ── */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.comp-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.comp-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.comp-box p { font-size: 14px; color: var(--text-muted); margin: 0; }
.comp-box ul { margin: 0; padding-left: 20px; font-size: 14px; }
.comp-box li { margin-bottom: 6px; line-height: 1.6; }
.comp-box.good .comp-label { color: #10b981; }
.comp-box.bad  .comp-label { color: #ef4444; }
.comp-label { font-size: 11.5px; }

/* ── Checklist ── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(30,45,69,0.4);
}
.checklist li:last-child { border-bottom: none; }

.check-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--accent3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Blockquote ── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 18px;
  margin: 16px 0;
  background: rgba(0,200,255,0.04);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── New badge ── */
.new-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-display);
  vertical-align: middle;
  margin-left: 4px;
}

/* Tags in repos section */
.tag {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-code);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 4px;
}
.tag-blue   { background: rgba(0,200,255,0.12); color: var(--accent); border: 1px solid rgba(0,200,255,0.2); }
.tag-green  { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.tag-gold   { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.tag-purple { background: rgba(124,58,237,0.12); color: #a78bfa; border: 1px solid rgba(124,58,237,0.2); }

/* ── Illustraties / schema's (v3.0) ── */
.figure {
  margin: 28px 0 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px 16px;
  overflow: hidden;
}
.figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 720px;
  margin: 0 auto;
  overflow: visible;
}
.figure figcaption {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}
.figure figcaption b { color: var(--text-muted); font-weight: 600; }

/* Kleuren van de schema's volgen het thema — nooit hardcoded zwart/wit */
.figure svg text  { font-family: 'DM Sans', sans-serif; fill: var(--text); }
.figure svg .f-mut  { fill: var(--text-muted); }
.figure svg .f-dim  { fill: var(--text-dim); }
.figure svg .f-acc  { fill: var(--accent); }
.figure svg .f-box  { fill: var(--surface2); stroke: var(--border); stroke-width: 1.5; }
.figure svg .f-box-acc { fill: rgba(0,200,255,0.10); stroke: var(--accent); stroke-width: 1.5; }
.figure svg .f-box-v   { fill: rgba(124,58,237,0.12); stroke: #7c3aed; stroke-width: 1.5; }
.figure svg .f-box-g   { fill: rgba(16,185,129,0.12); stroke: #10b981; stroke-width: 1.5; }
.figure svg .f-line { stroke: var(--border); stroke-width: 1.5; fill: none; }
.figure svg .f-arrow { stroke: var(--accent); stroke-width: 2; fill: none; marker-end: url(#fig-arrow); }
.figure svg .f-mono { font-family: 'JetBrains Mono', monospace; }
.figure svg .f-t   { font-size: 13px; font-weight: 600; }
.figure svg .f-s   { font-size: 11px; }
.figure svg .f-xs  { font-size: 10px; }
[data-theme="light"] .figure svg .f-box-acc { fill: rgba(0,114,163,0.10); }

@media (max-width: 580px) {
  .figure { padding: 16px 12px 12px; margin: 22px -4px; border-radius: 12px; }
  .figure figcaption { font-size: 12.5px; }
}

/* ── Hoofdstuknavigatie (vorige/volgende) ── v3.0 ── */
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* Alleen één knop? Dan mag die niet de halve breedte pakken en scheef staan. */
.chapter-nav.only-next  { grid-template-columns: 1fr; justify-items: end; }
.chapter-nav.only-prev  { grid-template-columns: 1fr; justify-items: start; }
.chapter-nav.only-next .chapter-nav-btn,
.chapter-nav.only-prev .chapter-nav-btn { max-width: 420px; width: 100%; }

.chapter-nav-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.chapter-nav-btn.next {
  grid-template-columns: 1fr auto;
  text-align: right;
}

/* Gekleurde rand aan de kant waar je heen gaat — richting is meteen zichtbaar */
.chapter-nav-btn::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: 0.55;
  transition: opacity 0.18s ease;
}
.chapter-nav-btn.prev::before { left: 0; }
.chapter-nav-btn.next::before { right: 0; }

@media (hover: hover) and (pointer: fine) {
  .chapter-nav-btn:hover {
    border-color: rgba(0,200,255,0.45);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  }
  .chapter-nav-btn:hover::before { opacity: 1; }
  .chapter-nav-btn.prev:hover .cnb-arrow { transform: translateX(-3px); }
  .chapter-nav-btn.next:hover .cnb-arrow { transform: translateX(3px); }
}
.chapter-nav-btn:active { transform: translateY(0) scale(0.99); }

.cnb-arrow {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
  background: rgba(0,200,255,0.10);
  border: 1px solid rgba(0,200,255,0.22);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
[data-theme="light"] .cnb-arrow { background: rgba(0,114,163,0.10); border-color: rgba(0,114,163,0.25); }

.cnb-text { min-width: 0; }

.cnb-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-display);
  font-weight: 700;
}

.cnb-num {
  font-family: var(--font-code);
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-left: 6px;
}
.chapter-nav-btn.next .cnb-num { margin-left: 0; margin-right: 6px; }

.cnb-title {
  display: block;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cnb-part {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toetsenbordhint onder de knoppen */
.chapter-nav-hint {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.chapter kbd {
  font-family: var(--font-code);
  font-size: 0.82em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
  white-space: nowrap;
}

.chapter-nav-hint kbd {
  font-family: var(--font-code);
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-muted);
}
@media (pointer: coarse) { .chapter-nav-hint { display: none; } }

/* ── Footer ── */
#footer {
  margin-left: calc(var(--sidebar-w) + var(--safe-l));
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px max(40px, var(--safe-r)) max(32px, calc(32px + var(--safe-b))) max(40px, var(--safe-l));
  text-align: center;
}

[data-theme="light"] #footer { background: var(--surface); }

.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

#footer p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 3px;
}

/* ── Scroll to top ── */
#scroll-top {
  position: fixed;
  bottom: max(24px, calc(24px + var(--safe-b)));
  right: max(24px, var(--safe-r));
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  z-index: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  display: flex; align-items: center; justify-content: center;
}

#scroll-top.visible { opacity: 1; transform: translateY(0); }

/* ── Search overlay ── */
#search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 5000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

#search-overlay.open { display: flex; }

#search-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 90%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

[data-theme="light"] #search-modal { background: var(--surface); }

.search-modal-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-modal-top span { font-size: 16px; color: var(--text-dim); }

#search-modal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  padding: 2px 0;
}

#search-modal-input::placeholder { color: var(--text-dim); }

#search-results {
  max-height: 340px;
  overflow-y: auto;
}

.sri {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(30,45,69,0.4);
}

.sri:last-child { border-bottom: none; }
.sri:hover { background: rgba(0,200,255,0.05); }
.sri-num { font-size: 10px; font-family: var(--font-code); color: var(--text-dim); min-width: 22px; }
.sri-title { font-size: 13.5px; color: var(--text); font-weight: 500; }
.sri-sec { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── PIN overlay ── */

/* ── Benchmark bars ── */
.benchmark-grid { display: flex; flex-direction: column; gap: 16px; margin: 16px 0; }

.benchmark-model {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.bm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.bm-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--text); }
.bm-price { font-family: var(--font-code); font-size: 10px; color: var(--text-muted); }

.bm-bars { display: flex; flex-direction: column; gap: 6px; }

.bm-row { display: flex; align-items: center; gap: 8px; }
.bm-label { font-size: 10px; color: var(--text-muted); width: 88px; flex-shrink: 0; font-family: var(--font-code); }
.bm-track { flex: 1; height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bm-fill { height: 100%; border-radius: 4px; width: 0%; transition: width 1.1s cubic-bezier(0.25,0.46,0.45,0.94); }
.bm-fill.speed { background: linear-gradient(90deg, #10b981, #34d399); }
.bm-fill.intel { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bm-fill.cost  { background: linear-gradient(90deg, #06b6d4, #0891b2); }
.bm-fill.ctx   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bm-val { font-size: 10px; color: var(--text-dim); width: 30px; text-align: right; flex-shrink: 0; }

/* ── Interface mockup ── */
.interface-mockup {
  background: #080d18;
  border: 1px solid #1e2d45;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}

.mockup-bar {
  background: #0d1424;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #1e2d45;
}

.mockup-dot { width: 9px; height: 9px; border-radius: 50%; }
.mockup-dot.r { background: #ef4444; }
.mockup-dot.y { background: #f59e0b; }
.mockup-dot.g { background: #10b981; }
.mockup-url {
  flex: 1;
  background: #161e30;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 10px;
  color: #4a5a72;
  font-family: var(--font-code);
  margin: 0 8px;
  text-align: center;
}

.mockup-body { display: flex; height: 320px; }

.mockup-sidebar {
  width: 200px;
  background: #0d1424;
  border-right: 1px solid #1a2535;
  padding: 10px 0;
  flex-shrink: 0;
  overflow: hidden;
}

.mockup-si {
  padding: 6px 12px;
  font-size: 10px;
  color: #4a5a72;
  display: flex;
  align-items: center;
  gap: 7px;
}

.mockup-si.active { color: #00c8ff; background: rgba(0,200,255,0.07); }
.mockup-slabel { font-size: 8px; color: #2d3d52; text-transform: uppercase; letter-spacing: 0.8px; padding: 8px 12px 3px; font-family: var(--font-display); font-weight: 700; }

.mockup-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mockup-messages { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }

.mockup-msg { display: flex; gap: 8px; align-items: flex-start; }
.mockup-msg.user { flex-direction: row-reverse; }

.mockup-av {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}

.mockup-av.c { background: linear-gradient(135deg, #00c8ff, #7c3aed); }
.mockup-av.u { background: #2d3d52; color: #8899b0; }

.mockup-bubble {
  background: #0d1424;
  border: 1px solid #1a2535;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 10px;
  color: #8899b0;
  max-width: 68%;
  line-height: 1.5;
}

.mockup-bubble.user { background: rgba(0,200,255,0.07); border-color: rgba(0,200,255,0.12); color: #a0b4cc; }

.mockup-input-area { padding: 0 12px 10px; }

.mockup-input {
  background: #0d1424;
  border: 1px solid #1e2d45;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mockup-input-text { flex: 1; font-size: 10px; color: #2d3d52; }

.mockup-send {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #00c8ff, #7c3aed);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}

/* ── Git diagram ── */
.git-diagram {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 22px 0;
  overflow-x: auto;
}

/* Het git-diagram had hardgecodeerde donkere kleuren — die waren onleesbaar in het lichte thema.
   CSS wint van presentation-attributen, dus we overschrijven ze hier per thema. */
.git-diagram svg text[fill="#4a5a72"]      { fill: var(--text-dim); }
.git-diagram svg circle[stroke="#0a0f1e"]  { stroke: var(--surface2); }
.git-diagram svg marker path[fill="#4a5a72"] { fill: var(--text-dim); }
.git-diagram svg text[fill="#00c8ff"]      { fill: var(--accent); }
.git-diagram svg text[fill="#7c3aed"]      { fill: #a78bfa; }   /* paars was 2.9:1 op donker → lichtere tint */
[data-theme="light"] .git-diagram svg line[stroke="#00c8ff"],
[data-theme="light"] .git-diagram svg circle[fill="#00c8ff"] { stroke: #0072a3; }
[data-theme="light"] .git-diagram svg circle[fill="#00c8ff"] { fill: #0072a3; }
/* Groen en amber halen op een lichte achtergrond geen 4.5:1 -> donkerder maken */
[data-theme="light"] .git-diagram svg text[fill="#10b981"] { fill: #0a7350; }
[data-theme="light"] .git-diagram svg text[fill="#f59e0b"] { fill: #8a5a04; }
[data-theme="light"] .git-diagram svg text[fill="#a78bfa"] { fill: #5b2fc4; }
[data-theme="light"] .git-diagram svg text[fill="#7c3aed"] { fill: #5b2fc4; }

.git-diagram svg { display: block; margin: 0 auto; }

/* ── Prompt builder ── */
.prompt-builder {
  background: linear-gradient(135deg, rgba(0,200,255,0.03), rgba(124,58,237,0.03));
  border: 1px solid rgba(0,200,255,0.18);
  border-radius: var(--radius);
  padding: 20px;
  margin: 14px 0;
}

.pb-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.pb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pb-field { display: flex; flex-direction: column; gap: 4px; }

.pb-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pb-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.15s;
}

.pb-input:focus { border-color: var(--accent); }
.pb-input::placeholder { color: var(--text-dim); }

.pb-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-code);
  font-size: 12px;
  color: #c9d8f0;
  min-height: 80px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  margin-bottom: 10px;
}

.pb-actions { display: flex; gap: 8px; }

.pb-copy-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-display);
}

.pb-reset-btn {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-ui);
}

/* ── Sidebar progress (sb) ── */
#sidebar-progress-wrap { padding: 8px 14px 4px; }
#sidebar-progress-label { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-dim); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 5px; }
#sidebar-progress-label span { color: var(--accent); }
#sidebar-progress-track { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
#sidebar-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); width: 0%; transition: width 0.4s ease; }

/* ── Resume banner ── */
#resume-banner {
  position: fixed;
  bottom: max(84px, calc(84px + var(--safe-b)));
  max-width: min(92vw, 460px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface);
  border: 1px solid rgba(0,200,255,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.4,0.64,1);
  white-space: nowrap;
}

#resume-banner.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.rb-icon { font-size: 18px; }
.rb-text { font-size: 12px; }
.rb-text strong { color: var(--text); font-size: 13px; display: block; }
.rb-text span { color: var(--text-muted); }
.rb-go {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 7px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: var(--font-display); flex-shrink: 0;
}
.rb-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 15px; padding: 3px; }

/* ── RESPONSIVE — alleen voor de echte breakpoints ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  body { overflow-x: hidden; }

  /* Topnav: versimpeld */
  #search-box { display: none; }
  #badge-desktop { display: none; }
  #btn-print { display: none; }
  #btn-menu { display: flex !important; }

  /* Sidebar: slide-in */
  #sidebar {
    top: 0;
    width: 280px;
    left: -300px;
    padding-top: calc(70px + var(--safe-t));
    z-index: 950;
    transform: translateX(0);
    transition: transform 0.28s ease;
  }

  #sidebar.open { transform: translateX(300px); }

  #sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 940; }
  #sidebar-backdrop.visible { display: block; }

  /* Zoek-icoon in nav */
  #btn-search-mobile { display: flex !important; }

  /* Content full width */
  #main { margin-left: 0; }
  #footer { margin-left: 0; padding-left: max(20px, var(--safe-l)); padding-right: max(20px, var(--safe-r)); }

  /* Layout */
  .comparison { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .chapter { padding: 52px max(20px, var(--safe-r)) 40px max(20px, var(--safe-l)); }
  #hero { padding: 48px max(20px, var(--safe-r)) 36px max(20px, var(--safe-l)); }

  /* Tekst */
  #hero h1 { font-size: 1.85rem; letter-spacing: -0.3px; }
  #hero p.lead { font-size: 15.5px; }

  /* Overflow */
  h1, h2, h3, h4 { overflow-wrap: break-word; word-break: break-word; }
  .table-wrap { overflow-x: auto; }
  .code-block pre { overflow-x: auto; white-space: pre; font-size: 11px; }
  .git-diagram { overflow-x: auto; }
}

@media (max-width: 580px) {
  :root { --read-size: 16.5px; --read-lh: 1.72; }
  #hero h1 { font-size: 1.55rem; }
  #hero p.lead { font-size: 15px; }
  .chapter { padding: 40px max(16px, var(--safe-r)) 32px max(16px, var(--safe-l)); }
  #hero { padding: 36px max(16px, var(--safe-r)) 28px max(16px, var(--safe-l)); }
  .chapter h2 { font-size: 1.38rem; }
  .chapter h3 { font-size: 1.15rem; margin-top: 34px; }

  /* Vorige/volgende: onder elkaar, én "Volgende" bovenaan — dat is de knop die je 95% van de tijd wil */
  .chapter-nav { grid-template-columns: 1fr; gap: 10px; }
  .chapter-nav-btn.next  { order: 1; }
  .chapter-nav-btn.prev  { order: 2; }
  .chapter-nav-hint      { order: 3; }
  .chapter-nav.only-next, .chapter-nav.only-prev { justify-items: stretch; }
  .chapter-nav.only-next .chapter-nav-btn,
  .chapter-nav.only-prev .chapter-nav-btn { max-width: none; }
  .chapter-nav-btn.next { text-align: left; grid-template-columns: auto 1fr; }
  .chapter-nav-btn.next .cnb-arrow { order: -1; }
  .chapter-nav-btn.next .cnb-num { margin-left: 6px; margin-right: 0; }

  .hero-stats { gap: 14px; }
  .stat-num { font-size: 22px; }
}

/* Aanraakschermen: alle bedienelementen minstens 44×44 (Apple HIG) */
@media (pointer: coarse) {
  .nav-btn, .sb-item, .copy-btn, .pe-copy-btn { min-height: 44px; }
  .sb-item { padding-top: 10px; padding-bottom: 10px; }
}

/* ── Print ── */
@media print {
  @page { size: A4; margin: 18mm 22mm 20mm 22mm; }
  @page :left  { margin-left: 28mm; margin-right: 18mm; }
  @page :right { margin-left: 18mm; margin-right: 28mm; }

  #topnav, #sidebar, #sidebar-backdrop, #scroll-top,
  #search-overlay, .chapter-nav, #resume-banner { display: none !important; }

  #main, #footer { margin-left: 0 !important; }
  body { background: #fff; color: #1a1a2e; font-size: 11pt; }
  .chapter { padding: 16pt 0; border: none; opacity: 1 !important; transform: none !important; }
  .chapter h2 { color: #1a1a2e; font-size: 16pt; }
  .chapter h3 { color: #2d3748; font-size: 13pt; }
  .chapter p, .chapter li { color: #374151; }
  .code-block { border: 0.5pt solid #ccc; background: #f8f8f8 !important; }
  .code-block pre { color: #1a1a2e; background: #f8f8f8; }
  .copy-btn, .pe-copy-btn, .reading-time, #skip-link { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #888; }

  /* Illustraties printen leesbaar: lichte achtergrond, zwarte tekst, niet over paginagrens */
  .figure { break-inside: avoid; page-break-inside: avoid; border: 0.5pt solid #ccc; background: #fff; padding: 8pt; }
  .figure svg text { fill: #1a1a2e !important; }
  .figure svg .f-mut, .figure svg .f-dim { fill: #4b5563 !important; }
  .figure svg .f-acc { fill: #0b6b8f !important; }
  .figure svg .f-box { fill: #f4f6fa !important; stroke: #9aa7bd !important; }
  .figure svg .f-box-acc { fill: #e6f6fd !important; stroke: #0b6b8f !important; }
  .figure svg .f-box-g   { fill: #eafaf3 !important; stroke: #0f9d6d !important; }
  .figure svg .f-box-v   { fill: #f1ecfd !important; stroke: #6d3fd6 !important; }
  .figure svg .f-line    { stroke: #9aa7bd !important; }
  .figure figcaption { color: #4b5563; font-size: 9pt; }
  .chapter h2, .chapter h3 { break-after: avoid; page-break-after: avoid; }
  .callout, .code-block, .table-wrap { break-inside: avoid; page-break-inside: avoid; }
}

/* ── v4.0: opgesplitste gids ───────────────────────────── */

/* Zijbalk: terug-naar-overzicht en 'alles op één pagina' */
.sb-home {
  display: block;
  margin: 10px 14px 14px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, color 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .sb-home:hover { border-color: var(--accent); color: var(--text); }
}
.sb-home.current { border-color: var(--accent); color: var(--accent); }

/* Kop van een deelpagina */
#part-head {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px max(40px, var(--safe-r)) 8px max(40px, var(--safe-l));
}
.crumbs { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.crumbs a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--accent); border-bottom-color: currentColor; }
.crumbs span { margin: 0 7px; opacity: 0.5; }

#part-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin-bottom: 12px;
  text-wrap: balance;
}
#part-head .part-emoji { font-size: 0.85em; margin-right: 10px; }
#part-head .part-lead {
  font-size: 1.06rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 58ch;
  margin-bottom: 18px;
}
.part-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-dim);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.part-meta .pm-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}

/* Houdbaarheidsdatum */
.reviewed {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.reviewed .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.reviewed time { color: var(--text-muted); font-weight: 600; }

/* Navigatie tussen delen, onderaan een pagina */
.part-nav {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 8px max(40px, var(--safe-r)) 0 max(40px, var(--safe-l));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.part-nav.only-one { grid-template-columns: 1fr; }
.part-nav-btn {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  text-decoration: none;
  min-height: 88px;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.part-nav-btn.next { text-align: right; }
@media (hover: hover) and (pointer: fine) {
  .part-nav-btn:hover { border-color: rgba(0,200,255,0.45); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
}
.pnb-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); font-family: var(--font-display); font-weight: 700; }
.pnb-title { display: block; font-size: 17px; font-weight: 700; color: var(--text); margin-top: 5px; font-family: var(--font-display); }
.pnb-sub   { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

/* Aanbod-CTA */
.offer-cta {
  max-width: var(--content-max);
  margin: 40px auto 0;
  padding: 0 max(40px, var(--safe-r)) 0 max(40px, var(--safe-l));
}
.offer-card {
  background: linear-gradient(135deg, rgba(0,200,255,0.10), rgba(124,58,237,0.10));
  border: 1px solid rgba(0,200,255,0.28);
  border-radius: 18px;
  padding: 30px 32px;
}
[data-theme="light"] .offer-card {
  background: linear-gradient(135deg, rgba(0,114,163,0.08), rgba(124,58,237,0.08));
  border-color: rgba(0,114,163,0.3);
}
.offer-card .oc-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.offer-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--text);
  text-wrap: balance;
}
.offer-card p { color: var(--text-muted); font-size: 15.5px; line-height: 1.65; max-width: 58ch; margin-bottom: 18px; }
.oc-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.oc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.oc-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.oc-btn.ghost   { background: transparent; border: 1px solid var(--border); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .oc-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,200,255,0.28); }
  .oc-btn.ghost:hover   { border-color: var(--accent); color: var(--accent); }
}
.oc-btn:active { transform: translateY(0) scale(0.985); }

/* Hubpagina: rooster met de twaalf delen */
.part-grid {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 8px max(40px, var(--safe-r)) 0 max(40px, var(--safe-l));
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.part-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 18px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
@media (hover: hover) and (pointer: fine) {
  .part-card:hover { border-color: rgba(0,200,255,0.45); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.24); }
}
.pc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pc-emoji { font-size: 24px; line-height: 1; }
.pc-range { font-family: var(--font-code); font-size: 11px; color: var(--accent); letter-spacing: 0.5px; }
.pc-title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.pc-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.6; flex: 1; margin-bottom: 14px; }
.pc-foot  { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-dim); }
.pc-bar { height: 4px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.pc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.5s ease; }

.section-heading {
  max-width: var(--content-max);
  margin: 44px auto 4px;
  padding: 0 max(40px, var(--safe-r)) 0 max(40px, var(--safe-l));
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.section-sub {
  max-width: var(--content-max);
  margin: 0 auto 18px;
  padding: 0 max(40px, var(--safe-r)) 0 max(40px, var(--safe-l));
  font-size: 14px;
  color: var(--text-dim);
}

/* Zoekresultaat is nu een link */
a.sri { color: inherit; text-decoration: none; }

@media (max-width: 900px) {
  #part-head, .part-nav, .offer-cta, .part-grid, .section-heading, .section-sub {
    padding-left: max(20px, var(--safe-l));
    padding-right: max(20px, var(--safe-r));
  }
}
@media (max-width: 580px) {
  #part-head { padding-top: 28px; }
  #part-head, .part-nav, .offer-cta, .part-grid, .section-heading, .section-sub {
    padding-left: max(16px, var(--safe-l));
    padding-right: max(16px, var(--safe-r));
  }
  .part-nav { grid-template-columns: 1fr; }
  .part-nav-btn.next { text-align: left; }
  .offer-card { padding: 24px 20px; }
  .oc-btn { width: 100%; }
}

@media print {
  .part-nav, .offer-cta, .sb-home, .crumbs { display: none !important; }
  #part-head { padding: 0; }
  .part-card { break-inside: avoid; }
}
